0
votes

While something like matplotlib.pyplot.xlabel(r'Wavelenghth [$\mu$m]') works in python2 I get error when I use it in python 3

TypeError: startswith first arg must be str or a tuple of str, not bytes

Does anyone know what it the problem? Is it from my latex installation?!

1
Could you please show the whole error traceback in your question, not just the last line. - ali_m
This works just fine for me in Python 3, using your exact line above. As per the previous comment - could you show the whole traceback? Are you sure it is this line that gives the error? The error given doesn't seem to match that string. - J Richard Snape
Thank you... And sorry that I reply late. - Maryam

1 Answers

0
votes

I could solve the problem using rc('text', usetex=False) which apparently make the matplotlib to use the internal mathtext instead of my default latex installation.

Still I can not figure out the reason why my OS latex installation fails.