Re: [Matplotlib-users] error when installing matplotlib -- wx requirement?
per freem writes: > i am trying to install the recent matplotlib (0.99.1.1) but i am > getting an error about wxPython not being available. The problem is that the tar.gz file includes setup.cfg, and the fix is to delete that file. This is also filed on sourceforge: https://sourceforge.net/tracker/?func=detail&aid=2871530&group_id=80706&atid=560720 -- Jouni K. Seppänen http://www.iki.fi/jks -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Axes3D labels
Does anyone know if it possible to annotate the axes with strings? I've tried a hundred combinations of set_xticklabels with and without set_xticks but absolutely nothing seems to have any effect. Perhaps this is a bug? Perhaps labelling 3d axes is not supported? There's no documentation on this matter and I'm at my wits end - any help is appreciated. -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Axes.bar(orientation='horizontal') doesn't work?
Hi, I'm trying to plot some horizontal bars using the .bar() method: import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(1,1,1) ax.bar([1,2,3],[4,6,5],orientation='horizontal') raises an AssertionError: AssertionErrorTraceback (most recent call last) /home/ernest/ in () /usr/lib/pymodules/python2.5/matplotlib/axes.py in bar(self, left, height, width, bottom, color, edgecolor, linewidth, yerr, xerr, ecolor, capsize, align, orientation, log, **kwargs) 4230 # FIXME: convert the following to proper input validation 4231 # raising ValueError; don't use assert for this. -> 4232 assert len(left)==nbars, "incompatible sizes: argument 'left' must be length %d or scalar" % nbars 4233 assert len(height)==nbars, ("incompatible sizes: argument 'height' must be length %d or scalar" % 4234 nbars) AssertionError: incompatible sizes: argument 'left' must be length 1 or scalar using scalars doesn't help: ax.bar(1,5,orientation='horizontal') TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' Am I doing something wrong?? -- Ernest -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Width of axes tick labels
Hello, I'm new to matplotlib, but have made great progress in using it over the past few days (thanks in no small part to this list). However, I am stuck on trying to determine the width of a y tick label (either in inches or figure space). I know I can get 'Text instances' of the tick labels using 'get_yticklabels'. However, a Text object doesn't appear to have a width field. Now, it would make sense that the width of a label depends on the rendered so I expect I need to take my text string and pass it through an appropriate transformation using something like 'get_yaxis_text1_transform'. Can anyone point me to an example of obtaining the width of a label and/or some code indicating how this can be done? I realize I can approximate the width of a label simply by considering how many characters it contains, the font size, and the DPI of the figure, but this will be rather crude as I am not using a fixed-width font. Much thanks. Cheers, Donovan -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Basemap drawcoastlines issue
Hi Scott, thanks for your response. This seems like the way to go! Ringo Scott Sinclair-4 wrote: > >>2009/10/1 ringobelingo : >> I would like to add coastlines to a map but do not want interior >> 'coastlines'. At present, without them my continents are not distinct >> enough >> from the data I am plotting in the background. But, when I draw them >> using >> drawcoastlines(), I also get e.g. the great lakes showing up, and this >> just >> makes my world maps look messy and distracts from my data which should be >> the main focus. Does anyone know of a way to force this to happen, or is >> it >> something that might be added, i.e. splitting the function into >> drawcoastlines() and drawicoastlines() ... ? > > The easiest way to address this is to obtain (or make) a GIS shapefile > that has the coastlines you'd like to see. Then use the > readshapefile() method on your Basemap object instead of the > drawcoastlines() method. > > my_map = Basemap(...) > my_map.readshapefile(my_shpfile_name) > > Cheers, > Scott > > -- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > ___ > 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/Basemap-drawcoastlines-issue-tp25690572p25769546.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Basemap drawcoastlines issue
Hi Jeff, I had already tried area_thresh, but suffered from the limitation that you pointed out, namely that although the inland waterways disappear, it is at the expense of a lot of land. That's why I wondered if the function might be splittable to avoid such issues. But thanks anyway. Ringo Jeff Whitaker wrote: > > Scott Sinclair wrote: >>> 2009/10/1 ringobelingo : >>> I would like to add coastlines to a map but do not want interior >>> 'coastlines'. At present, without them my continents are not distinct >>> enough >>> from the data I am plotting in the background. But, when I draw them >>> using >>> drawcoastlines(), I also get e.g. the great lakes showing up, and this >>> just >>> makes my world maps look messy and distracts from my data which should >>> be >>> the main focus. Does anyone know of a way to force this to happen, or is >>> it >>> something that might be added, i.e. splitting the function into >>> drawcoastlines() and drawicoastlines() ... ? >>> >> >> The easiest way to address this is to obtain (or make) a GIS shapefile >> that has the coastlines you'd like to see. Then use the >> readshapefile() method on your Basemap object instead of the >> drawcoastlines() method. >> >> my_map = Basemap(...) >> my_map.readshapefile(my_shpfile_name) >> >> Cheers, >> Scott >> >> > > You can also use the 'area_thresh' keyword to control the minimum size > of coastline features that are drawn. area_thresh=100 makes the > Great Lakes disappear, at the expense of making all the islands except > Greenland disappear too. If that's unacceptable, you'll have to do as > Scott suggests and create a shapfile without the lakes. > > -Jeff > > > -- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > ___ > 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/Basemap-drawcoastlines-issue-tp25690572p25769595.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)
I think this has nothing to do with dpi, but a file flushing issue. Try something like below with sage (note that the code does not work with svn version of matplotlib, i'll commit the fix soon). import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig=plt.figure() plt.plot([1,2,3]) f = open("test.png", "wb") plt.savefig(f, format="png", dpi=50) f.flush() I'll report some more details later. Regards, -JJ -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)
Jae-Joon Lee wrote: > I think this has nothing to do with dpi, but a file flushing issue. > Try something like below with sage (note that the code does not work > with svn version of matplotlib, i'll commit the fix soon). > > import matplotlib > matplotlib.use('Agg') > import matplotlib.pyplot as plt > fig=plt.figure() > plt.plot([1,2,3]) > f = open("test.png", "wb") > plt.savefig(f, format="png", dpi=50) > f.flush() > > I'll report some more details later. > > This seems to have solved the problem on the two systems on which I've run experiments. Now it makes perfect sense why I was always seeing a corrupt file size that was a multiple of 4K (e.g., 12K instead of 13K) :) . So just to confirm, is this a bug in matplotlib when using the plt.savefig(filename,dpi=72) form of calling savefig? Thanks, Jason -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)
I'm not sure. In short, what savefig does is (when filename ending with "png" is provided) is following. def savefig(filename): f = open(filename,"wb") write_png(f) I think there are two issue here. 1) write_png does not flush the file : this might be a bug or a feature, I'm not sure. 2) f is somehow not flushed when savefig returns (which should happen if file gets deleted). This only seems to happen in sage and this seems to be the reason why savefig does not work. As far as the second issues is concerned, I currently don't see anything wrong in mpl's side. We may try to explicitly flush (or close) the file after write_png, though. I hope someone who is more knowledgeable than me take a look at this. Meanwhile, I'll change the code to explicitly close the opened file. Regards, -JJ On Tue, Oct 6, 2009 at 1:44 PM, wrote: > Jae-Joon Lee wrote: >> I think this has nothing to do with dpi, but a file flushing issue. >> Try something like below with sage (note that the code does not work >> with svn version of matplotlib, i'll commit the fix soon). >> >> import matplotlib >> matplotlib.use('Agg') >> import matplotlib.pyplot as plt >> fig=plt.figure() >> plt.plot([1,2,3]) >> f = open("test.png", "wb") >> plt.savefig(f, format="png", dpi=50) >> f.flush() >> >> I'll report some more details later. >> >> > > > > This seems to have solved the problem on the two systems on which I've > run experiments. Now it makes perfect sense why I was always seeing a > corrupt file size that was a multiple of 4K (e.g., 12K instead of 13K) :) . > > So just to confirm, is this a bug in matplotlib when using the > plt.savefig(filename,dpi=72) form of calling savefig? > > Thanks, > > Jason > > -- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)
On Tue, Oct 6, 2009 at 2:24 PM, Jae-Joon Lee wrote: > 2) f is somehow not flushed when savefig returns (which should happen > if file gets deleted). I meant if the variable "f" gets dereferenced. -JJ -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] caps on errorbar
hi, i'm using the exact code pasted below, and copied from: http://matplotlib.sourceforge.net/examples/pylab_examples/errorbar_demo.html?highlight=errorbar i see the vertical error lines, but i'm not able to see the 'cap' as in the codex above, i've tried changing a few parameters in my matplotlibrc as well as different backends. i'm running matplotlib checked out from svn today. is there something i can try to make the caps appear? thanks, -brent from pylab import * t = arange(0.1, 4, 0.1) s = exp(-t) e = 0.1*abs(randn(len(s))) f = 0.1*abs(randn(len(s))) g = 2*e h = 2*f figure() errorbar(t, s, e, fmt='o') # vertical symmetric show() -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Axes.bar(orientation='horizontal') doesn't work?
Ernest Adrogué wrote: > Hi, > > I'm trying to plot some horizontal bars using the .bar() method: > > import matplotlib.pyplot as plt > fig=plt.figure() > ax=fig.add_subplot(1,1,1) > ax.bar([1,2,3],[4,6,5],orientation='horizontal') Use ax.barh([1,2,3], [4,5,6]) Eric -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users