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
(9) |
2
(8) |
3
|
4
(6) |
5
|
6
|
7
(41) |
8
(18) |
9
(25) |
10
(18) |
11
(10) |
12
(13) |
13
(7) |
14
(4) |
15
(12) |
16
(6) |
17
(9) |
18
(7) |
19
(2) |
20
(5) |
21
(7) |
22
(2) |
23
(11) |
24
(11) |
25
(14) |
26
(3) |
27
(3) |
28
(17) |
29
(7) |
30
(16) |
31
(8) |
|
|
On Mon, Mar 7, 2011 at 1:29 AM, Eric Firing <ef...@ha...> wrote: > On 03/06/2011 09:14 PM, Thomas Lecocq wrote: > > Dear, > > > > Please also note that '+' and 'x' are "lines", hence if you want them > > coloured, you'll need to set edgecolor="g" rather than just color='g' ... > > Exactly, but in the scatter context one shouldn't have to do this. I > consider it a bug, so I will shortly commit a fix. Markers that have no > face showing, only edge, should still behave as expected when a "c" > kwarg is supplied. I think this is what one would expect based on the > docstring. > > Eric > > I always did wonder what the difference was between 'c' and 'color'. We should definitely make this clearer in the docs. Obviously, the 'c' argument should always work because the user shouldn't have to know the difference. Those who do know the difference can continue using the appropriate kwargs for advanced control. Ben Root
On Mon, Mar 7, 2011 at 4:36 AM, Yuri D'Elia <wa...@us...> wrote: > On Fri, 4 Mar 2011 14:57:34 -0600 > Benjamin Root <ben...@ou...> wrote: > > > Which version of matplotlib are you using? This example works for me > using > > the latest matplotlib from source. Also, why the awkward usage and > > Yes, with matplotlib 1.0 bbox_extra_artists now works. > > I consider bbox_extra_artists some kind of a hack (IMHO, all artists should > be considered with a 'tight' box), but coming from gnuplot/asymptote maybe > my point of view is biased. > What would be the point of a 'tight' box that excludes parts of the plot? I > would specify the coordinates myself if I needed clipping. > > > imports? If you want to force the Agg backend to be used, you could just > > do: > > > > import matplotlib > > matplotlib.use("Agg") > > > > before any other matplotlib imports. > > Thanks for the suggestion, that looks promising, but doesn't work: > > ---- > import matplotlib as mpl > mpl.use("Agg") > import matplotlib.figure > fig = mpl.figure.Figure() > fig.set_size_inches((20,20)) > plot = fig.add_subplot(111) > plot.set_title("Subtitle") > plot.plot([1,2,3], [3,2,1]) > st = fig.suptitle("Horray!", fontsize=20) > fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) > ---- > > The problem is that you are creating your figure wrong. Try this: import matplotlib as mpl mpl.use("Agg") import matplotlib.pyplot as plt fig = plt.figure(figsize=(20, 20)) ax = fig.add_subplot(111) ax.set_title("Subtitle") ax.plot([1, 2, 3], [3, 2, 1]) st = fig.suptitle("Horray!", fontsize=20) fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) Notice that I am using the pyplot interface. Matplotlib was intended to be used through either this pyplot interface or the pylab interface (which I do not personally recommend if you want full control over your plots). If you don't use either interfaces, then don't be surprised when things do not work properly. In particular, creating the figure object by directly calling the Figure constructor bypasses important steps that involves attaching the appropriate backend to the figure object. Also notice that I name the object coming from add_subplot() "ax" instead of "plot". This is for clarity and to avoid confusion with the command "plot". This is also the generally accepted coding convention in matplotlib. > > I find the documentation a bit scattered around this subject. > I'm not using the pyplot interface, so I guess that .use("Agg") doesn't do > anything for me? > I also have no reason to use the pyplot interface, why should I? I have no > matlab background, and I mostly use matplotlib procedurally (ie not > interactively). > The only accepted ways to use matplotlib are through either the pyplot or the pylab interfaces. This is why they are called interfaces. It does not matter if you are using matplotlib interactively or procedurally. I personally use the pyplot interface in all of my scripts, as I rarely ever do interactive plotting. The pylab interface is more geared towards interactive plotting. These interfaces are designed to make your life easier. Think of it this way. The developers can make many changes to matplotlib internals from one release to the next, but we do our best to make the interface as stable as possible. If you write code that do not utilize the pylab or pyplot interfaces, then your scripts will likely break at the next release. Trust me, a lot of your problems will be solved by picking an interface (I recommend pyplot) and sticking with it. I hope this is helpful, Ben Root
On Mon, Mar 7, 2011 at 5:22 AM, Yuri D'Elia <wa...@us...> wrote: > Hi everyone. I'm a newbye to matplotlib, so excuse my naive questions. I > have a large experience with gnuplot and asymptote, and I only recently > started to experiment with matplotlib. > > Some background: I'm trying to use matplotlib mostly for complex plots with > a lot of data. Gnuplot is usually fine, but I ended up too often producing > huge batch scripts consisting of overlarge plot[] command sequences and > pre-processed input files. Asymptote is awesome, but reading data is a mayor > pita. As a result, I mostly use gnuplot interactively, and asymptote when I > need to plot functions. Both packages are generally excellent, they have > good support of multiple plots and usually never require manual placement of > figure elements. > > So far my experience with matplotlib is that a lot of manual placement seem > to be required when coming down to multiple plots and legends. > > I have a large figure, consisting of several dense plots. > > I'm trying to plot the legend outside of the plots, but I find it > bothersome how difficult it is to place the legend outside the plot. > > With gnuplot, it's as simple as: > > > set key outside top right > > This also works perfectly fine with 'multiplot' (gnuplot automatic multiple > plot layout). > With matplotlib, I have to do the following: > > legend(bbox_to_anchor=(1, 1 + ?), loc=2) > > but how do I calculate the vertical location? Do I have to go at random to > align the legend to the plot axis? It also breaks wonderfully with multiple > plots, since plot(xyz) seems to consider only the axis and nothing more. > > Can't we just have: > > legend(loc=2, outside=true) > > please? The vast majority of plots I do are too dense to have a legend > inside the plot. > > Also, related to my previous message (savefig bbox_inches='tight' does not > consider suptitle), the legend is not considered when constructing a 'tight' > boundary box. > It seems to me that the legend is another obvious element that should be > taken into account without resorting to bbox_extra_artists. > > Thanks again. > > > Matplotlib is designed to give you maximum control over the figure elements while still maintaining sensible defaults. This is helpful in some cases, and not so helpful in others. In your case of placing a legend outside an axes, calculating the location can be a bit of a trial-and-error, but if the number of elements in your legend is going to be fixed, once you find a good value, you can just leave it that way in your script. Automatic determination of legend size is difficult because the size of the text objects are not known until draw time. However, it is possible to query your legend object for its bbox and then reposition your legend object accordingly (but only after the initial draw). This is tricky, but do-able. By the way, another possible command you might want is called "figlegend", which is a legend that is attached to the figure object rather than the axes object. It is plotted outside the axes, and has to be given all the objects to list, but it might be what you want. See this example: http://matplotlib.sourceforge.net/examples/pylab_examples/figlegend_demo.html I hope that is helpful, Ben Root
On 3/7/11 7:38 AM, Aman Thakral wrote: > On a similar note, are there any alternatives available to nearest > neighbor? For example, kriging? I remember seeing a geostats library > in python (hpgl i think), but I found the API rather impractical and > difficult to use. > > Thanks, > Aman Aman: The basemap interp function is just a convenience function for simple regridding (linear, cubic and nearest neighbor). scipy.interpolate (http://docs.scipy.org/doc/scipy/reference/interpolate.html) provides many more options. -Jeff > > On Mon, Mar 7, 2011 at 8:23 AM, Jeff Whitaker <js...@fa... > <mailto:js...@fa...>> wrote: > > On 3/7/11 5:50 AM, Jeff Whitaker wrote: > > On 3/6/11 8:58 PM, Juan A. Saenz wrote: > >> Hi, > >> > >> I use Basemap and netCDF4-python on a regular basis, and find them > >> very useful tools. Thank you for developing them! > >> > >> I noticed that when using basemap.interp for nearest neighbor > >> (order=0) the interpolation is not masked, and nearest neighbor > masked > >> values will be used in the interpolation. I was wondering if > you could > >> suggest a way to do nearest neighbor interpolation where masked are > >> supported, i.e. nearest neighbor values that are not masked. > >> > >> Thanks for your help, > >> Juan > >> > > Juan: I agree that this would be desirable behavior. > Unfortunately, > > it's not obvious to me how to do it. I'll think about it and > get back > > to you. (cc'ing matplotlib-users list). > > > > -Jeff > > > > Juan: On second thought, I'm not sure this is desirable behavior. I > would guess that most of the time, if a nearest neighbor is > masked, the > user would expect the interpolation routine to return a masked > value. I > would be interested to hear what others think. > > -Jeff > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Mon, Mar 7, 2011 at 5:05 AM, Andrea Crotti <and...@gm...>wrote: > Here I am again with the text boxing and scaling. > I'm having some troubles to understand the whole picture, since it seems > that there are so many actors involved. > > So suppose I have some text and I want to see how big it is, I thought > I could > > t = matplotlib.text.Text(0, 0, "very long string") > t.get_bbox_patch() > > to get the size and then do the rest. > > but this still returns None, probably because at this point there's > probably something still missing, right? > > The thing that is missing is that it hasn't been drawn yet. This is why matplotlib can not act like LaTeX and figure out optimal layouts for you automatically. The bbox for any text object can not be known until draw time. > And when I get the resulting size, how do I make my axes big enough > anyway? > > You can use subplots_adjust() to change the spacing between subplots. There should also be a way to change the figure size as well through the figure object. > What's the relation between size and axes for example? > I am not sure I understand your question. Ben Root
On a similar note, are there any alternatives available to nearest neighbor? For example, kriging? I remember seeing a geostats library in python (hpgl i think), but I found the API rather impractical and difficult to use. Thanks, Aman On Mon, Mar 7, 2011 at 8:23 AM, Jeff Whitaker <js...@fa...> wrote: > On 3/7/11 5:50 AM, Jeff Whitaker wrote: > > On 3/6/11 8:58 PM, Juan A. Saenz wrote: > >> Hi, > >> > >> I use Basemap and netCDF4-python on a regular basis, and find them > >> very useful tools. Thank you for developing them! > >> > >> I noticed that when using basemap.interp for nearest neighbor > >> (order=0) the interpolation is not masked, and nearest neighbor masked > >> values will be used in the interpolation. I was wondering if you could > >> suggest a way to do nearest neighbor interpolation where masked are > >> supported, i.e. nearest neighbor values that are not masked. > >> > >> Thanks for your help, > >> Juan > >> > > Juan: I agree that this would be desirable behavior. Unfortunately, > > it's not obvious to me how to do it. I'll think about it and get back > > to you. (cc'ing matplotlib-users list). > > > > -Jeff > > > > Juan: On second thought, I'm not sure this is desirable behavior. I > would guess that most of the time, if a nearest neighbor is masked, the > user would expect the interpolation routine to return a masked value. I > would be interested to hear what others think. > > -Jeff > > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On Mon, Mar 7, 2011 at 5:53 PM, Gökhan Sever <gok...@gm...> wrote: > Hello, > > I am going to the PyCon this week. I am presenting a poster about an > atmospheric sciences related project -- the most active development > from my coding site over at http://code.google.com/p/ccnworks/ > > Is there anybody in the community participating there as well? Any > plans for sprinting or similar activities? Will be there as well, but only for the WE + monday, cheers, David
On 3/7/11 5:50 AM, Jeff Whitaker wrote: > On 3/6/11 8:58 PM, Juan A. Saenz wrote: >> Hi, >> >> I use Basemap and netCDF4-python on a regular basis, and find them >> very useful tools. Thank you for developing them! >> >> I noticed that when using basemap.interp for nearest neighbor >> (order=0) the interpolation is not masked, and nearest neighbor masked >> values will be used in the interpolation. I was wondering if you could >> suggest a way to do nearest neighbor interpolation where masked are >> supported, i.e. nearest neighbor values that are not masked. >> >> Thanks for your help, >> Juan >> > Juan: I agree that this would be desirable behavior. Unfortunately, > it's not obvious to me how to do it. I'll think about it and get back > to you. (cc'ing matplotlib-users list). > > -Jeff > Juan: On second thought, I'm not sure this is desirable behavior. I would guess that most of the time, if a nearest neighbor is masked, the user would expect the interpolation routine to return a masked value. I would be interested to hear what others think. -Jeff
On Mon, 7 Mar 2011 11:36:45 +0100 Yuri D'Elia <wa...@us...> wrote: > On Fri, 4 Mar 2011 14:57:34 -0600 > Benjamin Root <ben...@ou...> wrote: > > > Which version of matplotlib are you using? This example works for me using > > the latest matplotlib from source. Also, why the awkward usage and > > Yes, with matplotlib 1.0 bbox_extra_artists now works. Just out of curiosity, is this: legend = plot.legend() pic.savefig(..., bbox_extra_artists=[legend]) supposed to work? Traceback (most recent call last): File "./plot.py", line 108, in <module> fig.savefig(sys.argv[1], bbox_inches='tight', bbox_extra_artists=xa) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 1894, in print_figure in kwargs.pop("bbox_extra_artists", [])] TypeError: get_window_extent() takes exactly 1 argument (2 given)
On 3/6/11 8:58 PM, Juan A. Saenz wrote: > Hi, > > I use Basemap and netCDF4-python on a regular basis, and find them > very useful tools. Thank you for developing them! > > I noticed that when using basemap.interp for nearest neighbor > (order=0) the interpolation is not masked, and nearest neighbor masked > values will be used in the interpolation. I was wondering if you could > suggest a way to do nearest neighbor interpolation where masked are > supported, i.e. nearest neighbor values that are not masked. > > Thanks for your help, > Juan > Juan: I agree that this would be desirable behavior. Unfortunately, it's not obvious to me how to do it. I'll think about it and get back to you. (cc'ing matplotlib-users list). -Jeff
Hi Gökhan, I will present a poster about astronomical data reduction and visualization on Sunday. I will arrive to Atlanta on Wednesday morning to attend a couple of tutorials before the conference and look forward to participating in sprints or other activities. Regards, Miguel On Mon, Mar 07, 2011 at 01:53:45AM -0700, Gökhan Sever wrote: > Hello, > > I am going to the PyCon this week. I am presenting a poster about an > atmospheric sciences related project -- the most active development > from my coding site over at http://code.google.com/p/ccnworks/ > > Is there anybody in the community participating there as well? Any > plans for sprinting or similar activities? > > See you at PyCon. > > -- > Gökhan > _______________________________________________ > NumPy-Discussion mailing list > Num...@sc... > http://mail.scipy.org/mailman/listinfo/numpy-discussion
Hi everyone. I'm a newbye to matplotlib, so excuse my naive questions. I have a large experience with gnuplot and asymptote, and I only recently started to experiment with matplotlib. Some background: I'm trying to use matplotlib mostly for complex plots with a lot of data. Gnuplot is usually fine, but I ended up too often producing huge batch scripts consisting of overlarge plot[] command sequences and pre-processed input files. Asymptote is awesome, but reading data is a mayor pita. As a result, I mostly use gnuplot interactively, and asymptote when I need to plot functions. Both packages are generally excellent, they have good support of multiple plots and usually never require manual placement of figure elements. So far my experience with matplotlib is that a lot of manual placement seem to be required when coming down to multiple plots and legends. I have a large figure, consisting of several dense plots. I'm trying to plot the legend outside of the plots, but I find it bothersome how difficult it is to place the legend outside the plot. With gnuplot, it's as simple as: > set key outside top right This also works perfectly fine with 'multiplot' (gnuplot automatic multiple plot layout). With matplotlib, I have to do the following: legend(bbox_to_anchor=(1, 1 + ?), loc=2) but how do I calculate the vertical location? Do I have to go at random to align the legend to the plot axis? It also breaks wonderfully with multiple plots, since plot(xyz) seems to consider only the axis and nothing more. Can't we just have: legend(loc=2, outside=true) please? The vast majority of plots I do are too dense to have a legend inside the plot. Also, related to my previous message (savefig bbox_inches='tight' does not consider suptitle), the legend is not considered when constructing a 'tight' boundary box. It seems to me that the legend is another obvious element that should be taken into account without resorting to bbox_extra_artists. Thanks again.
Here I am again with the text boxing and scaling. I'm having some troubles to understand the whole picture, since it seems that there are so many actors involved. So suppose I have some text and I want to see how big it is, I thought I could t = matplotlib.text.Text(0, 0, "very long string") t.get_bbox_patch() to get the size and then do the rest. but this still returns None, probably because at this point there's probably something still missing, right? And when I get the resulting size, how do I make my axes big enough anyway? What's the relation between size and axes for example?
On Fri, 4 Mar 2011 14:57:34 -0600 Benjamin Root <ben...@ou...> wrote: > Which version of matplotlib are you using? This example works for me using > the latest matplotlib from source. Also, why the awkward usage and Yes, with matplotlib 1.0 bbox_extra_artists now works. I consider bbox_extra_artists some kind of a hack (IMHO, all artists should be considered with a 'tight' box), but coming from gnuplot/asymptote maybe my point of view is biased. What would be the point of a 'tight' box that excludes parts of the plot? I would specify the coordinates myself if I needed clipping. > imports? If you want to force the Agg backend to be used, you could just > do: > > import matplotlib > matplotlib.use("Agg") > > before any other matplotlib imports. Thanks for the suggestion, that looks promising, but doesn't work: ---- import matplotlib as mpl mpl.use("Agg") import matplotlib.figure fig = mpl.figure.Figure() fig.set_size_inches((20,20)) plot = fig.add_subplot(111) plot.set_title("Subtitle") plot.plot([1,2,3], [3,2,1]) st = fig.suptitle("Horray!", fontsize=20) fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) ---- produces: Traceback (most recent call last): File "test.py", line 13, in <module> fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) AttributeError: 'NoneType' object has no attribute 'print_figure' I find the documentation a bit scattered around this subject. I'm not using the pyplot interface, so I guess that .use("Agg") doesn't do anything for me? I also have no reason to use the pyplot interface, why should I? I have no matlab background, and I mostly use matplotlib procedurally (ie not interactively).
On Sun, 6 Mar 2011 21:47:04 +0900 Jae-Joon Lee <lee...@gm...> wrote: > > Ok, I can understand that, but shouldn't all artists used to construct the picture, as suptitle, be considered? > > I think considering all the artists is not very practical (as some of > them could have spline paths), but what we may be able to do is to > consider all the texts in the figure. I'll try to implement them. Can you describe a scenario where considering all artists may produce wrong/unintended results? Considering all texts in the figure might be a good-enough solution, but I honestly have an hard time figuring out a case where bbox_inches should ignore some elements. I come from a gnuplot/asymptote background, so my view could be biased. > > import matplotlib as mpl > > import matplotlib.figure > > import matplotlib.backends.backend_agg > > > > fig = mpl.figure.Figure() > > cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig) > > fig.set_size_inches((20,20)) > > plot = fig.add_subplot(111) > > plot.set_title("Subtitle") > > plot.plot([1,2,3], [3,2,1]) > > st = fig.suptitle("Horray!", fontsize=20) > > fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) > > > > I believe you're using a matplotlib version that the > "bbox_extra_artists" keyword was not yet implemented. > Can you try to install 1.0 version of matpltolib? > As Benjamin has confirmed, this is supposed to work (with recent > version of matplotlib). > If upgrading is not possible, I'll try to come up with a workaround (I > don't think it will be done with a few lines of code though). Yes, thanks. By upgrading to 1.0, bbox_extra_artists now works.
Hello, I am going to the PyCon this week. I am presenting a poster about an atmospheric sciences related project -- the most active development from my coding site over at http://code.google.com/p/ccnworks/ Is there anybody in the community participating there as well? Any plans for sprinting or similar activities? See you at PyCon. -- Gökhan
On 03/06/2011 09:14 PM, Thomas Lecocq wrote: > Dear, > > Please also note that '+' and 'x' are "lines", hence if you want them > coloured, you'll need to set edgecolor="g" rather than just color='g' ... Exactly, but in the scatter context one shouldn't have to do this. I consider it a bug, so I will shortly commit a fix. Markers that have no face showing, only edge, should still behave as expected when a "c" kwarg is supplied. I think this is what one would expect based on the docstring. Eric > > HTH > > Thom > > ********************** > Dr Thomas Lecocq > Geologist > Seismology > Royal Observatory of Belgium > ********************** > > > > > Date: Fri, 4 Mar 2011 10:49:09 -0800 > > From: sco...@na... > > To: mat...@li... > > Subject: Re: [Matplotlib-users] Can't set scatter plot point color > > > > > > Thank you for the reply. > > > > I discovered this myself yesterday. Now I have an official answer if > people > > want a colored + or the x symbol in the scatter plot. > > > > Scott Hansen > > > > > > > > efiring wrote: > > > > > > On 03/02/2011 06:42 AM, Mr. Python wrote: > > >> > > >> I am unable to set the color of the scatter plot points using the code > > >> below: > > >> > > >> import matplotlib > > >> matplotlib.use('Qt4Agg') > > >> > > >> import matplotlib.pyplot as plt > > >> import numpy as np > > >> > > >> plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+') > > > > > > This is a bug in the handling of symstyle 2, which includes '+' and > 'x'. > > > > > >> > > >> #Add the graph title and x/y axis labels > > >> plt.title("Gear Span") > > >> plt.xlabel("Vehicle Speed (mph)") > > >> plt.ylabel("Engine Load %") > > >> plt.show() > > >> > > >> No matter what I change the c parameter to ('b','r', etc.), the > color of > > >> the > > >> scatter plot points are always black. The lists newSpdVals and > > >> newEngLoadVals have 100 dimmensions and are of type numpy.ndarray. > > >> > > >> I am using the following software and hardware: > > >> > > >> Windows XP > > >> Python 2.7 > > >> PyQt4 (I launch the plot from a PyQt GUI. I don't embed the plot > in the > > >> GUI). > > >> matplotlib 1.01 > > >> > > >> In the beginning of the same function where my scatter plot code is, I > > >> added > > >> the following code to verify if the problem is due to the > matplotlib/PyQt > > >> interface: > > >> > > >> a = np.linspace(-10,100,33) > > >> b = np.linspace(-32,400,33) > > >> plt.scatter(a, b,color='g',marker='+') > > > > > > Note the difference: here you are using a 'color' kwarg that is > getting > > > passed directly to the AsteriskPolygonCollection, whereas before you > > > were using the 'c' kwarg that is being handled incorrectly in this > case > > > inside of the scatter code. > > > > > > Eric > > > > > >> plt.title("Gear Span") > > >> plt.xlabel("Vehicle Speed (mph)") > > >> plt.ylabel("Engine Load %") > > >> plt.show() > > >> > > >> The points for this plot are colored green. I'm able to change the > point > > >> color to blue, red, etc. > > >> > > >> Any ideas why I can't change the point color of my first graph? Thank > > >> you > > >> for your help. > > >> > > >> > > > > > > > > > > ------------------------------------------------------------------------------ > > > What You Don't Know About Data Connectivity CAN Hurt You > > > This paper provides an overview of data connectivity, details > > > its effect on application quality, and explores various alternative > > > solutions. http://p.sf.net/sfu/progress-d2d > > > _______________________________________________ > > > Matplotlib-users mailing list > > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > > > > -- > > View this message in context: > http://old.nabble.com/Can%27t-set-scatter-plot-point-color-tp31051071p31070224.html > > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > > > > ------------------------------------------------------------------------------ > > What You Don't Know About Data Connectivity CAN Hurt You > > This paper provides an overview of data connectivity, details > > its effect on application quality, and explores various alternative > > solutions. http://p.sf.net/sfu/progress-d2d > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Dear, Please also note that '+' and 'x' are "lines", hence if you want them coloured, you'll need to set edgecolor="g" rather than just color='g' ... HTH Thom ********************** Dr Thomas Lecocq Geologist Seismology Royal Observatory of Belgium ********************** > Date: Fri, 4 Mar 2011 10:49:09 -0800 > From: sco...@na... > To: mat...@li... > Subject: Re: [Matplotlib-users] Can't set scatter plot point color > > > Thank you for the reply. > > I discovered this myself yesterday. Now I have an official answer if people > want a colored + or the x symbol in the scatter plot. > > Scott Hansen > > > > efiring wrote: > > > > On 03/02/2011 06:42 AM, Mr. Python wrote: > >> > >> I am unable to set the color of the scatter plot points using the code > >> below: > >> > >> import matplotlib > >> matplotlib.use('Qt4Agg') > >> > >> import matplotlib.pyplot as plt > >> import numpy as np > >> > >> plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+') > > > > This is a bug in the handling of symstyle 2, which includes '+' and 'x'. > > > >> > >> #Add the graph title and x/y axis labels > >> plt.title("Gear Span") > >> plt.xlabel("Vehicle Speed (mph)") > >> plt.ylabel("Engine Load %") > >> plt.show() > >> > >> No matter what I change the c parameter to ('b','r', etc.), the color of > >> the > >> scatter plot points are always black. The lists newSpdVals and > >> newEngLoadVals have 100 dimmensions and are of type numpy.ndarray. > >> > >> I am using the following software and hardware: > >> > >> Windows XP > >> Python 2.7 > >> PyQt4 (I launch the plot from a PyQt GUI. I don't embed the plot in the > >> GUI). > >> matplotlib 1.01 > >> > >> In the beginning of the same function where my scatter plot code is, I > >> added > >> the following code to verify if the problem is due to the matplotlib/PyQt > >> interface: > >> > >> a = np.linspace(-10,100,33) > >> b = np.linspace(-32,400,33) > >> plt.scatter(a, b,color='g',marker='+') > > > > Note the difference: here you are using a 'color' kwarg that is getting > > passed directly to the AsteriskPolygonCollection, whereas before you > > were using the 'c' kwarg that is being handled incorrectly in this case > > inside of the scatter code. > > > > Eric > > > >> plt.title("Gear Span") > >> plt.xlabel("Vehicle Speed (mph)") > >> plt.ylabel("Engine Load %") > >> plt.show() > >> > >> The points for this plot are colored green. I'm able to change the point > >> color to blue, red, etc. > >> > >> Any ideas why I can't change the point color of my first graph? Thank > >> you > >> for your help. > >> > >> > > > > > > ------------------------------------------------------------------------------ > > What You Don't Know About Data Connectivity CAN Hurt You > > This paper provides an overview of data connectivity, details > > its effect on application quality, and explores various alternative > > solutions. http://p.sf.net/sfu/progress-d2d > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > -- > View this message in context: http://old.nabble.com/Can%27t-set-scatter-plot-point-color-tp31051071p31070224.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Wed, Mar 2, 2011 at 8:46 AM, Yuri D'Elia <wa...@th...> wrote: > > > > On Wed, 2 Mar 2011 22:01:02 +0900 > Jae-Joon Lee <lee...@gm...> wrote: > > > >> > Is this a bug? > > >> > > >> Unfortunately, bbox_inches option is never meant to be complete in > > >> figuring out the exact size of the figure area. > > > > > > Why not? What's the purpose of bbox_inches='tight' otherwise? > > > > Figuring out enclosing bbox when arbitrary spline paths are involved > > is difficult (I think there is no exact solution). So I only intended > > to support common cases. > > Ok, I can understand that, but shouldn't all artists used to construct the > picture, as suptitle, be considered? > > > >> However, you can use "bbox_extra_artists" keyword argument to specify > > >> additional artists that should be considered when dertermining the > > >> plot size. > > >> > > >> mytitle = fig.suptitle("Horray!", fontsize=20) > > >> > > >> ... > > >> > > >> fig.savefig("out.png", bbox_inches='tight', > bbox_extra_artists=[mytitle]) > > > > > > That doesn't work for me either. > > > > Can you be more specific? Does it throw an exception? Or the code runs > > without any error but the output is still wrong? > > No error/exception are produced. The output is simply identical to the one > without bbox_extra_artists. > > This also works in my previous example: > > import matplotlib as mpl > import matplotlib.figure > import matplotlib.backends.backend_agg > > fig = mpl.figure.Figure() > cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig) > fig.set_size_inches((20,20)) > plot = fig.add_subplot(111) > plot.set_title("Subtitle") > plot.plot([1,2,3], [3,2,1]) > st = fig.suptitle("Horray!", fontsize=20) > fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[st]) > > Which version of matplotlib are you using? This example works for me using the latest matplotlib from source. Also, why the awkward usage and imports? If you want to force the Agg backend to be used, you could just do: import matplotlib matplotlib.use("Agg") before any other matplotlib imports. Ben Root
On Thu, Mar 3, 2011 at 9:54 PM, George Washington <gw...@ho...>wrote: > I am new to Matplotlib and am having some problems plotting the following > set of coordinates (in python 2.6 and Win 7 32) > This is just a small sample of the data: > > Seq.No. x-scale y-scale z-scale > 01.000000 1579446.055280 5361974.495490 1342.967407 > 02.000000 1579446.646620 5361972.813700 1342.967407 > 03.000000 1579448.047050 5361968.830880 1341.237305 > 04.000000 1579450.992084 5361963.830880 1337.739502 > 05.000000 1579453.937117 5361958.830880 1336.262817 > ... > ... > > with the following outcome: > (plot3d.png) > > *Problem*: while the x-scale is ok and the z-scale looks ok, the y-scale > is definitely not ok. The numbers in the image are *not* the ones in the > y-array (I double checked.) > George, This is a known issue where very large axis values were being represented using an "offset" (much like in 2-d plots with very large axis values). The problem was that the offset was not displayed for 3d plots. This is definitely fixed in the latest development branch, but I can't remember if I fixed it in the 1.0.1 release (probably not). > > I also have a number of questons: > *Question1*: how does one create a label for the z scale? (zlabel is not > valid) > This should be fixed by the next release. Most functions like set_xlim(), set_ylabel() and such merely call that function for the appropriate axis object. If a particular function is missing, you can call it yourself doing something like the following: ax.zaxis.set_label() Note that if you have an earlier version of matplotlib, you might have to do: ax.w_zaxis.set_label() > *Queston2*: Is it possible to fill below the line (so it looks like a > mountain) and how > Never tried considered anything like that. Might involve creating a 3D patch object with some sort of path completion. File a feature request on the matplotlib tracker here: http://sourceforge.net/tracker2/?group_id=80706 > *Question3*: Is it possible to traverse sequentially all the points > plotted in the image so as to make computations (such as distance to the > next point, etc..). > The points themselves come from a text file but are not > in sequence. They are sequenced by being plotted in their right position in > 3D space. > > I am not exactly sure what you mean, but there is a nice data structure that I use to do efficient data operations on spatial data called KDTrees, which can be found in scipy: http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.html I hope that is helpful. Ben Root
Thank you for the reply. I discovered this myself yesterday. Now I have an official answer if people want a colored + or the x symbol in the scatter plot. Scott Hansen efiring wrote: > > On 03/02/2011 06:42 AM, Mr. Python wrote: >> >> I am unable to set the color of the scatter plot points using the code >> below: >> >> import matplotlib >> matplotlib.use('Qt4Agg') >> >> import matplotlib.pyplot as plt >> import numpy as np >> >> plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+') > > This is a bug in the handling of symstyle 2, which includes '+' and 'x'. > >> >> #Add the graph title and x/y axis labels >> plt.title("Gear Span") >> plt.xlabel("Vehicle Speed (mph)") >> plt.ylabel("Engine Load %") >> plt.show() >> >> No matter what I change the c parameter to ('b','r', etc.), the color of >> the >> scatter plot points are always black. The lists newSpdVals and >> newEngLoadVals have 100 dimmensions and are of type numpy.ndarray. >> >> I am using the following software and hardware: >> >> Windows XP >> Python 2.7 >> PyQt4 (I launch the plot from a PyQt GUI. I don't embed the plot in the >> GUI). >> matplotlib 1.01 >> >> In the beginning of the same function where my scatter plot code is, I >> added >> the following code to verify if the problem is due to the matplotlib/PyQt >> interface: >> >> a = np.linspace(-10,100,33) >> b = np.linspace(-32,400,33) >> plt.scatter(a, b,color='g',marker='+') > > Note the difference: here you are using a 'color' kwarg that is getting > passed directly to the AsteriskPolygonCollection, whereas before you > were using the 'c' kwarg that is being handled incorrectly in this case > inside of the scatter code. > > Eric > >> plt.title("Gear Span") >> plt.xlabel("Vehicle Speed (mph)") >> plt.ylabel("Engine Load %") >> plt.show() >> >> The points for this plot are colored green. I'm able to change the point >> color to blue, red, etc. >> >> Any ideas why I can't change the point color of my first graph? Thank >> you >> for your help. >> >> > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Can%27t-set-scatter-plot-point-color-tp31051071p31070224.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On 03/02/2011 06:42 AM, Mr. Python wrote: > > I am unable to set the color of the scatter plot points using the code below: > > import matplotlib > matplotlib.use('Qt4Agg') > > import matplotlib.pyplot as plt > import numpy as np > > plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+') This is a bug in the handling of symstyle 2, which includes '+' and 'x'. > > #Add the graph title and x/y axis labels > plt.title("Gear Span") > plt.xlabel("Vehicle Speed (mph)") > plt.ylabel("Engine Load %") > plt.show() > > No matter what I change the c parameter to ('b','r', etc.), the color of the > scatter plot points are always black. The lists newSpdVals and > newEngLoadVals have 100 dimmensions and are of type numpy.ndarray. > > I am using the following software and hardware: > > Windows XP > Python 2.7 > PyQt4 (I launch the plot from a PyQt GUI. I don't embed the plot in the > GUI). > matplotlib 1.01 > > In the beginning of the same function where my scatter plot code is, I added > the following code to verify if the problem is due to the matplotlib/PyQt > interface: > > a = np.linspace(-10,100,33) > b = np.linspace(-32,400,33) > plt.scatter(a, b,color='g',marker='+') Note the difference: here you are using a 'color' kwarg that is getting passed directly to the AsteriskPolygonCollection, whereas before you were using the 'c' kwarg that is being handled incorrectly in this case inside of the scatter code. Eric > plt.title("Gear Span") > plt.xlabel("Vehicle Speed (mph)") > plt.ylabel("Engine Load %") > plt.show() > > The points for this plot are colored green. I'm able to change the point > color to blue, red, etc. > > Any ideas why I can't change the point color of my first graph? Thank you > for your help. > >
On 03/01/2011 10:22 PM, Jason Grout wrote: > I tried building the standalone html docs using: > > cd doc > python make.py html > > I notice that there are around 30 .pyc files left in the > build/html/pyplots/ directory. Are these needed in the html > documentation build directory? > No -- but they are also a little hard to avoid. I have made a change to clean these out after the fact. > Also, it seems that the files in _images are redundant, as they are > referenced in their original directory, not _images. > > from the build/html directory: > > % find . -name multiline.pdf > ./_images/multiline.pdf > ./plot_directive/mpl_examples/pylab_examples/multiline.pdf > % grep -ri "multiline.pdf" * > examples/pylab_examples/multiline.html:<p>[<a class="reference external" > href="../../plot_directive/mpl_examples/pylab_examples/multiline.py">source > code</a>,<a class="reference external" > href="../../plot_directive/mpl_examples/pylab_examples/multiline.hires.png">hires.png</a>, > <a class="reference external" > href="../../plot_directive/mpl_examples/pylab_examples/multiline.pdf">pdf</a>]</p> > This one is harder. Sphinx annoyingly always copies every image that is displayed on a page to the _images directory. However, it is impossible to link (i.e. through an <a href="...">) to an image in the _images directory. Since our plot directive results need to both display the image and link to different resolutions of them, we have to at least have two copies of the "normal resolution" pngs, unless we can solve the problem in Sphinx itself or do some sort of postprocessing on the HTML output. However, the .pdf files ending up in _images is the result of the peculiar way in which HTML and LaTeX are generated from the same source. Sphinx seems to think it is displaying both png and pdf images in the HTML and copies them both over. I have added a post-processing step to our build that subsequently removes the pdf files under _images. You can see the changes here: https://github.com/matplotlib/matplotlib/pull/28 Mike > Any comments about trimming down the size of the build/html directory? > > Thanks, > > Jason > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search& Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA
I am unable to set the color of the scatter plot points using the code below: import matplotlib matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt import numpy as np plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+') #Add the graph title and x/y axis labels plt.title("Gear Span") plt.xlabel("Vehicle Speed (mph)") plt.ylabel("Engine Load %") plt.show() No matter what I change the c parameter to ('b','r', etc.), the color of the scatter plot points are always black. The lists newSpdVals and newEngLoadVals have 100 dimmensions and are of type numpy.ndarray. I am using the following software and hardware: Windows XP Python 2.7 PyQt4 (I launch the plot from a PyQt GUI. I don't embed the plot in the GUI). matplotlib 1.01 In the beginning of the same function where my scatter plot code is, I added the following code to verify if the problem is due to the matplotlib/PyQt interface: a = np.linspace(-10,100,33) b = np.linspace(-32,400,33) plt.scatter(a, b,color='g',marker='+') plt.title("Gear Span") plt.xlabel("Vehicle Speed (mph)") plt.ylabel("Engine Load %") plt.show() The points for this plot are colored green. I'm able to change the point color to blue, red, etc. Any ideas why I can't change the point color of my first graph? Thank you for your help. -- View this message in context: http://old.nabble.com/Can%27t-set-scatter-plot-point-color-tp31051071p31051071.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Zhaoru Zhang <zha...@gm...> writes: > I created an eps figure file with matplotlib. I can look at it via mac > preview, but when I inserted it into a word document and printed it > out, I got nothing except for the eps file information. It's a long time since I tried using eps files in Word, but I think it used to only work if you print to a PostScript printer. Does pdf work better? -- Jouni K. Seppänen http://www.iki.fi/jks