[Matplotlib-users] Line clipping on subplot border mandatory?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I would like to stack subplots in a figure with a couple of basic x,y-line plots with the subplot frames removed. But possible overlap of subplots is limited, because the drawn data lines are clipped on the border, if you'd lets say manually reset the ylims and decrease it below the highest data y-values. I know it is possible with any kind of text or data annotation, but do not find a way to let the data lines cross the frame border. I hope I made myself halfway clear - pls. don't hesitate to ask if not. Does one of you possibly have a solution or is it maybe plain impossible? Thanks! Cheers, Nix -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN40aCAAoJEGQ1ZathkK0XWqcIALPWS0vLh/oCISWfHaeB7NaV 7GOJizENlvD+kwuj1z8fEpMHOM2WrKYPX9GBh7SPGzHR+cZIcpmz0yCa2QhdB2jl YSNLHjL1z33JZf+CMuMsn6iI5KEi8s1WIZGJhYTq5LCklPitvqu0qsT518BjWPMc 7pezJMmYPPBFFYsvSlemO2PMitfa4EIHCjufySWSoPSveTSS8VBT8IsRRhcxoUca YmngZ7JA8vqrkJjRKUys5lyLsuKfUehhCmp+XaU6FAJL13rTe340dbfbUxp3IWfd QyNcn+UHlWJtR9tPgC5NfndIGIx3O9/jmllqXTn47oLD3A3ekFG03UjGY6K1ccY= =HuCp -END PGP SIGNATURE- -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
Thank you for your response. Benjamin Root-2 wrote: On Sunday, May 29, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: What does ion() exactly do? $$$ from matplotlib import pyplot as pp pp.plot([10, 20, 50]) pp.draw() raw_input('Press enter...') # No graph displayed?!! $$$ Turning interactive mode on also means an implied show command, if needed. The first program can replace draw() with show(). However, if interactive mode is off, then the python execution pauses. With it on, python execution will continue. So, if anything is drawn when interactive mode is off, does one *have* to use show() at the end? in other words does using a single raw_input() at the end of the program force the use of the interactive mode for *all* figures? (Closing all the figures with a simple enter is very convenient, but having a performance penalty for this would not be so nice…). Now, if I understand you correctly, I have another question. I don't understand anymore what draw() does: in fact, it is not necessary in interactive mode, and it does not appear to do anything in non-interactive mode, since show() is really the function that really displays the figures. So, why does matplotlib offer draw()? what does it really do? EOL PS: Here is an example: the following code does *not* display the first figure (Matplotlib 1.0.0 on Mac OS X with the GTKAgg backend): $$$ from matplotlib import pyplot as pp pp.figure() pp.plot([10, 20, 50]) pp.draw() # Will not be displayed despite the draw() pp.ion() # Interactive mode on pp.figure() pp.plot([100, 20, 10]) raw_input('Press enter...') # Only the second graph is displayed $$$ -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31731176.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] embedding subset of fonts when saving to pdf
Thank you for the info. I added the issue to the github for now. I will inspect the source whether there is an easy way to add subsetting of fonts for usetex=True case as well. Simon On 05/27/2011 05:02 PM, Michael Droettboom wrote: Ah, yes. That is all true. I'm not sure what options there may be in that case. Mike On 05/27/2011 10:56 AM, Simon Jesenko wrote: Setting 'pdf.fonttype'=3 had no effect, embedded fonts are of fonttype=1 nonetheless. I guess that pdf.fonttype parameter is used only when matplotlib uses it's own engine to render latex, and not when text.usetex=true is used. Cairo backend is not support when text.usetex=true (only Agg, pdf and ps according to documentation) On 05/27/2011 03:53 PM, Michael Droettboom wrote: Have you tried setting the rcParams pdf.fonttype to 3? That should subset the fonts. Also, the Cairo backend supports font subsetting. Mike On 05/27/2011 07:00 AM, Simon Jesenko wrote: Hi, I have a problem with large file-sizes of plots saved to pdf, when using rcParams['text.usetex']=True Files are very large (~150kb for simple line plot with some mathematical latex expressions) as all fonts are fully embedded into pdf. When resulting pdf is postprocessed (e.g. as is http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html), so that only subset of fonts is embedded, file size is reduced drastically(e.g. from 150kb to 15kb). Is there a way to enable embedding of subset of fonts in matplotlib? I am using matplotlib version 0.99.3. Did anyone else experience similar problems/found solution? Thank you for info/assistance! Simon -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Not able to access CSV file:
Hi, the content of the CSV is stored as an array after reading. You can simply access rows and columns like in Matlab: firstrow = a1[0] firstcol = a1.T[0] The .T transposes the array. The second element of the third row would be elem32 = a1[2][1] which is equivalent to elem32 = a1[2,1] A range of e.g. rows 3 to 6 is range36 = a1[2:6] Please have a look here for getting started with scipy/numpy: http://pages.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/arrays.html and http://www.scipy.org/NumPy_for_Matlab_Users Hope this helps, Daniel 2011/5/27 Karthikraja Velmurugan velmurugan.karthikr...@gmail.com: Hello Daniel, The code you have given is simple and works fab. Thank you very much. But I wasn't able to find an example which accesses the columns of a CSV files when I import data through datafile=filename.csv option. It will be great if you could help with accessing individual columns. What excatly I am looking for is to access individual coulmns (of the same CSV file), do calculations using the two coumns and plot them into seperate subplots of the same graph. I modified the script a lil bit. Please find it below: import matplotlib.pyplot as plt import pylab datafile1 = 'ch1_s1_lrr.csv' datafile2 = 'ch1_s1_baf.csv' a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';') b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';') v1 = [0,98760,0,1] v2 = [0,98760,-2,2] plt.figure(1) plt.subplot(4,1,1) print 'loading', datafile1 plt.axis(v2) plt.plot(a1, 'r.') plt.subplot(4,1,2) print 'loading', datafile2 plt.axis(v1) plt.plot(b1, 'b.') plt.show() Thank you very much in advance for your time and suggestions. Karthik -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] mpl newbie question...
I am a college student and I want to be able to use matplotlib to plot publishing quality graphs and embed them into my pdf documents (all composed with latex) for college. This would give my documents a more professional look. I do not know the first thing about Python language. And I am only able to create a very simple pie graph by using and editing a script file from mpl's website. But things are not going well and I do not want to use any other programs such as GNUplot or other such open source programs which run on my linux machine and I am not purchasing any anything developed by Micro$oft. I have come to a road block and need guidance regarding what materials (e.g. books) I should purchase to help teach myself python/mathplolib or how I should move forward to become proficient use mpl? I know little or nothing now so any newbie advice is much appreciated. Thanks in advance. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
On Monday, May 30, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: Thank you for your response. Benjamin Root-2 wrote: On Sunday, May 29, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: What does ion() exactly do? $$$ from matplotlib import pyplot as pp pp.plot([10, 20, 50]) pp.draw() raw_input('Press enter...') # No graph displayed?!! $$$ Turning interactive mode on also means an implied show command, if needed. The first program can replace draw() with show(). However, if interactive mode is off, then the python execution pauses. With it on, python execution will continue. So, if anything is drawn when interactive mode is off, does one *have* to use show() at the end? in other words does using a single raw_input() at the end of the program force the use of the interactive mode for *all* figures? (Closing all the figures with a simple enter is very convenient, but having a performance penalty for this would not be so nice…). Yes, if interactive mode is off, and you want to view the figures, you need show(). No, the raw_input does nothing in either case. Now, if I understand you correctly, I have another question. I don't understand anymore what draw() does: in fact, it is not necessary in interactive mode, and it does not appear to do anything in non-interactive mode, since show() is really the function that really displays the figures. So, why does matplotlib offer draw()? what does it really do? The draw() command is used for some more advanced features such as animations and widgets, as well as for internal use. I rarely use draw() in my scripts. May I suggest reading the FAQ and some of the example scripts on the website in order to demonstrate the different ways to use mpl? Ben Root EOL PS: Here is an example: the following code does *not* display the first figure (Matplotlib 1.0.0 on Mac OS X with the GTKAgg backend): Off the top of my head, this is either a bug that has been fixed, or is intended behavior. Turning interactive mode on after having made a figure might be confusing pyplot. Calling show at anytime will produce the intended behavior. show() is your friend. $$$ from matplotlib import pyplot as pp pp.figure() pp.plot([10, 20, 50]) pp.draw() # Will not be displayed despite the draw() pp.ion() # Interactive mode on pp.figure() pp.plot([100, 20, 10]) raw_input('Press enter...') # Only the second graph is displayed $$$ -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31731176.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Line clipping on subplot border mandatory?
On Monday, May 30, 2011, Mondsuechtiger el_lunat...@gmx.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I would like to stack subplots in a figure with a couple of basic x,y-line plots with the subplot frames removed. But possible overlap of subplots is limited, because the drawn data lines are clipped on the border, if you'd lets say manually reset the ylims and decrease it below the highest data y-values. I know it is possible with any kind of text or data annotation, but do not find a way to let the data lines cross the frame border. I hope I made myself halfway clear - pls. don't hesitate to ask if not. Does one of you possibly have a solution or is it maybe plain impossible? Thanks! Cheers, Nix Maybe you want to use matplotlib's spine feature? You are right that you can't plot outside the plotable region, but maybe you can emulate what you want by moving the axes lines into the plottable region. I hope that helps! Ben Root -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN40aCAAoJEGQ1ZathkK0XWqcIALPWS0vLh/oCISWfHaeB7NaV 7GOJizENlvD+kwuj1z8fEpMHOM2WrKYPX9GBh7SPGzHR+cZIcpmz0yCa2QhdB2jl YSNLHjL1z33JZf+CMuMsn6iI5KEi8s1WIZGJhYTq5LCklPitvqu0qsT518BjWPMc 7pezJMmYPPBFFYsvSlemO2PMitfa4EIHCjufySWSoPSveTSS8VBT8IsRRhcxoUca YmngZ7JA8vqrkJjRKUys5lyLsuKfUehhCmp+XaU6FAJL13rTe340dbfbUxp3IWfd QyNcn+UHlWJtR9tPgC5NfndIGIx3O9/jmllqXTn47oLD3A3ekFG03UjGY6K1ccY= =HuCp -END PGP SIGNATURE- -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
Benjamin Root-2 wrote: On Monday, May 30, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: Benjamin Root-2 wrote: So, if anything is drawn when interactive mode is off, does one *have* to use show() at the end? in other words does using a single raw_input() at the end of the program force the use of the interactive mode for *all* figures? (Closing all the figures with a simple enter is very convenient, but having a performance penalty for this would not be so nice…). Yes, if interactive mode is off, and you want to view the figures, you need show(). No, the raw_input does nothing in either case. Now, if I understand you correctly, I have another question. I don't understand anymore what draw() does: in fact, it is not necessary in interactive mode, and it does not appear to do anything in non-interactive mode, since show() is really the function that really displays the figures. So, why does matplotlib offer draw()? what does it really do? The draw() command is used for some more advanced features such as animations and widgets, as well as for internal use. I rarely use draw() in my scripts. Thank you for the follow up. I wish that Matplotlib provided a mechanism for bypassing show(), because show() is actually not my friend. :-) In fact, with show(), I hate having to close one by one each of the 12 figures that my script creates each time I run it. The Matplotlib documentation indeed lists many ways to use Matplotlib. However, I was trying to get beyond recipes and to get a deeper understanding of what Matplotlib does, so as to avoid wasting too much time when trying to do something that is not in one of those recipes. Like stopping a program that was fully or partially in run in non-interactive mode, without having to use this dreaded show()… Thank you again for your input. It is good to know the limitations of Matplotlib. Maybe it is time to suggest the feature I mentioned to the dev list?? -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734191.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
On Monday, May 30, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: Benjamin Root-2 wrote: On Monday, May 30, 2011, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: Benjamin Root-2 wrote: So, if anything is drawn when interactive mode is off, does one *have* to use show() at the end? in other words does using a single raw_input() at the end of the program force the use of the interactive mode for *all* figures? (Closing all the figures with a simple enter is very convenient, but having a performance penalty for this would not be so nice…). Yes, if interactive mode is off, and you want to view the figures, you need show(). No, the raw_input does nothing in either case. Now, if I understand you correctly, I have another question. I don't understand anymore what draw() does: in fact, it is not necessary in interactive mode, and it does not appear to do anything in non-interactive mode, since show() is really the function that really displays the figures. So, why does matplotlib offer draw()? what does it really do? The draw() command is used for some more advanced features such as animations and widgets, as well as for internal use. I rarely use draw() in my scripts. Thank you for the follow up. I wish that Matplotlib provided a mechanism for bypassing show(), because show() is actually not my friend. :-) In fact, with show(), I hate having to close one by one each of the 12 figures that my script creates each time I run it. The Matplotlib documentation indeed lists many ways to use Matplotlib. However, I was trying to get beyond recipes and to get a deeper understanding of what Matplotlib does, so as to avoid wasting too much time when trying to do something that is not in one of those recipes. Like stopping a program that was fully or partially in run in non-interactive mode, without having to use this dreaded show()… Thank you again for your input. It is good to know the limitations of Matplotlib. Maybe it is time to suggest the feature I mentioned to the dev list?? I am not sure exactly what feature you are asking for. If you are in interactive mode, you could setup a key binding to call a function to close all figures. Another route to go is to take advantage of subplots and reduce the number of figures you need to have. Also, it bares repeating. You may be experiencing some bugs with interactive mode in v1.0.0. Some very important bugfixes were made wrt interactive mode for the v1.0.1 release. I know the sourceforge page still points to v1.0.0, that is a problem that I hope to have fixed later in the next few days. Ben Root -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734191.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
Benjamin Root-2 wrote: On Monday, May 30, 2011, Eric O LEBIGOT (EOL) I wish that Matplotlib provided a mechanism for bypassing show(), because show() is actually not my friend. :-) In fact, with show(), I hate having to close one by one each of the 12 figures that my script creates each time I run it. (…) stopping a program that was fully or partially in run in non-interactive mode, without having to use this dreaded show()… (…) I am not sure exactly what feature you are asking for. If you are in interactive mode, you could setup a key binding to call a function to close all figures. Another route to go is to take advantage of subplots and reduce the number of figures you need to have. The keybinding idea is interesting, but the goal is to work in *non*-interactive mode (for optimization purposes), and the feature I would love is simply to be able to display graphs in this mode without using show(). Subplots are unfortunately not an option for me, as each of the numerous graph must be independent (they are each saved in a specific file). Benjamin Root-2 wrote: Also, it bares repeating. You may be experiencing some bugs with interactive mode in v1.0.0. Some very important bugfixes were made wrt interactive mode for the v1.0.1 release. I know the sourceforge page still points to v1.0.0, that is a problem that I hope to have fixed later in the next few days. Thanks, I'll definitely check out version 1.0.1. The feature I wish existed is unfortunately relevant to the *non*-interactive mode. -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734671.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] mpl newbie question...
I do not know the first thing about Python language.But things are not going well That's not a but but an of course. How could they possibly go well already? It takes time to learn something. You will get there, bit by bit. and I do not want to use any other programs such as GNUplot or other such open source programs which run on my linux machine and I am not purchasing any anything developed by Micro$oft. I'm curious. Why not? I have come to a road block and need guidance regarding what materials (e.g. books) I should purchase to help teach myself python/mathplolib or how I should move forward to become proficient use mpl? For Python, there are tons of online tutorials such as Alan Gauld's as well as any number of books (Google for recommendations or search the Python Google Group for very many iterations of asking for recommendations). For specific questions, the Python tutor list is great, and now Stack Overflow is also very good. For specific Matplotlib questions beyond the tutorial or examples, either SO or this list is excellent. There is now a matplotlib book by Sandro Tosi, too. I know little or nothing now so any newbie advice is much appreciated. I recommend that you write down a set of goals for what you want to accomplish, and then tackle them one by one. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
On 05/30/2011 06:42 AM, Eric O LEBIGOT (EOL) wrote: Benjamin Root-2 wrote: On Monday, May 30, 2011, Eric O LEBIGOT (EOL) I wish that Matplotlib provided a mechanism for bypassing show(), because show() is actually not my friend. :-) In fact, with show(), I hate having to close one by one each of the 12 figures that my script creates each time I run it. (…) stopping a program that was fully or partially in run in non-interactive mode, without having to use this dreaded show()… (…) I am not sure exactly what feature you are asking for. If you are in interactive mode, you could setup a key binding to call a function to close all figures. Another route to go is to take advantage of subplots and reduce the number of figures you need to have. The keybinding idea is interesting, but the goal is to work in *non*-interactive mode (for optimization purposes), and the feature I would love is simply to be able to display graphs in this mode without using show(). Subplots are unfortunately not an option for me, as each of the numerous graph must be independent (they are each saved in a specific file). Is it correct that you want interactive mode, except that you want to control when drawing occurs, for purposes of efficiency? If so, use interactive mode, but instead of using the pyplot interface for the actual plotting, use the OO interface, and call plt.draw() when you want to update a plot. See http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related although this does not give precisely the example to match your case. Eric Benjamin Root-2 wrote: Also, it bares repeating. You may be experiencing some bugs with interactive mode in v1.0.0. Some very important bugfixes were made wrt interactive mode for the v1.0.1 release. I know the sourceforge page still points to v1.0.0, that is a problem that I hope to have fixed later in the next few days. Thanks, I'll definitely check out version 1.0.1. The feature I wish existed is unfortunately relevant to the *non*-interactive mode. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Line clipping on subplot border mandatory?
On 05/30/2011 05:21 AM, Benjamin Root wrote: On Monday, May 30, 2011, Mondsuechtigerel_lunat...@gmx.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I would like to stack subplots in a figure with a couple of basic x,y-line plots with the subplot frames removed. But possible overlap of subplots is limited, because the drawn data lines are clipped on the border, if you'd lets say manually reset the ylims and decrease it below the highest data y-values. I know it is possible with any kind of text or data annotation, but do not find a way to let the data lines cross the frame border. You can cross the Axes frame border by turning off clipping: ll = plot([-1, 1])[0] axis([0.1, 0.95, -1, 1]) ll.set_clip_on(False) draw() Eric I hope I made myself halfway clear - pls. don't hesitate to ask if not. Does one of you possibly have a solution or is it maybe plain impossible? Thanks! Cheers, Nix Maybe you want to use matplotlib's spine feature? You are right that you can't plot outside the plotable region, but maybe you can emulate what you want by moving the axes lines into the plottable region. I hope that helps! Ben Root -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Line clipping on subplot border mandatory?
On Mon, May 30, 2011 at 1:12 PM, Eric Firing efir...@hawaii.edu wrote: On 05/30/2011 05:21 AM, Benjamin Root wrote: On Monday, May 30, 2011, Mondsuechtigerel_lunat...@gmx.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I would like to stack subplots in a figure with a couple of basic x,y-line plots with the subplot frames removed. But possible overlap of subplots is limited, because the drawn data lines are clipped on the border, if you'd lets say manually reset the ylims and decrease it below the highest data y-values. I know it is possible with any kind of text or data annotation, but do not find a way to let the data lines cross the frame border. You can cross the Axes frame border by turning off clipping: ll = plot([-1, 1])[0] axis([0.1, 0.95, -1, 1]) ll.set_clip_on(False) draw() Eric Ah, I see. I have to turn the clipping attribute off for the object(s) being plotted, not for the axes object. I learned something new today... Ben Root -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
efiring wrote: Is it correct that you want interactive mode, except that you want to control when drawing occurs, for purposes of efficiency? Thank you for your interest in this question, Eric! The goal is to indeed control when drawing occurs, but also to not use show() (because it cumbersome to have to close umpteen windows so as to finish a Matplotlib program that opened lots of figures). (I checked the examples that you referred to) It looks like Matplotlib forces either to use the interactive mode (possibly inefficient) or to use show() (possibly cumbersome). I wish that Matplotlib offers an alternative to this situation, but this looks less and less to be the case. That's something I would like to suggest to the devs. :-) -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31735322.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Line2D drawstyle
In the docs for Line2D, it says that the linestyle can be any drawstyle in combination with a linestyle, e.g. 'steps--'. However, this doesn't seem to work in practice. I believe I have matplotlib 1.0.1 here: In [2]: from matplotlib import lines In [3]: line=lines.Line2D([0,1,2],[0,1,4], linestyle='steps--') In [4]: line.get_drawstyle() Out[4]: 'default' In [5]: line.get_linestyle() Out[5]: '--' Note that if I specifically set the linestyle using set_linestyle, it appears to parse out the drawstyle: In [11]: line.set_linestyle('steps--') In [12]: line.get_drawstyle() Out[12]: 'steps' However, if I plot the line using the plot() command, the drawstyle is correctly set to 'steps'. In [6]: from matplotlib import pyplot In [7]: line2=pyplot.plot([0,1,2],[0,1,4], linestyle='steps--') In [8]: line2 Out[8]: [matplotlib.lines.Line2D object at 0x114fcb110] In [9]: line2[0].get_drawstyle() Out[9]: 'steps' In [10]: line2[0].get_linestyle() Out[10]: '--' Should Line2D parse out the drawstyle from the linestyle, or are the docs wrong about the Line2D linestyle parameters, or am I just misunderstanding something here? Thanks, Jason -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Exact semantics of ion()??
On Mon, May 30, 2011 at 3:11 PM, Eric O LEBIGOT (EOL) eric.lebi...@normalesup.org wrote: efiring wrote: Is it correct that you want interactive mode, except that you want to control when drawing occurs, for purposes of efficiency? Thank you for your interest in this question, Eric! The goal is to indeed control when drawing occurs, but also to not use show() (because it cumbersome to have to close umpteen windows so as to finish a Matplotlib program that opened lots of figures). (I checked the examples that you referred to) It looks like Matplotlib forces either to use the interactive mode (possibly inefficient) or to use show() (possibly cumbersome). I wish that Matplotlib offers an alternative to this situation, but this looks less and less to be the case. That's something I would like to suggest to the devs. :-) Question: would displaying a figure (or a group of figures), pausing to let you close them, and then continuing to the next figures more along the lines of what you want? That is certainly possible with matplotlib. Since v1.0.0, multiple calls to show() is allowed (although you may need v1.0.1 for certain backends to do this correctly). Furthermore, I think Eric Firing's point was that mpl is fully capable of doing what you want. The automatic draws are only done if the calls come through pyplot or pylab and if interactive mode is on. There might be a few minor exceptions to this rule, but those shouldn't cause significant overhead. If you call the drawing commands directly, then a refresh does not occur until you tell it to with a call to draw(). In pyplot, nearly all drawing commands have as the final step a call to a function called draw_if_interactive(). This function does exactly what it says. Therefore, if you want interactive mode, but do not want a refresh after each pyplot command, then don't use the pyplot commands! Just use the objects' drawing commands (which is what pyplot calls). Also, note that matplotlib is hierarchical. You could call directly call draw() on each object you want re-drawn, but you don't have to. You can give a single call to a parent object that would call draw() for all of its children objects. So, a figure object has (among other things) axes objects as children. An axes object has (among other things) various collection objects from the plotting commands as its children. Maybe a look at some of the animation examples might be a good way to illustrate this. I would suggest looking at the older animation examples on sourceforge where the internals are all laid out. I hope this is helpful, Ben Root -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users