You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: John H. <jdh...@ac...> - 2004-09-07 20:50:34
|
I got an answer from Robin Dunn on the wxpython list about the
stderr/stdout bug that was breaking ipython -pylab with the wx*
matplotlib backends. It turns out that the defaults for output
redirection are different on the different platforms, which explains
why it worked on linux but not win32 or OSX.
All you need to do is pass redirect=False to the wxapp constructor.
Eg, on or around line in 498 IPython/Shell.py v0.6.3
self.app = App(redirect=False)
Confirmed to fix both OSX and win32 for wx*.
Now I think the summary is
linux win32 OSX
GTK* : good ugly works except for shell close bug
WX* : good good good
TK* : good good good
Cool. If only all bugs were so easy.
JDH
|
|
From: Todd M. <jm...@st...> - 2004-09-07 18:55:08
|
WARNING!!! (from donner.stsci.edu) The following message attachments were flagged by the antivirus scanner: Attachment [2] , scan failed: Antivirus scan engine offline. Action taken: incomplete scan |
|
From: John H. <jdh...@ac...> - 2004-09-07 14:41:17
|
>>>>> "Gary" == Gary <pa...@in...> writes:
Gary> I've accomplished this feature via: ax = axis() set(gca().
Gary> hlines([0.], ax[0], ax[1])[0], linewidth=1)
Gary> I don't remember why I did it this way instead of just
Gary> plotting. Maybe I thought is was more clever. Does this
Gary> method avoid auto-scaling? -g
Yes it does, only because hlines doesn't call autoscale (I just looked
it up). This is probably a bug, since I don't see why the plot and
hlines method should have different behavior. It looks like an
oversight.
I think plotting the horizontal extent in axes coords is the proper
way to go.
JDH
|
|
From: Gary <pa...@in...> - 2004-09-07 13:10:57
|
Stephen Walton wrote: >On Mon, 2004-09-06 at 06:28, Alan G Isaac wrote: > > >>I'm a newbie to Matplotlib but a longtime gnuplot user. >>Using the matlab module, what is the right way to >>set xzeroaxis >> >> > >MATLAB doesn't have anything similar, AFAIK, but the following will >work: > >def xzeroaxis(form='k'): # draw a line at y=0 on the current plot > v=axis() > plot(v[0:2],[0,0],form) > > [...] I've accomplished this feature via: ax = axis() set(gca(). hlines([0.], ax[0], ax[1])[0], linewidth=1) I don't remember why I did it this way instead of just plotting. Maybe I thought is was more clever. Does this method avoid auto-scaling? -g |
|
From: John H. <jdh...@ac...> - 2004-09-07 12:04:15
|
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes:
Alan> When I run this script from scipy import * from
Alan> matplotlib.matlab import * def f(x): return 2*x**3-5*x
Alan> x=(arange(2001)-1000)/100.0 plot(x,f(x))
Alan> axis([-10,10,-20,20]) show() plot(x,f(x)) axis([-2,2,-5,5])
Alan> show()
Alan> I get an odd placement of the zero on the x axis in the
Alan> second plot. If I cut out the first plot, this does not
Alan> happen. How am I causing this?
Alan> Thank you, Alan Isaac
Calling show multiple times in one script is backend dependent and not
supported. See http://matplotlib.sf.net/faq.html#SHOW. I haven't
been able to replicate your bug - what version of matplotlib are you
using and what backend? Can you write an example w/o multiple show
calls that produces it?
What do you mean that the zero on the x axis has an odd placement?
Can you save a PNG and send it to me off list?
JDH
|
|
From: Alan G I. <ai...@am...> - 2004-09-07 07:24:51
|
When I run this script from scipy import * from matplotlib.matlab import * def f(x): return 2*x**3-5*x x=(arange(2001)-1000)/100.0 plot(x,f(x)) axis([-10,10,-20,20]) show() plot(x,f(x)) axis([-2,2,-5,5]) show() I get an odd placement of the zero on the x axis in the second plot. If I cut out the first plot, this does not happen. How am I causing this? Thank you, Alan Isaac |
|
From: Alan G I. <ai...@am...> - 2004-09-07 06:47:00
|
I'm using the matlab module in the classroom. Do I really have to get the current axis with 'gca' and then use 'set' to set tic marks? I'm new to this, but it seems coherent with the module that I would be able to say, e.g., xticks(range(11)) and be done with it. (Ignoring the question of spelling ;). A reasonable request? Thanks, Alan Isaac PS Comment: since setting tic marks is a very common desire, I think it should show up somewhere on http://matplotlib.sourceforge.net/matplotlib.matlab.html |
|
From: Alan G I. <ai...@am...> - 2004-09-07 06:46:56
|
On Mon, 06 Sep 2004, John Hunter apparently wrote: > I've not used set xzeroaxis. I googled around a bit and gathered that > this draws a horizontal line from xmin to xmax at y=0. Right. > Fernando Perez and I talked a bit at scipy about > adding some gnuplot compatibility functions and this would fit under > that umbrella. I'm interested in getting some feedback about whether > folks think this is a good idea. I care about functionality much more than syntax. This is a common need, so it shd be easy to do. > from matplotlib.transforms import blend_xy_sep_transform > ax = gca() > trans = blend_xy_sep_transform( ax.transAxes, ax.transData) > plot([0,1], [0,0], transform=trans) > Try this out and see if it behaves as you like. So far so good. > Rather than reusing the gnuplot names, it might be better to > provide a method that always draws a line from xmin to xmax at a given > height regardless of the xlim, and do the same for a vertical line at > some x. I agree. I actually need the additional functionality. So while we're generalizing let me dream. Focus on the case of vertical lines. The ideal functionality would allow me to use 'vlines' with a special value to indicate ymin and ymax. Ideally this same 'special values' convention would extend to 'fill' (or maybe 'bar'), since I often need event shading. Perhaps the obvious special value is None? fwiw, Alan |
|
From: John H. <jdh...@ac...> - 2004-09-07 03:10:05
|
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes:
Stephen> On Mon, 2004-09-06 at 06:28, Alan G Isaac wrote:
>> I'm a newbie to Matplotlib but a longtime gnuplot user. Using
>> the matlab module, what is the right way to set xzeroaxis
Stephen> MATLAB doesn't have anything similar, AFAIK, but the
Stephen> following will work:
Stephen> def xzeroaxis(form='k'): # draw a line at y=0 on the
Stephen> current plot v=axis() plot(v[0:2],[0,0],form)
Stephen> def yzeroaxis(form='k'): v=axis() plot([0,0],v[2:4],form)
Stephen> Is this worth adding to the distribution? I doubt it is
Stephen> general enough to warrant.
Stephen> John: when I do the following: v=arange(-5,5)
Stephen> plot(v,v**3) xzeroaxis() yzeroaxis()
Stephen> the vertical line at x=0 doesn't quite go to top and
Stephen> bottom of the plot. This is with 0.62.4.
Without testing, my guess is that the autoscale magic is getting in
your way. Every plot command calls autoscale, which in the absence of
bugs will include the data but may exceed it. Ie, if you plot data
with a x range from 0.1 to 9.9, it may set the xlim from 0--10.
Thus, although your idea of using the axis return values to get the
min, max is nice, it fails when the autoscale chooses a wider range
for nice ticking. The solution I posted a few minutes ago in which
the span is plotted in *axes* coordinates rather than data coordinates
circumvents this problem.
Cheers!
JDH
|
|
From: John H. <jdh...@ac...> - 2004-09-07 02:47:48
|
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes:
Alan> I'm a newbie to Matplotlib but a longtime gnuplot user.
Alan> Using the matlab module, what is the right way to set
Alan> xzeroaxis (using gnuplot terminology). Using axis and hline
Alan> seems cumbersome, so I assume there is a better way to
Alan> implement this common need.
Alan> Thank you, Alan Isaac
I've not used set xzeroaxis. I googled around a bit and gathered that
this draws a horizontal line from xmin to xmax at y=0. There is not
equivalent currently in matplotlib so there is no clean and easy way
to do this, but Fernando Perez and I talked a bit at scipy about
adding some gnuplot compatibility functions and this would fit under
that umbrella. I'm interested in getting some feedback about whether
folks think this is a good idea. The worry is that we dump too much
into the axes to support matlab, IDL and gnuplot users.
Here's how you should do this under the current matplotlib. What you
want to do is plot a line where the y coord is in data units and equal
to zero, and the x coord is in axes units and spans the xrange. The
line stretches from left to right regardless of the xlimits.
Each axes provides a data transform and an axes transform, so that you
can specify lines/text/etc in either coord system; axes coords are 0,0
for lower left and 1,1 for upper right. But what you want to do is
mix the data and axes transforms for x and y. The transforms module
provides a helper function for this. The following code is freestyle
(untested) but should work
from matplotlib.transforms import blend_xy_sep_transform
ax = gca()
trans = blend_xy_sep_transform( ax.transAxes, ax.transData)
plot([0,1], [0,0], transform=trans)
Try this out and see if it behaves as you like. I can add a methods
for this for xzero and yzero if you and others feel this would be
useful. Rather than reusing the gnuplot names, it might be better to
provide a method that always draws a line from xmin to xmax at a given
height regardless of the xlim, and do the same for a vertical line at
some x.
JDH
|
|
From: Alan G I. <ai...@am...> - 2004-09-07 02:44:49
|
On Mon, 6 Sep 2004, Jorg R=F8dsj=F8 apparently wrote: > But for one of the plots, > I get two lines - and I cant figure out why. Sorry to ask something too obvious but: what happens if you write the data to file? What do you see? It seems likely that you are asking Matplotlib to plot two series, even if you don't think so. Consider posting a link to the code in any case, since it looks like a fun application. fwiw, Alan |
|
From: John H. <jdh...@ac...> - 2004-09-07 02:28:34
|
>>>>> "Jean" == Jean Pierre <2s...@ma...> writes:
Jean> Hello, I'm a new user of matplotlib and I have to admit that
Jean> I'm quite impressed and excited about it ! I'm currently
Jean> trying to convince the whole company to switch from matlab
Jean> to python (at least 200 users I think), and matplotlib is a
Jean> big asset.
Good luck - is yours a software company? 200 new developers would be
a big help :-)
Jean> Extra content at the end of the document Could not load
Jean> filename for text
Jean> /users/m024234/local/share/matplotlib/Vera.ttf Traceback
Here is your problem. The font is not being loaded. First, in
matplotlib/backends/backend_agg.py on or around line 240, replace the
block
if font is None:
fname = fontManager.findfont(prop)
try: font = FT2Font(str(fname))
except RuntimeError, msg:
print >> sys.stderr, 'Could not load filename for text', \
fname
return None
else:
_fontd[key] = font
with
if font is None:
fname = fontManager.findfont(prop)
font = FT2Font(str(fname))
_fontd[key] = font
in other words, don't catch the exception. This may give you extra
information about what is going wrong.
I notice from your path above that you have installed matplotlib in a
nonstandard location. Have you set the MATPLOTLIB environment
variable, as described in the installing documentation on the web page
http://matplotlib.sf.net/installing.html?
Do you get the same traceback on win32?
Gladly-accepting-donationsly-yours,
JDH
|
|
From: Stephen W. <ste...@cs...> - 2004-09-07 02:26:15
|
On Mon, 2004-09-06 at 06:28, Alan G Isaac wrote: > I'm a newbie to Matplotlib but a longtime gnuplot user. > Using the matlab module, what is the right way to > set xzeroaxis MATLAB doesn't have anything similar, AFAIK, but the following will work: def xzeroaxis(form=3D'k'): # draw a line at y=3D0 on the current plot v=3Daxis() plot(v[0:2],[0,0],form) def yzeroaxis(form=3D'k'): v=3Daxis() plot([0,0],v[2:4],form) Is this worth adding to the distribution? I doubt it is general enough to warrant. John: when I do the following: v=3Darange(-5,5) plot(v,v**3) xzeroaxis() yzeroaxis() the vertical line at x=3D0 doesn't quite go to top and bottom of the plot. This is with 0.62.4. --=20 Stephen Walton <ste...@cs...> Dept. of Physics & Astronomy, CSU Northridge |
|
From: John H. <jdh...@ac...> - 2004-09-07 02:12:34
|
Jorg> I have installed matplotlib and tried to set up an automatic syst= em to plot Jorg> quotes for the funds I own. The data is retrieved from the same s= ource Jorg> (Yahoo finance) and is formated in the same way. But for one of t= he plots, Jorg> I get two lines - and I cant figure out why. Jorg> The graphs can be seen at : http://neoplex.org/money.php Jorg> All seem fine, except the one in the top righthand corner. (Skage= n Kontiki).=20 Jorg> I could post some data and the code if it would help. I seem to b= e at a Jorg> complete loss as to why this is happening. My guess is either that you used the same subplot twice, used the plot(x1,y1,x2,y2) form of plot, or failed to call clf (clear figure) between issuing two different plot/savefig calls in the same script. Definitely, post some code. =20 Cheers, JDH =20 ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jdh...@ac...> - 2004-09-07 02:12:24
|
Jorg> I have installed matplotlib and tried to set up an automatic syst= em to plot Jorg> quotes for the funds I own. The data is retrieved from the same s= ource Jorg> (Yahoo finance) and is formated in the same way. But for one of t= he plots, Jorg> I get two lines - and I cant figure out why. Jorg> The graphs can be seen at : http://neoplex.org/money.php Jorg> All seem fine, except the one in the top righthand corner. (Skage= n Kontiki).=20 Jorg> I could post some data and the code if it would help. I seem to b= e at a Jorg> complete loss as to why this is happening. My guess is either that you used the same subplot twice, used the plot(x1,y1,x2,y2) form of plot, or failed to call clf (clear figure) between issuing two different plot/savefig calls in the same script. Definitely, post some code. =20 Cheers, JDH =20 ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Alan G I. <ai...@am...> - 2004-09-07 01:02:03
|
On Mon, 6 Sep 2004, Jean Pierre apparently wrote: > I've decided to switch to 0.62.4 ... > But it seems that everything was broken ! I cannot even display a > simple plot on windows NT4 or linux. > On windows I use the enthought edition python-2.3.3-1057 and on linux I > was using the latest (python 2.3.4, wxPython 2.5.2.7, numarray 1.0, > Numeric 23.3...). > Here is the output on linux when I try to use the simple_plot.py : > ****************************************************************** > Extra content at the end of the document > Could not load filename for text > /users/m024234/local/share/matplotlib/Vera.ttf i. It looks like a missing font? ii. Another possibility: http://matplotlib.sourceforge.net/faq.html#FREEZE hth, Alan Isaac |
|
From: Alan G I. <ai...@am...> - 2004-09-07 01:01:59
|
I'm a newbie to Matplotlib but a longtime gnuplot user. Using the matlab module, what is the right way to set xzeroaxis (using gnuplot terminology). Using axis and hline seems cumbersome, so I assume there is a better way to implement this common need. Thank you, Alan Isaac |
|
From: Jean P. <2s...@ma...> - 2004-09-06 21:50:10
|
Hello,
I'm a new user of matplotlib and I have to admit that I'm quite
impressed and excited about it !
I'm currently trying to convince the whole company to switch from matlab
to python (at least 200 users I think), and matplotlib is a big asset.
If it's a success, as a big supporter of free software, I hope to
convince the company to make some donations to python and/or
matplotlib...(matlab licence are really expensive...)
Anyway, at the moment I can't make any donation, but I can at least help
to improve matplotlib, so here are the problems I've found :
I began with version 0.60.2 and everything worked out of the box with
either linux or windows NT4.
But when trying to display several plot on the same window, I had some
text overlapping so after a while I've decided to switch to 0.62.4 to
see if things has improved.
But it seems that everything was broken ! I cannot even display a
simple plot on windows NT4 or linux.
On windows I use the enthought edition python-2.3.3-1057 and on linux I
was using the latest (python 2.3.4, wxPython 2.5.2.7, numarray 1.0,
Numeric 23.3...).
Here is the output on linux when I try to use the simple_plot.py :
******************************************************************
Extra content at the end of the document
Could not load filename for text
/users/m024234/local/share/matplotlib/Vera.ttf
Traceback (most recent call last):
File
"/usr/local/lib/python2.3/site-packages/matplotlib/ba
ckends/backend_gtkagg.py", line 85, in callback
else: self.draw()
File
"/usr/local/lib/python2.3/site-packages/matplotlib/ba
ckends/backend_gtkagg.py", line 40, in draw
FigureCanvasAgg.draw(self)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/ba
ckends/backend_agg.py", line 307, in draw
self.figure.draw(self.renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/figure.py",
line 238, in draw
for a in self.axes: a.draw(renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/axes.py",
line 692, in draw
self.xaxis.draw(renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/ax is.py",
line 475, in draw
tick.draw(renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/axis.py",
line 136, in draw
if self.label1On: self.label1.draw(renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/text.py",
line 207, in draw
bbox, info = self._get_layout(renderer)
File
"/usr/local/lib/python2.3/site-packages/matplotlib/text.py",
line 106, in _get_layout
w,h = renderer.get_text_width_height(
File
"/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_agg
.py", line 211, in get_text_width_height
font.set_text(s, 0.0) # the width and height of unrotated string
AttributeError: 'NoneType' object has no attribute 'set_text'
******************************************************************
Let me know if I can do anything to help you understand the problem...
Anyway, great software !
Regards,
|
|
From: Jorg <jo...@ne...> - 2004-09-06 19:56:55
|
Hi I have installed matplotlib and tried to set up an automatic system to pl= ot quotes for the funds I own. The data is retrieved from the same source (Yahoo finance) and is formated in the same way. But for one of the plots= , I get two lines - and I cant figure out why. The graphs can be seen at : http://neoplex.org/money.php All seem fine, except the one in the top righthand corner. (Skagen Kontik= i).=20 I could post some data and the code if it would help. I seem to be at a complete loss as to why this is happening. regards Jorg R=F8dsj=F8 --=20 Jorg E. R=F8dsj=F8 |=20 "Be kind to your knees. | You'll miss them when they are gone." | =20 =20 |
|
From: Jean-Michel P. <jea...@ir...> - 2004-09-06 09:21:05
|
jdh...@ac... wrote: > Indeed. Unfortunately, in the current implementation, all the logic > is in the toolbar itself. On the dev list there was some discussion > in the last few weeks on how to modularize the toolbar base class code > (matplotlib.backend_bases.NavigationToolbar2), with an implementation > that factored out all of this code into independent pieces. This was > done to support a user customizable and extensible toolbar, but might > have wider application as this thread suggests, eg to support a > default navigation mode in the absence of any toolbar at all. > Unfortunately, I haven't had time to investigate this or include it as > a patch yet. Would it be possible to add some facilities to get a list of the method associated to each toolbar button in order to call the underlying function directly from within the program? (I'm not sure this very clear... The idea is to be able to perform some actions automatically while creating figures instead of waiting for mouse button clicks - e.g. the command 'grid(1)' displays grids and this feature could also be accessed from a toolbar button) > So in the current implementation, you have to call the 'pan' method of > the toolbar to set the pan/zoom functionality and the 'zoom' method to > activate zoom to rect. > > The following untested code should work across backends from the > matlab interface (using the API, you can access the toolbar instance > more directly) > > manager = get_current_fig_manager() > toolbar = manager.canvas.toolbar > toolbar.pan() # activate pan w/ left and zoom w/ right by default Ok, with TkAgg / matplotlib 0.62.4 I just had to use 'manager.toolbar' instead of 'manager.canvas.toolbar'. Obviously pan() is used to move the figure view and zoom() to let the user draw rectangles around the region to be zoomed. This is the last one which I needed: > manager = get_current_fig_manager() > manager.toolbar.zoom() (Thanks, I always knew this would be few code lines!) > I think your idea of adding a 'zoom on' function which can be called > from the matlab interface is a good one; any idea if there is a matlab > analog for activating zoom to rect? > Indeed 'zoom' activates zoom to rectangular region as toolbar.zoom() does. The only difference is that zoom in Matlab is able to toggle or to set the zoom state depending on the input args: zoom -> toggles the zoom zoom on -> turn it on zoom off -> turn it off So the previous code only mimics the first implementation. As I don't know how to get the zoom state, I cannot propose a full Matlab replacement to the 'zoom' function. Perhaps the modularized toolbar could introduce this feature for each button with a simple code like this: def myButtonCallBackFunc(state=-1): if state == -1: # toggle elif state == 0: # reset elif state == 1; # set else: #raise error Doing this each toolbar button would be easy to toggle or turn on/off from code and we could easily implement a matplotlib version of the Matlab 'zoom' function. JM. Philippe |
|
From: Jean-Michel P. <jea...@ir...> - 2004-09-06 08:35:05
|
ste...@cs... wrote: > You want the initial graph to come up already zoomed in, is that it? yes, that's exactly this! JM. |
|
From: John H. <jdh...@ac...> - 2004-09-06 04:43:03
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
Darren> Hi All, I had also been having trouble switching backends,
Darren> on winXP MPL 0.61. I found the reason for my problem:
Darren> import matplotlib import myModule #myModule includes a
Darren> "from matplotlib.matlab import mean" statement, which I
Darren> hadn't thought of matplotlib.use('GTKAgg') from
Darren> matplotlib.matlab import *
Darren> plot([1,2,3,4]) show() #This doesnt work
Darren> ###########################
Darren> import matplotlib matplotlib.use('GTKAgg') from
Darren> matplotlib.matlab import * import myModule
Darren> plot([1,2,3,4]) show() #This does work
Hi Darren,
Because you have to call 'use' before importing matplotlib.matlab,
even if the matplotlib.matlab import is done indirectly in myModule.
The backend choice is set at the time of the matplotlib.matlab import.
You might be able to work around this if necessary by issuing a use
call and the *reloading* matplotlib.matlab, though this is untested.
Of course, by reloading, I mean a proper reload, not just another
import call.
JDH
|
|
From: John H. <jdh...@ac...> - 2004-09-06 04:39:08
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
Darren> In Matlab, you can create a plot, and then calling "zoom
Darren> on" does the same thing as clicking the zoom button in
Darren> MPL: it just gives zooming context to mouse clicks inside
Darren> the axes. It would be helpful to know how to give such
Darren> context to mouse clicks without having to include toolbar2
Darren> in a figure.
Indeed. Unfortunately, in the current implementation, all the logic
is in the toolbar itself. On the dev list there was some discussion
in the last few weeks on how to modularize the toolbar base class code
(matplotlib.backend_bases.NavigationToolbar2), with an implementation
that factored out all of this code into independent pieces. This was
done to support a user customizable and extensible toolbar, but might
have wider application as this thread suggests, eg to support a
default navigation mode in the absence of any toolbar at all.
Unfortunately, I haven't had time to investigate this or include it as
a patch yet.
So in the current implementation, you have to call the 'pan' method of
the toolbar to set the pan/zoom functionality and the 'zoom' method to
activate zoom to rect.
The following untested code should work across backends from the
matlab interface (using the API, you can access the toolbar instance
more directly)
manager = get_current_fig_manager()
toolbar = manager.canvas.toolbar
toolbar.pan() # activate pan w/ left and zoom w/ right by default
Note that calling this function toggles the current state, as does the
'zoom' function.
I think your idea of adding a 'zoom on' function which can be called
from the matlab interface is a good one; any idea if there is a matlab
analog for activating zoom to rect?
Thanks,
JDH
|
|
From: Darren D. <dd...@co...> - 2004-09-04 21:07:39
|
Hi All,
I had also been having trouble switching backends, on winXP MPL 0.61. I
found the reason for my problem:
import matplotlib
import myModule #myModule includes a "from matplotlib.matlab import
mean" statement, which I hadn't thought of
matplotlib.use('GTKAgg')
from matplotlib.matlab import *
plot([1,2,3,4])
show()
#This doesnt work
###########################
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib.matlab import *
import myModule
plot([1,2,3,4])
show()
#This does work
|
|
From: Darren D. <dd...@co...> - 2004-09-04 16:51:38
|
Stephen Walton wrote: >On Thu, 2004-09-02 at 01:33, Jean-Michel Philippe wrote: > > >>ste...@cs... wrote: >> >> >>>Zooming is available via the widgets at the bottom of the plot menu by >>>default. >>> >>> >>Ok but I would like to activate zooming for users within the program. >> >> > >You want the initial graph to come up already zoomed in, is that it? > > In Matlab, you can create a plot, and then calling "zoom on" does the same thing as clicking the zoom button in MPL: it just gives zooming context to mouse clicks inside the axes. It would be helpful to know how to give such context to mouse clicks without having to include toolbar2 in a figure. Darren |