Re: [Matplotlib-users] More funky font baselines
Thanks. I think I have this fixed in SVN again... Basically what's happening is that Freetype's hinting imposes a vertical scale on the glyph that wasn't being taken into account. Mike Ryan May wrote: Mike, I've found another case of the funk baseline: import matplotlib.pyplot as plt plt.title('$Z_{DR}$ (from ts)') plt.show() I've attached an image of what I see. Here's my matplotlibrc: backend : GtkAgg mathtext.fontset : stixsans mathtext.default : regular font.size : 10.0 savefig.dpi : 100 Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] More funky font baselines
That fixed it for me, thanks. Ryan On Thu, Mar 19, 2009 at 7:54 AM, Michael Droettboom md...@stsci.edu wrote: Thanks. I think I have this fixed in SVN again... Basically what's happening is that Freetype's hinting imposes a vertical scale on the glyph that wasn't being taken into account. Mike Ryan May wrote: Mike, I've found another case of the funk baseline: import matplotlib.pyplot as plt plt.title('$Z_{DR}$ (from ts)') plt.show() I've attached an image of what I see. Here's my matplotlibrc: backend : GtkAgg mathtext.fontset : stixsans mathtext.default : regular font.size : 10.0 savefig.dpi : 100 Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Mathtext font size difference
Mike, Is there supposed to be a difference in the size of text printed with and without mathtext? Here's a simple script that shows what I'm talking about: import matplotlib.pyplot as plt f = plt.figure() ax1 = f.add_subplot(1,2,1) ax1.set_title('Hello') ax2 = f.add_subplot(1,2,2) ax2.set_title('$Hello$') plt.show() And here's my matplotlibrc: backend : GtkAgg mathtext.fontset : stixsans font.size : 10.0 savefig.dpi : 100 # figure dots per inch mathtext.default : regular I've attached a copy of what that looks like on my system. Sorry I keep finding these things. :) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. attachment: different_sizes.png-- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mathtext font size difference
They're actually different fonts. The one on the left is Vera Sans, the one on right is Stix Sans. There is a bug where regular (meaning Vera) text in math was getting mapping to Stix Sans when mathtext.fontset is set to stixsans. (This should now be fixed in SVN). All that said, fixing this bug will mean it's now fairly easy to get an unintended mix of Vera Sans and Stix Sans in math expressions. For example, $A \bf{A}$ will draw the first A in Vera and the second in STIX. There's no easy way around that, since we don't currently support rich text for non-math fonts. To avoid this mix of fonts within the $ $, you would probably want to set mathtext.default to rm. Mike Ryan May wrote: Mike, Is there supposed to be a difference in the size of text printed with and without mathtext? Here's a simple script that shows what I'm talking about: import matplotlib.pyplot as plt f = plt.figure() ax1 = f.add_subplot(1,2,1) ax1.set_title('Hello') ax2 = f.add_subplot(1,2,2) ax2.set_title('$Hello$') plt.show() And here's my matplotlibrc: backend : GtkAgg mathtext.fontset : stixsans font.size : 10.0 savefig.dpi : 100 # figure dots per inch mathtext.default : regular I've attached a copy of what that looks like on my system. Sorry I keep finding these things. :) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Mathtext font size difference
Awesome. Thanks for the quick fix and the tip about using 'rm'. Ryan On Thu, Mar 19, 2009 at 9:43 AM, Michael Droettboom md...@stsci.edu wrote: They're actually different fonts. The one on the left is Vera Sans, the one on right is Stix Sans. There is a bug where regular (meaning Vera) text in math was getting mapping to Stix Sans when mathtext.fontset is set to stixsans. (This should now be fixed in SVN). All that said, fixing this bug will mean it's now fairly easy to get an unintended mix of Vera Sans and Stix Sans in math expressions. For example, $A \bf{A}$ will draw the first A in Vera and the second in STIX. There's no easy way around that, since we don't currently support rich text for non-math fonts. To avoid this mix of fonts within the $ $, you would probably want to set mathtext.default to rm. Mike Ryan May wrote: Mike, Is there supposed to be a difference in the size of text printed with and without mathtext? Here's a simple script that shows what I'm talking about: import matplotlib.pyplot as plt f = plt.figure() ax1 = f.add_subplot(1,2,1) ax1.set_title('Hello') ax2 = f.add_subplot(1,2,2) ax2.set_title('$Hello$') plt.show() And here's my matplotlibrc: backend : GtkAgg mathtext.fontset : stixsans font.size : 10.0 savefig.dpi : 100 # figure dots per inch mathtext.default : regular I've attached a copy of what that looks like on my system. Sorry I keep finding these things. :) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Installing matplotlib for python 2.6 under windows
Hi! I'm having a bit difficulty getting matplotlib to run under windows (vista x64) with python 2.6. I downloaded the source from svn, ran the build and install commands, then copied the content of /build/lib.win32-2.6 to Lib/site-packages folder. But when I try to import pylab I get the following error message: Traceback (most recent call last): File pyshell#0, line 1, in module import pylab File C:\Python26\lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python26\lib\site-packages\matplotlib\pylab.py, line 207, in module from matplotlib import mpl # pulls in most modules File C:\Python26\lib\site-packages\matplotlib\mpl.py, line 1, in module from matplotlib import artist File C:\Python26\lib\site-packages\matplotlib\artist.py, line 5, in module from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File C:\Python26\lib\site-packages\matplotlib\transforms.py, line 34, in module from matplotlib._path import affine_transform ImportError: No module named _path So, where might I find the _path module be? Thanks in advance, Romi -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] title when using subplot
The easiest solution is the title keyword for subplot: pylab.subplot(221, title='A Title for 221') I'm using matplotlib/pylab 0.98.3 -- NTroutman Tommy Grav wrote: I have a plot that is divided into four subplots. pylab.figure() pylab.subplot(221) pylab.plot(a,b,k-) pylab.subplot(222) pylab.plot(a,b,k-) pylab.subplot(223) pylab.plot(a,b,k-) pylab.subplot(224) pylab.plot(a,b,k-) I would like to add a title to the entire plot, but pylab.title() only applies to the most recent subplot. I have tried pylab.figure() pylab.subplot(111) pylab.title(Title Here) pylab.subplot(221) pylab.plot(a,b,k-) pylab.subplot(222) pylab.plot(a,b,k-) pylab.subplot(223) pylab.plot(a,b,k-) pylab.subplot(224) pylab.plot(a,b,k-) but this does not work as I do not create a plot for the subplot(111) instance. Is there some way of getting the type of title I want easily? Cheers Tommy - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://www.nabble.com/title-when-using-subplot-tp15066004p22605721.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Installing matplotlib for python 2.6 under windows
Romi Agar wrote: Hi! I'm having a bit difficulty getting matplotlib to run under windows (vista x64) with python 2.6. I downloaded the source from svn, ran the build and install commands, Does that mean python setup.py install? then copied the content of /build/lib.win32-2.6 to Lib/site-packages folder. Hmm, why did you have to do that? Doesn't the install step do that automatically? Or did it break? But when I try to import pylab I get the following error message: Traceback (most recent call last): File pyshell#0, line 1, in module import pylab File C:\Python26\lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python26\lib\site-packages\matplotlib\pylab.py, line 207, in module from matplotlib import mpl # pulls in most modules File C:\Python26\lib\site-packages\matplotlib\mpl.py, line 1, in module from matplotlib import artist File C:\Python26\lib\site-packages\matplotlib\artist.py, line 5, in module from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File C:\Python26\lib\site-packages\matplotlib\transforms.py, line 34, in module from matplotlib._path import affine_transform ImportError: No module named _path So, where might I find the _path module be? This gets compiled from C sources. Do you a C compiler on your system? Python 2.6 is built with MicroSoft Visual Studio 2008 (aka VC++ v 9.0), but the free VC++ 2008 Express Edition compiles Python extensions just fine, according to http://mien.sourceforge.net/docs/platform_win.html#py26 Thanks in advance, Romi -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to turn off all clipping?
Hatch, Sara J wrote: Matplotlib Folks, How do I turn off all clipping when making a plot? It seems like everything has a set_clip_on argument, but I couldn’t figure out how to set all of these to False without explicitly doing so in every plot call. I would assume that there is a way to do this using an rcParam or the matplotlibrc file? No there isn't, and I think this is the first time this question has come up. Usually some clipping is desired. I doubt the need for absolutely no clipping is common enough to justify an rcParam entry. If you think there is a common use case that should be supported, though, please elaborate. Every artist has a set_clip_on() method, so to turn off all clipping you are stuck having to find all the artists and turn off clipping on each individually. Maybe something like this (untested): def noclip(ax): Turn off all clipping in axes ax; call immediately before drawing ax.set_clip_on(False) artists = [] artists.extend(ax.collections) artists.extend(ax.patches) artists.extend(ax.lines) artists.extend(ax.texts) artists.extend(ax.artists) for a in artists: a.set_clip_on(False) I suspect this will not necessarily take care of everything; there may be compound artists that do not define their own set_clip_on method to propagate down to the sub-artists. Eric -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to turn off all clipping?
On Thu, Mar 19, 2009 at 2:33 PM, Eric Firing efir...@hawaii.edu wrote: def noclip(ax): Turn off all clipping in axes ax; call immediately before drawing ax.set_clip_on(False) artists = [] Or even better:: for o in fig.findobj(): o.set_clip_on(False) findobj is an artist method that recursive searches all the artists contained in it -- you can optionally specify the type of artist you want returned. See http://matplotlib.sourceforge.net/examples/pylab_examples/findobj_demo.html JDH -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Installing matplotlib for python 2.6 under windows
Aha, I did not have VC++ 2008 EE on my PC, so it actually didn't compile anything. Now that I have it, I get a dependency problem with Freetype2. The build command fails with: c:\python26\matpotlib\src\ft2font.h(13) : fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory I downloaded the windows binaries of freetype2 in gnuwin32 project, but it doesn't seem to help. Or do I need to download freetype2 source and compile that. If so, maybe there is a detailed (step-by-step) guide installing the dependecies (libpng, zlib, freetype), because they don't seem to have windows installers like numpy has that actually works with matplotlib. Any helpl appreciated. When might we see matplotlib binaries for python 2.6? Andrew Straw wrote: Romi Agar wrote: Hi! I'm having a bit difficulty getting matplotlib to run under windows (vista x64) with python 2.6. I downloaded the source from svn, ran the build and install commands, Does that mean python setup.py install? then copied the content of /build/lib.win32-2.6 to Lib/site-packages folder. Hmm, why did you have to do that? Doesn't the install step do that automatically? Or did it break? But when I try to import pylab I get the following error message: Traceback (most recent call last): File pyshell#0, line 1, in module import pylab File C:\Python26\lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python26\lib\site-packages\matplotlib\pylab.py, line 207, in module from matplotlib import mpl # pulls in most modules File C:\Python26\lib\site-packages\matplotlib\mpl.py, line 1, in module from matplotlib import artist File C:\Python26\lib\site-packages\matplotlib\artist.py, line 5, in module from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File C:\Python26\lib\site-packages\matplotlib\transforms.py, line 34, in module from matplotlib._path import affine_transform ImportError: No module named _path So, where might I find the _path module be? This gets compiled from C sources. Do you a C compiler on your system? Python 2.6 is built with MicroSoft Visual Studio 2008 (aka VC++ v 9.0), but the free VC++ 2008 Express Edition compiles Python extensions just fine, according to http://mien.sourceforge.net/docs/platform_win.html#py26 Thanks in advance, Romi -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] optimal dpi for imshow
Is there a way to figure out the optimal dpi for imshow when saving as a png so that all the pixels are visible? I do something like the following: import matplotlib.pyplot as plt plt.clf() image = np.random.normal(0,1, (1000,1000)) plt.imshow(I, cmap=plt.cm.gray, interpolation='nearest', aspect='equal') plt.axis('off') plt.title('title') plt.savefig('~/tmp/test.png, dpi=600) If the size of 'image' is too large or dpi is too small, the elements in the matrix get blended. I would like to set the dpi to the minimal necessary so that the elements are distinct. Any tips appreciated. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users