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
(10) |
2
(3) |
3
(5) |
4
(7) |
5
(18) |
6
(4) |
7
(15) |
8
(7) |
9
(10) |
10
(4) |
11
(18) |
12
(15) |
13
(11) |
14
(11) |
15
(4) |
16
(28) |
17
(17) |
18
(22) |
19
(12) |
20
(19) |
21
(17) |
22
(14) |
23
(4) |
24
(3) |
25
(6) |
26
(8) |
27
(13) |
28
(11) |
29
(21) |
30
(3) |
31
(5) |
|
|
|
|
|
|
Steve Schmerler a =E9crit : > Nicolas Champavert wrote: > =20 >> Hello, >> >> I have some problems when trying to save a figure with usetex=3DTrue= .=20 >> Sometimes, it is not possible to save the figure when trying to put an= =20 >> xlabel with LaTeX inside. >> It works with pylab.xlabel('M$_\odot$') but not with=20 >> pylab.xlabel('10$^3$ M$_\odot$') (see below). Do you know why ? >> >> =20 > > > Works fine here, with and w/o raw strings. > > In [75]: rcParams['text.usetex']=3DTrue > > In [76]: plot([1,2,3]) > Out[76]: [<matplotlib.lines.Line2D instance at 0xa0db754c>] > > In [77]: xlabel('10$^3$ M$_\odot$') > Out[77]: <matplotlib.text.Text instance at 0xa0daea2c> > > In [78]: savefig('test.eps') > > In [79]: matplotlib.__version__ > Out[79]: '0.87.7' > > In [80]: matplotlib.__revision__ > Out[80]: '$Revision: 2835 $' > > > Maybe you need to upgrade, but that's just a guess. > =20 I had matplotlib revision 2835. I made an upgrade. Now I have revision 29= 05. I still have problem but it is very strange: - when I plot [0,1] with xlabel(r'(10$^3$ M$_\odot$)'), it works. - when I plot [1,2] with xlabel(r'Upper mass for the IMF (10$^3$=20 M$_\odot$)'), it works. - but it doesn't work if I plot [0,1] with xlabel(r'Upper mass for the=20 IMF (10$^3$ M$_\odot$)')... In [1]:import matplotlib In [2]:import pylab In [3]:matplotlib.__version__ Out[3]:'0.87.7' In [4]:matplotlib.__revision__ Out[4]:'$Revision: 2905 $' In [5]:matplotlib.rc('text',usetex=3DTrue) In [6]:pylab.plot([0,1]) Out[6]:[<matplotlib.lines.Line2D instance at 0xb67b7e4c>] In [7]:pylab.xlabel(r'(10$^3$ M$_\odot$)') Out[7]:<matplotlib.text.Text instance at 0xb691762c> In [8]:pylab.savefig('toto1.eps') In [9]:pylab.close() In [10]:pylab.plot([1,2]) Out[10]:[<matplotlib.lines.Line2D instance at 0xb67d7fec>] In [11]:pylab.xlabel(r'Upper mass for the IMF (10$^3$ M$_\odot$)') Out[11]:<matplotlib.text.Text instance at 0xb67d0c6c> In [12]:pylab.savefig('toto2.eps') In [13]:pylab.close() In [14]:pylab.plot([0,1]) Out[14]:[<matplotlib.lines.Line2D instance at 0xb67f078c>] In [15]:pylab.xlabel(r'Upper mass for the IMF (10$^3$ M$_\odot$)') Out[15]:<matplotlib.text.Text instance at 0xb63413ac> In [16]:pylab.savefig('toto3.eps') sh: line 1: 19756 Erreur de segmentation gs -dBATCH -dNOPAUSE -r6000=20 -sDEVICE=3Dpswrite -sPAPERSIZE=3Dletter=20 -sOutputFile=3D"/tmp/11701f1f88db8c691a0ca6ac520c7706.ps"=20 "/tmp/11701f1f88db8c691a0ca6ac520c7706"=20 >"/tmp/11701f1f88db8c691a0ca6ac520c7706.output" -------------------------------------------------------------------------= -- exceptions.RuntimeError Traceback (most=20 recent call last) /home/champavert/<ipython console> /usr/local/lib/python2.4/site-packages/matplotlib/pylab.py in=20 savefig(*args, **kwargs) 811 def savefig(*args, **kwargs): 812 fig =3D gcf() --> 813 return fig.savefig(*args, **kwargs) 814 if Figure.savefig.__doc__ is not None: 815 savefig.__doc__ =3D _shift_string(Figure.savefig.__doc__) /usr/local/lib/python2.4/site-packages/matplotlib/figure.py in=20 savefig(self, *args, **kwargs) 685 kwargs[key] =3D rcParams['savefig.%s'%key] 686 --> 687 self.canvas.print_figure(*args, **kwargs) 688 689 def colorbar(self, mappable, cax=3DNone, **kw): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.= py=20 in print_figure(self, filename, dpi, facecolor, edgecolor, orientation,=20 **kwargs) 184 if dpi is None: dpi =3D rcParams['savefig.dpi'] 185 agg =3D self.switch_backends(FigureCanvasAgg) --> 186 agg.print_figure(filename, dpi, facecolor, edgecolor,=20 orientation, 187 **kwargs) 188 self.figure.set_canvas(self) /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py= =20 in print_figure(self, filename, dpi, facecolor, edgecolor, orientation,=20 **kwargs) 486 ps =3D self.switch_backends(FigureCanvasPS) 487 ps.print_figure(filename, dpi, facecolor, edgecol= or, --> 488 orientation, **kwargs) 489 elif ext.find('pdf')>=3D0: 490 from backend_pdf import FigureCanvasPdf /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py=20 in print_figure(self, outfile, dpi, facecolor, edgecolor, orientation,=20 papertype) 1009 # Let's keep the usetex stuff seperate from the=20 generic postscript 1010 self._print_figure_tex(outfile, dpi, facecolor,=20 edgecolor, -> 1011 orientation, papertype) 1012 else: 1013 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py=20 in _print_figure_tex(self, outfile, dpi, facecolor, edgecolor,=20 orientation, papertype) 1243 elif rcParams['text.usetex']: 1244 if False: pass # for debugging -> 1245 else: gs_distill(tmpfile, ext=3D=3D'.eps',=20 ptype=3Dpapertype, bbox=3Dbbox) 1246 1247 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py=20 in gs_distill(tmpfile, eps, ptype, bbox) 1341 exit_status =3D os.system(command) 1342 fh =3D file(outfile) -> 1343 if exit_status: raise RuntimeError('ghostscript was not able=20 to process \ 1344 your image.\nHere is the full report generated by=20 ghostscript:\n\n' + fh.read()) 1345 else: verbose.report(fh.read(), 'debug') RuntimeError: ghostscript was not able to process your image. Here is the full report generated by ghostscript: ESP Ghostscript 8.15 (2006年04月19日) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details.
Nicolas Champavert wrote: > Hello, > > I have some problems when trying to save a figure with usetex=True. > Sometimes, it is not possible to save the figure when trying to put an > xlabel with LaTeX inside. > It works with pylab.xlabel('M$_\odot$') but not with > pylab.xlabel('10$^3$ M$_\odot$') (see below). Do you know why ? > Works fine here, with and w/o raw strings. In [75]: rcParams['text.usetex']=True In [76]: plot([1,2,3]) Out[76]: [<matplotlib.lines.Line2D instance at 0xa0db754c>] In [77]: xlabel('10$^3$ M$_\odot$') Out[77]: <matplotlib.text.Text instance at 0xa0daea2c> In [78]: savefig('test.eps') In [79]: matplotlib.__version__ Out[79]: '0.87.7' In [80]: matplotlib.__revision__ Out[80]: '$Revision: 2835 $' Maybe you need to upgrade, but that's just a guess. -- cheers, steve Random number generation is the art of producing pure gibberish as quickly as possible.
I haven't tried it, but my guess is the '\' character is the problem. > pylab.xlabel('10$^3$ M$_\odot$') Try pylab.xlabel(r'10$^3$ M$_\odot$') ^ Add raw string marker. or maybe pylab.xlabel('10$^3$ M$_\\odot$') Gary R. Nicolas Champavert wrote: > Hello, > > I have some problems when trying to save a figure with usetex=True. > Sometimes, it is not possible to save the figure when trying to put an > xlabel with LaTeX inside. > It works with pylab.xlabel('M$_\odot$') but not with > pylab.xlabel('10$^3$ M$_\odot$') (see below). Do you know why ?
On Monday 11 December 2006 7:12 am, Nicolas Champavert wrote: > Hello, > > I have some problems when trying to save a figure with usetex=True. > Sometimes, it is not possible to save the figure when trying to put an > xlabel with LaTeX inside. > It works with pylab.xlabel('M$_\odot$') but not with > pylab.xlabel('10$^3$ M$_\odot$') (see below). Do you know why ? You're example works on my system. But note, you should use raw strings, maybe that is the source of your problem: pylab.xlabel(r'10$^3$ M$_\odot$')
Hello, I have some problems when trying to save a figure with usetex=True. Sometimes, it is not possible to save the figure when trying to put an xlabel with LaTeX inside. It works with pylab.xlabel('M$_\odot$') but not with pylab.xlabel('10$^3$ M$_\odot$') (see below). Do you know why ? In [1]:import matplotlib In [2]:matplotlib.__version__ Out[2]:'0.87.7' In [3]:import pylab In [4]:a=[0,1] In [5]:pylab.plot(a) Out[5]:[<matplotlib.lines.Line2D instance at 0xb690472c>] In [6]:pylab.xlabel('M$_\odot$') Out[6]:<matplotlib.text.Text instance at 0xb6976d2c> In [7]:pylab.savefig('toto.eps') In [8]:matplotlib.rc('text',usetex=True) In [9]:pylab.plot(a) Out[9]:[<matplotlib.lines.Line2D instance at 0xb692466c>] In [10]:pylab.xlabel('M$_\odot$') Out[10]:<matplotlib.text.Text instance at 0xb6916e2c> In [11]:pylab.savefig('toto.eps') In [12]:matplotlib.rc('text',usetex=False) In [13]:pylab.plot(a) Out[13]:[<matplotlib.lines.Line2D instance at 0xb655cb8c>] In [14]:pylab.xlabel('10$^3$ M$_\odot$') Out[14]:<matplotlib.text.Text instance at 0xb65586ac> In [15]:pylab.savefig('toto.eps') In [16]:matplotlib.rc('text',usetex=True) In [17]:pylab.plot(a) Out[17]:[<matplotlib.lines.Line2D instance at 0xb657286c>] In [18]:pylab.xlabel('10$^3$ M$_\odot$') Out[18]:<matplotlib.text.Text instance at 0xb656af6c> In [19]:pylab.savefig('toto.eps') sh: line 1: 16796 Erreur de segmentation gs -dBATCH -dNOPAUSE -r6000 -sDEVICE=pswrite -sPAPERSIZE=letter -sOutputFile="/tmp/f71dbe52628a3f83a77ab494817525c6.ps" "/tmp/f71dbe52628a3f83a77ab494817525c6" >"/tmp/f71dbe52628a3f83a77ab494817525c6.output" --------------------------------------------------------------------------- exceptions.RuntimeError Traceback (most recent call last) /home/champavert/<ipython console> /usr/local/lib/python2.4/site-packages/matplotlib/pylab.py in savefig(*args, **kwargs) 812 def savefig(*args, **kwargs): 813 fig = gcf() --> 814 return fig.savefig(*args, **kwargs) 815 if Figure.savefig.__doc__ is not None: 816 savefig.__doc__ = _shift_string(Figure.savefig.__doc__) /usr/local/lib/python2.4/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs) 685 kwargs[key] = rcParams['savefig.%s'%key] 686 --> 687 self.canvas.print_figure(*args, **kwargs) 688 689 def colorbar(self, mappable, cax=None, **kw): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 184 if dpi is None: dpi = rcParams['savefig.dpi'] 185 agg = self.switch_backends(FigureCanvasAgg) --> 186 agg.print_figure(filename, dpi, facecolor, edgecolor, orientation, 187 **kwargs) 188 self.figure.set_canvas(self) /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 486 ps = self.switch_backends(FigureCanvasPS) 487 ps.print_figure(filename, dpi, facecolor, edgecolor, --> 488 orientation, **kwargs) 489 elif ext.find('pdf')>=0: 490 from backend_pdf import FigureCanvasPdf /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in print_figure(self, outfile, dpi, facecolor, edgecolor, orientation, papertype) 1009 # Let's keep the usetex stuff seperate from the generic postscript 1010 self._print_figure_tex(outfile, dpi, facecolor, edgecolor, -> 1011 orientation, papertype) 1012 else: 1013 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation, papertype) 1243 elif rcParams['text.usetex']: 1244 if False: pass # for debugging -> 1245 else: gs_distill(tmpfile, ext=='.eps', ptype=papertype, bbox=bbox) 1246 1247 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in gs_distill(tmpfile, eps, ptype, bbox) 1341 exit_status = os.system(command) 1342 fh = file(outfile) -> 1343 if exit_status: raise RuntimeError('ghostscript was not able to process \ 1344 your image.\nHere is the full report generated by ghostscript:\n\n' + fh.read()) 1345 else: verbose.report(fh.read(), 'debug') RuntimeError: ghostscript was not able to process your image. Here is the full report generated by ghostscript: ESP Ghostscript 8.15 (2006年04月19日) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file COPYING for details. Nicolas
Eric Firing wrote: > Robert Cimrman wrote: >> Eric Firing wrote: >>> Robert and any other spy users: >>> >>> I have committed to svn a new axes method, spy3, that combines a >>> modification of the functionality of both spy and spy2. I hope you >>> can check it out. If it looks OK, then I would like to simply >>> replace spy and spy2 with this combined version. In that case the >>> pylab interface, which now gives access to spy and spy2, would have a >>> single spy function which would access the new version. My suspicion >>> is that spy is used almost entirely in interactive mode, and probably >>> not by very many people, so that this changeover can be made quickly >>> with little disruption to present users. >>> >>> Attached is a script illustrating the difference in the way spy3 >>> displays a matrix (it matches the way it is printed: first index is >>> row number, second is column number, row number increases down) >>> versus what spy and spy2 do (first index is X, second index is Y). >>> >>> Also attached is the diff for spy3. >>> >>> Users may want to comment in particular on the default for the >>> "aspect" kwarg. Presently it is set to "equal" so that the shape of >>> the plot is the shape of the array with square cells. This differs >>> from spy and spy2. The rationale is that it gives the best picture >>> of what the array looks like, including its shape. >> >> Thumbs up :), just add the sparse-full matrix switch to the imshow >> branch too, if possible. But I am happy with it as it is. > > The sparse-full difference only works with the plot mode; for an image > there is no alternative to providing a value for every pixel, so I don't > know of any way to optimize it for the case of sparse storage. A > polygon collection could be used to achieve the same result in this > case. I'm not sure it is a good idea, though, because there would be an > advantage of not converting to a regular array only in the case where > the array is so large that such a conversion would use a big chunk of > memory, and in that case the polygons probably would be less than > single-pixel size anyway, so one would be better off using the present > symbol-plotting mode. Yeah, I have tried to write it myself before I posted this message but found that it probably would not work well - nevertheless I asked :). What could be done, though, is to raise an exception explaining that sparse matrices and the image mode don't like each other; as it is, the function spy3 just dies on asarray (should be st. like asarray( Z.todense() )) In [1]:import numpy as nm In [2]:import scipy.sparse as sp In [3]:a = nm.array( [[0, 1], [0,1], [2,3]] ) In [4]:b = sp.csr_matrix( a ) In [5]:gca().spy3( b ) --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) /home/eldaran/<console> /usr/lib/python2.4/site-packages/matplotlib/axes.py in spy3(self, Z, precision, marker, markersize, aspect, **kwargs) 4377 """ 4378 if marker is None and markersize is None: -> 4379 Z = asarray(Z) 4380 if precision is None: mask = Z!=0. 4381 else: mask = absolute(Z)>precision /usr/lib/python2.4/site-packages/numarray/numarraycore.py in asarray(seq, type, typecode, dtype) 432 if isinstance(seq, _gen.NDArray) and type is None and typecode is None: 433 return seq --> 434 return array(seq, type=type, typecode=typecode, copy=0, dtype=dtype) 435 436 inputarray = asarray # Obsolete synonym /usr/lib/python2.4/site-packages/numarray/numarraycore.py in array(sequence, typecode, copy, savespace, type, shape, dtype) 415 if (hasattr(sequence,'__getitem__') 416 and hasattr(sequence,'__len__')): --> 417 return fromlist(sequence,type,shape) 418 419 ##SEQUENCE is a scalar or unhandleable /usr/lib/python2.4/site-packages/numarray/numarraycore.py in fromlist(seq, type, shape, check_overflow, typecode, dtype) 246 return arr 247 --> 248 if not len(seq) and type is None: 249 type = _nt.Long 250 /home/share/software/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py in __len__(self) 163 def __len__(self): 164 # return self.getnnz() --> 165 raise TypeError, "sparse matrix length is ambiguous; use getnnz()" \ 166 " or shape[0]" 167 > Anyway, I'm glad it works for you. Thanks for checking. Thanks for your fast help! r.
On Sunday 10 December 2006 21:14, Chuang wrote: > Hi there, > > I wanna plot two curves, and save to 2 different files. However, when I > used the following code, the 2nd file contains both the 2 curves. > > plot(X1,Y1) > savefig('file1.png') > plot(X2,Y2) > savefig('file2.png') > > It seems like the program memorize both of the two curves and save to > the 2nd file. How can I save only the 2nd curve in the 2nd file? Possibility #1: Create a new figure before the second plot >>>plot(x1,y1) >>>figure() >>>plot(x2,y2) Possibility #2: Clear the figure before the second plot >>>plot(x1,y1) >>>clf() >>>plot(x2,y2) Possibility #3: Force the current axes to refresh, by setting its "hold" property to "False" >>>plot(x1,y1) >>>gca().hold(False) >>>plot(x2,y2) Possibiltiy #4: Get familiar with the more pythonesque functions.
Hi there, I wanna plot two curves, and save to 2 different files. However, when I used the following code, the 2nd file contains both the 2 curves. plot(X1,Y1) savefig('file1.png') plot(X2,Y2) savefig('file2.png') It seems like the program memorize both of the two curves and save to the 2nd file. How can I save only the 2nd curve in the 2nd file? Thanks, CC
Looks like I've been able to help myself on this one. I'll post this here b/c others had asked about this in prior emails and I never saw an answer given. You can make your own custom legend by keeping the return values from each plot command: e.g. l1 = plot(<y1's stuff>) twinx() l2 = plot(<y2's stuff>) legend([l1,l2],['y1s tag','y2s tag']) works like a charm. HTH --b
Note: there is a type-o in the above email. "W/MacPorts, I've been able to get the TkAgg backend to work" should be "W/MacPython, I've been able to get the TkAgg backend to work"
Below is the last (or nearly so) message of a thread from last summer. I have now implemented option 3 in svn, so: If y is 2-D, plot(y) plots the columns of y against the row-index. If x is 1-D and y is 2-D, plot(x,y) plots the columns of y against x. (In this case, x can also be 2-D if it is a single column.) If x is 2-D and y is 1-D, plot(x,y) plots y against each successive column of x. (Again, y can also be a single column.) If x and y are both 2-D, plot(x,y) plots columns of y against the corresponding columns of x. They must have the same number of columns. All of this is consistent with Matlab, as far as I know. Apart from this compatibility aspect, the design tradeoff is between the appeal of plotting rows, on the grounds that they correspond to C storage order, versus the appeal of plotting columns, on the grounds that one tends to think of columns in a table as the natural vectors to be plotted. I don't think it makes much difference in efficiency; transposing is cheap in numpy. It is possible that plotting non-contiguous values triggers an additional array copy somewhere in the chain of operations. I have not tried to figure out whether it does, or what the time penalty would be if it does, but I strongly doubt it would be a noticeable fraction of the total plot generation time. The changes are only very lightly tested so far, so please look for bugs. Eric Mark Bakker wrote: > You are right, concerning your comment below. > That will work just fine, > Mark > > On 7/13/06, *Eric Firing* <ef...@ha... > <mailto:ef...@ha...>> wrote: > > > > But why is this better than the following? > > plot(Z[0,:], Z[1:,:]) > > The latter would accomplish the same, be completely consistent with > option 4, be completely explicit and unambiguous, require no more typing > than using a kwarg, require no extra logic in the plot code, and > require > no extra documentation for the plot command. > > Eric > > > > As you said, there will be many more opinions, > > > > Mark > > > > > > > > To summarize, the options seem to be: > > > > 1) Leave plot argument parsing alone. > > 2) Accept an Nx2 array in place of a pair of arguments > containing x > > and y. > > > > 3) Implement the Matlab model. > > 4) Implement the Matlab model, but taking rows instead of > columns in an > > X or Y array that is 2-D. > > > > I am open to arguments, but my preference is the Matlab > model. I don't > > think that the difference in native array storage order > matters much. > > It is more important to have the API at the plot method and > function > > level match the way people think. > > > > Eric
Hi, This mailing list is great---I've gotten a couple very useful replies from others in a very short time period. Thanks! And now, onto my next question. I need to construct a two-y-axis plot. I've found some hints on how to do this on the mailing archive (Subject: secondary y-axis, Date: 9/28/05). I've got the basics working, but have run into the same problem this prior post did: I want a legend that lists content from both the "left-hand-sided" plots and the "right-hand-sided" ones. It appears only one axis or the others data can appear in a legend. Is there anyway to merge the two axes into a single legend? Also, the mail archives I'm viewing look terrible: line breaks aren't in the usual place, things are presented with >'s in them (which would make sense if the line breaks were preserved, b/c they correspond to pieces of prior email content). I'm using Safari 2.0.4 w/Mac OS X 10.4.8. Do others see the same thing, and if the answer is yes, are folks satisfied with this state of affairs? Thanks, --b
belinda thom wrote: > Hi, > > I could've sworn I recently read about how to draw a line on a plot > in such a way that you see it regardless of what the axis ranges are. If you need horizontal or vertical lines specified in normalized coordinates (0 to 1 spans the axes) then you can use the Axes.axhline() and Axes.axvline() methods or their pylab function counterparts. There are also methods for specifying the length of the line in normalized coordinates and the position in data coordinates: axhspan() and axvspan(). See examples/axhspan.py for examples of both types using the pylab interface. Eric
Alan G Isaac wrote: > I assume there must be a reason for this:: > > >>> import pylab > >>> pylab.__version__ > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > AttributeError: 'module' object has no attribute '__version__' > > That has always bothered me. > But of course you can:: > > >>> import matplotlib > >>> matplotlib.__version__ > '0.87.7' After a little experimentation I have tentatively concluded that __version__ only gets imported if it is a package attribute--that is, if it is defined in __init__.py. Matplotlib is a package but pylab is just a module, so it does not seem to be possible to give it matplotlib's __version__. I could not find anything in the python documentation about this, though. Eric
Hi, I could've sworn I recently read about how to draw a line on a plot in such a way that you see it regardless of what the axis ranges are. Now that I need it, I can't find it anywhere. I'm not even sure what to search for. I suspect this is really trivial and hope some more advanced users can enlighten me. Thanks, --b
Hello, Regarding http://matplotlib.sourceforge.net/installing.html, there is some unreliable info. In particular, under the OS X topic, "Robery Kern has built an all-in-one installer which includes scipy, Numeric, numarray, matplotlib, ipython, VTK, MayaVi, PIL, the enthought tool suite and much more; see >MacEnthon." should be removed. Whoever maintains this page should make the appropriate change. On Dec 6, 2006, at 11:38 PM, Robert Kern wrote: > belinda thom wrote: >> I do not want to compile code myself unless absolutely necessary. I >> was wondering what was up with the "MacEnton" suite; clicking on the >> link described at the above web page informs me that the "MacEnthon" >> page does not exist. > > Umm, ignore it. It targetted a now-old Python distribution, and I > don't have > time to update it anymore. References recommending it should be > removed. > > -- > Robert Kern
In the process of creating a Cocoa app for scientific data acquisition, I've built an NSImageView subclass that displays an MPL figure in the Cocoa NSView hierarchy. It's based on the CocoaAgg backend code in MPL. There are also some subclasses that allow the use of Cocoa Bindings to supply the data, axis labels, and units for the figure. Finally, I've created an IB palette for adding one of the PlotView subclasses to a Cocoa app and setting its bindings in Interface Builder. For plotting data passed via NSData instances is converted to a numpy array via numpy.frombuffer using the PlotView's .dtype parameter as the array dtype (see the source for DataPlotView in PlotView.py). I think the ability to have such a powerful plotting library available from Cocoa with so few lines of code illustrates the huge power of the combination of Cocoa, PyObjC, and the many good Python libraries such as MPL. CocoaMPLPlotView requires PyObjc, numpy, and matplotlib. You can download a copy of the CocoaMPLPlotView and CocoaMPLPlotViewPalette source from http://fairhall-lab.physiol.washington.edu/~bwark/mpl/. I don't have time to provide support for these, but would love to hear if anyone finds them useful. Obviously if you have comments, bugs, or patches, I'd love to hear those as well. Happy coding. Thanks, Barry
Sorry John, I see this was fixed a while ago - I was still using 0.87.3 from the last Enthought edition. Now that there's a scipy installer, I should upgrade numpy/scipy/mpl to something more current. Gary R. Gary Ruben wrote: > While I think of it, I think the default zorder of legends should be > bigger so that, by default it overlays all plot lines and symbols. > > Gary R.
I assume there must be a reason for this:: >>> import pylab >>> pylab.__version__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute '__version__' That has always bothered me. But of course you can:: >>> import matplotlib >>> matplotlib.__version__ '0.87.7' hth, Alan Isaac
I didn't see it either. For questions like this, I recommend heading to the #python channel on irc.freenode.net. If you find out how, please post. josh On Fri, 8 Dec 2006, belinda thom wrote: > Hi, > > Perhaps I'm missing something really basic, but I can't figure out > how to query pylab as to what version it is (the usual import <foo>, > <foo>.__version doesn't work). > > Advice appreciated. > > --b > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi, Perhaps I'm missing something really basic, but I can't figure out how to query pylab as to what version it is (the usual import <foo>, <foo>.__version doesn't work). Advice appreciated. --b
Hi again, At http://matplotlib.sourceforge.net/installing.html under topic OS X: "All of the backends run on OS X. Chris Barker has built a binary package (fink users see below) for matplotlib which is hosted on pythonmac, and works with Agg, Wx and Tk; see the step-by-step instructions kindly provided by Michael Tobis." note that the step-by-step link leads to: Under revision. Please come back soon. ------ It is because I've had some installation troubles that I have been looking at the OS X install info so closely. For instance: originally I tried to use macports for all python site- packages-related installs (as well as using their python24). The ONLY backend that seems to work thru that route is WxAgg (http:// howdy.physics.nyu.edu/index.php/Numpy_For_Mac_Using_MacPython corroborates this). I was able to achieve results w/backend WxAgg and numerix Numeric. However, when I tried to change the toolbar to classic, WxAgg crapped out. W/MacPorts, I've been able to get the TkAgg backend to work, but _NOT_ with numerix set to Numeric. Success was only achieved w/TkAgg when numerix was set to Numpy. When I try the WXAgg backend (along w/ the pythonmac 2.6.3.3 wxPython dmg for python 2.4), a simple plot ([1,2,3]) craps out with: exceptions.MemoryError Traceback (most recent call last) <snip> ---> 63 self.bitmap = _convert_agg_to_wx_bitmap (self.get_renderer(), None) 64 if repaint: 65 self.gui_repaint() <snip> MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the wx.Bitmap
Yannick Copin wrote: > Hi, > > in a case similar to matplotlib-0.87.7/examples/contour_demo.py (figure > 4), would it be possible to merge to two colorbars (a continuous one > from imshow, a discrete one from contour) into a single colorbar? > Indeed, in that case, the two colorbars are mostly redundant. > > Cheers. Yes, lines can be superimposed on a continuous colorbar. The demo is not ideal; I was mainly showing that one could use two colorbars for two different things. I have changed the contourf_demo.py in svn to include an example of a merged colorbar. Maybe I will change contour_demo.py later to make it an illustration of having colorbars for completely different fields, so it won't look so pointless as it does now. Eric
Yannick Copin wrote: > Hi, > > running the simple test code: > > from pylab import * > X, Y = meshgrid(linspace(-3,3,11),linspace(-3,3,11)) > Z = randn(*X.shape) > lev = linspace(Z.min(),Z.max(),11)[1:-1] > contourf(X,Y,Z, lev, extend='both') > contour(X,Y,Z, lev, colors='k') > show() > > you will probably notice that the 'contourf' contours are not always > exactly the sames as the 'contour' contours. Why is it so? Don't contour > and contourf use the same contour constructor? The same overall routine is used for contour as for contourf, but the contour tracing operation is not identical. Tracing a filled contour is much more complicated--that is probably why it is so hard to find filled contour routines. I suspect that whoever wrote the original code we are using wrote the line contour version first, then had to add quite a bit of logic and code to get it to make filled contours. Now, you may be wondering why we can't simply use the boundary of the filled regions for the lines as well, to guarantee they are the same. The reason is that filled contour boundaries include cuts connecting inner and outer contours, and also inner boundaries (edges of masked regions--except when affected by a bug) and the outer boundaries of the domain). It might be possible to simply exclude those line segments from the line contours, but it is not clear to me that the effort would be well-spent. I think that the differences illustrated in your example will occur almost entirely in pathologically ambiguous cases, but it is also possible that they reflect actual bugs or shortcomings of the algorithms used. Understanding the logic and tracing the code path in the present cntr.c is difficult; I have tried but failed to figure out and correct the interior masked region bug in contourf. If a better core contour routine with a suitable license could be found and substituted for the present one, that would be very nice. I have searched many times without turning anything up. Eric
In past work I have not been able to get clipping to behave as I expected. Today I was trying to understand how to add a right-axis label and was using an example from the matplotlib site that set clip_on=False. It did not work. In looking at the code in method text() it appears that it checks for the existance of clip_on and not the value. So clip_on=False results in clipping but not specifying clip_on does not. Is this understanding correct and is it the intended behavior? If so, I can't see how the example could have worked. Also is there a standard, easy way to get a 2nd (right) axis label and ticks or does it have to be done manually? I found only the one example on the screenshots page where it is done with several text() method calls. -- David