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
|
|
From: Francesco M. <fra...@gm...> - 2012-11-13 16:10:20
|
2012/11/13 Benjamin Root <ben...@ou...> > > > On Tue, Nov 13, 2012 at 6:16 AM, Francesco Montesano < > fra...@gm...> wrote: > >> Dear matplolibers, >> >> when dealing with multi-axes plot sometimes would be nice to use >> figure-wide x and y labels. >> On the web I've found some suggestion on how to do this, but I found >> no solution valid in the general case and that integrate in the >> matplotlib ecosystem. >> The ideal would be to have a "set_xlabel" and "set_ylabel" method in the >> Figure class, with the same api of the corresponding Axes methods. >> >> As a proof of concept I've written a class derived from Figure , which >> implements the two methods simply adding a horizontal (vertical) text below >> (left of) the lowest (leftmost) axes. >> The class together with a short example is attached. >> I'm aware that the current implementation is really poor (no integration >> with tight_layout, the padding must be adjusted by hand, a problem in >> particular for the y label). >> >> The best is to use "self.xaxis.set_label_text(xlabel, fontdict, >> **kwargs)" as in the Axis set_xlabel (as I gather this create a label that >> is rendered in the correct position accounting for ticklabels, ticks, >> tight_layout, etc). To do this one would have to create: >> >> - a figure-wide invisible axes that encloses all the other >> axes/subplots, and whose dimension has to be updated every time a new >> axis/subplot is added (this should be easily done) with only the label >> visible. This could also allow to use axis features, like twin axis. >> - just the required axis (invisible) that hosts the labels. I think >> that this approach is less demanding computationally, but I don't know how >> much sense have two axis not attached to axes. >> >> Any suggestions/hints on how to implement these methods in a better way >> is very welcome. >> >> If there is no opposition, later in the day I'll submit PR on github with >> the two new method and see if we can get something out of this idea. >> >> Cheers, >> Francesco >> >> > I am not exactly sure if this is the same as what you are thinking, but > the axes objects have a "label_outer()" method that would turn on and off > the visibility of various axis components based on their location in a > subplot grid. You call it for each axes in a subplot grid. > > Cheers! > Ben Root > > Hi Ben, sorry that I'm not being clear. My scope is to have the a unique x and y label as in "figure_label.png" instead a x and y label for each outer axes as in "axes_label.png". This could be done not writing axes labels and then using a simple text on the left and bottom, but I think that set_[xy]label method in class Figure (as the method legend) is much neater. Besides can improve readability of plots with lots of panels showing the same quantities. Is it clearer now? Francesco |
|
From: Benjamin R. <ben...@ou...> - 2012-11-13 14:04:34
|
On Tue, Nov 13, 2012 at 6:16 AM, Francesco Montesano < fra...@gm...> wrote: > Dear matplolibers, > > when dealing with multi-axes plot sometimes would be nice to use > figure-wide x and y labels. > On the web I've found some suggestion on how to do this, but I found > no solution valid in the general case and that integrate in the > matplotlib ecosystem. > The ideal would be to have a "set_xlabel" and "set_ylabel" method in the > Figure class, with the same api of the corresponding Axes methods. > > As a proof of concept I've written a class derived from Figure , which > implements the two methods simply adding a horizontal (vertical) text below > (left of) the lowest (leftmost) axes. > The class together with a short example is attached. > I'm aware that the current implementation is really poor (no integration > with tight_layout, the padding must be adjusted by hand, a problem in > particular for the y label). > > The best is to use "self.xaxis.set_label_text(xlabel, fontdict, **kwargs)" > as in the Axis set_xlabel (as I gather this create a label that is rendered > in the correct position accounting for ticklabels, ticks, tight_layout, > etc). To do this one would have to create: > > - a figure-wide invisible axes that encloses all the other > axes/subplots, and whose dimension has to be updated every time a new > axis/subplot is added (this should be easily done) with only the label > visible. This could also allow to use axis features, like twin axis. > - just the required axis (invisible) that hosts the labels. I think > that this approach is less demanding computationally, but I don't know how > much sense have two axis not attached to axes. > > Any suggestions/hints on how to implement these methods in a better way is > very welcome. > > If there is no opposition, later in the day I'll submit PR on github with > the two new method and see if we can get something out of this idea. > > Cheers, > Francesco > > I am not exactly sure if this is the same as what you are thinking, but the axes objects have a "label_outer()" method that would turn on and off the visibility of various axis components based on their location in a subplot grid. You call it for each axes in a subplot grid. Cheers! Ben Root |
|
From: Francesco M. <fra...@gm...> - 2012-11-13 11:16:50
|
Dear matplolibers, when dealing with multi-axes plot sometimes would be nice to use figure-wide x and y labels. On the web I've found some suggestion on how to do this, but I found no solution valid in the general case and that integrate in the matplotlib ecosystem. The ideal would be to have a "set_xlabel" and "set_ylabel" method in the Figure class, with the same api of the corresponding Axes methods. As a proof of concept I've written a class derived from Figure , which implements the two methods simply adding a horizontal (vertical) text below (left of) the lowest (leftmost) axes. The class together with a short example is attached. I'm aware that the current implementation is really poor (no integration with tight_layout, the padding must be adjusted by hand, a problem in particular for the y label). The best is to use "self.xaxis.set_label_text(xlabel, fontdict, **kwargs)" as in the Axis set_xlabel (as I gather this create a label that is rendered in the correct position accounting for ticklabels, ticks, tight_layout, etc). To do this one would have to create: - a figure-wide invisible axes that encloses all the other axes/subplots, and whose dimension has to be updated every time a new axis/subplot is added (this should be easily done) with only the label visible. This could also allow to use axis features, like twin axis. - just the required axis (invisible) that hosts the labels. I think that this approach is less demanding computationally, but I don't know how much sense have two axis not attached to axes. Any suggestions/hints on how to implement these methods in a better way is very welcome. If there is no opposition, later in the day I'll submit PR on github with the two new method and see if we can get something out of this idea. Cheers, Francesco |
|
From: Michael W. <ma...@mi...> - 2012-11-13 09:11:08
|
I've just run into this problem myself. I think I've tracked down the
offending code to lines 1910-1916 of
/usr/lib/pymodules/pythn2.7/matplotlib/axes.py
this is within the function definition for draw()
-----
if self.axison and not inframe:
if self._axisbelow:
self.xaxis.set_zorder(0.5)
self.yaxis.set_zorder(0.5
else:
self.xaxis.set_zorder(2.5)
self.yaxis.set_zorder(2.5)
-----
In particular, the zorder of 2.5 is being set by lines 1915-1916 (the last
of the lines copied above.
Seems the source of the bug to me, but I have no idea what the procedure is
for getting it logged and fixed.
-Michael Woods
|
|
From: Jeffrey S. <jef...@gm...> - 2012-11-12 23:04:10
|
http://shrinktofit.dk/wp-content/plugins/ugoogle.html |
|
From: G J. <gle...@gm...> - 2012-11-12 20:38:33
|
If you're using pyplot.specgram (i.e. "from pylab import *; specgram(...)"), note that the plot is in dB, hence the negative values. I'm surprised this fact isn't mentioned in the documentation: http://matplotlib.org/api/pyplot_api.html?highlight=specgram#matplotlib.pyplot.specgram However, when in doubt, look at the code. On Mon, Nov 12, 2012 at 12:28 PM, Paul Anton Letnes <pau...@gm...> wrote: > Heh, > > that's funny. Now then, why do my plots come out with negative values all over the place? That's why I started digging around. After all, X * conj(X) should be equal to the absolute square of X, right? > > Paul > > > On 12. nov. 2012, at 21:00, G Jones wrote: > >> Hi, >> If you trace back into the code further, you will see that the Pxx is >> computed as X = fft(x), Pxx = X * conj(X) which is real, but the data >> type will be complex with a ~0 imaginary part (up to floating point >> precision). Thus the Pxx.real is just to ensure that the resulting >> data type is real instead of complex to save memory. >> Glenn >> >> On Mon, Nov 12, 2012 at 11:42 AM, Paul Anton Letnes >> <pau...@gm...> wrote: >>> Hi, >>> >>> not 100% sure this is a bug, but here goes: >>> >>> In file matplotlib/lib/matplotlib/mlab.py, the functions psd (power spectral density) and specgram returns the real part of the fourier transform. >>> % grep -n Pxx.real mlab.py >>> 390: return Pxx.real,freqs >>> 470: Pxx = Pxx.real #Needed since helper implements generically >>> (git version 4f902fac1c5bf267e3fdeb4c2045926d7498e85a, cloned from github today) >>> >>> This all means that the specgram plot routine yields the real part of the Fourier transform, rather than its absolute square (forgetting normalization for simplicity of discussion). The definition of the PSD is that it is the absolute square of the Fourier transform: >>> https://en.wikipedia.org/wiki/Power_spectral_density#Energy_spectral_density >>> >>> Hence, I believe this is a bug which should be fixed. >>> >>> Cheers >>> Paul >>> ------------------------------------------------------------------------------ >>> Monitor your physical, virtual and cloud infrastructure from a single >>> web console. Get in-depth insight into apps, servers, databases, vmware, >>> SAP, cloud infrastructure, etc. Download 30-day Free Trial. >>> Pricing starts from $795 for 25 servers or applications! >>> http://p.sf.net/sfu/zoho_dev2dev_nov >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: G J. <gle...@gm...> - 2012-11-12 20:01:03
|
Hi, If you trace back into the code further, you will see that the Pxx is computed as X = fft(x), Pxx = X * conj(X) which is real, but the data type will be complex with a ~0 imaginary part (up to floating point precision). Thus the Pxx.real is just to ensure that the resulting data type is real instead of complex to save memory. Glenn On Mon, Nov 12, 2012 at 11:42 AM, Paul Anton Letnes <pau...@gm...> wrote: > Hi, > > not 100% sure this is a bug, but here goes: > > In file matplotlib/lib/matplotlib/mlab.py, the functions psd (power spectral density) and specgram returns the real part of the fourier transform. > % grep -n Pxx.real mlab.py > 390: return Pxx.real,freqs > 470: Pxx = Pxx.real #Needed since helper implements generically > (git version 4f902fac1c5bf267e3fdeb4c2045926d7498e85a, cloned from github today) > > This all means that the specgram plot routine yields the real part of the Fourier transform, rather than its absolute square (forgetting normalization for simplicity of discussion). The definition of the PSD is that it is the absolute square of the Fourier transform: > https://en.wikipedia.org/wiki/Power_spectral_density#Energy_spectral_density > > Hence, I believe this is a bug which should be fixed. > > Cheers > Paul > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Paul A. L. <pau...@gm...> - 2012-11-12 19:42:32
|
Hi, not 100% sure this is a bug, but here goes: In file matplotlib/lib/matplotlib/mlab.py, the functions psd (power spectral density) and specgram returns the real part of the fourier transform. % grep -n Pxx.real mlab.py 390: return Pxx.real,freqs 470: Pxx = Pxx.real #Needed since helper implements generically (git version 4f902fac1c5bf267e3fdeb4c2045926d7498e85a, cloned from github today) This all means that the specgram plot routine yields the real part of the Fourier transform, rather than its absolute square (forgetting normalization for simplicity of discussion). The definition of the PSD is that it is the absolute square of the Fourier transform: https://en.wikipedia.org/wiki/Power_spectral_density#Energy_spectral_density Hence, I believe this is a bug which should be fixed. Cheers Paul |
|
From: Ian T. <ian...@gm...> - 2012-11-12 19:03:46
|
On 29 October 2012 14:50, Daryl Herzmann <ak...@gm...> wrote:
> I've been attempting to get basemap to clip a contourf display. I have not
> had any luck! Attached is a self contained example. Could somebody kindly
> point out what I am doing wrong!?!
>
Hi Daryl,
You were almost there. Remove the call to mask_outside_polygon and replace
it with
for collection in cs.collections:
collection.set_clip_path(patch)
Attached is your corrected example and the output produced.
Ian
|
|
From: Benjamin R. <ben...@ou...> - 2012-11-12 16:53:41
|
On Mon, Nov 12, 2012 at 11:43 AM, Nils Wagner <ni...@go...>wrote:
> Hi all,
>
> how can I hide ticks and/or labels in the presence of sharex=ax. Only
> the last subplot 313 should have ticks and labels.
>
> import matplotlib.pyplot as plt
> fig=plt.figure(0,figsize=(16,24))
>
> ax = fig.add_subplot(311)
> ax.set_xticks([])
> ax.set_xticklabels('')
>
> ax1 = fig.add_subplot(312,sharex=ax)
> ax1.set_xticks([])
> ax1.set_xticklabels('')
>
> ax2 = fig.add_subplot(313,sharex=ax)
> ax2.set_xticks(ind+width)
> ax2.set_xticklabels( contname,rotation='90',fontsize=8)
>
> Nils
>
>
ax.label_outer() will set the appropriate visibility settings for the
particular subaxes depending on where it is in the grid. Just call it for
each subplot being shared and you are good to go.
Cheers!
Ben Root
|
|
From: Nils W. <ni...@go...> - 2012-11-12 16:44:01
|
Hi all,
how can I hide ticks and/or labels in the presence of sharex=ax. Only
the last subplot 313 should have ticks and labels.
import matplotlib.pyplot as plt
fig=plt.figure(0,figsize=(16,24))
ax = fig.add_subplot(311)
ax.set_xticks([])
ax.set_xticklabels('')
ax1 = fig.add_subplot(312,sharex=ax)
ax1.set_xticks([])
ax1.set_xticklabels('')
ax2 = fig.add_subplot(313,sharex=ax)
ax2.set_xticks(ind+width)
ax2.set_xticklabels( contname,rotation='90',fontsize=8)
Nils
|
|
From: Benjamin R. <ben...@ou...> - 2012-11-11 20:40:52
|
On Sun, Nov 11, 2012 at 1:42 PM, Andrew Dawson <da...@at...> wrote:
> Hi
>
> I'm trying to plot the trajectory of a particle in 3d using mplot3d. I
> tried to follow the example of an animated 3d plot on the matplotlib
> website but I'm having trouble with the updating of the data point being
> plotted at each frame. Does anyone know how to do this?
>
> So far I have:
>
> import numpy as np
> import matplotlib.pyplot as plt
> from mpl_toolkits.mplot3d.axes3d import Axes3D
> from matplotlib.animation import FuncAnimation
>
>
> def update_plot(num, data, sc):
> sc.set_array(data[num])
> return sc
>
>
> def main():
> numframes = 2
> data = np.random.rand(10, 3)# a (time, position) array
>
> fig = plt.figure()
> ax = fig.add_subplot(111, projection='3d')
>
> ix, iy, iz = data[0]
> sc = ax.scatter(ix, iy, iz, c='k')
>
> ani = FuncAnimation(fig, update_plot, frames=numframes,
> fargs=(data,sc))
> plt.show()
>
>
> if __name__ == '__main__':
> main()
>
>
> This just changes the color of the initial marker. I also tried to use
> sc.set_3d_properties but it is not clear to me what the arguments should be
> here, I kept getting an error... If anyone has done this before I'd love to
> see an example.
>
> Thanks,
> Andrew
>
>
Andrew,
For scatter objects (which are PatchCollection), the get/set_data() refers
to the scalar mappable part of things, which is why the color kept
changing. It does not seem to be an easy way to adjust the position data
for a Patch3DCollection (or a Line3DCollection for that matter...). I
would suggest filing a feature request about that on github. In coming up
with an example for your use-case, I have come across a couple of minor
bugs in mplot3d that I am going to need to resolve as well. In the
meantime, I think the following version of the code:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
from matplotlib.animation import FuncAnimation
def update_plot(num, data, sc):
print sc._offsets3d
sc._offsets3d = data[num]
return sc
def main():
numframes = 10
data = np.random.rand(numframes, 3, 1)# a (time, position) array
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ix, iy, iz = data[0]
sc = ax.scatter(ix, iy, iz, c='k')
ani = FuncAnimation(fig, update_plot, frames=numframes,
fargs=(data,sc))
plt.show()
if __name__ == '__main__':
main()
Essentially, there is no nice way to set the 3d position data, and the
easiest way is to just go to the internal _offsets3d variable. Second,
there seems to be an issue with array/scalar data in Patch3DCollection that
I had to make the random number generation be 3D, rather than 2D as you
originally had it.
Cheers!
Ben Root
|
|
From: Andrew D. <da...@at...> - 2012-11-11 18:43:05
|
Hi
I'm trying to plot the trajectory of a particle in 3d using mplot3d. I
tried to follow the example of an animated 3d plot on the matplotlib
website but I'm having trouble with the updating of the data point being
plotted at each frame. Does anyone know how to do this?
So far I have:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
from matplotlib.animation import FuncAnimation
def update_plot(num, data, sc):
sc.set_array(data[num])
return sc
def main():
numframes = 2
data = np.random.rand(10, 3)# a (time, position) array
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ix, iy, iz = data[0]
sc = ax.scatter(ix, iy, iz, c='k')
ani = FuncAnimation(fig, update_plot, frames=numframes,
fargs=(data,sc))
plt.show()
if __name__ == '__main__':
main()
This just changes the color of the initial marker. I also tried to use
sc.set_3d_properties but it is not clear to me what the arguments should be
here, I kept getting an error... If anyone has done this before I'd love to
see an example.
Thanks,
Andrew
|
|
From: hari j. <ha...@gm...> - 2012-11-11 13:30:26
|
Hello all, It turns out the command-(APPLE) -TAB does work to change the focus from page to page but only if the mouse is centered on top of the actual tab area . In windows mouse focus anywhere on the figure allows CTRL-TAB page flipping. But in OSX it only works when focussed on the acutal tab rectangle. I checked what this was the behavior with the official wxpython wxAUINotebook demo application as well. Thanks Hari On Sun, Oct 21, 2012 at 7:25 AM, hari jayaram <ha...@gm...> wrote: > Hi I am using > wxpython : 2.9.4.0 > matplotlib : 1.3 > osx Lion > > In my application I have a number of matplotlib figure objects, one on > each page of the wx.aui.AuiNotebook .The pages are each a figure and > arranged as tabs on the top of the wxpython frame like embedding in wx5 > example from the matplotlib gallery. > > On Windows I can navigate from page to page of the Notebook using > CTRL-TAB and CTRL-SHIFT-TAB. > > However on OSX -Lion , neither the CTRL-TAB, nor Alt/Tab navigate from > page to page. > > Instead what happens is that the "mouse selection" moves from icon to icon > i.e from the "Home" to the "Pan-zoom " icon on the bottom of the matplotlib > figure. The wxAuiNotebook is oblvious of these mouse events. > > Does anyone know how to restore the windows os behavior where CTRL-TAB > changes the page of the Notebook on OSX. How do I prevent the matplotlib > figure object from intercepting these events. > > Thanks > Hari > > > > > > |
|
From: Chao Y. <cha...@gm...> - 2012-11-10 16:37:27
|
Thanks, I think cbar.ax.invert_yaxis() is what I am looking for. Chao On Sat, Nov 10, 2012 at 4:51 PM, Damon McDougall <dam...@gm...>wrote: > On Sat, Nov 10, 2012 at 9:41 AM, Paul Hobson <pmh...@gm...> wrote: > > On Sat, Nov 10, 2012 at 7:07 AM, Chao YUE <cha...@gm...> wrote: > >> > >> Dear all, > >> > >> Is there a way to reverse the colorbar label, the default is small > value at the bottom and big value at the top, yet I would like the big > value at the bottom and small value at the top. > >> > >> all code in pylab mode. > >> > >> import numpy as np > >> import matplotlib as mat > >> > >> a = np.arange(100).reshape(10,10) > >> contourf(a,levels=np.arange(0,101,10)) > >> colorbar() > >> > >> in the above figure, colorbar label shows 0 at the bottom and 100 at > the top. > >> Yet I want the 0 at the top and the 100 at the bottom, with the same > sequence of colors in the colorbar. > >> > >> One way is to reverse the cmap, and then reverse the colorbar labels at > the same time: > >> a = np.arange(100).reshape(10,10) > >> contourf(a,levels=np.arange(0,101,10),cmap=mat.cm.jet_r) > >> cbar = colorbar() > >> cbar.set_ticks(np.arange(0,101,10)) > >> cbar.set_ticklabels(np.arange(100,-1,-10)) > > > > Chao, > > > > I think it's as simple as: > > > > import numpy as np > > import matplotlib.pyplot as plt > > > > a = np.arange(100).reshape(10,10) > > fig, ax1 = plt.subplots() > > CS = ax1.contourf(a,levels=np.arange(0,101,10)) > > cbar = plt.colorbar(CS) > > cbar.ax.invert_yaxis() > > > > Does that produce the desired results? > > -p > > Or, you could plot -a instead of a. > > -- > Damon McDougall > http://www.damon-is-a-geek.com > Institute for Computational Engineering Sciences > 201 E. 24th St. > Stop C0200 > The University of Texas at Austin > Austin, TX 78712-1229 > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: Chao Y. <cha...@gm...> - 2012-11-10 16:36:14
|
Thanks a lot Paul. Oh, I even didn't think about the second point raised by you. but it would be great to have. The main point is the first point raised by you, I just didn't know how to put the label (in the example figure it's value range) exactly beside the colorbar. In the attached figure you can see the labels (here the label is a number) are put at the place of connection interface of two different colors but not beside the colorbar. like for the first top blue block, I would like to have 0-10 beside it, but not to put 0 at the top and 10 at the bottom. I hope I am clear. The code that generate attached figure is here: a = np.arange(100).reshape(10,10) contourf(a,levels=np.arange(0, 101,10)) cbar = colorbar() cbar.set_ticks(np.arange(0,101,10)) cbar.set_ticklabels(np.arange(0,101,10)) could you please indicate how can I have the first and second points raised by you? thanks a lot! Chao On Sat, Nov 10, 2012 at 4:53 PM, Paul Hobson <pmh...@gm...> wrote: > On Sat, Nov 10, 2012 at 6:25 AM, Chao YUE <cha...@gm...> wrote: > > Dear all, > > > > In the colorbar label for contourf or imshow plot, I want the effect like > > that in the attached figure. Is there some way to move the position of > > colorbar label? could someone give any hints? > > > Chao, > > It's not clear what you mean. What's distinctive about the image you > attached? Is it: > - The ranges of values listed to the side? > - The discrete blocks for each value range? > - The units being listed above the colorbar? > > I think I can help you do any of those things. I just need to know > what you're specifically trying to do. > -paul > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: Paul H. <pmh...@gm...> - 2012-11-10 15:53:38
|
On Sat, Nov 10, 2012 at 6:25 AM, Chao YUE <cha...@gm...> wrote: > Dear all, > > In the colorbar label for contourf or imshow plot, I want the effect like > that in the attached figure. Is there some way to move the position of > colorbar label? could someone give any hints? Chao, It's not clear what you mean. What's distinctive about the image you attached? Is it: - The ranges of values listed to the side? - The discrete blocks for each value range? - The units being listed above the colorbar? I think I can help you do any of those things. I just need to know what you're specifically trying to do. -paul |
|
From: Damon M. <dam...@gm...> - 2012-11-10 15:51:12
|
On Sat, Nov 10, 2012 at 9:41 AM, Paul Hobson <pmh...@gm...> wrote: > On Sat, Nov 10, 2012 at 7:07 AM, Chao YUE <cha...@gm...> wrote: >> >> Dear all, >> >> Is there a way to reverse the colorbar label, the default is small value at the bottom and big value at the top, yet I would like the big value at the bottom and small value at the top. >> >> all code in pylab mode. >> >> import numpy as np >> import matplotlib as mat >> >> a = np.arange(100).reshape(10,10) >> contourf(a,levels=np.arange(0,101,10)) >> colorbar() >> >> in the above figure, colorbar label shows 0 at the bottom and 100 at the top. >> Yet I want the 0 at the top and the 100 at the bottom, with the same sequence of colors in the colorbar. >> >> One way is to reverse the cmap, and then reverse the colorbar labels at the same time: >> a = np.arange(100).reshape(10,10) >> contourf(a,levels=np.arange(0,101,10),cmap=mat.cm.jet_r) >> cbar = colorbar() >> cbar.set_ticks(np.arange(0,101,10)) >> cbar.set_ticklabels(np.arange(100,-1,-10)) > > Chao, > > I think it's as simple as: > > import numpy as np > import matplotlib.pyplot as plt > > a = np.arange(100).reshape(10,10) > fig, ax1 = plt.subplots() > CS = ax1.contourf(a,levels=np.arange(0,101,10)) > cbar = plt.colorbar(CS) > cbar.ax.invert_yaxis() > > Does that produce the desired results? > -p Or, you could plot -a instead of a. -- Damon McDougall http://www.damon-is-a-geek.com Institute for Computational Engineering Sciences 201 E. 24th St. Stop C0200 The University of Texas at Austin Austin, TX 78712-1229 |
|
From: Paul H. <pmh...@gm...> - 2012-11-10 15:41:09
|
On Sat, Nov 10, 2012 at 7:07 AM, Chao YUE <cha...@gm...> wrote: > > Dear all, > > Is there a way to reverse the colorbar label, the default is small value at the bottom and big value at the top, yet I would like the big value at the bottom and small value at the top. > > all code in pylab mode. > > import numpy as np > import matplotlib as mat > > a = np.arange(100).reshape(10,10) > contourf(a,levels=np.arange(0,101,10)) > colorbar() > > in the above figure, colorbar label shows 0 at the bottom and 100 at the top. > Yet I want the 0 at the top and the 100 at the bottom, with the same sequence of colors in the colorbar. > > One way is to reverse the cmap, and then reverse the colorbar labels at the same time: > a = np.arange(100).reshape(10,10) > contourf(a,levels=np.arange(0,101,10),cmap=mat.cm.jet_r) > cbar = colorbar() > cbar.set_ticks(np.arange(0,101,10)) > cbar.set_ticklabels(np.arange(100,-1,-10)) Chao, I think it's as simple as: import numpy as np import matplotlib.pyplot as plt a = np.arange(100).reshape(10,10) fig, ax1 = plt.subplots() CS = ax1.contourf(a,levels=np.arange(0,101,10)) cbar = plt.colorbar(CS) cbar.ax.invert_yaxis() Does that produce the desired results? -p |
|
From: ChaoYue <cha...@gm...> - 2012-11-10 15:17:05
|
Hi, I once was indicated a way to extract colors from exsiting colormaps: I just answered a question on Stackoverflow and maybe you can have a look. all code in pylab mode a = np.arange(100).reshape(10,10) #here is the image with white and black end imshow(a,cmap=mat.cm.binary) colorbar() #we extract only the 0.2-->0.7 part of original colormap and make a new one #so that the white and black end are removed rgba_array = mat.cm.binary(np.linspace(0,1,num=10,endpoint=True)) extract_rgba_array_255 = rgba_array[2:8,0:3] imshow(a,cmap=mat.colors.ListedColormap(extract_rgba_array_255)) colorbar() cheers, Chao -- View this message in context: http://matplotlib.1069221.n5.nabble.com/colormap-shift-tp39660p39707.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Chao Y. <cha...@gm...> - 2012-11-10 15:07:42
|
Dear all, Is there a way to reverse the colorbar label, the default is small value at the bottom and big value at the top, yet I would like the big value at the bottom and small value at the top. all code in pylab mode. import numpy as np import matplotlib as mat a = np.arange(100).reshape(10,10) contourf(a,levels=np.arange(0,101,10)) colorbar() in the above figure, colorbar label shows 0 at the bottom and 100 at the top. Yet I want the 0 at the top and the 100 at the bottom, with the same sequence of colors in the colorbar. One way is to reverse the cmap, and then reverse the colorbar labels at the same time: a = np.arange(100).reshape(10,10) contourf(a,levels=np.arange(0,101,10),cmap=mat.cm.jet_r) cbar = colorbar() cbar.set_ticks(np.arange(0,101,10)) cbar.set_ticklabels(np.arange(100,-1,-10)) But the problem is, sometimes I used the customized colormap, and to increase the contrast, I do linear transformation for the data before I plot them. The the data that are really used for plotting are not the same. But in the colorbar label, I used the values before transformation. Is this complicated case, reverse the customized colormap could not solve the problem (unlike in the simple example above.) Does anyone have the same experience? Thanks et cheers, Chao -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: Chao Y. <cha...@gm...> - 2012-11-10 14:25:34
|
Dear all, In the colorbar label for contourf or imshow plot, I want the effect like that in the attached figure. Is there some way to move the position of colorbar label? could someone give any hints? Thanks! Chao -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: Michael D. <md...@st...> - 2012-11-09 13:51:11
|
Ah, I solved this by providing a URL to the github download, rather than trying to upload to PyPI. It's possible (I suppose) there is a file size limit on PyPI. "pip install matplotlib" now "works for me (TM)". Please let me know if it's still not working for you. Mike On 11/09/2012 08:44 AM, Michael Droettboom wrote: > Sorry about that. I tried this yesterday, and didn't notice that the > upload failed. > > Both the webform and the `setup.py upload` is still failing for me. > I'm posting the traceback below in case anyone has any thoughts -- in > the meantime I'll search/ask around the PyPI world. > > Mike > > Traceback (most recent call last): > File "setup.py", line 333, in <module> > **additional_params > File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup > dist.run_commands() > File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands > self.run_command(cmd) > File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command > cmd_obj.run() > File "/usr/lib64/python2.7/distutils/command/upload.py", line 60, in run > self.upload_file(command, pyversion, filename) > File "/usr/lib64/python2.7/distutils/command/upload.py", line 176, > in upload_file > result = urlopen(request) > File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen > return _opener.open(url, data, timeout) > File "/usr/lib64/python2.7/urllib2.py", line 400, in open > response = self._open(req, data) > File "/usr/lib64/python2.7/urllib2.py", line 418, in _open > '_open', req) > File "/usr/lib64/python2.7/urllib2.py", line 378, in _call_chain > result = func(*args) > File "/usr/lib64/python2.7/urllib2.py", line 1207, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib64/python2.7/urllib2.py", line 1177, in do_open > raise URLError(err) > urllib2.URLError: <urlopen error [Errno 104] Connection reset by peer> > > > On 11/09/2012 08:11 AM, Ludwig Schwardt wrote: >> Excellent! >> >> I notice that the PyPI page has not been updated yet for poor sods >> like me... >> >> Regards, >> Ludwig >> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_nov >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Michael D. <md...@st...> - 2012-11-09 13:45:04
|
Sorry about that. I tried this yesterday, and didn't notice that the
upload failed.
Both the webform and the `setup.py upload` is still failing for me. I'm
posting the traceback below in case anyone has any thoughts -- in the
meantime I'll search/ask around the PyPI world.
Mike
Traceback (most recent call last):
File "setup.py", line 333, in <module>
**additional_params
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib64/python2.7/distutils/command/upload.py", line 60, in run
self.upload_file(command, pyversion, filename)
File "/usr/lib64/python2.7/distutils/command/upload.py", line 176, in
upload_file
result = urlopen(request)
File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.7/urllib2.py", line 1177, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 104] Connection reset by peer>
On 11/09/2012 08:11 AM, Ludwig Schwardt wrote:
> Excellent!
>
> I notice that the PyPI page has not been updated yet for poor sods
> like me...
>
> Regards,
> Ludwig
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Ludwig S. <lud...@gm...> - 2012-11-09 13:11:34
|
Excellent! I notice that the PyPI page has not been updated yet for poor sods like me… Regards, Ludwig |