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
(2) |
2
(5) |
3
(8) |
4
(6) |
5
(9) |
6
(7) |
7
(6) |
8
(10) |
9
(27) |
10
(7) |
11
(22) |
12
(13) |
13
(7) |
14
(4) |
15
(12) |
16
(32) |
17
(26) |
18
(14) |
19
(1) |
20
(11) |
21
(6) |
22
(11) |
23
(17) |
24
(18) |
25
(28) |
26
(11) |
27
(6) |
28
(1) |
29
(10) |
30
(12) |
|
|
|
|
jas...@cr... wrote: > Eric Firing wrote: >>>> Well, the easiest way is to build mpl from svn; a few minutes ago I >>>> added this capability to quiver, selectable with an "angles" kwarg. > > Eric, > > I tried just copying the quiver.py SVN version 6114 into my existing > matplotlib install and numpy 1.1.1. When running my example posted > earlier with the angles='xy' keyword added to the quiver call, I get the > following error: So do I. I'll have to track down the bug. Eric > > In [10]: show() > --------------------------------------------------------------------------- > <type 'exceptions.ValueError'> Traceback (most recent call last) > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py in > expose_event(self, widget, event) > 331 x, y, w, h = self.allocation > 332 self._pixmap_prepare (w, h) > --> 333 self._render_figure(self._pixmap, w, h) > 334 self._need_redraw = False > 335 > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py > in _render_figure(self, pixmap, width, height) > 73 def _render_figure(self, pixmap, width, height): > 74 if DEBUG: print 'FigureCanvasGTKAgg.render_figure' > ---> 75 FigureCanvasAgg.draw(self) > 76 if DEBUG: print 'FigureCanvasGTKAgg.render_figure > pixmap', pixmap > 77 #agg_to_gtk_drawable(pixmap, self.renderer._renderer, None) > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in > draw(self) > 259 > 260 self.renderer = self.get_renderer() > --> 261 self.figure.draw(self.renderer) > 262 > 263 def get_renderer(self): > > /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, > renderer) > 757 > 758 # render the axes > --> 759 for a in self.axes: a.draw(renderer) > 760 > 761 # render the figure text > > /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self, > renderer, inframe) > 1521 > 1522 for zorder, i, a in dsu: > -> 1523 a.draw(renderer) > 1524 > 1525 renderer.close_group('axes') > > /usr/lib/python2.5/site-packages/matplotlib/quiver.py in draw(self, > renderer) > 423 self._init() > 424 if self._new_UV or self.angles == 'xy': > --> 425 verts = self._make_verts(self.U, self.V) > 426 self.set_verts(verts, closed=False) > 427 self._new_UV = False > > /usr/lib/python2.5/site-packages/matplotlib/quiver.py in > _make_verts(self, U, V) > 483 else: > 484 theta = ma.asarray(self.angles*np.pi/180.0).filled(0) > --> 485 xy = (X+Y*1j) * np.exp(1j*theta)*self.width > 486 xy = xy[:,:,np.newaxis] > 487 XY = ma.concatenate((xy.real, xy.imag), axis=2) > > /usr/lib/python2.5/site-packages/numpy/ma/core.py in __mul__(self, other) > 1710 def __mul__(self, other): > 1711 "Multiply other by self, and return a new masked array." > -> 1712 return multiply(self, other) > 1713 # > 1714 def __div__(self, other): > > /usr/lib/python2.5/site-packages/numpy/ma/core.py in __call__(self, a, > b, *args, **kwargs) > 513 m = mask_or(getmask(a), getmask(b)) > 514 (d1, d2) = (get_data(a), get_data(b)) > --> 515 result = self.f(d1, d2, *args, > **kwargs).view(get_masked_subclass(a, b)) > 516 if result.size > 1: > 517 if m is not nomask: > > <type 'exceptions.ValueError'>: shape mismatch: objects cannot be > broadcast to a single shape > > > > Do you know if this is caused by trying to use the new quiver.py in > 0.98.3? Does my example before (copied below for convenience) work for > you? > > from pylab import * > > X,Y = meshgrid( arange(0,1,.2),arange(0,1,.2) ) > def yprime(x,y): > return 1 > > U,V = meshgrid([1]*len(X), [1]*len(Y)) > > figure() > Q = quiver(X,Y,U, V, angles='xy') > > # This is a solution to the differential equation y'=1, but it doesn't > # look like it because the slopes do not respect the aspect ratio of > # the plot. What should happen is the arrows should point along the > # line. > plot([0,1],[0,1]) > > axis([0,1,0,0.5]) > > title("Slope Field for $dy/dx=1$") > show() > > > Thanks, > > Jason >
Eric Firing wrote: >>> Well, the easiest way is to build mpl from svn; a few minutes ago I >>> added this capability to quiver, selectable with an "angles" kwarg. Eric, I tried just copying the quiver.py SVN version 6114 into my existing matplotlib install and numpy 1.1.1. When running my example posted earlier with the angles='xy' keyword added to the quiver call, I get the following error: In [10]: show() --------------------------------------------------------------------------- <type 'exceptions.ValueError'> Traceback (most recent call last) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py in expose_event(self, widget, event) 331 x, y, w, h = self.allocation 332 self._pixmap_prepare (w, h) --> 333 self._render_figure(self._pixmap, w, h) 334 self._need_redraw = False 335 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py in _render_figure(self, pixmap, width, height) 73 def _render_figure(self, pixmap, width, height): 74 if DEBUG: print 'FigureCanvasGTKAgg.render_figure' ---> 75 FigureCanvasAgg.draw(self) 76 if DEBUG: print 'FigureCanvasGTKAgg.render_figure pixmap', pixmap 77 #agg_to_gtk_drawable(pixmap, self.renderer._renderer, None) /usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in draw(self) 259 260 self.renderer = self.get_renderer() --> 261 self.figure.draw(self.renderer) 262 263 def get_renderer(self): /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer) 757 758 # render the axes --> 759 for a in self.axes: a.draw(renderer) 760 761 # render the figure text /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self, renderer, inframe) 1521 1522 for zorder, i, a in dsu: -> 1523 a.draw(renderer) 1524 1525 renderer.close_group('axes') /usr/lib/python2.5/site-packages/matplotlib/quiver.py in draw(self, renderer) 423 self._init() 424 if self._new_UV or self.angles == 'xy': --> 425 verts = self._make_verts(self.U, self.V) 426 self.set_verts(verts, closed=False) 427 self._new_UV = False /usr/lib/python2.5/site-packages/matplotlib/quiver.py in _make_verts(self, U, V) 483 else: 484 theta = ma.asarray(self.angles*np.pi/180.0).filled(0) --> 485 xy = (X+Y*1j) * np.exp(1j*theta)*self.width 486 xy = xy[:,:,np.newaxis] 487 XY = ma.concatenate((xy.real, xy.imag), axis=2) /usr/lib/python2.5/site-packages/numpy/ma/core.py in __mul__(self, other) 1710 def __mul__(self, other): 1711 "Multiply other by self, and return a new masked array." -> 1712 return multiply(self, other) 1713 # 1714 def __div__(self, other): /usr/lib/python2.5/site-packages/numpy/ma/core.py in __call__(self, a, b, *args, **kwargs) 513 m = mask_or(getmask(a), getmask(b)) 514 (d1, d2) = (get_data(a), get_data(b)) --> 515 result = self.f(d1, d2, *args, **kwargs).view(get_masked_subclass(a, b)) 516 if result.size > 1: 517 if m is not nomask: <type 'exceptions.ValueError'>: shape mismatch: objects cannot be broadcast to a single shape Do you know if this is caused by trying to use the new quiver.py in 0.98.3? Does my example before (copied below for convenience) work for you? from pylab import * X,Y = meshgrid( arange(0,1,.2),arange(0,1,.2) ) def yprime(x,y): return 1 U,V = meshgrid([1]*len(X), [1]*len(Y)) figure() Q = quiver(X,Y,U, V, angles='xy') # This is a solution to the differential equation y'=1, but it doesn't # look like it because the slopes do not respect the aspect ratio of # the plot. What should happen is the arrows should point along the # line. plot([0,1],[0,1]) axis([0,1,0,0.5]) title("Slope Field for $dy/dx=1$") show() Thanks, Jason
jas...@cr... wrote: > Eric Firing wrote: >>>> Well, the easiest way is to build mpl from svn; a few minutes ago I >>>> added this capability to quiver, selectable with an "angles" kwarg. > > Eric, > > I tried just copying the quiver.py SVN version 6114 into my existing > matplotlib install and numpy 1.1.1. When running my example posted > earlier with the angles='xy' keyword added to the quiver call, I get the > following error: Fixed in svn 6115. Sorry I didn't catch it initially. It was a pretty basic bug. Eric > > In [10]: show() > --------------------------------------------------------------------------- > <type 'exceptions.ValueError'> Traceback (most recent call last) > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py in > expose_event(self, widget, event) > 331 x, y, w, h = self.allocation > 332 self._pixmap_prepare (w, h) > --> 333 self._render_figure(self._pixmap, w, h) > 334 self._need_redraw = False > 335 > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py > in _render_figure(self, pixmap, width, height) > 73 def _render_figure(self, pixmap, width, height): > 74 if DEBUG: print 'FigureCanvasGTKAgg.render_figure' > ---> 75 FigureCanvasAgg.draw(self) > 76 if DEBUG: print 'FigureCanvasGTKAgg.render_figure > pixmap', pixmap > 77 #agg_to_gtk_drawable(pixmap, self.renderer._renderer, None) > > /usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in > draw(self) > 259 > 260 self.renderer = self.get_renderer() > --> 261 self.figure.draw(self.renderer) > 262 > 263 def get_renderer(self): > > /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, > renderer) > 757 > 758 # render the axes > --> 759 for a in self.axes: a.draw(renderer) > 760 > 761 # render the figure text > > /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self, > renderer, inframe) > 1521 > 1522 for zorder, i, a in dsu: > -> 1523 a.draw(renderer) > 1524 > 1525 renderer.close_group('axes') > > /usr/lib/python2.5/site-packages/matplotlib/quiver.py in draw(self, > renderer) > 423 self._init() > 424 if self._new_UV or self.angles == 'xy': > --> 425 verts = self._make_verts(self.U, self.V) > 426 self.set_verts(verts, closed=False) > 427 self._new_UV = False > > /usr/lib/python2.5/site-packages/matplotlib/quiver.py in > _make_verts(self, U, V) > 483 else: > 484 theta = ma.asarray(self.angles*np.pi/180.0).filled(0) > --> 485 xy = (X+Y*1j) * np.exp(1j*theta)*self.width > 486 xy = xy[:,:,np.newaxis] > 487 XY = ma.concatenate((xy.real, xy.imag), axis=2) > > /usr/lib/python2.5/site-packages/numpy/ma/core.py in __mul__(self, other) > 1710 def __mul__(self, other): > 1711 "Multiply other by self, and return a new masked array." > -> 1712 return multiply(self, other) > 1713 # > 1714 def __div__(self, other): > > /usr/lib/python2.5/site-packages/numpy/ma/core.py in __call__(self, a, > b, *args, **kwargs) > 513 m = mask_or(getmask(a), getmask(b)) > 514 (d1, d2) = (get_data(a), get_data(b)) > --> 515 result = self.f(d1, d2, *args, > **kwargs).view(get_masked_subclass(a, b)) > 516 if result.size > 1: > 517 if m is not nomask: > > <type 'exceptions.ValueError'>: shape mismatch: objects cannot be > broadcast to a single shape > > > > Do you know if this is caused by trying to use the new quiver.py in > 0.98.3? Does my example before (copied below for convenience) work for > you? > > from pylab import * > > X,Y = meshgrid( arange(0,1,.2),arange(0,1,.2) ) > def yprime(x,y): > return 1 > > U,V = meshgrid([1]*len(X), [1]*len(Y)) > > figure() > Q = quiver(X,Y,U, V, angles='xy') > > # This is a solution to the differential equation y'=1, but it doesn't > # look like it because the slopes do not respect the aspect ratio of > # the plot. What should happen is the arrows should point along the > # line. > plot([0,1],[0,1]) > > axis([0,1,0,0.5]) > > title("Slope Field for $dy/dx=1$") > show() > > > Thanks, > > Jason >
Hi, I would really like to use matplot lib, however I am having big problems as I try to do this on OSX 10.5. if there is someone how could give a detailed explination of how to get rid of the preinstalled python that is apparently rubbish and then how to install a new python version that would really help me. I am completely lost in a world of eggs etc. Bryn P.S. here is my particular compilation problem. Is there a simple solution so that I can code my first graph today? salvatella02:Downloads rbf$ sudo easy_install matplotlib-0.98.3-py2.5-macosx-10.3.egg Password: Processing matplotlib-0.98.3-py2.5-macosx-10.3.egg removing '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg' (and everything under it) creating /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg Extracting matplotlib-0.98.3-py2.5-macosx-10.3.egg to /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages Adding matplotlib 0.98.3 to easy-install.pth file Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg Processing dependencies for matplotlib==0.98.3 Searching for matplotlib==0.98.3 Reading http://pypi.python.org/simple/matplotlib/ Reading http://matplotlib.sourceforge.net Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194 Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Reading http://sourceforge.net/project/showfiles.php?group_id=80706 Best match: matplotlib 0.98.3 Downloading http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.3.tar.gz?modtime=1217773039&big_mirror=0 Processing matplotlib-0.98.3.tar.gz Running matplotlib-0.98.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JGl_1Z/matplotlib-0.98.3/egg-dist-tmp-T6PVvy ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.98.3 python: 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] platform: darwin REQUIRED DEPENDENCIES numpy: 1.1.1 freetype2: found, but unknown version (no pkg-config) OPTIONAL BACKEND DEPENDENCIES libpng: found, but unknown version (no pkg-config) Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: no * wxPython not found Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Qt: no Qt4: no Cairo: no OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: 1.9 ghostscript: 8.57 latex: 3.141592 EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: no [Edit setup.cfg to suppress the above messages] ============================================================================ warning: no files found matching 'NUMARRAY_ISSUES' warning: no files found matching 'MANIFEST' warning: no files found matching 'matplotlibrc' warning: no files found matching 'makeswig.py' warning: no files found matching 'examples/data/*' warning: no files found matching 'lib/mpl_toolkits' warning: no files found matching '*' under directory 'examples' warning: no files found matching '*' under directory 'swig' gcc: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: warning: unrecognized command line option "-Wno-long-double" error: Setup script exited with error: command 'gcc' failed with exit status 1 Exception exceptions.OSError: (2, 'No such file or directory', 'src/image.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1bb48a0>> ignored Exception exceptions.OSError: (2, 'No such file or directory', 'src/path.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1bb4080>> ignored Exception exceptions.OSError: (2, 'No such file or directory', 'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x1bb43c8>> ignored
jas...@cr... wrote: > Eric Firing wrote: >> Jason, >> >>> In looking at the basemap examples (specifically quiver_demo.py), it >>> looks like you specifically rotate the vectors to match up with map >>> coordinates; is that right? Applying to the situation above, do I need >> Yes. >>> to rotate my vectors to respect the aspect ratio? What's the easiest >>> way to get quiver(X,Y,U,V) to behave so that the vectors plotted >>> would, for each coordinate (x,y) and corresponding (u,v), be parallel >>> to the vector between (x,y) and (x+u, y+v) (where (x, y) and (u,v) >>> are taken as coordinates in the axis coordinate system). >> Well, the easiest way is to build mpl from svn; a few minutes ago I >> added this capability to quiver, selectable with an "angles" kwarg. > > Thanks! > > I'm working with matplotlib in Sage, so I'll probably update the > matplotlib package in Sage if it is fairly stable. Do you know when the > next release of matplotlib will be, in case it isn't stable for me? No, as far as I know there is no release schedule. The last one, 0.98.3, was not very long ago--early August--so I would not expect another until a couple more months have elapsed. But I could be wrong about that. Eric
Eric Firing wrote: > Jason, > >> >> In looking at the basemap examples (specifically quiver_demo.py), it >> looks like you specifically rotate the vectors to match up with map >> coordinates; is that right? Applying to the situation above, do I need > Yes. >> to rotate my vectors to respect the aspect ratio? What's the easiest >> way to get quiver(X,Y,U,V) to behave so that the vectors plotted >> would, for each coordinate (x,y) and corresponding (u,v), be parallel >> to the vector between (x,y) and (x+u, y+v) (where (x, y) and (u,v) >> are taken as coordinates in the axis coordinate system). > > Well, the easiest way is to build mpl from svn; a few minutes ago I > added this capability to quiver, selectable with an "angles" kwarg. Thanks! I'm working with matplotlib in Sage, so I'll probably update the matplotlib package in Sage if it is fairly stable. Do you know when the next release of matplotlib will be, in case it isn't stable for me? P.S. Sorry for the duplicate messages to you, Eric. I keep hitting reply instead of reply-all. Jason
Tanks, Michael. Maybe I'll try to build from SVN this weekend. Goyo El jue, 18-09-2008 a las 09:31 -0400, Michael Droettboom escribió: > Proper NaN handling has been a long and winding road. > > This particuar bug you're running into was fixed about a week *after* > the 0.98.3 release. Here's the patch: > > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=rev&revision=6018 > > So SVN trunk currently works. The patch against 0.98.3 is non-trivial > -- there were actually many changes throughout the code to make all this > work, so there isn't an easy workaround, and in any case requires a > recompile. > > If you can build from SVN, that's what I would suggest -- otherwise wait > for the 0.98.4 release (I don't believe we have an ETA on that, yet). > > Cheers, > Mike > > Goyo wrote: > > I'm having trouble plotting data with NaN values. My plot has lines and > > markers and usually both are skipped for NaN values. But when I have > > more than 127 data a line is drawn from the last non-NaN to the next. > > > > I read somewhere about a similar issue (maybe here? sorry I can't find > > it just now), it seems like it has to do with some optimization > > performed for large datasets and the use if lineto instead of moveto or > > something like that. It was supposed to be fixed in 0.98.2 but I'm using > > 0.98.3 from Benjamin Drung's PPA (http://ppa.launchpad.net/bdrung). > > > > This code shows the difference between plotting 127 and 128 data (look > > at the left of each figure): > > > > import pylab as pl > > x = pl.random(128) > > x[4:7] = pl.NaN > > y = x[:-1] > > pl.figure(1) > > pl.plot(x, '-o') > > pl.grid(True) > > pl.figure(2) > > pl.plot(y, '-o') > > pl.grid(True) > > pl.show() > > > > Is this a known issue? Is there any workaround? > > > > Thanks > > > > Goyo > > > > > > ------------------------------------------------------------------------- > > 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 > > >
First off, in rereading my message, it sounded more abrasive than I intended. I should have asked more questions and complained less; sorry. Eric Firing wrote: > jas...@cr... wrote: > >> >> Is there an easy way to get a correct quiver plot (i.e., correct >> slopes) now if the aspect ratio is not 1? > > Please provide a script that illustrates what you think is the > problem. Exactly what is it that you want to do, and don't know how > to do with quiver as it is? One application I'd like to use it for is direction field plots for first order linear differential equations (i.e., y' = some function of x and y). Given the function y'(x,y), I plot a quiver where U is a vector of ones and V is a vector of y'(corresponding x and y coordinates), so for the arrow based at point (x,y), the arrow has slope corresponding to the slope of the solution that passes through (x,y). However, when the aspect ratio is not one, a solution will have a different slope (because the slope is measured in coordinates corresponding to the axes) than the slope of the arrow. Here is a small example, modified from the quiver examples in matplotlib. from pylab import * X,Y = meshgrid( arange(0,1,.2),arange(0,1,.2) ) def yprime(x,y): return 1 U,V = meshgrid([1]*len(X), [1]*len(Y)) figure() Q = quiver(X,Y,U, V) # This is a solution to the differential equation y'=1, but it doesn't # look like it because the slopes do not respect the aspect ratio of # the plot. What should happen is the arrows should point along the # line. plot([0,1],[0,1]) axis([0,1,0,0.5]) title("Slope Field for $dy/dx=1$") show() In looking at the basemap examples (specifically quiver_demo.py), it looks like you specifically rotate the vectors to match up with map coordinates; is that right? Applying to the situation above, do I need to rotate my vectors to respect the aspect ratio? What's the easiest way to get quiver(X,Y,U,V) to behave so that the vectors plotted would, for each coordinate (x,y) and corresponding (u,v), be parallel to the vector between (x,y) and (x+u, y+v) (where (x, y) and (u,v) are taken as coordinates in the axis coordinate system). Please let me know if I'm not clear in what I'm asking. Thanks, Jason > > Note that you have full control over U and V; you can make the arrows > point any direction you want, and be any length you want. And you can > locate them anywhere you want. > > Basemap illustrates how quiver can be used with curvilinear > coordinates; the U and V are adjusted to align the arrows with the > coordinates. > > It is possible that quiver needs more modification to work properly > and flexibly with the new transforms implementation; in fact I know of > a bug that this introduced, and I will commit a correction shortly. > I have not looked into quiver behavior with transforms-based > projections. They might indeed call for a design change. > > Eric > >
Jeff, No the example doesn't show that line If I reduce the amount of data, the border will be on every side of the plot I'll show you an orthographic plot with no maskinf tomorrow and you will see the problem easily, it wraps in a white line along the 0° meridian and a white circle in the pole I think it's the imshow layer that is not totally transparent on the map background.. I tried every trick I could for example to put some zero-valued points on each corner to make imshow interpolate correctly the sides, but that doesn't make any difference >De Pauw Antoine wrote: >> Jeff, >> >> Yes they disappear, and they fluctuate with the interpolation method used >> >> For example, nearest interpolation don't show the line >> >> Also, if I reduce the grid resolution, the line is thicker, and if I use a >> masked array to get rid of undesired values, the border shows really >> strongly >> >> Here's an example everyone will see: >> >> http://img225.imageshack.us/img225/2671/testfigep2.png >> >> (everything except the clouds is noise) >> >> Antoine De Pauw >> Collaborateur de recherches, Informatique - Research collaborator, IT >> Laboratoire de chimie quantique et photophysique - Quantum chemistry and >> photophysics laboratory >> Université Libre de Bruxelles - ULB >> > >Antoine: Sorry to seem dense, but I don't see anything wrong with that >plot. I see a white border along the north and south pole, but I >intrepret that to be missing values. However, my eyes are notoriously >bad. I'd like to be to run a script that generates the artifacts >myself, so I can zoom in and see the problem myself. Does the >griddata_demo.py script show the same problem for you? > >-Jeff >> >> -----Original Message----- >> From: Jeff Whitaker [mailto:js...@fa...] >> Sent: mercredi 17 septembre 2008 19:05 >> To: John Hunter >> Cc: De Pauw Antoine; Matplotlib Users >> Subject: Re: [Matplotlib-users] Information request >> >> John Hunter wrote: >> >>> On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> wrote: >>> >>> >>> >>>> Attached is a screenshot (zoom.png) from the gimp, zoomed in near the >>>> axes border. The black horizontal line is the top axes border, the >>>> horizontal grey line is the artifact, the vertical dashed line is a >>>> grid line. I don't know if this offers a clue, but if you look at a >>>> zoom in the upper right corner, the grey line seems to break up and >>>> curve down and to the right (corner.png) >>>> >>>> >>> Sorry, screwed up corner.png (I attached the original and not the >>> screenshot). The correct screenshot is attached >>> >>> >>> >>> >> >> John: OK, now I finally see it. Antoine: Do these artifacts >> disappear if you comment out the imshow call? >> >> -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 > > >
De Pauw Antoine wrote: > Jeff, > > Yes they disappear, and they fluctuate with the interpolation method used > > For example, nearest interpolation don't show the line > > Also, if I reduce the grid resolution, the line is thicker, and if I use a > masked array to get rid of undesired values, the border shows really > strongly > > Here's an example everyone will see: > > http://img225.imageshack.us/img225/2671/testfigep2.png > > (everything except the clouds is noise) > > Antoine De Pauw > Collaborateur de recherches, Informatique - Research collaborator, IT > Laboratoire de chimie quantique et photophysique - Quantum chemistry and > photophysics laboratory > Université Libre de Bruxelles - ULB > Antoine: Sorry to seem dense, but I don't see anything wrong with that plot. I see a white border along the north and south pole, but I intrepret that to be missing values. However, my eyes are notoriously bad. I'd like to be to run a script that generates the artifacts myself, so I can zoom in and see the problem myself. Does the griddata_demo.py script show the same problem for you? -Jeff > > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: mercredi 17 septembre 2008 19:05 > To: John Hunter > Cc: De Pauw Antoine; Matplotlib Users > Subject: Re: [Matplotlib-users] Information request > > John Hunter wrote: > >> On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> wrote: >> >> >> >>> Attached is a screenshot (zoom.png) from the gimp, zoomed in near the >>> axes border. The black horizontal line is the top axes border, the >>> horizontal grey line is the artifact, the vertical dashed line is a >>> grid line. I don't know if this offers a clue, but if you look at a >>> zoom in the upper right corner, the grey line seems to break up and >>> curve down and to the right (corner.png) >>> >>> >> Sorry, screwed up corner.png (I attached the original and not the >> screenshot). The correct screenshot is attached >> >> >> >> > > John: OK, now I finally see it. Antoine: Do these artifacts > disappear if you comment out the imshow call? > > -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
Proper NaN handling has been a long and winding road. This particuar bug you're running into was fixed about a week *after* the 0.98.3 release. Here's the patch: http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=rev&revision=6018 So SVN trunk currently works. The patch against 0.98.3 is non-trivial -- there were actually many changes throughout the code to make all this work, so there isn't an easy workaround, and in any case requires a recompile. If you can build from SVN, that's what I would suggest -- otherwise wait for the 0.98.4 release (I don't believe we have an ETA on that, yet). Cheers, Mike Goyo wrote: > I'm having trouble plotting data with NaN values. My plot has lines and > markers and usually both are skipped for NaN values. But when I have > more than 127 data a line is drawn from the last non-NaN to the next. > > I read somewhere about a similar issue (maybe here? sorry I can't find > it just now), it seems like it has to do with some optimization > performed for large datasets and the use if lineto instead of moveto or > something like that. It was supposed to be fixed in 0.98.2 but I'm using > 0.98.3 from Benjamin Drung's PPA (http://ppa.launchpad.net/bdrung). > > This code shows the difference between plotting 127 and 128 data (look > at the left of each figure): > > import pylab as pl > x = pl.random(128) > x[4:7] = pl.NaN > y = x[:-1] > pl.figure(1) > pl.plot(x, '-o') > pl.grid(True) > pl.figure(2) > pl.plot(y, '-o') > pl.grid(True) > pl.show() > > Is this a known issue? Is there any workaround? > > Thanks > > Goyo > > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
I worked around this using masked arrays from numpy.ma. import numpy.ma as ma import pylab as pl import numpy as np x = ... x = ma.masked_where(np.isnan(x), x) pl.plot(x) pl.show() On Wed, Sep 17, 2008 at 6:36 PM, Goyo <goy...@gm...> wrote: > I'm having trouble plotting data with NaN values. My plot has lines and > markers and usually both are skipped for NaN values. But when I have > more than 127 data a line is drawn from the last non-NaN to the next. > > I read somewhere about a similar issue (maybe here? sorry I can't find > it just now), it seems like it has to do with some optimization > performed for large datasets and the use if lineto instead of moveto or > something like that. It was supposed to be fixed in 0.98.2 but I'm using > 0.98.3 from Benjamin Drung's PPA (http://ppa.launchpad.net/bdrung). > > This code shows the difference between plotting 127 and 128 data (look > at the left of each figure): > > import pylab as pl > x = pl.random(128) > x[4:7] = pl.NaN > y = x[:-1] > pl.figure(1) > pl.plot(x, '-o') > pl.grid(True) > pl.figure(2) > pl.plot(y, '-o') > pl.grid(True) > pl.show() > > Is this a known issue? Is there any workaround? > > Thanks > > Goyo > > > ------------------------------------------------------------------------- > 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 >
Can you show us what you've tried thus far? This is a rather open-ended question... Cheers, Mike Ryan Pavlovicz wrote: > Hi. I'd like to add a filled area on my graph to denote the standard > deviation from an average. Additionally, i'd prefer the fill to be a > diagonal hatch. Reading online, i found that there is a 'Rectangle' > class, but i can't get this to work. Can someone suggest a good way > to get the results i'm looking for? Thanks! > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
It seems you're getting bitten by the brain-dead interpolation of points (which is meant to draw line segments as curves that follow the radii). I have fixed the polar drawing code in SVN r6106 to normalize theta to (0.0 <= theta <= 2pi) before doing the interpolation, which seems to fix your example. The user doesn't/shouldn't have to care about whether theta is negative. Cheers, Mike jan gillis wrote: > Hi Tony, > > Thank you for the reply, the solutions you propose are fine in this > case. But I'm trying to use the polar plot > as a smith chart for an instrument and there i will receive data that is > unknown but can be something like this: > > r = np.transpose(.1+np.arange ( 0 , 0.7 , 0.001)) > theta = -4.5 * np.pi *r > freq = r*10e9 > data = np.multiply(r,np.exp(1j*theta)) > ax.plot(angle(data),abs(data)) > > Any idea why Polar plot can't handle theta going from negative to > positive radians? > > Jan > > Tony S Yu wrote: > >> On Sep 17, 2008, at 1:59 AM, jan gillis wrote: >> >> >>> Hello, >>> >>> I have a problem with polar plot, if i run the following code in >>> matplotlib 0.98.3, polar plot is drawing a extra circle to go from >>> angle -3.14159265 to angle 3.03753126. Is there a solution for this >>> problem? >>> >>> ******************** >>> import numpy as np >>> from matplotlib.pyplot import figure, show, rc, grid >>> >>> # radar green, solid grid lines >>> rc('grid', color='#316931', linewidth=1, linestyle='-') >>> rc('xtick', labelsize=15) >>> rc('ytick', labelsize=15) >>> >>> # force square figure and square axes looks better for polar, IMO >>> fig = figure(figsize=(8,8)) >>> ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') >>> >>> z = np.zeros((1,2000),complex) >>> z.real = 0.2 >>> z.imag = np.arange(-50,50,0.05) >>> gamma_r = np.transpose((z-1)/(z+1)) >>> >>> ax.plot(np.angle(gamma_r), np.abs(gamma_r), '.-', zorder=0) >>> >> Hi Jan, >> >> It looks like you get the circle because the angles you're plotting go >> from negative to positive radians in a weird way. The circle being >> drawn starts around 0 radians and goes clockwise by negative values. >> Then when it gets to - pi, it switches to positive indices, i.e. pi. >> Of course, these are the same points on a polar plot, but different >> angles, if you want to be consistent. >> >> Here are a couple of quick solutions, but there but there maybe better >> ways of handling this. >> >> # ~~~~~~~~~~~~~~~~~~ >> # get rid of the plot line above, and add the following >> theta = np.angle(gamma_r) >> mag = np.abs(gamma_r) >> >> # option 1 >> ordered = np.argsort(theta, axis=0).squeeze() >> ax.plot(theta[ordered], mag[ordered], '.-', zorder=0) >> >> # option 2 >> neg_theta = np.where(theta < 0) >> theta[neg_theta] += 2 * np.pi >> ax.plot(theta, mag, '.-', zorder=0) >> # ~~~~~~~~~~~~~~~~~~ >> >> I hope that's helpful, >> -Tony >> >> >>> ax.set_rmax(2.0) >>> grid(True) >>> >>> show() >>> >>> ******************** >>> Kind regards, >>> Jean >>> >>> >>> ------------------------------------------------------------------------- >>> >>> 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 >>> >> > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On Mon, Sep 15, 2008 at 1:51 PM, Mathieu Dubois <mat...@li...> wrote: > Hi, > > I'm a (still) beginner in scipy and I have a small problem with figures. > Let me > explain. > > I have to plot a lot of huge data so I have a lot of figures. I have set > title and axes names. All the handles are in a list (the list can vary > at run time according to the user input). > > My goal is to save the figures (with savefig()). For this I want to > write a loop which look like this: > for fig in fig_list > figure(fig) # Select current figure > savefig('%s.png' % fig.title, format='png') # Save it as 'title'.png > > The problem is well explained in a previous message: > http://sourceforge.net/mailarchive/message.php?msg_id=a7f1ef730709101012o20abd37aj116e100d9b105d52%40mail.gmail.com > but nobody has answered to this post. > The matplotlib figure is contained in a FigureCanvas which is contained in a FigureManager, and the manager has a method to set the window title: fig.canvas.manager.set_window_title('some title') unfortunately, there is no method provided to *get* the window title for reuse later by savefig (we need to add it). You can, however, use the figure label (all matplotlib artists from lines, to text, to the axes to the figure have a label property. So something like this should work import matplotlib.pyplot as plt fig = plt.figure() title = 'some title' fig.set_label(title) fig.canvas.manager.set_window_title(title) and later: fig.savefig(fig.get_label()) Hope this helps, JDH
Hi everyone, Sorry for the delayed response. Thank you very much everyone for the help. Maybe it would be a good idea to add a 'window_title' keyword to figure() (à la matlab ;). kind regards, Mathieu Jae-Joon Lee wrote: >> Kind of awkward, but >> >> fig.canvas.manager.window.wm_title() >> >> > > I guess this is backend dependent. In my Gtk backend, I don't have > such a method. But I found fig.canvas.manager.window.get_title(). > Thanks! > > -JJ > > ------------------------------------------------------------------------- > 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 >
Jeff, Yes they disappear, and they fluctuate with the interpolation method used For example, nearest interpolation don't show the line Also, if I reduce the grid resolution, the line is thicker, and if I use a masked array to get rid of undesired values, the border shows really strongly Here's an example everyone will see: http://img225.imageshack.us/img225/2671/testfigep2.png (everything except the clouds is noise) Antoine De Pauw Collaborateur de recherches, Informatique - Research collaborator, IT Laboratoire de chimie quantique et photophysique - Quantum chemistry and photophysics laboratory Université Libre de Bruxelles - ULB -----Original Message----- From: Jeff Whitaker [mailto:js...@fa...] Sent: mercredi 17 septembre 2008 19:05 To: John Hunter Cc: De Pauw Antoine; Matplotlib Users Subject: Re: [Matplotlib-users] Information request John Hunter wrote: > On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> wrote: > > >> Attached is a screenshot (zoom.png) from the gimp, zoomed in near the >> axes border. The black horizontal line is the top axes border, the >> horizontal grey line is the artifact, the vertical dashed line is a >> grid line. I don't know if this offers a clue, but if you look at a >> zoom in the upper right corner, the grey line seems to break up and >> curve down and to the right (corner.png) >> > > Sorry, screwed up corner.png (I attached the original and not the > screenshot). The correct screenshot is attached > > > John: OK, now I finally see it. Antoine: Do these artifacts disappear if you comment out the imshow call? -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
jas...@cr... wrote: > Recently I noticed that the quiver plots all make the arrows as if the > plot had aspect ratio 1. See, for example, the documentation for quiver: > > In all cases the arrow aspect ratio is 1, so that if *U*==*V* the > angle of the arrow on the plot is 45 degrees CCW from the *x*-axis. > > > This seems to make the plot pretty useless if the aspect ratio is not 1, > since then the slopes of the arrows do not match up with the coordinate > axes. What is the reason for this design decision? Does it have to do > with the arrows distorting if the aspect ratio is not 1? At one time, No, the design suits my applications: I want to plot arrows indicating ocean current vectors as a function of position in the horizontal, or as a function of depth and time. But I don't think the design is limiting. See below. > there was talk of adding a line version of quiver (as opposed to the > patch version there now). See > http://article.gmane.org/gmane.comp.python.matplotlib.devel/1885. Has > that happened? I suppose a line version would allow different aspect > ratios. No, in this respect it would be no different. And no, a line version has not been added. > > Is there an easy way to get a correct quiver plot (i.e., correct slopes) > now if the aspect ratio is not 1? Please provide a script that illustrates what you think is the problem. Exactly what is it that you want to do, and don't know how to do with quiver as it is? Note that you have full control over U and V; you can make the arrows point any direction you want, and be any length you want. And you can locate them anywhere you want. Basemap illustrates how quiver can be used with curvilinear coordinates; the U and V are adjusted to align the arrows with the coordinates. It is possible that quiver needs more modification to work properly and flexibly with the new transforms implementation; in fact I know of a bug that this introduced, and I will commit a correction shortly. I have not looked into quiver behavior with transforms-based projections. They might indeed call for a design change. Eric
Hi Tony, Thank you for the reply, the solutions you propose are fine in this case. But I'm trying to use the polar plot as a smith chart for an instrument and there i will receive data that is unknown but can be something like this: r = np.transpose(.1+np.arange ( 0 , 0.7 , 0.001)) theta = -4.5 * np.pi *r freq = r*10e9 data = np.multiply(r,np.exp(1j*theta)) ax.plot(angle(data),abs(data)) Any idea why Polar plot can't handle theta going from negative to positive radians? Jan Tony S Yu wrote: > > On Sep 17, 2008, at 1:59 AM, jan gillis wrote: > >> Hello, >> >> I have a problem with polar plot, if i run the following code in >> matplotlib 0.98.3, polar plot is drawing a extra circle to go from >> angle -3.14159265 to angle 3.03753126. Is there a solution for this >> problem? >> >> ******************** >> import numpy as np >> from matplotlib.pyplot import figure, show, rc, grid >> >> # radar green, solid grid lines >> rc('grid', color='#316931', linewidth=1, linestyle='-') >> rc('xtick', labelsize=15) >> rc('ytick', labelsize=15) >> >> # force square figure and square axes looks better for polar, IMO >> fig = figure(figsize=(8,8)) >> ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') >> >> z = np.zeros((1,2000),complex) >> z.real = 0.2 >> z.imag = np.arange(-50,50,0.05) >> gamma_r = np.transpose((z-1)/(z+1)) >> >> ax.plot(np.angle(gamma_r), np.abs(gamma_r), '.-', zorder=0) > > Hi Jan, > > It looks like you get the circle because the angles you're plotting go > from negative to positive radians in a weird way. The circle being > drawn starts around 0 radians and goes clockwise by negative values. > Then when it gets to - pi, it switches to positive indices, i.e. pi. > Of course, these are the same points on a polar plot, but different > angles, if you want to be consistent. > > Here are a couple of quick solutions, but there but there maybe better > ways of handling this. > > # ~~~~~~~~~~~~~~~~~~ > # get rid of the plot line above, and add the following > theta = np.angle(gamma_r) > mag = np.abs(gamma_r) > > # option 1 > ordered = np.argsort(theta, axis=0).squeeze() > ax.plot(theta[ordered], mag[ordered], '.-', zorder=0) > > # option 2 > neg_theta = np.where(theta < 0) > theta[neg_theta] += 2 * np.pi > ax.plot(theta, mag, '.-', zorder=0) > # ~~~~~~~~~~~~~~~~~~ > > I hope that's helpful, > -Tony > >> >> ax.set_rmax(2.0) >> grid(True) >> >> show() >> >> ******************** >> Kind regards, >> Jean >> >> >> ------------------------------------------------------------------------- >> >> 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 > >
Recently I noticed that the quiver plots all make the arrows as if the plot had aspect ratio 1. See, for example, the documentation for quiver: In all cases the arrow aspect ratio is 1, so that if *U*==*V* the angle of the arrow on the plot is 45 degrees CCW from the *x*-axis. This seems to make the plot pretty useless if the aspect ratio is not 1, since then the slopes of the arrows do not match up with the coordinate axes. What is the reason for this design decision? Does it have to do with the arrows distorting if the aspect ratio is not 1? At one time, there was talk of adding a line version of quiver (as opposed to the patch version there now). See http://article.gmane.org/gmane.comp.python.matplotlib.devel/1885. Has that happened? I suppose a line version would allow different aspect ratios. Is there an easy way to get a correct quiver plot (i.e., correct slopes) now if the aspect ratio is not 1? Thanks, Jason
Adjusting a physical size of the axes is a bit tricky in matplotlib, as the axes has an fixed position in normalized figure coordinate. But, I guess setting the axes aspect ratio in physical size is doable relatively easily, at least if your x,y axis are in linear scales. For example, if you want a square axes, set the aspect as the inverse of your data aspect (ratio). ax.set_aspect(1./ax.get_data_ratio()) As you see, you need to reset the aspect whenever your data limit changes. IHTH, -JJ On Wed, Sep 17, 2008 at 2:41 PM, Erik Tollerud <eri...@gm...> wrote: > I would like to ensure that the axes on a plot I'm making are square > in the sense of how the axes appear in the figure. I tried using > ax.set_aspect(1) , but that squares the axes in data coordinates, > rather than in figure coordinates. So aside from generating a figure > that is always square (which doesn't always work anyway if, for > example, I want a colorbar), how can I force the axes to be a > particular axis ratio in coordinates of physical size on the page? > > ------------------------------------------------------------------------- > 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 >
import matplotlib.pyplot as plt import matplotlib.patches as mpatches xy = 0.3, 0.3, width, height = 0.2, 0.5 p = mpatches.Rectangle(xy, width, height, facecolor="orange", edgecolor="red") plt.gca().add_patch(p) plt.draw() A Rectangle is a patch class and (although I'm not sure) I don't think there is a helper function to easily create a patch object in the pyplot level. To draw a Rectangle (or any patch object), you need to import matplotlib.patches module, create a patch object and add it to your axes (add_patch method). The doc says that hatch is only supported in ps backend. Check the set_hatch method. Regards, -JJ On Wed, Sep 17, 2008 at 1:06 PM, Ryan Pavlovicz <pa...@gm...> wrote: > Hi. I'd like to add a filled area on my graph to denote the standard > deviation from an average. Additionally, i'd prefer the fill to be a > diagonal hatch. Reading online, i found that there is a 'Rectangle' class, > but i can't get this to work. Can someone suggest a good way to get the > results i'm looking for? Thanks! > > ------------------------------------------------------------------------- > 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 > >
I'm having trouble plotting data with NaN values. My plot has lines and markers and usually both are skipped for NaN values. But when I have more than 127 data a line is drawn from the last non-NaN to the next. I read somewhere about a similar issue (maybe here? sorry I can't find it just now), it seems like it has to do with some optimization performed for large datasets and the use if lineto instead of moveto or something like that. It was supposed to be fixed in 0.98.2 but I'm using 0.98.3 from Benjamin Drung's PPA (http://ppa.launchpad.net/bdrung). This code shows the difference between plotting 127 and 128 data (look at the left of each figure): import pylab as pl x = pl.random(128) x[4:7] = pl.NaN y = x[:-1] pl.figure(1) pl.plot(x, '-o') pl.grid(True) pl.figure(2) pl.plot(y, '-o') pl.grid(True) pl.show() Is this a known issue? Is there any workaround? Thanks Goyo
On Wed, Sep 17, 2008 at 12:55:40PM -0700, Ted Drain wrote: > I agree completely - I was just pointing that it is possible. I think what > people might not be aware of is that it's really an all or nothing > proposition. You either jump in completely and pay the large cost to handle > this in a maintainable, scalable way or don't do it at all. All of the > "quick and easy" solutions have too many problems and aren't really > maintainable. Here is my (easy and maintainable) way to handle the versions for my graphics: * I write the data creation in a python script * I write the creation of the mpl graphics in a script (most the same) * I manage these python file with a version-system (eg mercurial) So I have different versions for my mpl graphics and I can modify the graphic any time (with a new python run). If the data creation takes too long, I could save the data in an extra file (eg pickle file) and versioning the pickled file. So I dont need an extra way to reedit a mpl graphic. By, Friedrich
Josef, I too have been interested in such a feature for matplotlib and have made some (albeit lame) stabs at finding a solution. I started a project on google code that has some very limited capacity to save line plots and the necessary data arrays from matplotlib into an hdf5 file for later processing. It is by no means a complete solution but may serve as a VERY rough model to add this functionality. It was my hope that if you could capture the underlying keyword arguments necessary to recreate a plot then you might be able to simply recreate the original figure assuming the correct interpreter functions are established. Anyway, if you are interested please take a look to see if there may be something useful. From the perspective of the IPython users out there, a question to you: is there a good way to do achieve this feature with some of the logging commands? http://code.google.com/p/subplot/ Cheers, Brian -ps excuse the name of the project--I lacked creative drive at the time of naming. --- On Tue, 9/16/08, John Hunter <jd...@gm...> wrote: From: John Hunter <jd...@gm...> Subject: Re: [Matplotlib-users] save or pickle figure object To: "Josef Koller" <jk...@la...> Cc: mat...@li... Date: Tuesday, September 16, 2008, 7:49 PM On Tue, Sep 16, 2008 at 5:06 PM, Josef Koller <jk...@la...> wrote: > Hi folks, > I would like to save preliminary figures for later processing and > refinement with matplotlib. Is there a way to save or pickle a figure > object and later reload it. Matlab has a feature like that and and I was > wondering if matplotlib has it too. No, it doesn't exist. We've taken a stab at it once or twice, but have been stymied because we make extensive use of a python extension libray CXX, and these objects have resisted our attempts to pickle them. With our recent transforms refactoring, which removes the hairiest CXX dependency, it may be worth taking another look, but noone is currently working on it. JDH ------------------------------------------------------------------------- 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