[Matplotlib-users] Multiple plots
Hi, I'm quite new to Matplot. When issuing show() from Python 2.5 under OS X I get a nice menu bar at the bottom with home, left, right etc. How can I use these? I tried the different examples, and there are plenty of examples that open multiple windows (such as legend_auto.py) and that put multiple subplots in a plot, but none that actually use the arrows. How can I put multiple plots into a window that can be navigated using these arrows? Cheers Niklas - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Multiple plots
On 3/16/07, Niklas Saers [EMAIL PROTECTED] wrote: Hi, I'm quite new to Matplot. When issuing show() from Python 2.5 under OS X I get a nice menu bar at the bottom with home, left, right etc. How can I use these? I tried the different examples, and there are plenty of examples that open multiple windows (such as legend_auto.py) and that put multiple subplots in a plot, but none that actually use the arrows. How can I put multiple plots into a window that can be navigated using these arrows? Those arrows are meant to navigate through the various zoom level you have chosen with the zoom tool (click on the zoom button the select a rectangle with the left mouse button to zoom in, with the right mouse button to zoom out). Home returns to the first zoom level. Cheers Niklas Cheers, ~ Antonio - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] GTK backend problem
Hi, all. I have a problem when using matpltlib and pygtk. When I draw a very very long line in a figure, the line cannot be drawn as it should be. For example, consider the codes below: -Beginning of codes-- #!/usr/bin/env python import gtk from matplotlib.figure import Figure from matplotlib.lines import Line2D from matplotlib.backends.backend_gtkagg import FigureCanvasGTK as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTK as NavigationToolbar # Uncomment the two lines below to use GTKAgg as a different backend #from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas #from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg \ # as NavigationToolbar win = gtk.Window() win.connect(destroy, lambda x: gtk.main_quit()) win.set_default_size(400,300) win.set_title(Embedding in GTK) vbox = gtk.VBox() win.add(vbox) fig = Figure() ax = fig.add_subplot(111) ax.grid(True) ax.set_autoscale_on(False) ax.set_xlim(0, 2) ax.set_ylim(-2, 2) ax.plot([1, 1, 2,2], [-1, 1, 1, 0]) canvas = FigureCanvas(fig) vbox.pack_start(canvas) toolbar = NavigationToolbar(canvas, win) vbox.pack_start(toolbar, False, False) win.show_all() gtk.main() -End of codes-- You might think that it will show a line like this: +... | A very very long line | | | | But the result is like this: ...--+ Also a very very long line ... | | | | You can view the picture here: http://ljiaping.googlepages.com/embedding_in_gtk1.jpg And if you use the zoom button in the navigation toolbar to zoom out this image, the horizontal line will change its direction to right. You can view the picture here: http://ljiaping.googlepages.com/embedding_in_gtk2.jpg But if you use GTKAgg as matplotlib's backend the figure shows properly. Here is the source code file embedding_in_gtk.pyhttp://ljiaping.googlepages.com/embedding_in_gtk.py, you can try it yourself. I have tried to read the source codes of the library to know the reason, but I have not enough knowledge of image processing and I failed. Any help is appreciated. Thank you. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] troubles with plot_date
Hello - I am trying to plot two sets of data on one graph, using plot_date. But I get an error. It is easy to replicate, by calling the plot_date function twice. Is this supposed to work? from pylab import * plot_date(linspace(726468,726668,4),linspace(0,1,4)) plot_date(linspace(726468,726668,4),linspace(0,1,4)) And I get the error: Traceback (most recent call last): File pyshell#2, line 1, in ? plot_date(linspace(726468,726668,4),linspace(0,1,4)) File C:\Python24\Lib\site-packages\matplotlib\pylab.py, line 2064, in plot_date ret = gca().plot_date(*args, **kwargs) File C:\Python24\lib\site-packages\matplotlib\axes.py, line 2395, in plot_date self.xaxis_date(tz) File C:\Python24\lib\site-packages\matplotlib\axes.py, line 1564, in xaxis_date formatter = AutoDateFormatter(locator) UnboundLocalError: local variable 'locator' referenced before assignment Any ideas? Thanks, Mark - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] troubles with plot_date
On 3/16/07, Mark Bakker [EMAIL PROTECTED] wrote: Hello - I am trying to plot two sets of data on one graph, using plot_date. But I get an error. It is easy to replicate, by calling the plot_date function twice. Is this supposed to work? Fixed in svn - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] multiple plots for the color blind
Dear Experts, When plotting multiple lines, is there a way to have matplotlib automatically make the lines look different using something other than color to distinguish the lines? For example, it would be nice if I could issue multiple plot commands (with hold=True) and have the lines automatically select different markers or line styles. While matplotlib does make the colors different, this doesn't help much for people who are color blind. I checked the FAQ, cookbook, mailing lists, google, etc., but couldn't find a way to do this besides explicitly specifying the style for each line. Thanks, -Emin - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problem to embed figure in Tk
Hi everybody, Would you have any idea how to embed a matshow (or imshow) object in a Tk application but with a given dimension ? Using FigureCanvasTkAgg embed a matshow object in my application but it takes the dimension of the matshow object not the dimension of the place where I would like to embed it. Thank you very much Best regards Eric Pellegrini - Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] source install question: WXAgg's accelerator requires the wxPython headers.
I am getting a message during a source install that WXAgg's accelerator requires the wxPython headers. What do I need to do to get them for Ubuntu? I think I have all wx packages installed? Do I need to download the source tarball from wxPython.org? If so, where should I put the headers? Ryan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] source install question: WXAgg's accelerator requires the wxPython headers.
Dear Ryan, I think you want libwxgtk2.6-dev Ryan Krauss wrote: I am getting a message during a source install that WXAgg's accelerator requires the wxPython headers. What do I need to do to get them for Ubuntu? I think I have all wx packages installed? Do I need to download the source tarball from wxPython.org? If so, where should I put the headers? Ryan - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Square/Circle markers with transparent, faces?
Hi, John T Whelan [EMAIL PROTECTED] wrote: set markerfacecolor (a.k.a. mfc) = 'None' (make sure you include the quotes). This works with plot: plot(randn(5),randn(5), 'bo', mfc=None, mec='b') but not with scatter: scatter(randn(5),randn(5), edgecolor='b', facecolor='None') returns: -- 141 self._facecolors = colorConverter.to_rgba_list(c) TypeError: c must be a matplotlib color arg or a sequence of them Is there a way to make 'transparent' markers with scatter? (this relates to an old thread, http://thread.gmane.org/gmane.comp.python.matplotlib.general/7842, but I'd like to know if there was any news about that?) Cheers. -- .~. Yannick COPIN (o:* Doctus cum libro /V\ Institut de physique nucleaire de Lyon (IN2P3 - France) // \\ Tel: (33/0) 472 431 968 AIM: YnCopin ICQ: 236931013 /( )\ http://snovae.in2p3.fr/ycopin/ ^`~'^ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] new release of basemap
All: I just put a new release (0.9.5) of basemap on the sf download site. Not much in the way of new features, mostly minor bugfixes, python 2.5 compatibility fixes and under-the-hood changes to facilitate building eggs. MacOS X and windows binary installers are available for python 2.4 and 2.5. The examples are in a separate tarfile, since they are not included with the binary installers. The 'crude', 'low' and 'intermediate' boundary datasets are now installed by default. If you need the 'high' resolution data, you can download a separate 18 mb tar.gz and drop the files manually into basemap_datadir (from matplotlib.toolkits.basemap import basemap_datadir to find out what that is). Windows users - please let me know if the binary installers work OK. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [EMAIL PROTECTED] 325 BroadwayOffice : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] source install question: WXAgg's accelerator requires the wxPython headers.
On Mar 16, 2007, at 10:57 AM, Andrew Straw wrote: Dear Ryan, I think you want libwxgtk2.6-dev Unfortunately, the wxPython Debian package and its Ubuntu cousin do not include the wxPython headers. This is an issue that I looked into a while ago, but was unable to get resolved. That being said, you have three options for moving forward: 1. Just ignore the message. Unless you're doing animation you probably won't be hurting for speed. 2. Grab the wxPython headers from source and install them in `/usr/ include/wx/wxPython'. I believe that John Hunter has been doing this for some time now, so he might be able to help you if there are any caveats that I've forgotten. 3. Upgrade to wxPython 2.8 and the svn version of matplotlib. I've written a version of the accelerator in pure Python that moves at a pretty good clip but requires functionality that is only present in wxPython 2.8. Ken - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] source install question: WXAgg's accelerator requires the wxPython headers.
Ryan, I found the 2.6 sources: http://wxpython.sourceforge.net/download-2.6.3.3.php Ken - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matshow?
Why does pylab.matshow() create a new figure by default when no other standard pylab function I know of does that? It seems very inconsistent for no particular gain, since as always figure();matshow(m) will achieve that result if that is what is desired. --bb - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matshow?
On 3/17/07, Bill Baxter [EMAIL PROTECTED] wrote: A pox on matplotlib's default reply-to-sender! Resending my reply that went to Fernando alone below. On 3/17/07, Fernando Perez [EMAIL PROTECTED] wrote: On 3/16/07, Bill Baxter [EMAIL PROTECTED] wrote: Why does pylab.matshow() create a new figure by default when no other standard pylab function I know of does that? It seems very inconsistent for no particular gain, since as always figure();matshow(m) will achieve that result if that is what is desired. No: matshow has to create a figure with a non-standard size so that the final figure has the same aspect ratio as the array being displayed. If you call figure() first, the figure has already been created. The code: # Extract actual aspect ratio of array and make appropriately sized figure w,h = figaspect(arr) fig = figure(fignum,figsize=(w,h)) I guess that makes sense. Personally I'd rather have consistency. I'm not sure why matshow() in particular needs to have the window shape match the image shape. Why not just do axis('scaled') within the confines of the window you have? Tried it out, it seems to work pretty well, and seems more consistent with the way other things work in pylab. def mymatshow(*args,**kw): Display an array as a matrix in a new figure window. The origin is set at the upper left hand corner and rows (first dimension of the array) are displayed horizontally. The aspect ratio of the figure window is that of the array, as long as it is possible to fit it within your screen with no stretching. If the window dimensions can't accomodate this (extremely tall/wide arrays), some stretching will inevitably occur. Tick labels for the xaxis are placed on top by default. matshow() calls imshow() with args and **kwargs, but by default it sets interpolation='nearest' (unless you override it). All other arguments and keywords are passed to imshow(), so see its docstring for further details. Special keyword arguments which are NOT passed to imshow(): - fignum(None): by default, matshow() creates a new figure window with automatic numbering. If fignum is given as an integer, the created figure will use this figure number. Because of how matshow() tries to set the figure aspect ratio to be the one of the array, if you provide the number of an already existing figure, strange things may happen. - returnall(False): by default, the return value is a figure instance. With 'returnall=True', a (figure, axes, image) tuple is returned. Example usage: def samplemat(dims): aa = zeros(dims) for i in range(min(dims)): aa[i,i] = i return aa dimlist = [(12,12),(128,64),(64,512),(2048,256)] for d in dimlist: fig, ax, im = matshow(samplemat(d)) show() # Preprocess args for our purposes arr = asarray(args[0]) # Extract unique keywords we can't pass to imshow kw = kw.copy() fignum = popd(kw,'fignum',None) retall = popd(kw,'returnall',False) # Extract actual aspect ratio of array and make appropriately sized figure w,h = figaspect(arr) #fig = figure(fignum,figsize=(w,h)) fig = gcf() cla() ax = fig.add_axes([0.15, 0.09, 0.775, 0.775]) axis('scaled') ax.xaxis.tick_top() ax.title.set_y(1.05) # raise it up a bit for tick top kw['aspect'] = 'auto' # imshow call: use 'lower' origin (we'll flip axes later) kw['origin'] = 'lower' # Unless overridden, don't interpolate kw.setdefault('interpolation','nearest') # All other keywords go through to imshow. im = ax.imshow(*args,**kw) gci._current = im # set the x and y lim to equal the matrix dims nr,nc = arr.shape[:2] ax.set_xlim((0,nc)) ax.set_ylim((nr,0)) draw_if_interactive() if retall: return fig, ax, im else: return fig --bb - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users