Re: [Matplotlib-users] creating colors for many plots
A colormap can be called like a function to get the colors associated to (normalized) values. In your example, it is called with uniformly spaced values (linspace) between 0 and 1. This should return the corresponding colors. print plt.get_cmap('gray')(0.0) (0.0, 0.0, 0.0, 1.0) print plt.get_cmap('gray')(1.0) (1.0, 1.0, 1.0, 1.0) print plt.get_cmap('gray')(np.linspace(0,1,6)) [[ 0. 0. 0. 1. ] [ 0.2 0.2 0.2 1. ] [ 0.4 0.4 0.4 1. ] [ 0.6 0.6 0.6 1. ] [ 0.8 0.8 0.8 1. ] [ 1. 1. 1. 1. ]] Nicolas On 08 May 2014, at 11:41, MaxMax a3233...@drdrb.net wrote: i have found a solution for creating colors for many plots at this page: http://stackoverflow.com/questions/7513262/matplotlib-large-set-of-colors-for-plots what does this the following line do? colors = plt.get_cmap('jet')(np.linspace(0, 1.0, len(kinds))) plt.get_cmap('jet') gets a LinearSegmentedColormap object and np.linspace creates a ndarray but what happens because of this instruction? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/creating-colors-for-many-plots-tp43381.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Is your legacy SCM system holding you back? Join Perforce May 7 to find out: #149; 3 signs your SCM is hindering your productivity #149; Requirements for releasing software faster #149; Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Is your legacy SCM system holding you back? Join Perforce May 7 to find out: #149; 3 signs your SCM is hindering your productivity #149; Requirements for releasing software faster #149; Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib for tiles - blank lines
If you do not draw at all (no pcolor call), do you still get transparent colors ? If yes, what is your .matplotlibrc ? Nicolas On 24 Mar 2014, at 11:49, Jesper Larsen jesper.webm...@gmail.com wrote: Thanks Pierre, from __future__ import division did not help me, I am using mpl 1.1.1rc. I will try upgrading to a newer version of mpl and report back whether that helps. My output is: [(511, (255, 255, 255, 0)), (65025, (0, 0, 128, 255))] Best regards, Jesper 2014-03-24 11:27 GMT+01:00 Pierre Haessig pierre.haes...@crans.org: Hi, Le 24/03/2014 10:45, Jesper Larsen a écrit : I am using matplotlib to produce plots (tiles) in a Web Map Service. Unfortunately I cannot get Matplotlib to plot on the entire image. There are one transparent (pixel) line at the bottom and one transparent line at the right. This is of course a problem when the tiles are shown in a map. Please see example below. Can anyone see what I am doing wrong? I've run your code and got no transparent pixels. print im.getcolors() [(65536, (0, 0, 128, 255))] I also tried with __future__ division to see if there was something with figsize = w/dpi, h/dpi, but got the same output best, Pierre (python 2.7 on Linux, mpl 1.3.1) -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Choosing optimal figure width/height automatically
Would something like this suit your needs ? import matplotlib.pyplot as plt # Image size width,height = 640,480 # Pixel border around image border = 1 dpi = 72.0 figsize= (width+2*border)/float(dpi), (height+2*border)/float(dpi) fig = plt.figure(figsize=figsize, dpi=dpi, facecolor=white) hpixel = 1.0/(width+2*border) vpixel = 1.0/(height+2*border) ax = fig.add_axes([border*hpixel, border*vpixel, 1-2*border*hpixel, 1-2*border*vpixel]) ax.set_xlim(0, width) ax.set_ylim(0, height) plt.show() Nicolas On Oct 17, 2013, at 4:16 PM, Christoph Groth christ...@grothesque.org wrote: Benjamin Root writes: I particularly like using the figaspect() function: (...) It isn't perfect, but for its simplicity, it gets it mostly right. Thanks, Benjamin, for your quick reply. Unfortunately, figaspect is only an approximate solution, as it simply uses the aspect ration of the image for the whole figure (with axes and labels). I wonder how difficult it would be to teach matplotlib to tightly fit the axes around an image, and, ideally, output the figure cropped. -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] contourf() for proper plotting purpose
You can use the 'origin' keyword: pl.controuf(Matrix, origin='lower') or pl.controuf(Matrix, origin='upper') Nicolas On May 23, 2013, at 7:27 AM, Bakhtiyor Zokhidov bakhtiyor_zokhi...@mail.ru wrote: Hi, I have following code: import numpy as np import pylab as pl Matrix(10,10) = np.array([[ 4.5, 4.5, 4.5, 3.4, 2.5, 3.9, 3.4, 3.4, 2.2, 3.9], [ 3.9, 4.5, 5.2, 4.5, 3.4, 3.4, 2.2, 2.9, 3.4, 3.4], [ 3.9, 3.9, 2.5, 2.2, 1.9, 1.2, 1.2, 1.4, 2.5, 2.9], [ 3.4, 3.9, 2.9, 2.2, 1.2, 1.4, 1.7, 1.4, 1.9, 2.2], [ 2.5, 3.4, 2.2, 1.4, 1.2, 1.2, 1.7, 0.8, 1.9, 1.7], [ 2.5, 2.2, 2.5, 1.2, 1.2, 0.9, 1.7, 1.7, 1.4, 1.9], [ 2.2, 2.2, 3.4, 1.7, 0.9, 0.9, 0.9, 1.2, 1.7, 1.9], [ 2.9, 1.9, 1.9, 1.4, 1.1, 0.9, 1.2, 1.1, 1.7, 1.9], [ 2.9, 1.7, 2.2, 1.4, 1.1, 0.9, 1.1, 0.8, 1.1, 1.9], [ 2.5, 1.9, 1.7, 1.2, 1.4, 0.8, 1.1, 0.8, 1.4, 1.7]]) pl.contourf(Matrix) pl.show() The problem is that that plots reversely, in other words top values are below, bottom values are top!! How can I plot it properly? -- Bakhtiyor Zokhidov -- Try New Relic Now We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Try New Relic Now We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib pnpoly-example-results-in-error
From the matplotlib page, you can reach: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html and just translates the function: def inside_polygon(p, vertices): vx,vy = vertices[:,0], vertices[:,1] x,y = p c = 0 j = len(vertices)-1 for i in xrange(len(vertices)): if( ((vy[i] y) != (vy[j] y)) and (x (vx[j]-vx[i]) * (y-vy[i]) / (vy[j]-vy[i]) + vx[i]) ): c = 1-c j = i return c Of course this would be slower than the corresponding C implementation. Nicolas On May 9, 2013, at 21:55 , algotr8der wrote: I tried to execute the following code: http://matplotlib.org/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon However I get errors I describe here: http://stackoverflow.com/questions/16452509/matplotlib-pnpoly-example-results-in-error import numpy as np import matplotlib.nxutils as nx verts = np.array([ [0,0], [0, 1], [1, 1], [1,0]], float) nx.pnpoly(0.5, 0.5, verts) Traceback (most recent call last): File console, line 1, in module File C:\Python27\lib\site-packages\matplotlib\nxutils.py, line 26, in pnpoly return p.contains_point(x, y) File C:\Python27\lib\site-packages\matplotlib\path.py, line 289, in contains_point transform = transform.frozen() AttributeError: 'float' object has no attribute 'frozen' nx.pnpoly(0.5, 1.5, verts) Traceback (most recent call last): File console, line 1, in module File C:\Python27\lib\site-packages\matplotlib\nxutils.py, line 26, in pnpoly return p.contains_point(x, y) File C:\Python27\lib\site-packages\matplotlib\path.py, line 289, in contains_point transform = transform.frozen() AttributeError: 'float' object has no attribute 'frozen' Apparently, nxutils is deprecated, which to me means it should still work but a user on stackoverflow pointed out that there may be some code rot. That said, the documentation on matplotlib.path.Path.contains_point is weak (see below). Does anyone have an example of how I can do the exact same thing in the code in the howto_faq but using the suggested function (contains_point)? http://matplotlib.org/1.2.1/api/path_api.html?highlight=contains_point#matplotlib.path.Path.contains_point contains_point(point, transform=None, radius=0.0) Returns True if the path contains the given point. If transform is not None, the path will be transformed before performing the test. radius allows the path to be made slightly larger or smaller. contains_points(points, transform=None, radius=0.0) Returns a bool array which is True if the path contains the corresponding point. If transform is not None, the path will be transformed before performing the test. radius allows the path to be made slightly larger or smaller. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/re-matplotlib-pnpoly-example-results-in-error-tp41028.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to start when you don't know what to do
I do exactly that from time to time (copying a graphic) and I always start looking at the matplotlib gallery (http://matplotlib.org/gallery.html) for what is the most similar figure and starts from here (after removing what is not necessary). Most important is identifying the kind of axis necessary (cartesian, log, polar, ...) Some examples at: http://www.loria.fr/~rougier/coding/gallery/ Some really nice graphics (but difficult) to try to copy at: http://www.improving-visualisation.org/visuals Nicolas On Jan 15, 2013, at 20:52 , Steven Boada wrote: Heyya list. I must admit that my matplotlib-foo is only so so. One of the biggest problems that I face is seeing cool stuff around the net, and thinking, that's pretty neat, I'd like to copy it. In reality, I have no idea how I would go about creating something like that. Here's an example: http://imgur.com/JdkR4 Just a little circular histogram thing with some annotations. Obviously, I'd need the annotate command for the words, but what about the arcs? No idea, off hand. So my question is, how do you decode (read: what to think about) figures that you see, and turn them into actual python? Sure I could post on stack exchange or email all you people every time, but I want to be *better* at this. And while some people are going to scoff and reply that's easy, silly it's not so for some. I just hate to admit it's me. Thanks for the advice. -- Steven Boada Doctoral Student Dept of Physics and Astronomy Texas AM University bo...@physics.tamu.edu -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] New tutorial (beginner level)
Thanks Fernando ! By the way, I suspect the simple plot part may well suited for the ipython notebook ! I'll give it a try. Nicolas On Aug 11, 2012, at 4:55 , Fernando Perez wrote: On Fri, Aug 10, 2012 at 5:23 AM, Nicolas Rougier nicolas.roug...@inria.fr wrote: I've just finished a new introductory tutorial for incoming Euroscipy 2012. You can find it here: http://www.loria.fr/~rougier/teaching/matplotlib/ Wow! Other than the rendering glitches already mentioned, this is *awesome*. We're teaching a python workshop at UC Berkeley in 2 weeks (http://register.pythonbootcamp.info) and I just suggested we use this for our mpl intro. It's the best one I've seen so far, and the reference info at the bottom as well as the mini-gallery will make it a very useful resource even for seasoned users. Fantastic job, Nicolas (and Mike M.), and thanks for sharing this great resource! Cheers, f -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] New tutorial (beginner level)
Fantastic ! This is very valuable teaching material. Really great job and big thanks to all the ipython developers. Matthias, hope to see you at Euroscipy (and see some ipython demos). In fact, I've also some questions around ipython/webgl for you... Nicolas On Aug 11, 2012, at 9:17 , Fernando Perez wrote: On Sat, Aug 11, 2012 at 12:09 AM, Nicolas Rougier nicolas.roug...@inria.fr wrote: By the way, I suspect the simple plot part may well suited for the ipython notebook ! I'll give it a try. Actually in the notebook it is now possible to enable exercises, hints, reveal-boxes, etc. I'm cc'ing here Matthias Bussonnier b/c I'm not sure if he's on the mpl list. He's one of our recent core devs who is behind a lot of our new JS magic in the notebook, and he's also a French scientist who will be at Euroscipy, so you guys could perhaps touch bases (I'm unfortunately not going to make it this year). Ultimately we'd like to make it very easy to write tutorials such as yours directly as notebooks, so that when used in the classroom students can work straight off them, and yet also publish then with clean and customizable HTML on the web like you did. Lots of the pieces are in place, though not quite all yet :) Cheers, f -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] New tutorial (beginner level)
Hi all, I've just finished a new introductory tutorial for incoming Euroscipy 2012. You can find it here: http://www.loria.fr/~rougier/teaching/matplotlib/ It is based on Mike Müller tutorial from scipy lecture notes (http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html) Sources are available from: https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012 If you've any comments or see errors... Nicolas -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] New tutorial (beginner level)
Thank you all, I will try to correct that. I developed it in full screen mode and did not paid attention to the layout. Nicolas On Aug 10, 2012, at 15:33 , Fabrice Silva wrote: Le vendredi 10 août 2012 à 14:19 +0100, Damon McDougall a écrit : On Fri, Aug 10, 2012 at 09:10:15AM -0400, Benjamin Root wrote: Nice work. I haven't read through all of it yet, but I did notice a layout issue in firefox (using 10.0.4). Many of the code snippets are being placed on top of the example image. I see this behaviour too, on Chrome, version 20.0.1132.57. Same on epiphany 3.4.2 (webkit 1.8.1) -- Fabrice Silva -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] New tutorial (beginner level)
Thanks, just forgot about the license. It will be the same as the scipy lecture notes which is a Creative Commons Attribution 3.0 United States License (CC-by) http://creativecommons.org/licenses/by/3.0/us Would that be ok or is a BSD one more suited ? Nicolas On Aug 10, 2012, at 15:10 , Benjamin Root wrote: On Fri, Aug 10, 2012 at 8:23 AM, Nicolas Rougier nicolas.roug...@inria.fr wrote: Hi all, I've just finished a new introductory tutorial for incoming Euroscipy 2012. You can find it here: http://www.loria.fr/~rougier/teaching/matplotlib/ It is based on Mike Müller tutorial from scipy lecture notes (http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html) Sources are available from: https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012 If you've any comments or see errors... Nicolas Nice work. I haven't read through all of it yet, but I did notice a layout issue in firefox (using 10.0.4). Many of the code snippets are being placed on top of the example image. What is the license for this tutorial? You should also place some copyright info at the bottom as well. Cheers! Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] New tutorial (beginner level)
Not at all of course. Glad this might be of some help for matplolib. Nicolas On Aug 10, 2012, at 16:03 , Michael Droettboom wrote: Very nice. I'm thinking of some ideas to revamp the documentation/website, and one thing I would like to do is to link to some of these external resources. Do you have any objections to me linking to this? Mike On 08/10/2012 08:23 AM, Nicolas Rougier wrote: Hi all, I've just finished a new introductory tutorial for incoming Euroscipy 2012. You can find it here: http://www.loria.fr/~rougier/teaching/matplotlib/ It is based on Mike Müller tutorial from scipy lecture notes (http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html) Sources are available from: https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012 If you've any comments or see errors... Nicolas -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] need an icon for a new featureH
What size/format do you need and would that be an option to transform/use Tango icons ? http://tango.freedesktop.org/ http://commons.wikimedia.org/wiki/Tango_icons Tango (for fullscreen but might suit tight-layout) inline: view-fullscreen.png inline: view-fullscreen.png inline: view-fullscreen.png inline: view-fullscreen.png inline: view-fullscreen.svg Nicolas On Jul 19, 2012, at 0:47 , Benjamin Root wrote: Hello all! I have just about completed a PR that would add a new button to the navigation toolbar for the tight_layout() action. I am hardly an artist and have no clue how to graphically represent the tight_layout action in a tiny icon. I would greatly welcome any graphics artist out there who could provide such an icon for matplotlib. Thanks! Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Additional line styles - comparison excel chart
Here is a quick example that might help you: http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-10-large.png http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-10.py Nicolas On Jul 16, 2012, at 11:27 , Daπid wrote: On Mon, Jul 16, 2012 at 11:09 AM, Benjamin Jonen bjo...@gmail.com wrote: 2) The coloring and the way the lines curve around looks very nice to me. I remember that the Excel charts did not have this nice look before Excel 2007. Can I achieve similar effects with matplotlib? I'm not really sure what creates this nice look, so this question is of course a little fuzzy. Maybe you are thinking about the smoothness of the curves. Even you have spaced points, they don't do sharp edges. In my opinion, for scientific research, they shouldn't be concealed in the general case, and this is, I think, the main target of MPL. Nevertheless, if in your case it makes sense and you want them to be smooth, you can do it through SciPy, applying a interpolation scheme. tck=scipy.interpolate(datax, datay) datax_n=np.arange(datax.min(), datax.max(), len(datax)*20) datay_n=sicpy.interpolate(splev(datax_n,tck,der=0) And then you plot datax_n and datay_n. http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#spline-interpolation-in-1-d-procedural-interpolate-splxxx -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Accelerating PDF saved plots
Your files do not seem to be readable: http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.pdf Nicolas On Jul 4, 2012, at 19:17 , Gökhan Sever wrote: Hello, I am working on creating some distribution plots to analyze cloud droplet and drop features. You can see one such plot at http://atmos.uwyo.edu/~gsever/data/rf06_1second/rf06_belowcloud_SurfaceArea_1second.pdf This file contains 38 pages and each page has 16 panels created via MPL's AxesGrid toolkit. I am using PdfPages from pdf backend profile to construct this multi-page plot. The original code that is used to create this plot is in http://code.google.com/p/ccnworks/source/browse/trunk/parcel_drizzle/rf06_moments.py The problem I am reporting is due to the lengthier plot creation times. It takes about 4 minutes to create such plot in my laptop. To better demonstrate the issue I created a sample script which you can use to reproduce my timing results --well based on pseudo/random data points. All my data points in the original script are float64 so I use float64 in the sample script as well. The script is at http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py I also included 2 pages output running the script with nums=2 setting http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.pdf Comparing my original output, indeed cloud particles are not from a normal distribution :) Joke aside, running with nums=2 for 2 pages time run test_speed.py CPU times: user 12.39 s, sys: 0.10 s, total: 12.49 s Wall time: 12.84 s when nums=38, just like my original script, then I get similar timing to my original run time run test.py CPU times: user 227.39 s, sys: 1.74 s, total: 229.13 s Wall time: 234.87 s In addition to these longer plot creation times, 38 pages plot creation consumes about 3 GB memory. I am wondering if there are tricks to improve plot creation times as well as more efficiently using the memory. Attempting to create two such distributions blocks my machine eating 6 GB of ram space. Using Python 2.7, NumPy 2.0.0.dev-7e202a2, IPython 0.13.beta1, matplotlib 1.1.1rc on Fedora 16 (x86_64) Thanks. -- Gökhan -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] tornado chart
I did it once and posted it to the list but never found the time to add it to the official gallery (my bad): http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-3-large.png http://www.loria.fr/~rougier/coding/gallery/ Nicolas On Jun 23, 2012, at 5:36 , Benjamin Root wrote: On Friday, June 22, 2012, John Hunter wrote: On Fri, Jun 22, 2012 at 2:48 PM, Alan G Isaac alan.is...@gmail.com wrote: On 6/21/2012 10:24 PM, Tony Yu wrote: Here's an example based off the horizontal bar charts in the gallery. Pretty good, really! More than just a starting point. And here is a modified example a little closer visually # tornado chart example; inspired by # http://www.nytimes.com/imagepages/2007/07/29/health/29cancer.graph.web.html # and sample code from Tony Yu import numpy as np import matplotlib.pyplot as plt cancers = [ 'Kidney cancer', 'Bladder cancer', 'Esophageal cancer', 'Ovarian cancer', 'Liver cancer', Non-Hodgkin's\nlymphoma, 'Leukemia', 'Prostate cancer', 'Pancreatic cancer', 'Breast cancer', 'Colorectal cancer', 'Lung cancer', ] num_cancers = len(cancers) # generate some random data for the graphs (TODO; put real data here) new_cases_men = np.random.uniform(low=20e3, high=200e3, size=num_cancers) new_cases_women = np.random.uniform(low=20e3, high=200e3, size=num_cancers) deaths_women = np.random.rand(num_cancers)*new_cases_women deaths_men = np.random.rand(num_cancers)*new_cases_men # force these values where the labels happen to make sure they are # positioned nicely new_cases_men[-1] = 120e3 new_cases_men[-2] = 55e3 deaths_men[-1] = 80e3 # bars centered on the y axis pos = np.arange(num_cancers) + .5 # make the left and right axes for women and men fig = plt.figure(facecolor='white', edgecolor='none') ax_women = fig.add_axes([0.05, 0.1, 0.35, 0.8]) ax_men = fig.add_axes([0.6, 0.1, 0.35, 0.8]) ax_men.set_xticks(np.arange(50e3, 201e3, 50e3)) ax_women.set_xticks(np.arange(50e3, 201e3, 50e3)) # turn off the axes spines except on the inside y-axis for loc, spine in ax_women.spines.iteritems(): if loc!='right': spine.set_color('none') # don't draw spine for loc, spine in ax_men.spines.iteritems(): if loc!='left': spine.set_color('none') # don't draw spine # just tick on the top ax_women.xaxis.set_ticks_position('top') ax_men.xaxis.set_ticks_position('top') # make the women's graphs ax_women.barh(pos, new_cases_women, align='center', facecolor='#DBE3C2', edgecolor='None') ax_women.barh(pos, deaths_women, align='center', facecolor='#7E895F', height=0.5, edgecolor='None') ax_women.set_yticks([]) ax_women.invert_xaxis() # make the men's graphs ax_men.barh(pos, new_cases_men, align='center', facecolor='#D8E2E1', edgecolor='None') ax_men.barh(pos, deaths_men, align='center', facecolor='#6D7D72', height=0.5, edgecolor='None') ax_men.set_yticks([]) # we want the cancer labels to be centered in the fig coord system and # centered w/ respect to the bars so we use a custom transform import matplotlib.transforms as transforms transform = transforms.blended_transform_factory( fig.transFigure, ax_men.transData) for i, label in enumerate(cancers): ax_men.text(0.5, i+0.5, label, ha='center', va='center', transform=transform) # the axes titles are in axes coords, so x=0, y=1.025 is on the left # side of the axes, just above, x=1.0, y=1.025 is the right side of the # axes, just above ax_men.set_title('MEN', x=0.0, y=1.025, fontsize=12) ax_women.set_title('WOMEN', x=1.0, y=1.025, fontsize=12) # the fig suptile is in fig coords, so 0.98 is the far right; we right align the text fig.suptitle('July 29, 2007', x=0.98, ha='right') # now add the annotations ax_men.annotate('New Cases', xy=(0.95*new_cases_men[-1], num_cancers-0.5), xycoords='data', xytext=(20, 0), textcoords='offset points', size=12, va='center', arrowprops=dict(arrowstyle=-), ) # a curved arrow for the deaths annotation ax_men.annotate('Deaths', xy=(0.95*deaths_men[-1], num_cancers-0.5), xycoords='data', xytext=(40, -20), textcoords='offset points', size=12, va='center', arrowprops=dict(arrowstyle=-, connectionstyle=angle,angleA=0,angleB=90,rad=3), ) plt.show() With some real data and a bit of polish to the source, I would love to add this to the gallery. Real data is a must, of course-- men with ovarian cancer just look silly. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security
Re: [Matplotlib-users] histogram and a line
You need to specify the ylim because your height may be larger than your histogram and then you cannot see it. Here is a script that reproduce your screenshot (with random data). import numpy as np import matplotlib.pyplot as plt plt.rc('xtick', direction = 'out') plt.rc('ytick', direction = 'out') data = np.random.normal(0,1,100) fig = plt.figure(figsize=(8,6), dpi=72, facecolor='w') axes = plt.subplot(111) axes.axvline(np.mean(data), 0, data.max(), linewidth=2, color='red') axes.hist(data, bins=50, normed=True) axes.set_ylim(0, 1) axes.set_xlim(-3, 3) axes.spines['right'].set_color('none') axes.spines['top'].set_color('none') axes.xaxis.set_ticks_position('bottom') axes.spines['bottom'].set_position(('data', -0.05)) axes.yaxis.set_ticks_position('left') axes.spines['left'].set_position(('data',-3.25)) plt.show() Nicolas On Mar 8, 2012, at 7:54 , Mic wrote: Hi Jerzy, Thank you for your answer. With the code below I get only a green line (see attached line.png): import numpy as np import matplotlib.pyplot as plt hist_data = [] heigth = max(hist_data) + 10 mean = np.mean(hist_data) f = plt.figure() h = f.add_subplot(111) h.hist(hist_data, bins=50, normed=True) h.plot([mean,mean],[0,height]) f.savefig('myhist.png') without h.plot() I get a histogram (see attached matplot_hist.png). How can I get the line and the histogram at the same time in the picture? How is it possible to norm the vertical axis in order to get similar results like in this picture (see attached hist.png)? Thank you in advance. On Wed, Mar 7, 2012 at 6:41 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: Mic: Hello, I am able to draw a histogram with the following code: ... h.hist(hist_data, bins=50, normed=True) However, I don't know how to draw a line for median at 249 position like in attachment. Are your axes really matplotlib axes? (I have doubts, since the vertical is not normed, although your histogram is). In your real axes, the command plot([249,249],[0,height]) draws a vertical line (there is a primitive vert. line as well), what is the problem?? Jerzy Karczmarczuk -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users line.pngmatplot_hist.pnghist.png-- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Matplotlib gallery
I've seen the discussion around the re-organization of the matplotlib gallery. If that might help, here is a link to a small gallery I made. The overall organization is simply based on subdirectories so maybe it could be a (temporary) solution for the matplotlib gallery (just matter of moving examples in the right subdirectory). http://www.loria.fr/~rougier/coding/gallery/ https://github.com/rougier/gallery Nicolas -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib gallery
I agree, but the current matplotlib gallery is rather clueless about what the examples are related to until you click an image. I'm personally using the gallery by looking at an example that match what I've in mind most closely and then look at the code. But you're right, some structure(s) would definitely help. Here is an example of a well structured gallery: http://www.gigawiz.com/aagraphs.html. The first-level structure is organized at: Specialized Scientific Graphing Scatter Graphs Contour Charts (2-D, 3-D, and Ternary) Heatmaps Voronoi Diagram Waterfall Charts Bubble Charts Spider Charts Polar Charts Column and Bar Charts Area Charts Line Charts Combination Charts (Column-Line, Bar-Line, Area-Line) Diagrams of Multiple, Independent Value-Axes Column, Bar or Area Graphs High-Low, (Open)-High-Low-Close, and Range Charts Pie Charts and X-Y Scatter Pie Vector Charts Statistical Charts Maybe we can find/agree on similar structure(s)/sub-structure(s) and adapt it to the current gallery ? Nicolas On Feb 23, 2012, at 16:59 , Jerzy Karczmarczuk wrote: Nicolas Rougier : I've seen the discussion around the re-organization of the matplotlib gallery. If that might help, here is a link to a small gallery I made. The overall organization is simply based on subdirectories so maybe it could be a (temporary) solution for the matplotlib gallery (just matter of moving examples in the right subdirectory). THANKS, Nicolas. This is a nice initiative, but I believe that in the context of a presentation of some software, this is not the way I would have chosen. Why people look-up /such/ galleries? Why I do it myself? What are the needs of my students (about 20 - 30 guys who work with matplotlib week after wek)? Often because I want to find a concrete program, which answers a concrete question : how to implement timed animations. How to make multiple plots. How to insert a figure in a GUI with widgets, how to distort an image matrix, etc. etc. So a gallery should contains infos about what the hell the example XYZ is about, what does it show, where is the *concrete* documentation page with the description of the tools used, etc. The order of examples should be rational, and as ALWAYS some cross-links would be useful. Program-sources without comments are not so useful... == But I believe that this is just a start, and I am aware that to criticize is easier than to do something. (Je suis un grognon né, Nicolas, désolé...). So please, continue, my heart is with you! Jerzy Karczmarczuk Caen, France. -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Hardware rendering with tricontourf
Thanks for posting the link to glumpy. As Benjamin explained, glumpy servers as a testbed for various technics that could be implemented later in matplotlib. The main problem today is that if you want to benefit from hardware acceleration, you have to use some GL features that are not compatible with he whole matplotlib framework (and we need to ensure some degree of compatibilty). I do not have yet a clean solution and I'm still experimenting. For your tricontourf problem, I think it might be solved quite easily with the proper GL shader but I would need a complete (and basic) matplotlib script example to check if this is actually the case. Nicolas On Jan 27, 2012, at 23:12 , Benjamin Root wrote: On Fri, Jan 27, 2012 at 10:06 AM, Howard how...@renci.org wrote: On 1/27/12 3:39 AM, Ian Thomas wrote: On 26 January 2012 19:36, Howard how...@renci.org wrote: I'm rendering some images with about 3.5 million triangles into a 512x512 png file using tricontourf. I'm running this in a virtual machine, and I'm pretty sure that there is no graphics rendering hardware being used. Is it possible, assuming the hardware was available, to make tricontourf use the rendering hardware? Will that happen by default? You are correct, there is no graphics hardware rendering. Rendering is controlled by the various matplotlib backends, and to my knowledge there are no backends currently available that use hardware rendering. There has been some work done on an OpenGL backend, but I am not sure of the status of this. The last time I checked it was pretty experimental. Perhaps someone involved with it can comment on its current status. Ian Thomas Ian Thanks very much for the reply. If it helps whoever is doing the OpenGL backend, I may be able to play with it a bit. Howard That would be the Glumpy project. http://code.google.com/p/glumpy/ As stated in an email response a while back, glumpy is intended to be a testbed for developing the OpenGL backend for future inclusion into matplotlib. Cheers! Ben Root -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] data free margin
Is that what you want ? No ticks, no labels: import matplotlib.pyplot as plt plt.plot(np.arange(10), np.arange(10)) plt.ylim(0,10) plt.yticks(np.linspace(3,10,8)) plt.show() Ticks but no labels: import matplotlib.pyplot as plt plt.plot(np.arange(10), np.arange(10)) plt.ylim(0,10) plt.yticks(np.linspace(0,10,11), ['']*3 + ['%d' % i for i in linspace(3,10,8)]) plt.show() Nicolas On Nov 22, 2011, at 20:13 , C M wrote: What's the best way in Matplotlib to have a y axis that doesn't have ticks/axis numbers near the bottom of the graph? I don't know if it would be specified as the bottom 1/10th of the graph or x amount of pixels or inches or whatever...just need a bit of extra y-less space there to plot values that have an x value but no y value. I'm assuming this would be done with a Formatter or Locator, but wasn't sure how to go about it. See attached image Thanks, Che y_axis_lower_margin.jpg-- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [ANN] glumpy 0.2.0
The interactive plot has been done using the AntTweakBar library and is not really user friendly. You can view the source from the demos directory: http://code.google.com/p/glumpy/source/browse/demos/atb.py Also, note that glumpy is not a replacement for matplotlib but rather a testbed for a future OpenGL backend to be integrated into matplotlib. Nicolas On Sep 18, 2011, at 14:00 , Stef Mientki wrote: hi Nicolas, looks very interesting. I was considering to move from MatPlotLib to guiqwt, because of it's easy interactive plots. But I see glumpy has it too. Can show the source code for the interactive plot in your examples ? thanks, stef On 17-09-2011 19:22, Nicolas Rougier wrote: Hi folks, I am pleased to announce a new release of glumpy, a small python library for the (very) fast vizualization of numpy arrays, (mainly two dimensional) that has been designed with efficiency in mind. If you want to draw nice figures for inclusion in a scientific article, you’d better use matplotlib but if you want to have a sense of what’s going on in your simulation while it is running, then maybe glumpy can help you. Download and screenshots at: http://code.google.com/p/glumpy/ Nicolas -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] [ANN] glumpy 0.2.0
Hi folks, I am pleased to announce a new release of glumpy, a small python library for the (very) fast vizualization of numpy arrays, (mainly two dimensional) that has been designed with efficiency in mind. If you want to draw nice figures for inclusion in a scientific article, you’d better use matplotlib but if you want to have a sense of what’s going on in your simulation while it is running, then maybe glumpy can help you. Download and screenshots at: http://code.google.com/p/glumpy/ Nicolas-- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] [ANN] glumpy 0.2.0
Hi folks, I am pleased to announce a new release of glumpy, a small python library for the (very) fast vizualization of numpy arrays, (mainly two dimensional) that has been designed with efficiency in mind. If you want to draw nice figures for inclusion in a scientific article, you’d better use matplotlib but if you want to have a sense of what’s going on in your simulation while it is running, then maybe glumpy can help you. Download and screenshots at: http://code.google.com/p/glumpy/ Nicolas-- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] RuntimeError: CGContextRef is NULL
I'm trying to have animated plots using draw_artist on mac os x and I got an error with the following script: import numpy as np import matplotlib.pyplot as plt plt.ion() plt.figure() subplot = plt.subplot(1,1,1) axis = plt.imshow(np.random.random((10,10))) plt.draw() subplot.draw_artist(axis) plt.show() The traceback is: Traceback (most recent call last): File matplotlib-bug.py, line 8, in module subplot.draw_artist(axis) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/axes.py, line 1946, in draw_artist a.draw(self._cachedRenderer) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/artist.py, line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/image.py, line 338, in draw gc = renderer.new_gc() File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py, line 105, in new_gc self.gc.save() RuntimeError: CGContextRef is NULL Is there something wrong in my script (it seems to be working on linux) ? Information: matplotlib version: 1.0.0 python version 2.7 macosx version: 10.6.4 Nicolas -- Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding. http://p.sf.net/sfu/hp-phase2-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] RuntimeError: CGContextRef is NULL
Thanks. Unfortunately wx and tk backends are broken on my machine (but they may be easier to fix). I will file a bug report for the native backend bug. Nicolas On Oct 4, 2010, at 22:27 , Friedrich Romstedt wrote: 2010/10/4 Nicolas Rougier nicolas.roug...@loria.fr: I'm trying to have animated plots using draw_artist on mac os x and I got an error with the following script: import numpy as np import matplotlib.pyplot as plt plt.ion() plt.figure() subplot = plt.subplot(1,1,1) axis = plt.imshow(np.random.random((10,10))) plt.draw() subplot.draw_artist(axis) plt.show() The traceback is: Traceback (most recent call last): File matplotlib-bug.py, line 8, in module subplot.draw_artist(axis) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/axes.py, line 1946, in draw_artist a.draw(self._cachedRenderer) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/artist.py, line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/image.py, line 338, in draw gc = renderer.new_gc() File /Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py, line 105, in new_gc self.gc.save() RuntimeError: CGContextRef is NULL Is there something wrong in my script (it seems to be working on linux) ? I don't know what it is, and it looks like some problem with the Mac-native backend, but I believe you can sort it out by just switching the backend to e.g. TkAgg. Friedrich -- Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding. http://p.sf.net/sfu/hp-phase2-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] glumpy: fast OpenGL numpy visualization + matplotlib integration
Hi all, glumpy is a fast OpenGL visualization tool for numpy arrays coded on top of pyglet (http://www.pyglet.org/). The package contains many demos showing basic usage as well as integration with matplotlib. As a reference, the animation script available from matplotlib distribution runs at around 500 fps using glumpy instead of 30 fps on my machine. Package/screenshots/explanations at: http://www.loria.fr/~rougier/coding/glumpy.html (it does not require installation so you can run demos from within the glumpy directory). Nicolas -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Numpy-discussion] glumpy: fast OpenGL numpy visualization + matplotlib integration
Well, I've been starting working on a pyglet backend but it is currently painfully slow mainly because I do not know enough of the matplotlib internal machinery to really benefit from it. In the case of glumpy, the use of texture object for representing 2d arrays is a real speed boost since interpolation/colormap/heightmap is made on the GPU. Concerning matplotlib examples, the use of glumpy should be actually two lines of code: from pylab import * from glumpy import imshow, show but I did not package it this way yet (that is easy however). I guess the main question is whether people are interested in glumpy to have a quick dirty debug tool on top of matplotlib or whether they prefer a full fledged and fast pyglet/OpenGL backend (which is really harder). Nicolas On 28 Sep, 2009, at 18:05 , Gökhan Sever wrote: On Mon, Sep 28, 2009 at 9:06 AM, Nicolas Rougier nicolas.roug...@loria.fr wrote: Hi all, glumpy is a fast OpenGL visualization tool for numpy arrays coded on top of pyglet (http://www.pyglet.org/). The package contains many demos showing basic usage as well as integration with matplotlib. As a reference, the animation script available from matplotlib distribution runs at around 500 fps using glumpy instead of 30 fps on my machine. Package/screenshots/explanations at: http://www.loria.fr/~rougier/coding/glumpy.html (it does not require installation so you can run demos from within the glumpy directory). Nicolas ___ NumPy-Discussion mailing list numpy-discuss...@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion Hi Nicolas, This is technically called OpenGL backend, isn't it? It is nice that integrates with matplotlib, however 300 hundred lines of code indeed a lot of lines for an ordinary user. Do you think this could be further integrated into matplotlib with a wrapper to simplify its usage? -- Gökhan -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Simple 3D support
Hi all, I've been working lately on 3d visualization for my own need and maybe the result may have some interest for some of you. I know there is already mlab/mayavi2/vtk that does a great job, but after having spent a lot of time trying to install all requirements, I headed for a very fast, simple and dedicated solution. Currently, scigl (this is the name of the framework) dependencies are restricted to OpenGL, GLUT, GLEW and Boost (for python export). You can find a beta version at http://www.loria.fr/~rougier/scigl/index.html and the mandatory screenshots are available at http://www.loria.fr/~rougier/scigl/screenshots.html . Nicolas - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] GTK pylab console
Hi all, I've developed a GTK/Python/Pylab console that is able to display most matplotlib figures directly within the console and handle matplotlib mouse events properly. Screenshots and sources are available at: http://www.loria.fr/~rougier/pylab.html I've tested several examples from matplotlib examples and they seem to be displayed properly. Any comments/requests are welcome. Nicolas Rougier. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] GTK pylab console
Thanks. I've stumbled across reinteract and found that the inline plot has been done using the previous version of the pylab console (http://blog.fishsoup.net/2007/11/10/reinteract-better-interactive-python/) Concerning ipython, I've once designed the code to integrate it but since then I got a bit lost with the future new version of ipython (ipython1). I will try to look again. Nicolas On Fri, 2008-06-27 at 09:29 -0400, Michael Droettboom wrote: Very nice. I like the idea of inline plots -- less of an interrupted flow. Have you looked at the similar project reinteract? (www.reinteract.org) It's a little more aggressively different, for what it's worth. The author seems to have lost steam in the last few months, but it has some interesting ideas. It would be neat to integrate ipython, rather than just the standard python shell, into your console to get autocompletion, fancier help etc. I think the combination could be great. Thanks for sharing this, and keep us updated! Cheers, Mike Nicolas Rougier wrote: Hi all, I've developed a GTK/Python/Pylab console that is able to display most matplotlib figures directly within the console and handle matplotlib mouse events properly. Screenshots and sources are available at: http://www.loria.fr/~rougier/pylab.html I've tested several examples from matplotlib examples and they seem to be displayed properly. Any comments/requests are welcome. Nicolas Rougier. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users