Matplotlib problem under Windows: %HOME% expands to %USERPROFILE%
I found a Matplotlib problem under Win 2000. THE SYMPTOM: Matplotlib appears to install fine under Windows 2000, but trying to include text in a plot produces the following error message: Traceback (most recent call last): [snip] File "C:\programs\Python23\lib\site-packages\matplotlib\font_manager.py", line 764, in __init__ pickle.dump(self.ttfdict, file(ttfcache, 'w')) IOError: [Errno 2] No such file or directory: '%USERPROFILE%\\.ttffont.cache' THE PROBLEM: In matplotlib's font_manager.py, we find the line ttfpath = os.environ.get('HOME', get_data_path()) (as well as one more problematic use of HOME). Under Windows 2000 (and other Windows?), %HOME% expands to %USERPROFILE%, *not* to the user's home directory. %USERPROFILE% in turn expands to the user's home directory, but this expansion is not done by the line above. COMMENT: this problem affects the installation as well: a directory called literally '%USERPROFILE% is created! THE HACK for Windows users with the problematic install and behavior: change HOME to USERPROFILE in font_manager.py. Hopefully there is also a simple solution for Matplotlib, but I'm just an end user so I won't propose one. Cheers, Alan Isaac
"Alan" == Alan G Isaac <aisaac@american.edu> writes:
Alan> I found a Matplotlib problem under Win 2000. THE SYMPTOM: Alan> Matplotlib appears to install fine under Windows 2000, but Alan> trying to include text in a plot produces the following Alan> error message: Traceback (most recent call last): [snip] Alan> File Alan> "C:\programs\Python23\lib\site-packages\matplotlib\font_manager.py", Alan> line 764, in __init__ pickle.dump(self.ttfdict, Alan> file(ttfcache, 'w')) IOError: [Errno 2] No such file or Alan> directory: '%USERPROFILE%\\.ttffont.cache' Hi Alan, I'm going to forward this post and the subsequent one about font problems to the matplotlib-users list and address them there. Sorry for the troubles! JDH
Hi, I'm having a minor problem with the plotting function from gplt. When I use the line gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") the graph appears as expected; however, the legend in the top right labels the line as "/tmp/@14079.22" or some small variation on the number. Is there a way to prevent this from occurring or to even label it with a string from another location? Thanks, Matt
On Wed, 18 Aug 2004, Matthew Hellman apparently wrote:
When I use the line gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") the graph appears as expected; however, the legend in the top right labels the line as "/tmp/@14079.22" or some small variation on the number. Is there a way to prevent this from occurring or to even label it with a string from another location?
http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-August/003071.h... hth, Alan Isaac
That worked great. Thanks. On Wed, 2004-08-18 at 11:00, Alan G Isaac wrote:
On Wed, 18 Aug 2004, Matthew Hellman apparently wrote:
When I use the line gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") the graph appears as expected; however, the legend in the top right labels the line as "/tmp/@14079.22" or some small variation on the number. Is there a way to prevent this from occurring or to even label it with a string from another location?
http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-August/003071.h...
hth, Alan Isaac
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user
participants (3)
-
Alan G Isaac -
John Hunter -
Matthew Hellman