SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] Problem saving to eps with usetex=True

From: Ken S. <kts...@gm...> - 2009年04月23日 18:25:51
I've been trying to track down some strange behavior I was getting,
and I think narrowed it down to some code that I'll paste below.
I'm trying to write to .eps files, and when I have usetex=True,
something is screwed up with the padding on the left, and eventually
the whole image is just white.
If I run this script, the 'testA-*.eps' look good, but 'testB-*' does
not. The same problem happens even if I remove the ticklabels.
Any tips would be appreciated.
thanks,
Ken
------------------------------------------------
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rc
fig = plt.figure()
ax = fig.add_axes([0,0,1,1],frameon=False)
X = np.tile(np.arange(500),(10,1)) # (10,500) shape
ax.imshow(X,interpolation='nearest',aspect='auto')
def go(name):
 for d in (1,2,3,4):
 w = d*5
 h = d
 fig.set_size_inches(w,h)
 fig.savefig("%s-%d.eps" % (name,d))
rc('text', usetex=False)
go("testA")
rc('text', usetex=True)
go("testB")

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /