[Matplotlib-users] numpy-1.0b-compatible release?
Hi all, I'm using recently changed numpy features, so I have not been able to use matplotlib in a while, hoping for a release compatible with numpy 1.0beta. I guess I could also install Numeric and use that for matplotlib in the meantime, as a workaround. But from posts on the devel list it seems that a new release is imminent? It's just that I need to get something done in matplotlib until tomorrow, so it would be great if somebody could tell me if I should workaround or just wait. Btw, I tried the egg that was mentioned in a post, but it didn't work for me (something about "matrix not defined" or similar). Thanks for your help, Sven - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Zooming errors/bugs
Hi,I have come across a couple of bugs when zooming into a plot1) if you goto draw a box (to where you are going to zoom) it will zoom in finebut if while drawing the box you release the mouse button BUT continue to move the mouse the zoom does not function (when mouse stops) and a black box is drawn in the plotting window 2) If you just keep zooming in eventually you get to a point where the graph just doesn't make sense.I mean if you plot a slope and keep zooming in smaller and smaller you eventually get to a position where you suddenly get a "triangle" shaped plot - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] numpy-1.0b-compatible release?
array.tolist() can be used as a temporary workaround.i.e. tack .tolist() onto the end of any numpy.array arguments to matplotlib functions.--bbOn 8/22/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: Hi all,I'm using recently changed numpy features, so I have not been able touse matplotlib in a while, hoping for a release compatible with numpy1.0beta.I guess I could also install Numeric and use that for matplotlib in the meantime, as a workaround. But from posts on the devel list it seemsthat a new release is imminent?It's just that I need to get something done in matplotlib untiltomorrow, so it would be great if somebody could tell me if I should workaround or just wait.Btw, I tried the egg that was mentioned in a post, but it didn't workfor me (something about "matrix not defined" or similar).Thanks for your help,Sven - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 3d Plotting
> The colors come from the current colormap. You can go all out and > make your own colormap and color based on index using your map. I > don't know how to do that off the top of my head though. The colors may come from the colormap, but how do they get assigned to areas of the plot itself? The most obvious way to do it is to index by z, so areas with low z are shown with a cool color, and areas with high z are shown with a hot color (assuming you are using a cold-hot colormap). As far as I can tell though, this is not the system currently used, nor is there any coherent system used. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] quiver2
Hi,I am tring to figure out how to use the c argument to the quiver2 function.I want to be able to color my arrows proportionally to their size. I have tried this and it doesn' t work as I imagined: c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2)quiver2(x,y,u,v,c)the docstring on quiver2 is not clear on how c works, any help will be appreciated.thanks,-- Flávio Codeço Coelho registered Linux user # 386432---"Laws are like sausages. It's better not to see them being made."Otto von Bismark - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] extend for colorbar
Thanks, Eric Ok, I ran the image_masked.py and all went OK BUT if I change line 34 of image_masked.py: im = imshow(Zm, interpolation='bilinear', cmap=palette, norm = colors.normalize(vmin = -1.0, vmax = 1.0, clip = False), origin='lower', extent=[-3,3,-3,3]) to im = contourf(Zm,cmap=palette) I do not get the over/under pointers on the end of the colorbar. Does this feature not work with contourf - Or am I doing something wrong. --Jim On Aug 21, 2006, at 5:13 PM, Eric Firing wrote: > Jim, > > Look at examples/image_masked.py. I think that is the only example > with pointed ends, and I think it was present as-is in 0.87.3. > > Eric > > James Boyle wrote: >> I am using matplotlib 0.87.3 >> The documentation of colorbar in color.py seems to indicate that one >> should be able to create a color bar with pointed ends, the fill >> color of the ends corresponding to the over and under colors. >> I have not been able to get this to work. I have set the >> colormap.set_under and set_over values but no success. >> If this does work could someone (Eric?) post an example, of how it is >> done. I feel that I am missing something simple. >> Thanks for any help. >> --Jim - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] extend for colorbar
James Boyle writes: > Thanks, Eric > > to > > im = contourf(Zm,cmap=palette) > > I do not get the over/under pointers on the end of the colorbar. > > Does this feature not work with contourf - Or am I doing something > wrong. Here's a code segment that works for me: vmin,vmax=(280,305) norm = colors.normalize(vmin = vmin, vmax = vmax, clip = True) cmap=matplotlib.cm.jet cmap.set_over('salmon', 1.0) cmap.set_under('black', 0.25) contplot = axes.contourf(pv.time_value, pv.pressure_value, pv.var1_value, n.arange(vmin,vmax,2.), norm=norm, extend='both', cmap=cmap) I got the hint on this from the contourf docstring * New: * * extend = 'neither', 'both', 'min', 'max' Unless this is 'neither' (default), contour levels are automatically added to one or both ends of the range so that all data are included. These added ranges are then mapped to the special colormap values which default to the ends of the colormap range, but can be set via Colormap.set_under() and Colormap.set_over() methods. To replace clip_ends=True and V = [-100, 2, 1, 0, 1, 2, 100], use extend='both' and V = [2, 1, 0, 1, 2]. regards, Phil - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] axes.toggle_log_lineary resets user-defined ticks
I was a little suprised to learn that axes.toggle_log_lineary() overwrites user-supplied tick locators and formatters. My naive assumption was that it would "toggle" only the semilog property and leave other attributes unchanged. Perhaps this could be mentioned in the docstring? regards, Phil Austin - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] extend for colorbar
Phil, Jim, Thanks. I need to add a suitable example for the contourf case, because as you have discovered it is a little different from all the other mappable cases: colorbar takes its cue from the contourf arguments so as to be consistent with the way the contourf plot was made. There is a line in the colorbar docstring indicating this, although I don't recall when I put that line in, so it may not be in the version you are using: If mappable is a ContourSet, its extend kwarg is included automatically. Eric Philip Austin wrote: > James Boyle writes: > > Thanks, Eric > > > > to > > > > im = contourf(Zm,cmap=palette) > > > > I do not get the over/under pointers on the end of the colorbar. > > > > Does this feature not work with contourf - Or am I doing something > > wrong. > > Here's a code segment that works for me: > > vmin,vmax=(280,305) > norm = colors.normalize(vmin = vmin, vmax = vmax, clip = True) > cmap=matplotlib.cm.jet > cmap.set_over('salmon', 1.0) > cmap.set_under('black', 0.25) > contplot = axes.contourf(pv.time_value, > pv.pressure_value, > pv.var1_value, > n.arange(vmin,vmax,2.), > norm=norm, > extend='both', > cmap=cmap) > > > I got the hint on this from the contourf docstring > > * New: * > * extend = 'neither', 'both', 'min', 'max' > Unless this is 'neither' (default), contour levels are > automatically added to one or both ends of the range so that > all data are included. These added ranges are then > mapped to the special colormap values which default to > the ends of the colormap range, but can be set via > Colormap.set_under() and Colormap.set_over() methods. > To replace clip_ends=True and V = [-100, 2, 1, 0, 1, 2, 100], > use extend='both' and V = [2, 1, 0, 1, 2]. > > > regards, Phil > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] quiver2
Flavio Coelho wrote: > Hi, > > I am tring to figure out how to use the c argument to the quiver2 function. > > I want to be able to color my arrows proportionally to their size. > > I have tried this and it doesn' t work as I imagined: > > c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2) The length of the arrow is proportional to sqrt(u**2 + v**2), not to sqrt((u-x)**2 + (v-y)**2). Is the reason you are not getting what you expect? Eric > > quiver2(x,y,u,v,c) > > the docstring on quiver2 is not clear on how c works, any help will be > appreciated. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] quiver2
Thanks Eric,in fact it depends on if x,y are 0 or not. But I got it to work it now. thanks,FlávioOn 8/22/06, Eric Firing < [EMAIL PROTECTED]> wrote:Flavio Coelho wrote:> Hi,>> I am tring to figure out how to use the c argument to the quiver2 function. >> I want to be able to color my arrows proportionally to their size.>> I have tried this and it doesn' t work as I imagined:>> c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2) The length of the arrow is proportional to sqrt(u**2 + v**2),not to sqrt((u-x)**2 + (v-y)**2).Is the reason you are not getting what you expect?Eric>> quiver2(x,y,u,v,c)> > the docstring on quiver2 is not clear on how c works, any help will be> appreciated.-- Flávio Codeço Coelhoregistered Linux user # 386432--- "Laws are like sausages. It's better not to see them being made."Otto von Bismark - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] quiver2
Flavio, One more point: please do not use quiver2 directly. Instead, use quiver, which will call quiver2 unless it finds a keyword argument that exists only in the old version of quiver. The name quiver2 is used only temporarily to provide this compatibility, which will be removed in a future release. Eric Flavio Coelho wrote: > Hi, > > I am tring to figure out how to use the c argument to the quiver2 function. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Canvas change events?
Briefly, is there a way to get a callback in the event that the canvas has been redrawn (e.g. from a zoom or pan)? matplotlib 0.86.2 python 2.4.1 wxPython 2.6.2.1 Mac OS X.4.7 I draw a circle at a certain point. I let the user drag that point to a new location. However, if the plot is redrawn for any reason, I have to redraw my circle in a new position. I can't seem to find any way to get notified of a redraw. Figure.add_axobserver() isn't fully implemented as far as I can tell since it only notifies for a artist deletion or a call to sca(). Axes.connect() doesn't work either because there's no way to set emit in a class-wide scope and consequently calls made to set_xlim made by the toolbar do not trigger an event because they lack the emit keyword in their calls. Here's the relevant code from axes.py. def set_xlim(self, *args, **kwargs): # . emit = popd(kwargs, 'emit', False) # . if emit: self._send_xlim_event() return vmin, vmax I've been trying to accomplish this without editing matplotlib package code. Is there a way I could override Axes.set_xlim() in order to insert "emit=True" into the arguments? Maybe there's a better way to do what I'm doing? Thanks, R. PGP.sig Description: This is a digitally signed message part - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] [Mac OS 10.4.7, Python 2.4.3] Problem using plot_date
First, sorry for the long email. I'm having a segmentation fault problem trying to use plot_date, somewhere deep in matplotlib. After giving up trying to figure out what was going wrong from within my "real" code, I wrote a "minimal" sample to try to reproduce (or not) the problem; here it is: import datetime as dt import wx import matplotlib as mpl import wxmpl class PlotPanel(wxmpl.PlotPanel): def __init__(self, parent, *args, **kwargs): wxmpl.PlotPanel.__init__(self, parent, wx.ID_ANY, *args, **kwargs) self.set_crosshairs(False) self.Figure = self.get_figure() ax = self.Figure.add_subplot(111) ax.clear() ax.grid(False) zerodate = dt.datetime(2001,2,15) zero = mpl.dates.date2num(zerodate) x = range(int(zero), int(zero)+11) ax.plot_date(x,x) # Problem line; works fine with plot instead of plot_date self.draw() class MainFrame(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.PlotPanel = PlotPanel(self) self.MainBox = wx.BoxSizer(wx.VERTICAL) self.MainBox.Add(self.PlotPanel, 1, wx.EXPAND ) self.SetSizerAndFit(self.MainBox) class App(wx.App): def OnInit(self): self.frame = MainFrame(None) self.SetTopWindow(self.frame) self.frame.Fit() self.frame.Show() return True if __name__ == "__main__": print wx.__version__ print wxmpl.__version__ print mpl.__version__ app = App(0) app.MainLoop() This code runs fine with plot instead of plot_date (just like my original code with the same substitution). But with plot_date, I get (please note the versions I'm using): wx.__version__ = 2.6.3.3 wxmpl.__version__ = 1.2.7 matplotlib.__version__ = 0.87.4 Traceback (most recent call last): File "debugplot_date.py", line 40, in ? app = App(0) File "//Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx-2.6-mac-unicode/wx/_core.py", line 7700, in __init__ self._BootstrapApp() File "//Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx-2.6-mac-unicode/wx/_core.py", line 7352, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "debugplot_date.py", line 30, in OnInit self.frame = MainFrame(None) File "debugplot_date.py", line 23, in __init__ self.PlotPanel = PlotPanel(self) File "debugplot_date.py", line 18, in __init__ self.draw() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wxmpl.py", line 1189, in draw else: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 61, in draw FigureCanvasAgg.draw(self) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 391, in draw self.figure.draw(renderer) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/figure.py", line 532, in draw for a in self.axes: a.draw(renderer) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py", line 1045, in draw a.draw(renderer) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axis.py", line 548, in draw majorLabels = [self.major.formatter(val, i) for i, val in enumerate(majorLocs)] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/dates.py", line 369, in __call__ return self._formatter(x, pos) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/dates.py", line 247, in __call__ dt = num2date(x, self.tz) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/dates.py", line 205, in num2date if not iterable(x): return _from_ordinalf(x, tz) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/dates.py", line 156, in _from_ordinalf hour, remainder = divmod(24*remainder, 1) ValueError: need more than 0 values to unpack Using winpdb, I determined that this line in dates.py get called 13 times before, on the 14th time, it causes a "communication failure" between winpdb and the code. Any ideas what's up? Thanks in advance, DG PS: I'm on a Mac, running system 10.4.7 with Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&b
Re: [Matplotlib-users] Getting started with bar charts
[Again copying to matplotlib-users; maybe the main developers can comment on whether these shortcomings in the getp/setp interface should be fixed.] Hi Derek, > It does seem as those these settings affect the top and bottom of > the graph - I was wondering if it was possible to show tickmarks > along the bottom edge but not the top edge? I don't think that's directly supported. Here's a hacky way to do it: lines = getp(gca(), 'xticklines') toplines = [ l for l in lines if getp(l, 'ydata') == (1,) ] setp(toplines, visible=False) How I came up with this: I knew that I wanted to make some of the xticklines invisible, so I looked at the list of line objects for clues as to what differs between them. They seem to have xdata and ydata properties, and ydata is (0,) for half of the lines and (1,) for the other half, so it looks like it is the vertical position in axis coordinates. (xdata seems to be in data coordinates.) > And the other property I do not see on the list is the one that > shows whether a tick goes "into" the graph or just "out" - in the > prc file, there is a line: > xtick.direction : in # direction: in or out > but there is no "direction' property? You're right, there is no obvious property to control this. Here's an even hackier way to do this (and one that doesn't look very future- proof): for l in getp(gca(), 'xticklines'): setp(l, 'marker', 5-getp(l, 'marker')) The line objects have a marker property, which is 2 for some markers and 3 for the others... so I guessed that one of them means upwards and the other downwards, and checked this guess by flipping the xtick.direction parameter and looking again. So subtracting the marker from 5 flips the direction. I wonder how this is done in Matlab? > label: any string > > which shows me that the Yaxis has a label - in this case a > string - but I do not see how one can set the font properties > for the Yaxis label as it is not Text object?? I think you cannot do this with setp alone. Use the ylabel command: ylabel('foo bar', fontsize=18) -- Jouni - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users