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) |
|
From: Eric F. <ef...@ha...> - 2009-10-06 22:24:55
|
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 |
|
From: Brent P. <bpe...@gm...> - 2009-10-06 21:16:04
|
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() |
|
From: Ann N. <Ann...@no...> - 2009-10-06 21:15:38
|
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 |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 18:26:13
|
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 |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 18:24:41
|
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
>
|
|
From: <jas...@cr...> - 2009-10-06 17:45:09
|
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
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 16:43:39
|
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
|
|
From: ringobelingo <rin...@gm...> - 2009-10-06 14:17:31
|
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. |
|
From: ringobelingo <rin...@gm...> - 2009-10-06 14:14:55
|
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. |
|
From: Donovan P. <don...@gm...> - 2009-10-06 13:54:57
|
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 |
|
From: Ernest A. <ead...@gm...> - 2009-10-06 12:24:18
|
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
|
|
From: William H. <wi...@qu...> - 2009-10-06 11:36:54
|
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. |
|
From: Jouni K. S. <jk...@ik...> - 2009-10-06 07:56:34
|
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 |
|
From: Scott S. <sco...@gm...> - 2009-10-06 05:46:54
|
> 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 |
|
From: <jas...@cr...> - 2009-10-06 03:53:37
|
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 |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 02:42:13
|
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 > > > > > > |
|
From: <jas...@cr...> - 2009-10-06 02:26:02
|
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 |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 02:17:42
|
with hold=False, the axes is reset whenever something new is added to
the axes. Instead of using pylab.hold(False), clear the figure or axes
explicitly (clf() or cla())
-JJ
On Mon, Oct 5, 2009 at 9:58 PM, Ross Anderson <rpa...@gm...> wrote:
> Hi all,
>
> I'm making multiple semilogy histograms, which for now are on separate
> figures and not in subplots. Here's something patched together:
> def makehistogram(data,strtitle, filename):
> fig = Figure()
> pylab.hold(False)
> pylab.semilogy(base=10)
> n, bins, patches = pylab.hist(data, 50, normed=1)
> pylab.setp(patches, 'facecolor', 'g', 'alpha', 0.75)
> pylab.xlabel('bins')
> pylab.ylabel('logP')
> pylab.title(strtitle)
> pylab.grid(True)
> pylab.savefig(filename,dpi=72)
>
> The first call to makehistogram() saves the semilogy histogram I want, but
> the subsequent calls create regular cartesian histograms. Am I missing
> something?
>
> Thanks
>
> ------------------------------------------------------------------------------
> 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
>
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-06 02:08:13
|
I just want to mention that axes size in mpl, by design, is supposed to be proportional to the figure size, so there could be cases when a fixed-sized axes messes up something. Furthermore, using axes_grid toolkit can be a bit tricky, so I (as an author of the axes_grid toolkit) personally do no recommend it for someone new to matplotlib. Having said that, add below after the make_axes_locatable call. from mpl_toolkits.axes_grid import Size divider.get_horizontal()[0] = Size.Fixed(3.0) # 3 inch divider.get_vertical()[0] = Size.Fixed(2.0) # 2 inch The axes will have a fixed size regardless of the figure size. Also, take a look at the below example of fixed size axes. http://matplotlib.sourceforge.net/examples/axes_grid/demo_fixed_size_axes.html FYI, if you want your output automatically clipped according to the axes size and label etc., try savefig with bbox_inches="tight" option (it does not affect the displayed figure size). Although the current algorithm is not perfect, it seems to work okay for a simple case as yours. Regards, -JJ On Mon, Oct 5, 2009 at 8:59 PM, Donovan Parks <don...@gm...> wrote: > Hello, > > I am new to matplotlib and am having trouble understanding how to set > the size of a subplot when a figure contains multiple subplots. In > particular, I have been playing around with the scatter_hist.py demo > at http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html. > A simplified version of this code is given below: > > ***************** > > import numpy as np > import matplotlib.pyplot as plt > from mpl_toolkits.axes_grid import make_axes_locatable > > fig = plt.figure(1, figsize=(4,4)) > > axScatter = plt.subplot(111) > divider = make_axes_locatable(axScatter) > axHisty = divider.new_horizontal(1.2, pad=0.5, sharey=axScatter) > fig.add_axes(axHisty) > > x = np.random.randn(1000) > y = np.random.randn(1000) > axScatter.scatter(x, y) > axHisty.hist(x, orientation='horizontal') > > plt.draw() > plt.show() > > ***************** > > I'd like to have direct control over the size of the scatter plot in > this figure. As it stands, I can 'sort of' control its size by > changing the figsize property of the figure. I say 'sort of' since the > size of any labels also come into play here. Is it possible to > directly make the scatter plot a certain size (say, 3 x 2 inches), set > the figure size independently (say, 5 x 4 inches), and have the > histogram size be set based on the scatter plot height and width set > in divider.new_horizontal (in this case to 3 x 1.2 inches)? > > I realize that in this example, it probably seems silly to not just > change figsize, but I am working with a more complicated plot in > reality where I'd like precise control over the size of the initial > subplot since the aspect ratio is important to me. I can then adjust > the figsize to make sure all the labels fit in nicely. > > Thanks for any and all help. > > 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 > |
|
From: Ross A. <rpa...@gm...> - 2009-10-06 01:58:40
|
Hi all,
I'm making multiple semilogy histograms, which for now are on separate
figures and not in subplots. Here's something patched together:
def makehistogram(data,strtitle, filename):
fig = Figure()
pylab.hold(False)
pylab.semilogy(base=10)
n, bins, patches = pylab.hist(data, 50, normed=1)
pylab.setp(patches, 'facecolor', 'g', 'alpha', 0.75)
pylab.xlabel('bins')
pylab.ylabel('logP')
pylab.title(strtitle)
pylab.grid(True)
pylab.savefig(filename,dpi=72)
The first call to makehistogram() saves the semilogy histogram I want, but
the subsequent calls create regular cartesian histograms. Am I missing
something?
Thanks
|
|
From: Chloe L. <ch...@be...> - 2009-10-06 01:38:04
|
You will probably want to add axes explicitly (not with subplot), e.g. fig.add_axes([.1,.1,.71,.8]) specifies the coordinates of one corner and the width and height (in proportions of the figure size). When doing this explicitly, you will probably need to do some extra adjustments to fit the axis labels and so forth. &C On Oct 5, 2009, at 5:59 PM, Donovan Parks wrote: > Hello, > > I am new to matplotlib and am having trouble understanding how to set > the size of a subplot when a figure contains multiple subplots. In > particular, I have been playing around with the scatter_hist.py demo > at http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html > . > A simplified version of this code is given below: > > ***************** > > import numpy as np > import matplotlib.pyplot as plt > from mpl_toolkits.axes_grid import make_axes_locatable > > fig = plt.figure(1, figsize=(4,4)) > > axScatter = plt.subplot(111) > divider = make_axes_locatable(axScatter) > axHisty = divider.new_horizontal(1.2, pad=0.5, sharey=axScatter) > fig.add_axes(axHisty) > > x = np.random.randn(1000) > y = np.random.randn(1000) > axScatter.scatter(x, y) > axHisty.hist(x, orientation='horizontal') > > plt.draw() > plt.show() > > ***************** > > I'd like to have direct control over the size of the scatter plot in > this figure. As it stands, I can 'sort of' control its size by > changing the figsize property of the figure. I say 'sort of' since the > size of any labels also come into play here. Is it possible to > directly make the scatter plot a certain size (say, 3 x 2 inches), set > the figure size independently (say, 5 x 4 inches), and have the > histogram size be set based on the scatter plot height and width set > in divider.new_horizontal (in this case to 3 x 1.2 inches)? > > I realize that in this example, it probably seems silly to not just > change figsize, but I am working with a more complicated plot in > reality where I'd like precise control over the size of the initial > subplot since the aspect ratio is important to me. I can then adjust > the figsize to make sure all the labels fit in nicely. > > Thanks for any and all help. > > 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 |
|
From: Donovan P. <don...@gm...> - 2009-10-06 01:00:23
|
Hello, I am new to matplotlib and am having trouble understanding how to set the size of a subplot when a figure contains multiple subplots. In particular, I have been playing around with the scatter_hist.py demo at http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html. A simplified version of this code is given below: ***************** import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid import make_axes_locatable fig = plt.figure(1, figsize=(4,4)) axScatter = plt.subplot(111) divider = make_axes_locatable(axScatter) axHisty = divider.new_horizontal(1.2, pad=0.5, sharey=axScatter) fig.add_axes(axHisty) x = np.random.randn(1000) y = np.random.randn(1000) axScatter.scatter(x, y) axHisty.hist(x, orientation='horizontal') plt.draw() plt.show() ***************** I'd like to have direct control over the size of the scatter plot in this figure. As it stands, I can 'sort of' control its size by changing the figsize property of the figure. I say 'sort of' since the size of any labels also come into play here. Is it possible to directly make the scatter plot a certain size (say, 3 x 2 inches), set the figure size independently (say, 5 x 4 inches), and have the histogram size be set based on the scatter plot height and width set in divider.new_horizontal (in this case to 3 x 1.2 inches)? I realize that in this example, it probably seems silly to not just change figsize, but I am working with a more complicated plot in reality where I'd like precise control over the size of the initial subplot since the aspect ratio is important to me. I can then adjust the figsize to make sure all the labels fit in nicely. Thanks for any and all help. Cheers, Donovan |
|
From: Paul H. <p_h...@ho...> - 2009-10-06 00:18:39
|
Whenever I run the statement: from pylab import randn, hist OR import matplotlib.pyplot as plt Python crashes, no error ... nothing Running under Python 2.5 Any ideas? _________________________________________________________________ Take a peek at other people's pay and perks Check out The Great Australian Pay Check http://clk.atdmt.com/NMN/go/157639755/direct/01/ |