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
(12) |
2
(13) |
|
3
(4) |
4
(34) |
5
(14) |
6
(23) |
7
(26) |
8
(12) |
9
(7) |
|
10
(7) |
11
(9) |
12
(12) |
13
(20) |
14
(14) |
15
(13) |
16
(5) |
|
17
(4) |
18
(22) |
19
(29) |
20
(13) |
21
(9) |
22
(22) |
23
(3) |
|
24
(3) |
25
(29) |
26
(9) |
27
(10) |
28
(16) |
29
(16) |
30
(16) |
|
31
(9) |
|
|
|
|
|
|
|
From: K.-Michael A. <kmi...@gm...> - 2010-10-28 16:02:28
|
I once had bus errors when i mixed gdal with Enthought, because gdal brought it's own numpy version, that didn't match Enthoughts. In a pure pure Enthought environment where really nothing else is installed, this should not happen, I think. BR, Michael On 2010-10-28 05:06:46 +0200, Lou Wicker said: > Gideon Simpson <simpson@...> writes: > >> >> I'm using the prebuilt OS X dmg distribution of matplotlib with >> the mac python 2.6.4 installation on os x >> 10.6.3. I find that if I try to use savefig to pdf format, my >> program terminates with a bus error. There is no >> such error if I save to eps format. >> >> -gideon >> >> ----------------------------------------------------------------------- > ------- >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> > > > Gideon: did you ever figure this out? I have been using the EPD > python, and I get the same problem. Several incantations of EPD > do this, on both my macbook pro and mac pro. > > Thanks. > > Lou Wicker > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Friedrich R. <fri...@gm...> - 2010-10-28 11:43:21
|
SORRY DON'T USE IT FOR NOW There was some mistake even in the freetype instructions. I was tooo quick. I will post once I've tested everything. cu Friedrich 2010/10/27 Friedrich Romstedt <fri...@gm...>: > Maybe you can make use of this, it's not complete but I'll work on it tomorrow. > > ESPECIALLY for the libpng there is a trick to make fat libpng. > > http://vincentdavis.info/Shared/Docs/matplotlib-installation/build/html/Macosx10.6.html > > Maybe you can complete the sections which are in. > > Friedrich > |
|
From: Pau <vim...@go...> - 2010-10-28 06:17:27
|
Hello, I didn't mean it bad for the people at macports. I know you are working very hard and you have all of my respect, honestly. I was confusing, sorry. My personal problem is that somebody convinced me about the it's-so-easy-ness of apple's products and I thought I would give it a shot. This was for me a nightmare because I felt like tight up when using that mac book pro. It was not only that I found it difficult to install matplotlib, but many other things were hard and difficult to understand... if you want to go *your* way and not apple's way. For instance encryption... take this as an example http://www.aei.mpg.de/~pau/Encrypt_Users.html In any case, again, yo have all of my respect and I thank you for helping me out when I had the macbook pro with your effort by porting all of that software. Pau 2010/10/28 Benjamin Root <ben...@ou...>: > On Wed, Oct 27, 2010 at 4:19 PM, Pau <vim...@go...> wrote: >> >> Sorry for being negative, but it's reassuring that I took the right >> decision when I gave back my macbook pro to IT and asked for a >> thinkpad instead and I installed UNIX on it. You know what I did to >> install matplotlib on my OpenBSD laptop? >> >> pkg_add py-matplotlib >> >> And after 1 minute it was up and running... >> >> sorry! >> > > Just to keep in mind, there is a lot of work that goes into getting packages > working for any particular distribution (which then presents to you as a > seamless operation). Along with Friedrich for his efforts in improving > packaging for MacOS, be sure to thank your local distro maintainers for > their tireless efforts to making the *nix environments one of the best to > develop in. > > Ben Root > > |
|
From: Lou W. <Lou...@no...> - 2010-10-28 03:15:19
|
Gideon Simpson <simpson@...> writes: > > I'm using the prebuilt OS X dmg distribution of matplotlib with > the mac python 2.6.4 installation on os x > 10.6.3. I find that if I try to use savefig to pdf format, my > program terminates with a bus error. There is no > such error if I save to eps format. > > -gideon > > ----------------------------------------------------------------------- ------- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > Gideon: did you ever figure this out? I have been using the EPD python, and I get the same problem. Several incantations of EPD do this, on both my macbook pro and mac pro. Thanks. Lou Wicker |
|
From: Benjamin R. <ben...@ou...> - 2010-10-28 02:31:33
|
On Wed, Oct 27, 2010 at 4:19 PM, Pau <vim...@go...> wrote: > Sorry for being negative, but it's reassuring that I took the right > decision when I gave back my macbook pro to IT and asked for a > thinkpad instead and I installed UNIX on it. You know what I did to > install matplotlib on my OpenBSD laptop? > > pkg_add py-matplotlib > > And after 1 minute it was up and running... > > sorry! > > Just to keep in mind, there is a lot of work that goes into getting packages working for any particular distribution (which then presents to you as a seamless operation). Along with Friedrich for his efforts in improving packaging for MacOS, be sure to thank your local distro maintainers for their tireless efforts to making the *nix environments one of the best to develop in. Ben Root |
|
From: Ryan M. <rm...@gm...> - 2010-10-28 01:57:15
|
On Wed, Oct 27, 2010 at 5:31 PM, Alan G Isaac <ai...@am...> wrote: > Here is another example of unwanted text clipping > in the gallery: > http://matplotlib.sourceforge.net/examples/api/two_scales.html#api-two-scales > (Both y axis labels are clipped.) > > I also think the example would be more complete if it > 1. set a 270 degree rotation on the second ylabel, and > 2. showed how to make a single legend for the two lines > > Btw, how *does* one best do 2? For this example, saving the line objects will do. Then you just call legend with the objects. The new example looks thusly: import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111) t = np.arange(0.01, 10.0, 0.01) s1 = np.exp(t) line1 = ax1.plot(t, s1, 'b-') ax1.set_xlabel('time (s)') # Make the y-axis label and tick labels match the line color. ax1.set_ylabel('exp', color='b') for tl in ax1.get_yticklabels(): tl.set_color('b') ax2 = ax1.twinx() s2 = np.sin(2*np.pi*t) line2 = ax2.plot(t, s2, 'r.') # Rotate ylabel 180 from normal y-axis label orientation ax2.set_ylabel('sin', color='r', rotation=270.) for tl in ax2.get_yticklabels(): tl.set_color('r') ax2.legend((line1, line2), ('exp(t)', '$sin(2 \pi t)$')) plt.show() Thanks for the suggestions. Any idea how the clipped figure problem was solved in the past? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Paul I. <piv...@gm...> - 2010-10-28 00:21:37
|
Alan G Isaac, on 2010-10-27 18:31, wrote: > Here is another example of unwanted text clipping > in the gallery: > http://matplotlib.sourceforge.net/examples/api/two_scales.html#api-two-scales > (Both y axis labels are clipped.) > > I also think the example would be more complete if it > 1. set a 270 degree rotation on the second ylabel, and > 2. showed how to make a single legend for the two lines > > Btw, how *does* one best do 2? I don't know if it's best, but legend can take a list of objects and labels, so you can just grab all of the objects from the twin, and put them all in one legend: def onelegend_twinaxes(axis,twin): #make a joint axis legend lines = twin.get_lines() lines.extend(axis.get_lines()) labels = [l.get_label() for l in lines] return axis.legend(lines, labels) Here's a picture of what that looks like (thought I did some other prettifications). <http://pirsquared.org/images/twinaxes_onelegend.png> I wrote this in a solution set for a class I'm TAing this semester, so you can look at the whole thing here, if you'd like. the file is part of the solutions for Lab #1, it's called lab1.py (but actually links to lab1.txt): <http://redwood.berkeley.edu/wiki/VS265:_Homework_assignments> -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |
|
From: Alan G I. <ai...@am...> - 2010-10-27 22:31:45
|
Here is another example of unwanted text clipping in the gallery: http://matplotlib.sourceforge.net/examples/api/two_scales.html#api-two-scales (Both y axis labels are clipped.) I also think the example would be more complete if it 1. set a 270 degree rotation on the second ylabel, and 2. showed how to make a single legend for the two lines Btw, how *does* one best do 2? Cheers, Alan Isaac |
|
From: Pau <vim...@go...> - 2010-10-27 21:20:07
|
Sorry for being negative, but it's reassuring that I took the right decision when I gave back my macbook pro to IT and asked for a thinkpad instead and I installed UNIX on it. You know what I did to install matplotlib on my OpenBSD laptop? pkg_add py-matplotlib And after 1 minute it was up and running... sorry! 2010/10/27 Friedrich Romstedt <fri...@gm...>: > Maybe you can make use of this, it's not complete but I'll work on it tomorrow. > > ESPECIALLY for the libpng there is a trick to make fat libpng. > > http://vincentdavis.info/Shared/Docs/matplotlib-installation/build/html/Macosx10.6.html > > Maybe you can complete the sections which are in. > > Friedrich > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Friedrich R. <fri...@gm...> - 2010-10-27 17:39:49
|
Maybe you can make use of this, it's not complete but I'll work on it tomorrow. ESPECIALLY for the libpng there is a trick to make fat libpng. http://vincentdavis.info/Shared/Docs/matplotlib-installation/build/html/Macosx10.6.html Maybe you can complete the sections which are in. Friedrich |
|
From: izzybitsie <is...@ju...> - 2010-10-27 16:13:46
|
Hi, Finding the (x,y) to properly position a label on the lower right hand corner of all the maps I created using basemap is the challenge. All these maps were created using basemap() for different projections and covering different areas of the world. pyplot.text(x,y,...,bbox()) is the command I'd like to use to add the label to the maps. Computing the x,y is what I have not been able to accomplish. How can I get either the lat/lon or the X,Y position to add the label on the lower right hand corner of the maps? Lower left and upper right corners as well as center point latitudes/longitudes, and projection are all known but I cannot find a function or trick to get the lower right hand corner position for my label. Thanks -- View this message in context: http://old.nabble.com/pyplot-position-text%28%29-lower-right-corner-of-map-tp30068770p30068770.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Bram S. <sa...@kn...> - 2010-10-27 16:08:35
|
Hi, I want to create graphs, fully specify their properties and only then combine them in a single figure. The figure instance holding these graphs is made after creating the graphs: I want to decide afterwards what selection of graphs (subplots) to combine in my final figure. I have plotting functions for creating graphs. What should they return? An axes instance, figure instance ....? How to combine them in a single figure? I've tried adding an axes instance to a figure using fig.set_axes() Bram |
|
From: Matthieu H. <mat...@wa...> - 2010-10-27 14:05:37
|
Greetings, Is there any documentation available on how to write and use AGG filters in matplotlib ? The only information I could gather comes from the rather obscure example in http://matplotlib.sourceforge.net/examples/pylab_examples/demo_agg_filter.html. This is a very powerful feature and I ended up adapting one of these demo filters to achieve what I wanted (a glossy effect on pie charts), but it took me quite a lot time to figure out what was going on through trial and error, and I can't shake away the feeling that I am not really sure of what I actually did. Anyone knows of a comprehensive doc or tutorial on that subject ? Regards, Matthieu Huin |
|
From: Markus P. <mar...@gm...> - 2010-10-27 05:15:08
|
Hi, list. Whenever I use matplotlib, I see the following set of warnings: /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0. Returning /usr/share/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf UserWarning) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) They don't seem to affect my output, but I looked into it anyway. It turns out that the texcm-ttf package installed by most distributions only includes a handful of fonts (cmex10.ttf, cmmi10.ttf, cmr10ttf, cmsy10.ttf). I was able to get rid of the warnings by manually installing the missing fonts from http://tug.ctan.org/tex-archive/fonts/cm/ps-type1/bakoma/ttf/ Should distributions be installing the rest of the TeX fonts like I did? Is there another way to avoid these warnings? Thanks. Markus |
|
From: Jae-Joon L. <lee...@gm...> - 2010-10-27 01:12:25
|
One option is to use proxy artists. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist Regards, -JJ 2010/10/26 Marek Giebułtowski <mg...@gm...>: > Dear All, > I use hist in pylab.I have different sets of data in different colours > in one chart. In legend all rectangulars are unfortunately blue. > In plot() it is ok but not in hist(). > How to receive correct colours in histogram legend? > > x is nested list x[1][2][3] is an ordinary list. > for p in range(2,3): > for c in range(0,4): > hist(x[c][p][7],range=(0,2000),bins=20) > title('Axis dist[m];nr '+str(p)+nams(x[3][p][7])) > legend(['LHXGHX','>1','>3','>5']) > figure() > Best Regards > Marek Giebułtowski > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jae-Joon L. <lee...@gm...> - 2010-10-27 01:09:04
|
Try this.
def get_indx(irow, icol):
return irow*4+icol
ax = plt.subplot(gs[get_indx(0,3):get_indx(3,3)])
With 1d slicing, the axes will occupy the rectangle defined by the
start and stop location.
For example,
gs[i:j]
will occupy the rectangular area between
gs[i] and gs[j-1].
Let me know if this does not work (this is only tested w/ the svn
version and may not work with v1.0).
Regards,
-JJ
On Tue, Oct 26, 2010 at 12:30 AM, Nikolaus Rath <Nik...@ra...> wrote:
> On 10/25/2010 11:18 AM, Jae-Joon Lee wrote:
>> On Mon, Oct 25, 2010 at 10:45 PM, Nikolaus Rath <Nik...@ra...> wrote:
>>> So I have to instantiate GridSpec with a (rows, column), but when I
>>> index the grid I have to use (column, row).
>>>
>>> Is there any reason for this counterintuitive behaviour?
>>>
>>
>> This is not an intended behavior but a bug which affects a grid of
>> non-square shape.
>> This has been fixed in the svn version.
>>
>> Meanwhile, you may use 1-d indexing. e.g.,
>>
>> import matplotlib.pyplot as plt
>> from matplotlib.gridspec import GridSpec
>>
>> gs = GridSpec(3, 4)
>>
>> for irow in range(3):
>> for icol in range(4):
>> ax = plt.subplot(gs[irow*4+icol])
>
> I see, thanks. Is there also a way to use this workaround for slices? I
> want a subplot in column 4 that spans all rows...
>
>
> Best,
>
> -Nikolaus
>
> --
> »Time flies like an arrow, fruit flies like a Banana.«
>
> PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2010-10-27 00:57:35
|
the "bbox_inches" option does not work well for your case since the
axes frame (although not visible) occupy much larger area than your
plot elements. Make axis limits more tighter, then try to use
bbox_inches option (with this, you don't need to fiddle with subplot
params).
Here is my try.
ax.set_xlim(-ini, ini)
ax.set_ylim(-ini, ini+1)
ax.set_xticks([]) # this is needed for bbox_inches
ax.set_yticks([])
savefig("first-plot.pdf", bbox_inches="tight")
Regards,
-JJ
On Tue, Oct 26, 2010 at 7:26 PM, Lorenzo Isella
<lor...@gm...> wrote:
> Thanks.
> This indeed improves the situation (and your suggestions about a for
> loop is appreciated).
> I am surprised at the fact that I have been able to generate such a plot
> via scripting only (well, with a lot of help from the list) by browsing
> the online examples and with my limited knowledge of matplotlib.
> Keep up the good work.
> Cheers
>
> Lorenzo
>
> On 10/26/2010 06:07 AM, Tony S Yu wrote:
>>
>> On Oct 25, 2010, at 12:56 PM, Lorenzo Isella wrote:
>>
>>> Dear All,
>>> I am aware that this question has already been asked several times on
>>> the mailing list, see e.g.
>>>
>>> http://bit.ly/aPzQTA
>>>
>>> However, in the following snippet, nothing I tried has been able to
>>> reduce the amount of white space around the figure (including toying
>>> around with
>>>
>>> ax = plt.axes([0.0, 0.0, 1.0, 1.0])
>>> )
>>> Of course, one can always resort to pdfcrop, but I believe there must be
>>> a better solution to resize the margins from matplotlib.
>>> Please see the snippet at the end of the email.
>>> Every suggestion is welcome.
>>> Cheers
>>>
>>> Lorenzo
>>
>> [cut out code snippet]
>>
>> You can always use subplots_adjust. I haven't looked into the details of your code, but it appears as though the actual plot (the actual graphics) is well within the margins of your subplot (extending the boundaries of the subplot would still leave a lot of white space). To counteract this you can use negative padding (and padding greater than 1); e.g.
>>
>> subplots_adjust(top=1, bottom=-0.2, left=-0.3, right=1.3)
>>
>> (you can add this right before "savefig".) This means that the actual boundaries of the subplot extend outside the figure (which normally have extents from 0 to 1). The above gives pretty good results. To get any better, I think you need to adjust the aspect ratio of the figure to match the plot (you can do this by creating a "figure" and passing a value for "figsize").
>>
>> -Tony
>>
>> P.S. since you posted code, I'll offer an unsolicited suggestion. :) You can replace all your annotate commands (except for the last 2) with two short loops:
>>
>> for y in np.arange(-1.4, 1.5, 0.2):
>> annotate("", xy=(-pi/2., y), xytext=(-ini, y), arrowprops=dict(fc="g"))
>> for y in np.arange(-1.4, 1.5, 0.2):
>> annotate("", xy=(pi/2., y), xytext=(ini, y), arrowprops=dict(fc="g"))
>>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: John [H2O] <was...@gm...> - 2010-10-26 21:26:34
|
Bringing up an old thread, but just curious if this can be done with the plot command as well, as in: plt.plot(X,Y[1:3,:].T,c=['blue','red']) Thanks, john sordnay wrote: > > > John Hunter-4 wrote: >> >> On Fri, Jun 20, 2008 at 6:14 PM, sordnay <so...@gm...> wrote: >>> >>> Hi all, >>> I'm trying to plot in 2D, 3 variables from time series, instead of >>> volume I >>> want color for the third variable. >>> I have partial success with a scatter plot, but I'm unable to manage the >>> colorbar so it represents z values, >>> I needed to sort the variables and it's getting a bit ugly, so I though >>> I >>> might be missing some other function ? >>> this is what I used: >>> pylab.figure() >>> x=self.stData.[items[0]] >>> y=self.stData.[items[1]] >>> z=self.stData.[items[2]] >>> points=zip(x,y) >>> points3=sorted(zip(z,points)) >>> for i,p in enumerate(points3): >>> z[i]=p[0] >>> x[i]=p[1][0] >>> y[i]=p[1][1] >>> #colors=pylab.linspace(z.min(),z.max(),len(z)) did not work >>> colors=pylab.linspace(0,1,len(z)) >>> pylab.scatter(x,y,c=colors,faceted=False) >> >> Just pass c=z to scatter if z are the values you want to colormap. >> >> JDH >> >> ------------------------------------------------------------------------- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > yes it was lot easier, but i had to set the vmin and vmax kwargs or it > wouldn't work: > sigbrowse=figure() > x=self.stData.Data[items[0]] > y=self.stData.Data[items[1]] > z=self.stData.Data[items[2]] > scatter(x,y,c=z,faceted=False,vmin=z.min(),vmax=z.max()) > colorbar() > show() > > -- View this message in context: http://old.nabble.com/color-xy-plot-tp18047665p30061906.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2010-10-26 18:28:23
|
On 10/26/2010 04:50 AM, Maarten Sneep wrote: > Hi, > > I did solve my own question. For posterity, and perhaps for a more > elegant solution, I post my solution here. > > On Tue, 2010-10-26 at 10:56 +0200, Maarten Sneep wrote: > >> I have an image with cloud pressures, 1000 at the surface, 200 at the >> top of the atmosphere. I'd like to reverse the axis, i.e. 1000 at the >> bottom of the scale, 200 at the top. How should I approach this? > > Instead of using a figure.colorbar() call, I instantiate ColorbarBase > directly. I needed an axes object anyway to use a single colorbar fro a > two-subplot figure. The ColorbarBase gets the reversed colormap compared > to the image. > > fig = plt.figure() > norm=Normalize(vmin=200.0, vmax=1000.0, clip=False) > cmap = cm.jet > cmap.set_bad(color=(0.75,0.75, 0.75)) > cmap.set_over(color=(1.0, 1.0, 1.0)) > cmap.set_under(color=(0.5, 0.5, 0.5)) > cmap_bar = cm.jet_r > # note that under and over are reversed. > cmap_bar.set_bad(color=(0.75,0.75, 0.75)) > cmap_bar.set_under(color=(1.0, 1.0, 1.0)) > cmap_bar.set_over(color=(0.5, 0.5, 0.5)) > > # make subplots > ax1 = fig.add_subplot(211) > ax1.imshow(cp1, origin='lower', cmap=cmap, > interpolation='nearest', aspect='auto', norm=norm) > ax2 = fig.add_subplot(212) > ax2.imshow(cp2, origin='lower', cmap=cmap, > interpolation='nearest', aspect='auto', norm=norm) > > # make room for colorbar > plt.subplots_adjust(left=0.07, hspace=0.25, right=0.825) > cbar_ax = plt.axes([0.875, 0.1, 0.025, 0.8]) > tickvals = [200, 400, 600, 800, 1000] > cbar = ColorbarBase(cbar_ax, cmap=cmap_bar, > ticks=tickvals, extend='both', norm=norm) > # I use latex formatting, original is more interesting. > labels = ['%d' % v for v in tickvals] > cbar.ax.set_yticklabels(lblslabels[::-1]) > > Dirty: yes, and it only works because of the equidistant labels. A more > elegant solution is appreciated. Illustrated using ipython -pylab: z = rand(10, 12) im = imshow(z) cbar = colorbar(im, extend='both') cbar.ax.invert_yaxis() # This is the key method. draw() > >> Related: I have set colors for under- and over-values. I'd like to >> display a small patch of these colors at either end of the scale. The >> bad values are clear enough. > > extend='both' keyword to the ColorbarBase() call, or the colorbar() > call. That is indeed the right way to do it. Eric > > Maarten > |
|
From: Benjamin R. <ben...@ou...> - 2010-10-26 15:05:30
|
On Tue, Oct 26, 2010 at 12:45 AM, Drew Frank <dre...@gm...> wrote: > I believe I've found a problem with the following cookbook example: > http://www.scipy.org/Cookbook/Matplotlib/Animations?action=show#head-3d51654b8306b1585664e7fe060a60fc76e5aa08. Specifically, the example calls canvas.copy_from_bbox() before the > initial draw(). This doesn't throw an error, but will result in unexpected > behavior (I spent an embarrassing amount of time debugging the resulting > confusion in my own code). > > The solution I came up with to fix the issue is to structure the code as > follows: > > ...set up plot... > background = None > > def animate(*args): > global background > if background is None: > background = canvas.copy_from_bbox(ax.bbox) > canvas.restore_region(background) > ...rest of animation... > > gobject.idle_add(animate) > p.show() > > This works, but I dislike it for two reasons: I have to use a global > variable, and there is an extra conditional test in every call to the > animation function. Obviously neither flaw is terribly serious, but I was > wondering if there is a better / accepted way of handling this. Or, am I > just completely off-base on this whole issue -- I'm new to matplotlib, still > figuring things out. > > Thanks, > Drew Frank > > Drew, What sort of unexpected behaviors occurred from calling .copy_from_background() before the initial draw and which backend were you using? Also, if you are feeling adventurous, there is a very nice Animation module in the development branch of matplotlib that you might find handy. We are working on eliminating some of the older methods of doing animations and replacing them with a much cleaner interface. If you try it out, we greatly welcome any feedback on what you find useful/not useful about it. Ben Root |
|
From: Maarten S. <maa...@kn...> - 2010-10-26 14:50:09
|
Hi,
I did solve my own question. For posterity, and perhaps for a more
elegant solution, I post my solution here.
On Tue, 2010-10-26 at 10:56 +0200, Maarten Sneep wrote:
> I have an image with cloud pressures, 1000 at the surface, 200 at the
> top of the atmosphere. I'd like to reverse the axis, i.e. 1000 at the
> bottom of the scale, 200 at the top. How should I approach this?
Instead of using a figure.colorbar() call, I instantiate ColorbarBase
directly. I needed an axes object anyway to use a single colorbar fro a
two-subplot figure. The ColorbarBase gets the reversed colormap compared
to the image.
fig = plt.figure()
norm=Normalize(vmin=200.0, vmax=1000.0, clip=False)
cmap = cm.jet
cmap.set_bad(color=(0.75,0.75, 0.75))
cmap.set_over(color=(1.0, 1.0, 1.0))
cmap.set_under(color=(0.5, 0.5, 0.5))
cmap_bar = cm.jet_r
# note that under and over are reversed.
cmap_bar.set_bad(color=(0.75,0.75, 0.75))
cmap_bar.set_under(color=(1.0, 1.0, 1.0))
cmap_bar.set_over(color=(0.5, 0.5, 0.5))
# make subplots
ax1 = fig.add_subplot(211)
ax1.imshow(cp1, origin='lower', cmap=cmap,
interpolation='nearest', aspect='auto', norm=norm)
ax2 = fig.add_subplot(212)
ax2.imshow(cp2, origin='lower', cmap=cmap,
interpolation='nearest', aspect='auto', norm=norm)
# make room for colorbar
plt.subplots_adjust(left=0.07, hspace=0.25, right=0.825)
cbar_ax = plt.axes([0.875, 0.1, 0.025, 0.8])
tickvals = [200, 400, 600, 800, 1000]
cbar = ColorbarBase(cbar_ax, cmap=cmap_bar,
ticks=tickvals, extend='both', norm=norm)
# I use latex formatting, original is more interesting.
labels = ['%d' % v for v in tickvals]
cbar.ax.set_yticklabels(lblslabels[::-1])
Dirty: yes, and it only works because of the equidistant labels. A more
elegant solution is appreciated.
> Related: I have set colors for under- and over-values. I'd like to
> display a small patch of these colors at either end of the scale. The
> bad values are clear enough.
extend='both' keyword to the ColorbarBase() call, or the colorbar()
call.
Maarten
|
|
From: Lorenzo I. <lor...@gm...> - 2010-10-26 10:26:14
|
Thanks. This indeed improves the situation (and your suggestions about a for loop is appreciated). I am surprised at the fact that I have been able to generate such a plot via scripting only (well, with a lot of help from the list) by browsing the online examples and with my limited knowledge of matplotlib. Keep up the good work. Cheers Lorenzo On 10/26/2010 06:07 AM, Tony S Yu wrote: > > On Oct 25, 2010, at 12:56 PM, Lorenzo Isella wrote: > >> Dear All, >> I am aware that this question has already been asked several times on >> the mailing list, see e.g. >> >> http://bit.ly/aPzQTA >> >> However, in the following snippet, nothing I tried has been able to >> reduce the amount of white space around the figure (including toying >> around with >> >> ax = plt.axes([0.0, 0.0, 1.0, 1.0]) >> ) >> Of course, one can always resort to pdfcrop, but I believe there must be >> a better solution to resize the margins from matplotlib. >> Please see the snippet at the end of the email. >> Every suggestion is welcome. >> Cheers >> >> Lorenzo > > [cut out code snippet] > > You can always use subplots_adjust. I haven't looked into the details of your code, but it appears as though the actual plot (the actual graphics) is well within the margins of your subplot (extending the boundaries of the subplot would still leave a lot of white space). To counteract this you can use negative padding (and padding greater than 1); e.g. > > subplots_adjust(top=1, bottom=-0.2, left=-0.3, right=1.3) > > (you can add this right before "savefig".) This means that the actual boundaries of the subplot extend outside the figure (which normally have extents from 0 to 1). The above gives pretty good results. To get any better, I think you need to adjust the aspect ratio of the figure to match the plot (you can do this by creating a "figure" and passing a value for "figsize"). > > -Tony > > P.S. since you posted code, I'll offer an unsolicited suggestion. :) You can replace all your annotate commands (except for the last 2) with two short loops: > > for y in np.arange(-1.4, 1.5, 0.2): > annotate("", xy=(-pi/2., y), xytext=(-ini, y), arrowprops=dict(fc="g")) > for y in np.arange(-1.4, 1.5, 0.2): > annotate("", xy=(pi/2., y), xytext=(ini, y), arrowprops=dict(fc="g")) > |
|
From: Maarten S. <maa...@kn...> - 2010-10-26 08:56:26
|
Hi, My searching for reverse in the documentation and gallery came up empty, so I'll try it here: I have an image with cloud pressures, 1000 at the surface, 200 at the top of the atmosphere. I'd like to reverse the axis, i.e. 1000 at the bottom of the scale, 200 at the top. How should I approach this? Related: I have set colors for under- and over-values. I'd like to display a small patch of these colors at either end of the scale. The bad values are clear enough. Best, Maarten -- KNMI, De Bilt T: 030 2206 747 E: Maa...@kn... Room B 2.42 |
|
From: Marek G. <mg...@gm...> - 2010-10-26 07:53:51
|
Dear All,
I use hist in pylab.I have different sets of data in different colours
in one chart. In legend all rectangulars are unfortunately blue.
In plot() it is ok but not in hist().
How to receive correct colours in histogram legend?
x is nested list x[1][2][3] is an ordinary list.
for p in range(2,3):
for c in range(0,4):
hist(x[c][p][7],range=(0,2000),bins=20)
title('Axis dist[m];nr '+str(p)+nams(x[3][p][7]))
legend(['LHXGHX','>1','>3','>5'])
figure()
Best Regards
Marek Giebułtowski
|
|
From: Drew F. <dre...@gm...> - 2010-10-26 05:46:13
|
I believe I've found a problem with the following cookbook example: http://www.scipy.org/Cookbook/Matplotlib/Animations?action=show#head-3d51654b8306b1585664e7fe060a60fc76e5aa08. Specifically, the example calls canvas.copy_from_bbox() before the initial draw(). This doesn't throw an error, but will result in unexpected behavior (I spent an embarrassing amount of time debugging the resulting confusion in my own code). The solution I came up with to fix the issue is to structure the code as follows: ...set up plot... background = None def animate(*args): global background if background is None: background = canvas.copy_from_bbox(ax.bbox) canvas.restore_region(background) ...rest of animation... gobject.idle_add(animate) p.show() This works, but I dislike it for two reasons: I have to use a global variable, and there is an extra conditional test in every call to the animation function. Obviously neither flaw is terribly serious, but I was wondering if there is a better / accepted way of handling this. Or, am I just completely off-base on this whole issue -- I'm new to matplotlib, still figuring things out. Thanks, Drew Frank |