1

I would like to produce plots using matplotlib (through anaconda-spider installed on os x yosemite) and put labels on it not interpreted by tex. Here is the sample code:

# -*- coding: utf-8 -*-
import matplotlib.pyplot as pp
my_rc_param = {'text.usetex': False}
pp.figure()
pp.rcParams.update(my_rc_param)
pp.plot(range(10))
pp.xlabel('$x$')

I would like to see exactly the string $x$ as x label. In turn, I get the math-mode latex x. I have also tried, unsuccessfully, to put the following preamble:

from matplotlib import rc
rc('text', usetex=False) 

Is there a way to force a plain interpreter? Or should I consider this as a bug?

1 Answer 1

3

You are not getting any latex mode. You are simply using the mathtex feature of matplotlib. Using latex is a different thing. I checked whether it is possible to switch off mathtex for matplotlib, and there is a quiet recent issue on this (see here). However, the way to sort out this problem consist is avoiding the math just escaping the $ symbol with '\':

pp.xlabel('\$x\$')

Just remove all the stuff related to the text.usetex as you are trying to do a complete different thing here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.