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: 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 |
|
From: Tony S Yu <ts...@gm...> - 2010-10-26 04:07:24
|
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")) |