You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(19) |
2
(28) |
3
(8) |
4
(15) |
5
(20) |
6
(23) |
7
(12) |
8
(11) |
9
(13) |
10
(4) |
11
(9) |
12
(34) |
13
(33) |
14
(24) |
15
(15) |
16
(12) |
17
(8) |
18
(5) |
19
(5) |
20
(6) |
21
(10) |
22
(9) |
23
(18) |
24
(10) |
25
(7) |
26
(13) |
27
(18) |
28
(29) |
29
(4) |
30
(5) |
31
(2) |
As far as I know, there is no easy way to do that with mpl (especially when image is involved). You may manually add ticks and ticklabels (but without using set_ticks, etc). If you're using 0.99 and later, you may use axes_grid toolkit, but it has some cons. So, if you're going to use it, please read through the documentation. from mpl_toolkits.axes_grid.parasite_axes import SubplotHost import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms fig = plt.figure(1, (4,3)) ax = SubplotHost(fig, 111) fig.add_subplot(ax) ax.imshow([[1,2],[3,4]], origin="lower") # transform from arcsecond to pixel tr = mtransforms.Affine2D().translate(+1,+1).scale(2., 2.) ax2 = ax.twin(tr) plt.show() Regards, -JJ On Wed, Oct 7, 2009 at 6:14 AM, Pim Schellart <p.s...@gm...> wrote: > Hi Everyone, > > after trying every example I could find in the documentation, gallery > and online I thought let's give the mailing list a try. > I have an image displayed with imshow. > I would like to display the pixel coordinates on the left y and bottom > x axis and the physical coordinates (in arcseconds) on the right y and > top x axis. > I tried it with twinx & twiny but then only a part of the image is > shown (image is in pixel coordinates), I also tried creating a new > axes object with ax2=plt.subplot(1,1,1, frameon=False) but then the > image is no longer shown (this might be a bug). > Is this possible with the current version (0.99) of matplotlib? > > Kind regards, > > Pim Schellart > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Text instances have "get_window_extent" method. However, it requires a renderer instance (because the size of the text depends on the backend), i.e., the size of the text is only known during the drawing time. The easiest ways is to call get_window_extent without any argument, but after figure is already drawn. However, it depends on why you need the size of the text. Regards, -JJ On Tue, Oct 6, 2009 at 9:54 AM, Donovan Parks <don...@gm...> wrote: > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On Wed, Oct 7, 2009 at 12:12 PM, Jae-Joon Lee <lee...@gm...> wrote: > Jason, > > This is now fixed in the svn. > Meanwhile, you may use the following workaround. Great! Thanks for the help! Jason
moving around artists form one axes to the other can be very tricky due to the underlying design of mpl. So, it is generally better idea to create artists for each axes, instead of reusing them. For a simple case as yours, adding the following line after line.remove() will work. line._transformSet = False Regards, -JJ On Mon, Oct 5, 2009 at 12:37 PM, TP <par...@fr...> wrote: > Hi everybody, > > I try to move an instance of matplotlib.lines.Line2D from one subplot to > another. How to do that? I have tried the following code, but the Line2D > does not appear on the second subplot. > > Thanks in advance, > > Julien > > ############### > from pylab import * > > ion() > f = figure() > s = f.add_subplot("211") > line = matplotlib.lines.Line2D([0,1],[0,1],color='m') > s.add_line( line ) > s2 = f.add_subplot("212") > > draw() > > raw_input( 'press a key to remove the line and try to add it to second > subplot' ) > > line.remove() > s2.add_line( line ) > draw() > > raw_input('press a key to quit') > ##################### > > -- > python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\ > 9&1+,\'Z4(55l4('])" > > "When a distinguished but elderly scientist states that something is > possible, he is almost certainly right. When he states that something is > impossible, he is very probably wrong." (first law of AC Clarke) > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Jason, This is now fixed in the svn. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/patches.py?r1=7840&r2=7857 Meanwhile, you may use the following workaround. import matplotlib import pylab from matplotlib.path import Path if __name__ == '__main__': pylab.clf() ax = pylab.axes([0,0,1,1]) ax.add_line(matplotlib.lines.Line2D((2, 5), (0.75, 6))) arc = matplotlib.patches.Arc((2, 0), 1.5, 1.5, 0.0, 0, 180.0, fill=False) arc._path = Path.arc(arc.theta1, arc.theta2) ax.add_patch(arc) ax.axis('equal') Note that the current pathces.Arc may update its _path during draw(). So, you may need to do arc._path = Path.arc(arc.theta1, arc.theta2) whenever correct extent of the arc is required (i.e., before calling axis). Regards, -JJ On Sun, Oct 4, 2009 at 11:51 PM, Jason Sewall <jas...@gm...> wrote: > On Sun, Oct 4, 2009 at 11:45 PM, Eric Firing <ef...@ha...> wrote: >> Use the Axes.set_aspect() method for full control of the aspect ratio, and >> of what gets changed to preserve that aspect ratio. > > Thanks, that works great! Any ideas about Arc's effect on the 'tight' bounds? > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi, I am quite new to python and matplotlib!! When plotting a simple graph using python and matplotlib my plot appears however the area (background) where my x.label and y.label and axes limits lie is grey, does anyone know how to set this to another color ie. white???? Thanks Maria -- View this message in context: http://www.nabble.com/Background-colours-tp25787444p25787444.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi all, What would be really useful for me, is to be able to hatch the area filled using the fill_between() method, instead of using solid color. Does anybody know if this is possible? Thanks in advance, Matt
Hi Everyone, after trying every example I could find in the documentation, gallery and online I thought let's give the mailing list a try. I have an image displayed with imshow. I would like to display the pixel coordinates on the left y and bottom x axis and the physical coordinates (in arcseconds) on the right y and top x axis. I tried it with twinx & twiny but then only a part of the image is shown (image is in pixel coordinates), I also tried creating a new axes object with ax2=plt.subplot(1,1,1, frameon=False) but then the image is no longer shown (this might be a bug). Is this possible with the current version (0.99) of matplotlib? Kind regards, Pim Schellart
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
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()
I am plotting time-series 1-minute cadence data for specific multiple-day validation periods. Sometimes the data have a gap between the start of the validation period and the start of the data. Attached is a stand-alone Python script that demonstrates the problem, along with the plot that the script produces. April 20 is the start of the validation period. I want 04-20 to appear at the plot origin. This does not happen unless either the model or observed dictionary contain a key/value pair for 1998,4,20,0. I tried adding datetime(1998,4,20,0):None to one or both dictionaries, but it is ignored. Also the minor tick marks do not look right, especially the ones just to the right of each x-axis label. Do you have any suggestions? Thanks, Ann I am working on a Windows PC; O/S is Windows XP Professional, Version 2002, Service Pack 3. I am running matplotlib, version '0.99.0' which I obtained from the matplotlib Sourceforge site. I have not customized matplotlibrc. I am running python version 2.6.2. Attached is output.txt, the result of running my script with a verbose-helpful
On Tue, Oct 6, 2009 at 2:24 PM, Jae-Joon Lee <lee...@gm...> 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
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, <jas...@cr...> 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
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
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
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 <rin...@gm...>: >>> 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=1000000 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 > Mat...@li... > 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.
Hi Scott, thanks for your response. This seems like the way to go! Ringo Scott Sinclair-4 wrote: > >>2009年10月1日 ringobelingo <rin...@gm...>: >> 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 > Mat...@li... > 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.
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
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: AssertionError Traceback (most recent call last) /home/ernest/<ipython console> in <module>() /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
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.
per freem <per...@gm...> 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
> 2009年10月5日 Ernest Adrogué <ead...@gm...>: > is it possible to draw unfilled scatter points? Yes, try the following >>> import numpy as np >>> import matplotlib.pyplot as plt >>> x = np.random.rand(10) >>> y = np.random.rand(10) >>> plt.scatter(x, y, facecolor='none') >>> plt.show() Also take a look at http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter Cheers, Scott
Jae-Joon Lee wrote: > On Mon, Oct 5, 2009 at 10:25 PM, <jas...@cr...> wrote: > >> Jae-Joon Lee wrote: >> >>> As one of who never used Sage, I don't think I'll be any help here. >>> Anyhow, can you tell us what kind of backed is used by default in the >>> two environment? I mean the type of the canvas that is initially >>> created. >>> >>> >> Thanks for following up on this. Is there an easy way to ask matplotlib >> what its default canvas is (i.e., what canvas pyplot will use for savefig)? >> I believe it's probably using the FigureCanvasAgg canvas, but I'm not sure. >> Since I've reproduced the problem with pure matplotlib code, I'm not sure >> where the canvas is set up and initialized. >> >> > > In [17]: fig = plt.figure() > > In [18]: print type(fig.canvas) > <class 'matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg'> > > See if matplotlib session and sage session uses different backend. > > >>> It seems to be some dpi issue, but MPL supposed to handle this correctly. >>> I guess it also works fine if the figure is initially created with the >>> matching dpi as the savefig (72),? >>> >>> >> I'm not sure what you're asking here or how to test your assumption. I >> posted the code that gave the problem in a Sage session, but worked fine in >> a normal python session. I also saw the problem (cut-off bottom in firefox, >> which looked like a transparent bottom portion of the figure in gimp) with >> varying amounts when I specified other dpi values. Is there something I can >> insert into my script to test what you're asking? >> >> > > plt.figure takes dpi parameter. This is the dpi of the figure instance > (not the output). Set this to same value as one you use for savefig. > > >> Again, I'm really puzzled by this. We are using just pure matplotlib, and >> yet, there seems to be something in the Sage configuration or environment or >> something that is causing pure matplotlib code to generate these erroneous >> figures, but the exact same installation of matplotlib, when run under >> python, generates perfectly fine figures. >> > > I do not have any clue either. However, one possibility I can think of > is that it is a bug in certain backend whose savefig command does not > take care of changing dpi correctly. If it turns out that the sage > session and ipython session uses a same backend, then, I have no idea. > I hope some other developer who uses sage take a look at this. > > I ran some more tests, this time on sage.math.washington.edu, which is a 64-bit Ubuntu system. This time, instead of errors, all I saw were zero-length files! (i.e., the file was there, but it was completely empty, i.e., zero bytes). I consistently produced a zero-length file the first time I used the dpi keyword argument to savefig. If I called savefig again, the correct figure was saved to the file. Any ideas about what in the world could be going on here? The logs of my trials are below. Using Sage's copy of python (2.6.2), the code printed out the exact same values for fig.canvas and fig.dpi each time, but there were no erroneous figures (i.e., all of the figures were saved to images correctly the first time savefig was called and the dpi was specified in savefig). Thanks, Jason <new Sage session> sage: import matplotlib.pyplot as plt;import numpy sage: fig=plt.figure() sage: print fig.canvas <matplotlib.backends.backend_agg.FigureCanvasAgg instance at 0x4ad8440> sage: print fig.dpi 80 sage: plt.plot(numpy.arange(0,1.1,0.01)) [<matplotlib.lines.Line2D object at 0x51275d0>] sage: plt.savefig('foo.png',dpi=72) # zero-length file generated sage: plt.savefig('foo.png',dpi=72) # correct figure generated <new Sage session> sage: import matplotlib.pyplot as plt;import numpy sage: fig=plt.figure(dpi=72) sage: print fig.canvas <matplotlib.backends.backend_agg.FigureCanvasAgg instance at 0x4ad94d0> sage: print fig.dpi 72 sage: plt.plot(numpy.arange(0,1.1,0.01)) [<matplotlib.lines.Line2D object at 0x51285d0>] sage: plt.savefig('foo.png',dpi=72) # zero-length file generated sage: plt.savefig('foo.png',dpi=72) # correct figure generated <new Sage Session> sage: import matplotlib.pyplot as plt;import numpy sage: fig=plt.figure() sage: print fig.canvas <matplotlib.backends.backend_agg.FigureCanvasAgg instance at 0x4ad7440> sage: print fig.dpi 80 sage: plt.plot(numpy.arange(0,1.1,0.01)) [<matplotlib.lines.Line2D object at 0x51305d0>] sage: plt.savefig('foo.png',dpi=80) # zero-length file generated sage: plt.savefig('foo.png',dpi=80) # correct figure generated <new Sage Session> sage: import matplotlib.pyplot as plt;import numpy sage: fig=plt.figure(dpi=72) sage: print fig.canvas <matplotlib.backends.backend_agg.FigureCanvasAgg instance at 0x4ad94d0> sage: print fig.dpi 72 sage: plt.plot(numpy.arange(0,1.1,0.01)) [<matplotlib.lines.Line2D object at 0x51325d0>] sage: plt.savefig('foo.png') # correct figure generated <new Sage session> sage: import matplotlib.pyplot as plt;import numpy sage: fig=plt.figure() sage: print fig.canvas <matplotlib.backends.backend_agg.FigureCanvasAgg instance at 0x4ad8440> sage: print fig.dpi 80 sage: plt.plot(numpy.arange(0,1.1,0.01)) [<matplotlib.lines.Line2D object at 0x51275d0>] sage: plt.savefig('foo.png') # correct figure generated
On Mon, Oct 5, 2009 at 10:25 PM, <jas...@cr...> wrote: > Jae-Joon Lee wrote: >> >> As one of who never used Sage, I don't think I'll be any help here. >> Anyhow, can you tell us what kind of backed is used by default in the >> two environment? I mean the type of the canvas that is initially >> created. >> > > Thanks for following up on this. Is there an easy way to ask matplotlib > what its default canvas is (i.e., what canvas pyplot will use for savefig)? > I believe it's probably using the FigureCanvasAgg canvas, but I'm not sure. > Since I've reproduced the problem with pure matplotlib code, I'm not sure > where the canvas is set up and initialized. > In [17]: fig = plt.figure() In [18]: print type(fig.canvas) <class 'matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg'> See if matplotlib session and sage session uses different backend. > >> It seems to be some dpi issue, but MPL supposed to handle this correctly. >> I guess it also works fine if the figure is initially created with the >> matching dpi as the savefig (72),? >> > > I'm not sure what you're asking here or how to test your assumption. I > posted the code that gave the problem in a Sage session, but worked fine in > a normal python session. I also saw the problem (cut-off bottom in firefox, > which looked like a transparent bottom portion of the figure in gimp) with > varying amounts when I specified other dpi values. Is there something I can > insert into my script to test what you're asking? > plt.figure takes dpi parameter. This is the dpi of the figure instance (not the output). Set this to same value as one you use for savefig. > Again, I'm really puzzled by this. We are using just pure matplotlib, and > yet, there seems to be something in the Sage configuration or environment or > something that is causing pure matplotlib code to generate these erroneous > figures, but the exact same installation of matplotlib, when run under > python, generates perfectly fine figures. I do not have any clue either. However, one possibility I can think of is that it is a bug in certain backend whose savefig command does not take care of changing dpi correctly. If it turns out that the sage session and ipython session uses a same backend, then, I have no idea. I hope some other developer who uses sage take a look at this. Regards, -JJ > > Thanks, > > Jason > > > > > >
Jae-Joon Lee wrote: > As one of who never used Sage, I don't think I'll be any help here. > Anyhow, can you tell us what kind of backed is used by default in the > two environment? I mean the type of the canvas that is initially > created. > Thanks for following up on this. Is there an easy way to ask matplotlib what its default canvas is (i.e., what canvas pyplot will use for savefig)? I believe it's probably using the FigureCanvasAgg canvas, but I'm not sure. Since I've reproduced the problem with pure matplotlib code, I'm not sure where the canvas is set up and initialized. > It seems to be some dpi issue, but MPL supposed to handle this correctly. > I guess it also works fine if the figure is initially created with the > matching dpi as the savefig (72),? > I'm not sure what you're asking here or how to test your assumption. I posted the code that gave the problem in a Sage session, but worked fine in a normal python session. I also saw the problem (cut-off bottom in firefox, which looked like a transparent bottom portion of the figure in gimp) with varying amounts when I specified other dpi values. Is there something I can insert into my script to test what you're asking? Again, I'm really puzzled by this. We are using just pure matplotlib, and yet, there seems to be something in the Sage configuration or environment or something that is causing pure matplotlib code to generate these erroneous figures, but the exact same installation of matplotlib, when run under python, generates perfectly fine figures. Thanks, Jason