[Matplotlib-users] Editing a colorbar
Hi all, I am having a problem with manipulating colorbars. I want to take the cm.Blues colorbar and edit it so that the lowest end of the colorbar is light blue instead of white, or in other words I want to remove the lightest 1/4 of the colorbar and just keep the darker end. Is there any easy way to do this? Any help would be greatly appreciated! Thanks Ian Harry -- --- Ian Harry School of Physics Astronomy Queens Buildings, The Parade Cardiff, CF24 3AA Email: ian.ha...@astro.cf.ac.uk Phone: (+44) 29 208 75120 Mobile: (+44) 7890 479090 --- -- This SF Dev2Dev email is sponsored by: WikiLeaks The End of the Free Internet http://p.sf.net/sfu/therealnews-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] unable to point pick 2nd axis after upgrade to mpl 1.0
I have created a runnable sample app that demonstrates the problem Here is a much simpler 10 line sample that doesn't require wxPython and demonstrates the problem: you can't pick the red line. This seems like a bug in mpl 1.0. import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax2 = ax.twinx() line, = ax.plot([1,2,3], 'r-o', markersize=15, picker=5) line2, = ax2.plot([4,2,12], 'b-o', markersize=15, picker=5) def onpick(event): print 'picked line: ', event.artist fig.canvas.mpl_connect('pick_event', onpick) plt.show() -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] unable to point pick 2nd axis after upgrade to mpl 1.0
2010/12/9 C M cmpyt...@gmail.com: I have created a runnable sample app that demonstrates the problem Here is a much simpler 10 line sample that doesn't require wxPython and demonstrates the problem: you can't pick the red line. This seems like a bug in mpl 1.0. Confirmed using tkagg, mpl 1.0.0 and Ubuntu 10.10. I do not know much about the semantics of the pick event but it I don't think it should discriminate between lines in the same canvas si I guess it's a bug. Goyo -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Taylor diagram
Hi, Has anyone ever managed to draw a taylor diagram in Matplotlib? For example like this http://www.mathworks.com/matlabcentral/fx_files/20559/2/taylordiag_fig.jpg Cheers, Martin -- View this message in context: http://old.nabble.com/Taylor-diagram-tp30421393p30421393.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] memory leak caused by canvas.draw()
I explored the memory leak in my strip chart widget some more and found that it is caused by calling canvas.draw(), where canvas is: figure = matplotlib.figure.Figure(figsize=(8, 2), frameon=True) canvas = FigureCanvasTkAgg(figure, self) canvas.show() exhibits exactly the same problem. So...what is the right way to redraw a plot after its X axes have been changed? -- Russell -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Bus error on import - Mac OS X (10.5.8) Matplotlib 1.0.0
In article 4cfd8253.5060...@hms.harvard.edu, Kaushik Ghose kaushik_gh...@hms.harvard.edu wrote: Hi Guys, I did a search on the mailing list but could not come up with a solution, so I am crying Uncle and writing. I installed matplotlib 1.0.0 from the package on SF (http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0/ma tplotlib-1.0.0-python.org-py2.6-macosx10.4.dmg/download) I assumed that 10.4 would work on my 10.5 - perhaps that is where I went wrong? I installed it and got, satisfactorily: import matplotlib matplotlib.__version__ --- '1.0.0' But when I do import pylab I get a bus error that throws me out of ipython. It should work on Mac OS X 10.4. A newer version of this binary is available here, which I recommend instead: http://www.astro.washington.edu/users/rowen/python/ A few things to try: - Make sure you have Python 2.6 from python.org - Make sure you have a good numpy build, preferably of 1.5 or 1.5.1 - matplotlib 1.0.0 will crash if it has a problem with the font cache (though I don't think that is what caused your crash); to fix that delete the font cache in the ~/.matplotlib directory. That problem should be fixed in 1.0.1. -- Russell -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] unable to point pick 2nd axis after upgrade to mpl 1.0
As far as I understand, all the events in matplotlib are associated with a single Axes instance (or None). For overlapping multiple axes, the axes with highest zorder is picked up. And a pick event only works for artists in the associated axes. While this simple approach is okay at least to me, I want to hear from other developers. For the example above, a workaround is to move the line to the axes of higher zorder. line.remove() ax2.add_line(line) Regards, -JJ On Fri, Dec 10, 2010 at 5:01 AM, Goyo goyod...@gmail.com wrote: 2010/12/9 C M cmpyt...@gmail.com: I have created a runnable sample app that demonstrates the problem Here is a much simpler 10 line sample that doesn't require wxPython and demonstrates the problem: you can't pick the red line. This seems like a bug in mpl 1.0. Confirmed using tkagg, mpl 1.0.0 and Ubuntu 10.10. I do not know much about the semantics of the pick event but it I don't think it should discriminate between lines in the same canvas si I guess it's a bug. Goyo -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Taylor diagram
On 12/09/2010 05:42 PM, mdekauwe wrote: Hi, Has anyone ever managed to draw a taylor diagram in Matplotlib? For example like this http://www.mathworks.com/matlabcentral/fx_files/20559/2/taylordiag_fig.jpg Cheers, Martin Not sure whether Matplotlib can do this, but it can be done with CDAT, another Python-based library: http://www2-pcmdi.llnl.gov/cdat HTH, AMG - -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] unable to point pick 2nd axis after upgrade to mpl 1.0
When I was using matplotlib 0.98.5.2, I had the same code as I have now, with two different axes, and pick events were picked up on lines belonging to either of the axes. Unless I'm misunderstanding, something has changed and this used to be possible. Is that correct? Yes, I believe this used to be possible. While I'm not sure why it changed, I'm also not sure if we need to revert this change as I personally prefer the current simple behavior (although there could be a room for improvement). And I want to hear what others think. You may file a new feature request (or a bug if you want) issue regarding this. For the example above, a workaround is to move the line to the axes of higher zorder. line.remove() ax2.add_line(line) Thanks. That works for that example, but in my actual program I want to highlight the picked points with a star. if I reparent the one line to the other axis, the stars will be plotted on the wrong axis, way off the intended marker. This can be seen in the modification of the above code, posted below (click on the middle red marker, then the middle blue one). Is there a further workaround? (Code at bottom). It will work if you explicitly set its transform. star, = ax.plot([xdata[ind]], [ydata[ind]], '*', ms=40, mfc='y', mec='b', transform=thisline.get_transform()) I also use the identity of the picked line in my code, since I provide additional information about that data series to the user based on which line (and point) they picked. So if reparenting the line loses that information, that's going to be a problem. I believe that reparenting only changes the axes attribute of the line, so it might not be a problem. Given the current implementation of the pick event handler, I think it might be better for you to implement a custom handler although this may takes you more time. However, I must admit that I rarely use events with matplotlib. I'm only addressing this since there were no response from other developers. And they may have different opinions than me. Regards, -JJ thanks, -Che --- import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax2 = ax.twinx() line, = ax.plot([1,2,5], 'r-o', markersize=15, picker=5) line2, = ax2.plot([4,5,12], 'b-o', markersize=15, picker=5) line.remove() ax2.add_line(line) def onpick(event): thisline = event.artist print 'picked line: ', event.artist ind = event.ind xdata = thisline.get_xdata() ydata = thisline.get_ydata() star, = ax.plot([xdata[ind]], [ydata[ind]], '*', ms=40, mfc='y', mec='b') fig.canvas.draw() fig.canvas.mpl_connect('pick_event', onpick) plt.show() -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Taylor diagram (mdekauwe)
Hi Jean-Marie Epitalon (from IPSL) developped several scripts devoted to model inter-comparison, included Taylor Diagram, which you can find here (http://www.ipsl.jussieu.fr/~jmesce/Taylor_diagram/Miscelaneous/plot_taylor_diagrams.py) see also here (http://www.ipsl.jussieu.fr/~jmesce/Taylor_diagram/index.html) and follow the complete description of the program code hope that helps Nicolas Message: 6 Date: Thu, 9 Dec 2010 14:42:41 -0800 (PST) From: mdekauwe mdeka...@gmail.com Subject: [Matplotlib-users] Taylor diagram To: matplotlib-users@lists.sourceforge.net Message-ID: 30421393.p...@talk.nabble.com Content-Type: text/plain; charset=us-ascii Hi, Has anyone ever managed to draw a taylor diagram in Matplotlib? For example like this http://www.mathworks.com/matlabcentral/fx_files/20559/2/taylordiag_fig.jpg Cheers, Martin -- View this message in context: http://old.nabble.com/Taylor-diagram-tp30421393p30421393.html Sent from the matplotlib - users mailing list archive at Nabble.com. ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users End of Matplotlib-users Digest, Vol 55, Issue 12 -- _/\/¯¯\/\_ 33º49'45.24S 18º28'45.60E Dr. Nicolas Fauchereau CSIR - NRE Research Group: Ocean systems and climate 15 Lower Hope street, Rosebank 7700 South Africa tel: 021 658 2764 _/\/¯¯\/\_ 33º49'45.24S 18º28'45.60E -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users