Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
I am trying to save some figures I made as .ps or .eps but I am getting an error. I narrowed the error down to the fact that I am using Latex for some of the text in my figure but usingrc.params['text.usetex'] = False
. Here is some code that reproduces the bug:
importmatplotlibimportmatplotlib.pyplotaspltfig=plt.figure()plt.text(0.5,0.5,'Here is some text, $math mode$',ha='center',va='center',usetex=True)fig.savefig('test.ps')
The error you get isAttributeError: 'RendererPS' object has no attribute 'textcnt'
When looking atthis code in in the RendererPS class thetextcnt
attribute is only added whenrc.params['text.usetex'] = True
. However I am just using Latex for specific text objects with the optionusetex=True
. Is there a way to save these figures as .ps or .eps?
I am using Matplotlib 1.5.1 installed via conda on Windows with python 2.7. I also tested it with Matplotlib 2.0.0b4 which also produced the same error, however I would prefer a solution for 1.5.1 if possible.