Having problem in displaying latex maths for axes labelling in matplotlib plots

I’m having trouble writing mathematical formulas on the axes labels for a simple plot in matplotlib. When I tried to do this, I encountered an error. I’ve attached the code I used and the error message. Can you please suggest how to resolve this issue?

import numpy as np
import matplotlib.pyplot as plt
from math import *

x = np.linspace(0,10*pi, 100)
y =  x*np.sin(x) 
plt.xlabel('$x$')
plt.ylabel('$xsin(x)$')
plt.plot(x,y ,'bo-')
plt.show()
ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled

Note: I already have MikteX installed on my device.

Miketex

Smells like windows. The errors suggests either:

1 Like