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
(8) |
2
(11) |
3
(4) |
4
(6) |
|
5
(13) |
6
(30) |
7
(21) |
8
(9) |
9
(19) |
10
(4) |
11
(5) |
|
12
(14) |
13
(19) |
14
(22) |
15
(12) |
16
(15) |
17
(14) |
18
(1) |
|
19
(1) |
20
(11) |
21
(9) |
22
(18) |
23
(39) |
24
(12) |
25
(7) |
|
26
(13) |
27
(18) |
28
(3) |
29
(5) |
30
(12) |
31
(10) |
|
|
From: Jeff W. <js...@fa...> - 2008-10-06 16:23:52
|
Mathew Yeates wrote: > Hi > How easy is it to customize the Basemap class? I seem to remember an > example where something is added to the toolbar but I can't remember > which example it was. What if I want to add a menu at the top of the window? > > Mathew > > Mathew: Basemap doesn't handle any GUI stuff - this is all done by matplotlib proper. So, you'll need to look at the matplotlib docs to see how to customize the toolbar. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Mathew Y. <my...@jp...> - 2008-10-06 16:16:31
|
Hi How easy is it to customize the Basemap class? I seem to remember an example where something is added to the toolbar but I can't remember which example it was. What if I want to add a menu at the top of the window? Mathew |
|
From: Henry P. <hen...@en...> - 2008-10-06 15:21:30
|
On Mon, 2008-10-06 at 08:04 -0500, John Hunter wrote: > On Mon, Oct 6, 2008 at 3:52 AM, Henry Proudhon <hen...@en...> wrote: > > Hi everyone, > > > > I wonder if there is a simple way to apply a multiplication factor to > > the ticks labels of an axis. > > > > say I'm plotting a 100 x 100 matrix with imshow and want the axis to > > show (0 to 70) instead of (0 to 100), while still displaying the whole > > matrix. In that case the coefficient would be 0.7. > > > > I had a look at the Formatter class but I cannot find a method to do > > that, do I've to implement a custom formatter or I'm missing something > > obvious here ? > > Use the "extent" keyword argument to imshow to set the [xmin, xmax, > ymin, ymax] extent of the image > > JDH Thanks a lot John, works great. Henry |
|
From: Gregor T. <gre...@gm...> - 2008-10-06 14:47:05
|
jcarnes schrieb: > I am writing a GUI application in wxPython and using MPL that plots figures, > saves them to image files, and then closes them all from within a thread to > keep the GUI responsive. Using the Enthought 2.3 install I would > sporatically have crashes that were hard to reproduce, but now that I've > upgrade to Enthought 2.5 (Python 2.5 and MPL 0.91.2.0001) it started > throwing exceptions when attempting to close a figure that I don't > understand. I've created an example script that excites the exception. I'm > not sure if the syptoms are a combination of problems caused by my use of > threads but this problem does not occur if threading is removed from the > script. I've read of others experiencing memory leaks and such when closing > figures, but no situations quite like this. > > I am working from a desktop in Windows XP and I use the WXAgg backend. > > Does anyone have any ideas, or any feedback on my use of threads? Thanks, > Josh > wxPython and multithreading don't go well together. Have a look at the wxWidgets docs about multithreading. Changes to the GUI (this includes closing a window) should only be done from the main thread. Continously creating and destroying a figure window seems not necessary in your application. Create it once in the main thread ((have a look at the embedding_in_wx examples of matplotlib) and only clear/replot it in your thread. In my experience replotting from the main thread is fast enough, saving to a file takes more time, this is worth to be done in another thread. Gregor |
|
From: John H. <jd...@gm...> - 2008-10-06 13:15:59
|
On Mon, Oct 6, 2008 at 3:52 AM, Henry Proudhon <hen...@en...> wrote: > Hi everyone, > > I wonder if there is a simple way to apply a multiplication factor to > the ticks labels of an axis. > > say I'm plotting a 100 x 100 matrix with imshow and want the axis to > show (0 to 70) instead of (0 to 100), while still displaying the whole > matrix. In that case the coefficient would be 0.7. > > I had a look at the Formatter class but I cannot find a method to do > that, do I've to implement a custom formatter or I'm missing something > obvious here ? Use the "extent" keyword argument to imshow to set the [xmin, xmax, ymin, ymax] extent of the image JDH |
|
From: John H. <jd...@gm...> - 2008-10-06 13:09:03
|
On Mon, Oct 6, 2008 at 7:15 AM, Michael Droettboom <md...@st...> wrote:
> In 0.98 ellipse is drawn using bezier curves, which do not scale
> correctly in log-scaled plots.
>
> As an alternative, you can use a RegularPolygon with a high number of
> vertices (this is exactly what 0.91 did).
Here is some example code which compares the polygonal ellipse with
the spline version to get you started if you decide to go with the
polygonal appromximation Michal suggest:
import numpy as npy
from matplotlib import patches
from pylab import figure, show
xcenter, ycenter = 0.38, 0.52
#xcenter, ycenter = 0., 0.
width, height = 1e-1, 3e-1
angle = -30
theta = npy.arange(0.0, 360.0, 1.0)*npy.pi/180.0
x = width/2. * npy.cos(theta)
y = height/2. * npy.sin(theta)
rtheta = angle*npy.pi/180.
R = npy.array([
[npy.cos(rtheta), -npy.sin(rtheta)],
[npy.sin(rtheta), npy.cos(rtheta)],
])
x, y = npy.dot(R, npy.array([x, y]))
x += xcenter
y += ycenter
fig = figure()
ax = fig.add_subplot(211, aspect='auto')
ax.fill(x, y, alpha=0.2, facecolor='yellow', edgecolor='yellow',
linewidth=1, zorder=1)
e1 = patches.Arc((xcenter, ycenter), width, height,
angle=angle, linewidth=2, fill=False, zorder=2)
ax.add_patch(e1)
ax = fig.add_subplot(212, aspect='equal')
ax.fill(x, y, alpha=0.2, facecolor='green', edgecolor='green', zorder=1)
e2 = patches.Arc((xcenter, ycenter), width, height,
angle=angle, linewidth=2, fill=False, zorder=2)
ax.add_patch(e2)
#fig.savefig('ellipse_compare.png')
fig.savefig('ellipse_compare')
show()
|
|
From: Michael D. <md...@st...> - 2008-10-06 12:23:03
|
imshow always assumes a regular rectangular grid of pixels. To plot image data on a non-rectilinear projection, you need to use pcolor or pcolormesh. You may also want to look at the basemap toolkit, which provides much better support for geographic projections. The ones included in matplotlib are essentially "toy" examples to test the infrastructure, but aren't really intended for advanced usage. Cheers, Mike dasratsel wrote: > Hi, > > I've done some poking an I can't find a way to use imshow() to plot a > luminosity map on a hammer projection. (looking to generate a plot like > http://en.wikipedia.org/wiki/Image:WMAP_2008.png). Just setting the > projection in a call to subplot gives some axes and an off-center retangular > image of my array. Bearing in mind that I am completely new to matplotlib, > does anyone have an idea of how to get this sort of plot? > > Thanks, > Kris > > (PS. Apologies if this shows up in two places, I'm not used to using mailing > lists) > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Jeff W. <js...@fa...> - 2008-10-06 12:19:54
|
Eric Firing wrote: > dasratsel wrote: > >> Hi, >> >> I've done some poking an I can't find a way to use imshow() to plot a >> luminosity map on a hammer projection. (looking to generate a plot like >> http://en.wikipedia.org/wiki/Image:WMAP_2008.png). Just setting the >> projection in a call to subplot gives some axes and an off-center retangular >> image of my array. Bearing in mind that I am completely new to matplotlib, >> does anyone have an idea of how to get this sort of plot? >> >> Thanks, >> Kris >> >> (PS. Apologies if this shows up in two places, I'm not used to using mailing >> lists) >> > > Kris, > > For any sort of mapping like this, you will probably want to use basemap > matplotlib toolkit, except that I don't see "hammer" among the supported > projections. > > With straight mpl, imshow does not support projections. You could use > pcolor (very slow) or pcolormesh. In neither case will you get > interpolation; you will be specifying colored quadrilaterals. > > Eric > > > Kris: Basemap does not support the 'hammer' projection, but it does have mollweide, which is very similar. Something like this ought to do it: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt # lon_0 is the center longitude of the data. map = Basemap(projection='moll',lon_0=180) # lons, lats are the longitudes and latitudes of the data # lons.shape, lats.shape = data.shape x, y = map(lons,lats) # make a filled mesh plot. im = map.pcolormesh(x,y,data,cmap=plt.cm.jet) # draw a boundary around the map map.drawmapboundary() plt.show() -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Darren D. <dsd...@gm...> - 2008-10-06 12:18:15
|
On Monday 29 September 2008 13:35:57 Buz Barstow wrote: > Dear All, > > Does anyone know of a citation that I can use for Numpy? > > Thanks! and all the best, I found the following link that discusses a few options, but you may want to ask on the numpy-discussion mailing list if there is a more up-to-date and preferred option: http://www.mail-archive.com/num...@sc.../msg04303.html |
|
From: Michael D. <md...@st...> - 2008-10-06 12:17:11
|
In 0.98 ellipse is drawn using bezier curves, which do not scale correctly in log-scaled plots. As an alternative, you can use a RegularPolygon with a high number of vertices (this is exactly what 0.91 did). Mike Yves Revaz wrote: > Dear list, > > How is it possible to draw a nice ellipse in a log-log plot using > patches.Ellipse ? > With matplotlib 0.91 I was able to to that using : > Ellipse((log10(100),log10(100)), width=100, height=100,alpha=0.5) > > Now, it seems that something has changed in version 0.98 and I do not > need to ad the log10 > in Ellipse. However, instead of having a nice ellipse, I get a kind of > patatoïd ? > See the example below. > How can I fix it ? > > Thanks in advance, > > yves > > > > > > from numpy import * > import pylab as pt > from matplotlib.patches import Ellipse > > > ax = pt.gca() > > e = Ellipse((100,100), width=100, height=100,alpha=0.5) > ax.add_artist(e) > > pt.semilogx() > pt.semilogy() > > pt.axis([1,1e3,1,1e3]) > > pt.show() > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Henry P. <hen...@en...> - 2008-10-06 10:20:36
|
Hi everyone, I wonder if there is a simple way to apply a multiplication factor to the ticks labels of an axis. say I'm plotting a 100 x 100 matrix with imshow and want the axis to show (0 to 70) instead of (0 to 100), while still displaying the whole matrix. In that case the coefficient would be 0.7. I had a look at the Formatter class but I cannot find a method to do that, do I've to implement a custom formatter or I'm missing something obvious here ? many thanks Henry |
|
From: Yves R. <yve...@ep...> - 2008-10-06 09:35:46
|
Dear list,
How is it possible to draw a nice ellipse in a log-log plot using
patches.Ellipse ?
With matplotlib 0.91 I was able to to that using :
Ellipse((log10(100),log10(100)), width=100, height=100,alpha=0.5)
Now, it seems that something has changed in version 0.98 and I do not
need to ad the log10
in Ellipse. However, instead of having a nice ellipse, I get a kind of
patatoïd ?
See the example below.
How can I fix it ?
Thanks in advance,
yves
from numpy import *
import pylab as pt
from matplotlib.patches import Ellipse
ax = pt.gca()
e = Ellipse((100,100), width=100, height=100,alpha=0.5)
ax.add_artist(e)
pt.semilogx()
pt.semilogy()
pt.axis([1,1e3,1,1e3])
pt.show()
--
(o o)
--------------------------------------------oOO--(_)--OOo-------
Yves Revaz
Laboratory of Astrophysics EPFL
Observatoire de Sauverny Tel : ++ 41 22 379 24 28
51. Ch. des Maillettes Fax : ++ 41 22 379 22 05
1290 Sauverny e-mail : Yve...@ep...
SWITZERLAND Web : http://www.lunix.ch/revaz/
----------------------------------------------------------------
|
|
From: Alan <ala...@gm...> - 2008-10-06 08:20:08
|
Thanks for all replies. I got a solution by copying some files from SVN trunk revision 6155. I did as follow: svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib sudo cp -b matplotlib/lib/matplotlib/backends/backend_pdf.py /sw/lib/python2.5/site-packages/matplotlib/backends sudo cp -b matplotlib/lib/matplotlib/config/mplconfig.py /sw/lib/python2.5/site-packages/matplotlib/config sudo cp -b matplotlib/lib/matplotlib/mlab.py /sw/lib/python2.5/site-packages/matplotlib/ sudo cp -b matplotlib/lib/matplotlib/path.py /sw/lib/python2.5/site-packages/matplotlib sudo cp -b matplotlib/lib/matplotlib/rcsetup.py /sw/lib/python2.5/site-packages/matplotlib Cheers, Alan On Fri, Oct 3, 2008 at 1:21 PM, Michael Droettboom <md...@st...> wrote: > Are you perhaps trying to plot data containing NaN or Inf? If so, this is > a known bug in 0.98.3 that has seen been corrected on SVN trunk. > > A workaround is to pass masked arrays (where the NaNs and Infs are masked > out) to matplotlib instead. > > But this bug should be gone in the next release of matplotlib. If you're > comfortable building from SVN, you could even try that now. > > Cheers, > Mike > > > Alan wrote: > >> Dear all, >> >> I don't know much how to express this issue I am having but I will try. >> >> We are developing an application (CING: cing.googlecodes.com) and we >> have some routines to test the sanity of our code. >> >> I am developing in python, on a mac book pro with Mac OSX tiger and FINK. >> >> So when we were using matplotlib 0.90.1 and numpy 1.0.4 the routine >> below was running fine. >> >> Then I updated all from Fink, having now mtplib 0.98.3 and numpy 1.1.1 >> and problems started to appear. >> >> I could solve all (e.g. replace verify_intervals()) but one, as shown >> below. >> >> I don't have much idea at moment how to debug it better, but it seems >> that I cannot generate the PDFs because mtplib functions don't guess a >> finite number of pages. >> >> I hope someone can give any idea. >> >> Many thanks in advance. >> >> Alan >> >> ====================================================================== >> ERROR: testMoleculePlot (cing.Libs.test.test_NTMoleculePlot.AllChecks) >> ---------------------------------------------------------------------- >> Traceback (most recent call last): >> File >> "/Users/alan/workspace/cingWork/python/cing/Libs/test/test_NTMoleculePlot.py", >> line 178, in testMoleculePlot >> createPngCopyToo=True ) >> File "/Users/alan/workspace/cingWork/python/cing/Libs/NTmoleculePlot.py", >> line 176, in renderMoleculePlotSet >> if ps.hardcopy(fileNameList[r-1]): >> File "/Users/alan/workspace/cingWork/python/cing/Libs/NTplot.py", >> line 1201, in hardcopy >> savefig(fileName) >> File "/sw/lib/python2.5/site-packages/matplotlib/pyplot.py", line >> 342, in savefig >> return fig.savefig(*args, **kwargs) >> File "/sw/lib/python2.5/site-packages/matplotlib/figure.py", line >> 964, in savefig >> self.canvas.print_figure(*args, **kwargs) >> File "/sw/lib/python2.5/site-packages/matplotlib/backend_bases.py", >> line 1310, in print_figure >> **kwargs) >> File "/sw/lib/python2.5/site-packages/matplotlib/backend_bases.py", >> line 1204, in print_pdf >> return pdf.print_pdf(*args, **kwargs) >> File >> "/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", >> line 1864, in print_pdf >> self.figure.draw(renderer) >> File "/sw/lib/python2.5/site-packages/matplotlib/figure.py", line 759, in >> draw >> for a in self.axes: a.draw(renderer) >> File "/sw/lib/python2.5/site-packages/matplotlib/axes.py", line 1523, in >> draw >> a.draw(renderer) >> File "/sw/lib/python2.5/site-packages/matplotlib/lines.py", line 437, in >> draw >> markerFunc(renderer, gc, tpath, affine.frozen()) >> File "/sw/lib/python2.5/site-packages/matplotlib/lines.py", line >> 885, in _draw_plus >> path, path_trans) >> File >> "/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", >> line 1253, in draw_markers >> marker, Op.use_xobject) >> File >> "/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", >> line 451, in output >> self.write(fill(map(pdfRepr, data))) >> File >> "/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", >> line 124, in pdfRepr >> raise ValueError, "Can only output finite numbers in PDF" >> ValueError: Can only output finite numbers in PDF >> >> ---------------------------------------------------------------------- >> >> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK. >>http://www.bio.cam.ac.uk/~awd28<< |
|
From: Eric F. <ef...@ha...> - 2008-10-06 05:27:45
|
dasratsel wrote: > Hi, > > I've done some poking an I can't find a way to use imshow() to plot a > luminosity map on a hammer projection. (looking to generate a plot like > http://en.wikipedia.org/wiki/Image:WMAP_2008.png). Just setting the > projection in a call to subplot gives some axes and an off-center retangular > image of my array. Bearing in mind that I am completely new to matplotlib, > does anyone have an idea of how to get this sort of plot? > > Thanks, > Kris > > (PS. Apologies if this shows up in two places, I'm not used to using mailing > lists) Kris, For any sort of mapping like this, you will probably want to use basemap matplotlib toolkit, except that I don't see "hammer" among the supported projections. With straight mpl, imshow does not support projections. You could use pcolor (very slow) or pcolormesh. In neither case will you get interpolation; you will be specifying colored quadrilaterals. Eric |
|
From: dasratsel <das...@gm...> - 2008-10-06 02:23:50
|
Hi, I've done some poking an I can't find a way to use imshow() to plot a luminosity map on a hammer projection. (looking to generate a plot like http://en.wikipedia.org/wiki/Image:WMAP_2008.png). Just setting the projection in a call to subplot gives some axes and an off-center retangular image of my array. Bearing in mind that I am completely new to matplotlib, does anyone have an idea of how to get this sort of plot? Thanks, Kris (PS. Apologies if this shows up in two places, I'm not used to using mailing lists) -- View this message in context: http://www.nabble.com/luminocity-plot-on-hammer-projection-tp19829899p19829899.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2008-10-06 00:59:28
|
Angus McMorland wrote: > Hi all, > > I'm trying to plot a colour bar for a scatter plot, and set the > maximum value of the plot to something arbitrary. At the moment it > always comes up as 255. How can I change this? > > ax = plt.gca() > pts = ax.scatter(coords[:,0], coords[:,1], c=np.linspace(0,1,n_pts), s=16, > edgecolors='k', linewidth=1) > > Also, there seem to be many different ways to make colorbars associate > with certain objects like the colorbar keyword to scatter perhaps, but > the simplest/only way to create a colorbar that I can get to work is: > > ax.figure.colorbar(ax.images[0]) > > Is there a better way to do this so the vmin and vmax attributes of > the scatter plot get used in the colorbar? > > Thanks, > > Angus. Maybe I am misunderstanding you, but the ipython -pylab approach looks like this: In [1]:x = rand(20) In [2]:y = rand(20) In [3]:z = rand(20)*10 In [4]:scatter? In [5]:sc = scatter(x, y, c=z) In [6]:sc Out[6]:<matplotlib.collections.RegularPolyCollection object at 0x8d8dd6c> In [7]:colorbar? In [8]:colorbar(sc) Out[8]:<matplotlib.colorbar.Colorbar instance at 0x92d29cc> The more object-oriented approach with ax.scatter, etc. is essentially the same. If color mapping is used by scatter, then the collection it returns is a "mappable", which is the argument colorbar needs to make the connection. Eric |
|
From: Angus M. <am...@gm...> - 2008-10-05 23:12:54
|
Hi all,
I'm trying to plot a colour bar for a scatter plot, and set the
maximum value of the plot to something arbitrary. At the moment it
always comes up as 255. How can I change this?
ax = plt.gca()
pts = ax.scatter(coords[:,0], coords[:,1], c=np.linspace(0,1,n_pts), s=16,
edgecolors='k', linewidth=1)
Also, there seem to be many different ways to make colorbars associate
with certain objects like the colorbar keyword to scatter perhaps, but
the simplest/only way to create a colorbar that I can get to work is:
ax.figure.colorbar(ax.images[0])
Is there a better way to do this so the vmin and vmax attributes of
the scatter plot get used in the colorbar?
Thanks,
Angus.
--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
|
|
From: Eric F. <ef...@ha...> - 2008-10-05 21:17:55
|
Jae-Joon Lee wrote: >> Done, except that it just raises a warning, and still works with the old >> kwarg. The new kwarg is "borderpad"; it is used if pad==0, which is the new >> rc default. I set the default borderpad=0.5. >> >> There is still too much other positioning in legend that is based on axes >> units. I briefly tried to start changing others, again with additional >> kwargs, and things quickly fell apart. Legend needs considerable reworking >> to take full advantage of the transforms framework (and maybe other mpl >> improvements since the original legend) and to put all positioning kwargs >> and code in sensible units. It is amazing that the present code works as >> well as it does. >> >> The way to make a transition may be via a separate version for a while. >> There could be a single interface, with a kwarg to choose the version. >> > > Thanks Eric. > > I would like to help reworking on the legend class. > I once tried to incorporate the FancyBox into the legend but the > result is not satisfactory because the legend bounding box is defined > as axes units in the current implementation (see the attached > screenshot). And I guess it would be better do things in the display > coordinate. > > Also, in the current implementation, the vertical spacing between each > legend varies according to the height of the legend text. For example, > in the attached screenshot, the spacings between "ac", "ag", "lg" are > all different and this is because their text heights are different. I > think it is better if we have a fixed spacing, or have a minimum > spacing as the text height of "lg". And use the baseline-alignment if > possible. Jae-Joon, It would be great if you would take this on. I agree about the spacing. I suspect there are good opportunities for factoring out parts of the problem in such a way that they can be used more flexibly in legend, and may turn out to be useful elsewhere. An ability to nicely format plot elements (line segments, etc.) with text into a block would facilitate satisfying another request that has come up: a legend with more than one column, or a legend that is entirely horizontal. Eric |
|
From: Vincent Favre-N. <vi...@us...> - 2008-10-05 21:09:42
|
On dimanche 05 octobre 2008, jcarnes wrote: > I am writing a GUI application in wxPython and using MPL that plots > figures, saves them to image files, and then closes them all from within a > thread to keep the GUI responsive. Normally only the main thread should alter the graphics - you'll have crashes if you try to do it otherwise. If you want to perform calculations in a separate thread to keep the GUI responsive, you have to send an event from the working thread to the main thread, so that the main thread does the GUI update. http://docs.wxwidgets.org/stable/wx_wxthreadoverview.html#wxthreadoverview Well, at least that's the story from my C++ wx knowledge, but it is probably still valid in Python. Another interesting read from the samples page: http://docs.wxwidgets.org/trunk/page_samples.html#page_samples_thread Maybe simply using wxMutexGUIEnter() / wxMutexGUILeave() will sort your problems, but I've not tried this method. Vincent -- Vincent Favre-Nicolin CEA Grenoble/INAC/SP2M http://inac.cea.fr Univ. Joseph Fourier (Grenoble) http://www.ujf-grenoble.fr ObjCryst & Fox http://objcryst.sf.net/Fox |
|
From: Jae-Joon L. <lee...@gm...> - 2008-10-05 20:53:42
|
> > Done, except that it just raises a warning, and still works with the old > kwarg. The new kwarg is "borderpad"; it is used if pad==0, which is the new > rc default. I set the default borderpad=0.5. > > There is still too much other positioning in legend that is based on axes > units. I briefly tried to start changing others, again with additional > kwargs, and things quickly fell apart. Legend needs considerable reworking > to take full advantage of the transforms framework (and maybe other mpl > improvements since the original legend) and to put all positioning kwargs > and code in sensible units. It is amazing that the present code works as > well as it does. > > The way to make a transition may be via a separate version for a while. > There could be a single interface, with a kwarg to choose the version. > Thanks Eric. I would like to help reworking on the legend class. I once tried to incorporate the FancyBox into the legend but the result is not satisfactory because the legend bounding box is defined as axes units in the current implementation (see the attached screenshot). And I guess it would be better do things in the display coordinate. Also, in the current implementation, the vertical spacing between each legend varies according to the height of the legend text. For example, in the attached screenshot, the spacings between "ac", "ag", "lg" are all different and this is because their text heights are different. I think it is better if we have a fixed spacing, or have a minimum spacing as the text height of "lg". And use the baseline-alignment if possible. Regards, -JJ |
|
From: Jon F. <jfr...@cs...> - 2008-10-05 19:46:27
|
Back in March, 2007, a user asked about getting the resize_even to work.
No one responded to his question. I have the same problem. I tried
hooking up a method that I hoped would be called every time the graph
was resized (using the UI that is displayed by a show() call).
connect('resize_event', plotutils.recalculateTimeSeriesXLabels)
However, my method is never called, even when I maximize the window.
Here is his email as well:
Trying to get resize event to work, but either I don't understand the
definition of when resize_event should work, or it's broken.
for example
=======================
from matplotlib import pylab , numerix
def GotResizeEvent( event ):
print 'Resize event detected'
def GotDrawEvent( event ):
print 'Draw event detected'
X = range(0, 200)
Y = pylab.sin(X)
r = pylab.plot(X,Y)
pylab.connect( 'resize_event', GotResizeEvent)
pylab.connect( 'draw_event', GotDrawEvent)
pylab.show()
=========================
Will only get draw_events as I zoom in on the data, never a resize event?
I also get draw_events as I resize the window itself, but never a
resize_event.
So my question, .. what user activity triggers a resize event?
--
Jon Froehlich
PhD Student
Computer Science and Engineering
University of Washington
http://www.cs.washington.edu/homes/jfroehli
|
|
From: Venkat R. <ve...@sr...> - 2008-10-05 17:00:14
|
Hi all, I'm trying to install the latest matplotlib on a couple of machines. They both run the same OS (an old custom version between Fedora 2 and 3) but the rest of the setup are rather different. For the curious, one is an MR scanner and the other is a developmental machine for compiling pulse-sequences etc. I have root permissions on both, but would rather not disturb the installed directory tree. What is the best/recommended way of going about it? 1. Is it possible to install matplotlib ( and its requirements ) in the developmental machine in a separate root directory, export it and mount from the other machine? The idea is to install once and use those from both. Would this work? What backends would work on this setup? 2. This is to be used for dynamically plotting the data coming out of the scanner. I'm also thinking of embedding it in an UI. Can all the UI backends handle the rate of about 10 FPS with each data ~5K short-ints? Thanks for your time, Venkat. |
|
From: John H. <jd...@gm...> - 2008-10-05 13:36:50
|
On Sun, Oct 5, 2008 at 3:50 AM, rocha <ber...@me...> wrote: >>> self.canvas.figure.clf() >>> self.canvas.draw() >>> self.canvas.axes.plot([1.,2.,4.]) >>> >>> and nothing is plotted. The Figure is totally gray. I tried to do the >>> same thing in embedding_in_qt4.py example, modifying some parts, but it >>> didn't work too. >>> >>> Do you have any suggestions? The problem appears to be that you have kept a copy of your old axes around (self.canvas.axes is not a mpl construct, so it looks like you have attached an axes instance to your canvas instance). You will want to either not clear your figure and clear your axes instead ax.cla() ax.plot([1,2,3]) canvas.draw() or clear your figure, create a new axes, plot and then draw fig.clf() ax = fig.add_subplot(111) ax.plot([1,2,3]) ax.draw() Be careful with the name "axes" to refer to a single axes instance attached to your canvas. In the mpl scheme, axes is a list of Axes instance and is attached to the Figure instance. See for example http://matplotlib.sourceforge.net/doc/html/users/artists.html JDH |
|
From: Jouni K. S. <jk...@ik...> - 2008-10-05 10:28:16
|
ber...@xn... (Berthold
Höllmann) writes:
> (Pdb) print self._header
> {'Notice': 'Copyright (c) 1999 Ministry of Education, Taipei, Taiwan. All Rights Reserved.', 'Ascender': 880.0, 'FontBBox': [-123, -250, 1000, 880], 'Weight': 'Regular', 'Descender': -250.0, 'CharacterSet': 'Adobe-CNS1-0', 'IsFixedPitch': False, 'FontName': 'MOEKai-Regular', 'StartFontMetrics': 4.0999999999999996, 'CapHeight': 880.0, 'Version': '1.000', 'UnderlinePosition': -100, 'Characters': 13699, 'UnderlineThickness': 50, 'ItalicAngle': 0.0, 'StartCharMetrics': 13699}
That AFM file doesn't include a family name or a full name for the font
it describes. It seems that both are in fact optional attributes. I have
committed a change (on the trunk, and in the maintenance branch) that
should fix this, but since I don't have any AFM files like this, I can't
check that it works. Can you check out either the trunk or the
maintenance branch from Subversion, or apply the following patch and try
again?
--
Jouni K. Seppänen
http://www.iki.fi/jks
|
|
From: rocha <ber...@me...> - 2008-10-05 08:53:27
|
Hi Jae-Joon Lee, I tried it but unfortunately it didn't work too. After the Figure is cleared I cannot plot again. I've attached the whole code that I'm trying to do this, I hope it could help a little bit. I modified the original example just to test this feature. Thanks! Bernardo M. Rocha Jae-Joon Lee wrote: > I guess you need to put draw() after plot() > > self.canvas.figure.clf() > self.canvas.axes.plot([1.,2.,4.]) > self.canvas.draw() > > Let us know if it does not help. > > -JJ > > > > On Sat, Oct 4, 2008 at 7:17 PM, rocha <ber...@me...> wrote: > >> Hi Guys, >> >> I need to clear the Figure after the user has clicked the some button in >> PyQt, but when I try to plot the graphics again nothing appear. In >> ipython it works, but when I try it inside my application it does not >> work. What am I missing? >> >> Inside my MplCanvas class (actually it is a QWidget - see >> embedding_in_qt4.py in matplotlib examples file - user_interface) I have >> this code: >> >> self.fig = Figure(figsize=(self.width, self.height), dpi=dpi) >> >> And then in my main application I'm trying to do: >> >> self.canvas.figure.clf() >> self.canvas.draw() >> self.canvas.axes.plot([1.,2.,4.]) >> >> and nothing is plotted. The Figure is totally gray. I tried to do the >> same thing in embedding_in_qt4.py example, modifying some parts, but it >> didn't work too. >> >> Do you have any suggestions? >> >> Thanks! >> Best regards, >> Bernardo M. Rocha >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> |