Re: [Matplotlib-users] Plotting style
On Tue, Mar 3, 2015 at 12:07 PM, Marin GILLES mrngil...@gmail.com wrote: Sure, I'll be careful about that. I'm going to go try and design some new interesting ones. Maybe adding some styles specific to some plot types could be useful. Also some styles specific for some applications (geoscience, biology)? If you have any other ideas, please let me know. -- *Marin GILLES* It would be good to have styles for paper and presentation modes. The former would have smaller ticks, labels, linewidths, other axis elements that goes into a journal publication, while the latter with much magnified elements to be clearly visible on a screen from the back of a room. -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] CAPE and CIN calculation in Python
Hi James, I have managed to run CLIMT's thermodyn.py . Most of the functions I tested from within the Driver.f90 works fine except the CAPE and CIN routines. I sent an e-mail to the author regarding this but nothing back from him so far. Would you give a test if I send you a simple sounding data? My system is Window 7 (x64) and using Python(XY). f2py uses the gfortran provided in MinGW32 folder. Could you provide an example (with some test data) for Kerry Emanuel's code? That code has definitely more functions than I need but it might be a valuable source. As for the NCL, it is easy to interface to a WRF output, it also includes a SkewT/LogP [https://www.ncl.ucar.edu/Applications/skewt.shtml], but the CAPE estimation in this script is very sensitive to the number of data-points, which I have bitten a couple of times. Dennis Shea has provided some CAPE calculation routines coded in fortran. [Check under http://www.cgd.ucar.edu/~shea/ for the files starting with cape*]. Yet I have no luck wrapping them via f2py. On Sat, Mar 29, 2014 at 7:11 PM, James Boyle jsboyle...@gmail.com wrote: I have used the CAPE and CIN from ClMT - a bit of overkill but many useful functions: http://people.su.se/~rcaba/climt/ I have also wrapped using f2py the the Fortran CAPE and CIN of Kerry Emanuel ( a prestigious source) in his convect code: http://eaps4.mit.edu/faculty/Emanuel/products If you prowl about in the NCL source distribution, you will find the fortran that the NCL skew - T uses. If you ask, Dennis Shea of NCAR might break the code out for you. It is trivial to wrap using f2py ( f77). On Mar 29, 2014, at 3:32 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, Lately, I am working on plotting sounding profiles on a SkewT/LogP diagram. The SkewT package which is located at https://github.com/tchubb/SkewT has a nice feature to lift a parcel on dry/moist adiabats. This is very useful to demonstrate the regions of CIN and CAPE overlaid with the full sounding. However, the package misses these diagnostic calculations. This is the only step holding me back to use Python only (migrating from NCL) for my plotting tasks. I am aware that these calculations are usually performed in fortran. Are there any routines wrapped in Python to calculate CAPE and CIN parameters? Any suggestions or comments would be really appreciated. -- Gökhan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Pyaos] CAPE and CIN calculation in Python
Thanks Daniel. Your CAPE calculation approach looks robust. I will give it a try with my sounding data. In the mean time, do you plan on putting a function for CIN calculation? On Sun, Mar 30, 2014 at 10:37 AM, Daniel Rothenberg darot...@mit.eduwrote: Hello Gokhan, I've written my own SkewT/LogP code with some lifted parcel calculations - it's included in a GitHub repo I use to maintain a collection of utilities I've written for analyzing output from a cloud resolving model I use. You can find my code for this purpose at https://github.com/darothen/crm-tools/blob/master/vis/soundings.py, along with other useful scripts. - Daniel Rothenberg On Sat, Mar 29, 2014 at 6:32 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Lately, I am working on plotting sounding profiles on a SkewT/LogP diagram. The SkewT package which is located at https://github.com/tchubb/SkewT has a nice feature to lift a parcel on dry/moist adiabats. This is very useful to demonstrate the regions of CIN and CAPE overlaid with the full sounding. However, the package misses these diagnostic calculations. This is the only step holding me back to use Python only (migrating from NCL) for my plotting tasks. I am aware that these calculations are usually performed in fortran. Are there any routines wrapped in Python to calculate CAPE and CIN parameters? Any suggestions or comments would be really appreciated. -- Gökhan ___ Pyaos mailing list py...@lists.johnny-lin.com http://lists.johnny-lin.com/listinfo.cgi/pyaos-johnny-lin.com -- Gökhan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] CAPE and CIN calculation in Python
As for the rest of the two suggestions: [ https://github.com/pmarshwx/SHARPpy/tree/gui https://github.com/PyAOS/aoslib] there doesn't seem be routines included for CAPE and CIN calculations. I am working on idealized orographic precipitation simulations in WRF that will hopefully be presented in the Mountain Meteorology conference in August. Perhaps I am extra cautious, but I need a good control especially on CAPE calculation (independent of data-points, being able to specify where to lift the parcel and specify mixed layer depth etc.). This could be a good subject to discuss on the coming SciPy conference. The abstract deadline is tomorrow. I might join if I can get some funding to attend the conference. Is there any symposium planned for atmospheric science people? Thanks again. On Sat, Mar 29, 2014 at 6:32 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, Lately, I am working on plotting sounding profiles on a SkewT/LogP diagram. The SkewT package which is located at https://github.com/tchubb/SkewT has a nice feature to lift a parcel on dry/moist adiabats. This is very useful to demonstrate the regions of CIN and CAPE overlaid with the full sounding. However, the package misses these diagnostic calculations. This is the only step holding me back to use Python only (migrating from NCL) for my plotting tasks. I am aware that these calculations are usually performed in fortran. Are there any routines wrapped in Python to calculate CAPE and CIN parameters? Any suggestions or comments would be really appreciated. -- Gökhan -- Gökhan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] CAPE and CIN calculation in Python
Hello, Lately, I am working on plotting sounding profiles on a SkewT/LogP diagram. The SkewT package which is located at https://github.com/tchubb/SkewT has a nice feature to lift a parcel on dry/moist adiabats. This is very useful to demonstrate the regions of CIN and CAPE overlaid with the full sounding. However, the package misses these diagnostic calculations. This is the only step holding me back to use Python only (migrating from NCL) for my plotting tasks. I am aware that these calculations are usually performed in fortran. Are there any routines wrapped in Python to calculate CAPE and CIN parameters? Any suggestions or comments would be really appreciated. -- Gökhan -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] set_scale and set_xscale
Here it comes - https://github.com/matplotlib/matplotlib/issues/1871 On Fri, Mar 29, 2013 at 6:57 AM, Benjamin Root ben.r...@ou.edu wrote: On Thu, Mar 28, 2013 at 12:52 PM, Gökhan Sever gokhanse...@gmail.com wrote: There is no documentation supplied for the first call. Should I file an issue for this on github? Wouldn't hurt. Be sure to include an image showing the result of each command. Ben -- Gökhan -- Own the Future-Intel(R) Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] set_scale and set_xscale
There is no documentation supplied for the first call. Should I file an issue for this on github? On Wed, Mar 27, 2013 at 7:10 AM, Benjamin Root ben.r...@ou.edu wrote: On Wed, Mar 27, 2013 at 1:03 AM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, Aren't these two log scaling calls supposed to be performing the same action? Here is a simple script tested in ipython --pylab fig = plt.figure(figsize=(5, 5)) ax1 = fig.add_subplot(1,1,1) ax1.plot(np.random.randn(100)) ax1.xaxis.set_scale('log') ax1.set_xscale('log') Intuitively, I guess they should be identical, but they don't seem to be. It seems like for ax1.xaxis.set_scale('log'), everything is set correctly, except the projection. Ben Root -- Gökhan -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] set_scale and set_xscale
Hello, Aren't these two log scaling calls supposed to be performing the same action? Here is a simple script tested in ipython --pylab fig = plt.figure(figsize=(5, 5)) ax1 = fig.add_subplot(1,1,1) ax1.plot(np.random.randn(100)) ax1.xaxis.set_scale('log') ax1.set_xscale('log') Thanks. -- Gökhan -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unicode characters in PS output
Okay, fair enough. But do you have any ideas, how to force the PS creator to use a different font? Say - font Times-Bold On Wed, Feb 27, 2013 at 12:59 PM, Thomas Sprinzing sprinz...@hdm-stuttgart.de wrote: I'd say it's got nearly nothing to do with matplotlib. The question is: will the font be included in the .ps and in the .pdf? If not, which is most likely, it's upon the renderer to decide what to do if the requested glyph in the requested font is present or not in the system. pdf is more likely to have the fonts / glyphs used also embeded in the pdf. One reason for them to be bigger than .ps. Ps, on the other hand, most of the times relys on the renderer to have the exact same font, referenced by name, pre-loaded in the system. Go figure. To sum it up: use the old 7-bit equivalent for the degree sign, not any fancydancy UTF-8 character that is commonly not included in ye olde style postscript standard font embedded into your laser printer wy back then in the last millenium... Am 26.02.2013 um 21:26 schrieb Gökhan Sever: On Tue, Feb 26, 2013 at 8:29 AM, Pierre Haessig pierre.haes...@crans.org wrote: Le 26/02/2013 14:38, Gökhan Sever a écrit : Could you test my outputs if they look fine on your side? http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps Good idea ! * your PDF file looks fine with Okular * your PS indeed has the problem you describe (again Okular) : - ° (degree sign) is fine - but ⁰ (zero superscript) is replaced by ? In case it may explain the difference : I'm using mpl 1.1.1rc2 from Debian testing and I have the following line in my matplotlibrc (is it relevant ???) font.sans-serif : DejaVu Sans, sans-serif Best, Pierre My matplotlib is a git clone of a couple weeks old. There is this line in the PS file (opening via vim) %%BeginResource: font KDYSTE+NewCenturySchlbk-Roman don't know where it gets this. #font.serif : DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif PS uses that even I choose to use fot.sans-serif. Dont see any font specification in the PDF file. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unicode characters in PS output
On Mon, Feb 25, 2013 at 11:00 PM, Ryan Nelson rnelsonc...@gmail.com wrote: On 2/25/2013 9:29 PM, Gökhan Sever wrote: Hello, For some reason, I can't get the degree sign showing up in my ps output: Here is the simple test code: fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, uTemperature, ⁰C, color='black', fontsize=16) plt.savefig('test.ps', papertype='letter') plt.savefig('test.pdf', papertype='letter') PS output shows Temperature, ?C, however PDF renders degree sign correctly. I can't seem to select the text in PS output, but the text is selectable in PDF. This is probably a font issue, where PDF uses DejaVu, on the other hand PS uses a Times type font. So, how can I adjust matplotlib to save in PS file? Thanks. -- Gökhan Gökhan, I tried your code, and everything worked fine for me. (PythonXY 2.7.3.1 on Windows 7) However, I usually use the escaped unicode value rather than unicode characters directly. Does the following work instead: fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, uTemperature, \u00B0C, color='black', fontsize=16) plt.savefig('test.ps', papertype='letter') plt.savefig('test.pdf', papertype='letter') Just a thought. Hope it helps. Ryan This works fine. However it is easy to remember a superscript o then its code :) By the way, can you select the text within the PS file? -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unicode characters in PS output
On Tue, Feb 26, 2013 at 6:02 AM, Pierre Haessig pierre.haes...@crans.orgwrote: Hi, Le 26/02/2013 12:38, Gökhan Sever a écrit : fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, uTemperature, \u00B0C, color='black', fontsize=16) plt.savefig('test.ps', papertype='letter') plt.savefig('test.pdf', papertype='letter') Just a thought. Hope it helps. Ryan This works fine. However it is easy to remember a superscript o then its code :) By the way, can you select the text within the PS file? I just noticed that you are using here the character U+2070 superscript zero (⁰) while Ryan's proposition is U+00B0 degree sign (°) which I think is the correct one to use. This being said, there should be no difference between using the Unicode code and actual ° character (and I agree it's simpler to remember) You are right, U+00B0 is the right one. I think, I couldn't find a superscript o easily then decided to use superscript zero from http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts However, there is a slight difference in their appearance when I compare them side by side. For simplicity, I just use subscript and superscript unicode symbols to construct simple units. In [1]: a = uTemperature, \u00B0C In [2]: a Out[2]: u'Temperature, \xb0C' In [6]: b = uTemperature °C In [7]: b Out[7]: u'Temperature \xb0C' Coming back to your other question, I can't select the text in the PS file (using Okular or Evince). (but PDF is selectable) Also, the PS file renders properly with both ⁰ and ° signs. (but with PDF, the ⁰ is placed to low, while ° is fine) Could you test my outputs if they look fine on your side? http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps Thanks. Best, Pierre -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unicode characters in PS output
On Tue, Feb 26, 2013 at 8:29 AM, Pierre Haessig pierre.haes...@crans.orgwrote: Le 26/02/2013 14:38, Gökhan Sever a écrit : Could you test my outputs if they look fine on your side? http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps Good idea ! * your PDF file looks fine with Okular * your PS indeed has the problem you describe (again Okular) : - ° (degree sign) is fine - but ⁰ (zero superscript) is replaced by ? In case it may explain the difference : I'm using mpl 1.1.1rc2 from Debian testing and I have the following line in my matplotlibrc (is it relevant ???) font.sans-serif : DejaVu Sans, sans-serif Best, Pierre My matplotlib is a git clone of a couple weeks old. There is this line in the PS file (opening via vim) %%BeginResource: font KDYSTE+NewCenturySchlbk-Roman don't know where it gets this. #font.serif : DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif PS uses that even I choose to use fot.sans-serif. Dont see any font specification in the PDF file. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Unicode characters in PS output
Hello, For some reason, I can't get the degree sign showing up in my ps output: Here is the simple test code: fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, uTemperature, ⁰C, color='black', fontsize=16) plt.savefig('test.ps', papertype='letter') plt.savefig('test.pdf', papertype='letter') PS output shows Temperature, ?C, however PDF renders degree sign correctly. I can't seem to select the text in PS output, but the text is selectable in PDF. This is probably a font issue, where PDF uses DejaVu, on the other hand PS uses a Times type font. So, how can I adjust matplotlib to save in PS file? Thanks. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving open symbols in PDF
On Thu, Oct 18, 2012 at 2:09 AM, Jouni K. Seppänen j...@iki.fi wrote: Gökhan Sever gokhanse...@gmail.com writes: Another point I noticed is setting linewidth to 0 (in fill_between function) isn't working as expected when figure is saved as a PDF file. A workaround is to add edgecolor='None' to the fill_between call. This workaround resolves the issue here. Thanks Jouni. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving open symbols in PDF
Thanks Mike, Another point I noticed is setting linewidth to 0 (in fill_between function) isn't working as expected when figure is saved as a PDF file. I noticed this while posting a sample script on scipy-users: http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.py Compare the outputs of pdf and png to see the difference that I am mentioning: http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.pdf http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.png On Wed, Oct 17, 2012 at 9:16 AM, Michael Droettboom md...@stsci.edu wrote: Filed as https://github.com/matplotlib/matplotlib/issues/1410 On 10/16/2012 10:38 PM, Eric Firing wrote: On 2012/10/16 4:27 PM, Gökhan Sever wrote: Hello, I see that a few days old clone of mpl, cannot save open symbols correctly in a pdf file. Here is a simple test case (in ipython --pylab): I6 xx = np.random.random(1000) I7 plt.plot(xx, 'D', mfc='none') On screen open symbols are fine, as expected transparency works fine, however when saved in pdf transparency disappears, symbols cover each other. (Saving to png is also fine) Could you confirm if this is a case in another installation? Confirmed with 1.2.x. The problem is only on pdf; ps and svg are correct. Eric Thanks. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving open symbols in PDF
On Wed, Oct 17, 2012 at 10:21 AM, Benjamin Root ben.r...@ou.edu wrote: On Wed, Oct 17, 2012 at 12:17 PM, Gökhan Sever gokhanse...@gmail.comwrote: Thanks Mike, Another point I noticed is setting linewidth to 0 (in fill_between function) isn't working as expected when figure is saved as a PDF file. I noticed this while posting a sample script on scipy-users: http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.py Compare the outputs of pdf and png to see the difference that I am mentioning: http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.pdf http://atmos.uwyo.edu/~gsever/data/test/curvefit_test.png Actually, this is not a bug in mpl. It is a bug in various viewers. Some viewers have a minimum linewidth and will use that for any requested linewidths smaller than that. Are you using Apple's Preview? Cheers! Ben Root Hi Ben, I was guessing the same way, but trying different viewers doesn't make any difference: Evince v3.2.1 Xpdf v3.03 Okular v0.14.3 Could anyone confirm this on a window machine? -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving open symbols in PDF
I see that the same behavior here on 3 different viewers. It is a slight aesthetic issue, but once in a while I come up similar differences between PDF and PNGs outputs. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem saving open symbols in PDF
On Wed, Oct 17, 2012 at 12:03 PM, Damon McDougall damon.mcdoug...@gmail.com wrote: Also notice the triangle transparency... True. Mike's 4 line addition fixes that issue: https://github.com/matplotlib/matplotlib/issues/1410 -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problem saving open symbols in PDF
Hello, I see that a few days old clone of mpl, cannot save open symbols correctly in a pdf file. Here is a simple test case (in ipython --pylab): I6 xx = np.random.random(1000) I7 plt.plot(xx, 'D', mfc='none') On screen open symbols are fine, as expected transparency works fine, however when saved in pdf transparency disappears, symbols cover each other. (Saving to png is also fine) Could you confirm if this is a case in another installation? Thanks. -- Gökhan -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Pylab import error due to dateutil
On Thu, Oct 11, 2012 at 3:49 AM, Damon McDougall damon.mcdoug...@gmail.comwrote: Gökhan, did you implement the symlink fix? If so, would you mind making a pull request out of it? I was just about to look into doing this, but if you've done it already that'd save us some effort rolling out fixes for 1.2. Cheers. Damon Hi Damon, I think adding these lines before execfile line in setupegg.py should fix it: import os os.chdir('lib') if not os.path.isdir('dateutil'): os.symlink('dateutil_py2', 'dateutil') os.chdir('..') Could you give it a test? Do we require a similar symlink for py3? Thanks. -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Pylab import error due to dateutil
I am not sure about that technical detail, but it works fine here on my Fedora 16 (x86_64) system. On Thu, Oct 11, 2012 at 11:04 AM, Damon McDougall damon.mcdoug...@gmail.com wrote: On Thursday, October 11, 2012, Gökhan Sever wrote: On Thu, Oct 11, 2012 at 3:49 AM, Damon McDougall damon.mcdoug...@gmail.com wrote: Gökhan, did you implement the symlink fix? If so, would you mind making a pull request out of it? I was just about to look into doing this, but if you've done it already that'd save us some effort rolling out fixes for 1.2. Cheers. Damon Hi Damon, I think adding these lines before execfile line in setupegg.py should fix it: import os os.chdir('lib') if not os.path.isdir('dateutil'): os.symlink('dateutil_py2', 'dateutil') os.chdir('..') Could you give it a test? Do we require a similar symlink for py3? Thanks. -- Gökhan Awesome. I'll give it a go later on. I'm a little concerned using os.chdir. I think Peter Wuertz/Chris Gohlke had problems with it not being threadsafe on windows. Does the same apply here? -- Damon McDougall http://www.damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Pylab import error due to dateutil
setupegg.py develop is the easiest way for me to install the latest mpl and also ipython from the github repos. I see that your suggested symlink fix also resolves this issue. Thanks Mike for looking into this quickly. On Wed, Oct 10, 2012 at 7:09 AM, Michael Droettboom md...@stsci.edu wrote: I filed an issue for this. We should try to get the fix into 1.2.x https://github.com/matplotlib/matplotlib/issues/1354 Mike On 10/10/2012 09:00 AM, Michael Droettboom wrote: I think this stack overflow question [1] sort of sums up the problem -- setuptools develop is kind of a hack and only really works if the source structure matches the installed structure. That used to be true of matplotlib, but installing different packages based on the Python version breaks that assumption. A suggestion in the Stack Overflow entry is to install symlinks to fix this, and indeed doing this works: cd lib ln -s dateutil_py2 dateutil We can probably automate this in the setupegg.py script, but I don't think I'll have a chance to get to this today. We can't just include the symlink in git, since it should point to the version that corresponds to the user's Python. [1] http://stackoverflow.com/questions/6019042/is-there-a-way-to-add-a-namespace-prefix-setuptools-package-distributions Mike On 10/10/2012 08:50 AM, Michael Droettboom wrote: This is related to using develop mode. I never use that (I use virtualenvs instead), so this doesn't get much testing. This seems to have broken when we started to ship separate versions of dateutil for python2 and python3. setuptools doesn't seem to like the fact that we rename dateutil_py2 to dateutil when installing (since in develop mode it doesn't really install or move anything). That's problematic, of course. I'll have to see if there's another way to handle this. Mike On 10/09/2012 09:36 PM, Gökhan Sever wrote: Hello, With a fresh git clone git://github.com/matplotlib/matplotlib.git sudo python setupegg.py develop Starting ipython --pylab I get this error: .../matplotlib/lib/matplotlib/dates.py in module() 120 import matplotlib.ticker as ticker 121 -- 122 from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \ 123 MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY 124 from dateutil.relativedelta import relativedelta ImportError: No module named dateutil.rrule Installing dateutil 1.5 fixes this. mpl install log shows the following: OPTIONAL DATE/TIMEZONE DEPENDENCIES dateutil: matplotlib will provide pytz: matplotlib will provide Will dateutil be shipped with mpl or this line needs to be updated? Thanks. -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too!http://p.sf.net/sfu/newrelic-dev2dev ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too!http://p.sf.net/sfu/newrelic-dev2dev ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too!http://p.sf.net/sfu/newrelic-dev2dev ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ Matplotlib-users mailing list Matplotlib-users
[Matplotlib-users] Pylab import error due to dateutil
Hello, With a fresh git clone git://github.com/matplotlib/matplotlib.git sudo python setupegg.py develop Starting ipython --pylab I get this error: .../matplotlib/lib/matplotlib/dates.py in module() 120 import matplotlib.ticker as ticker 121 -- 122 from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \ 123 MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY 124 from dateutil.relativedelta import relativedelta ImportError: No module named dateutil.rrule Installing dateutil 1.5 fixes this. mpl install log shows the following: OPTIONAL DATE/TIMEZONE DEPENDENCIES dateutil: matplotlib will provide pytz: matplotlib will provide Will dateutil be shipped with mpl or this line needs to be updated? Thanks. -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles
On Fri, Oct 5, 2012 at 10:26 AM, Fernando Perez fperez@gmail.comwrote: @Article{Hunter:2007, Author = {Hunter, J. D.}, Title = {Matplotlib: A 2D graphics environment}, Journal= {Computing In Science \ Engineering}, Volume = {9}, Number = {3}, Pages = {90--95}, abstract = {Matplotlib is a 2D graphics package used for Python for application development, interactive scripting, and publication-quality image generation across user interfaces and operating systems.}, address= {10662 LOS VAQUEROS CIRCLE, PO BOX 3014, LOS ALAMITOS, CA 90720-1314 USA}, bdsk-url-1 = { http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2SrcAuth=AlertingSrcApp=AlertingDestApp=WOSDestLinkType=FullRecord;KeyUT=000245668100019 }, date-added = {2010-09-23 12:22:10 -0700}, date-modified = {2010-09-23 12:22:10 -0700}, isi= {000245668100019}, isi-recid = {155389429}, month = may # / # jun, publisher = {IEEE COMPUTER SOC}, year = 2007 } That wos link is useful, however I see only a paper listed following the Time Cited link in the atmospheric science field. A few papers I have seen mentions mpl in acknowledgement section, but some not, though the plots in them are obviously produced by mpl. Should we list some articles here, as a base for a section that would go to mpl website? -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles
On Fri, Oct 5, 2012 at 11:45 AM, Nelle Varoquaux nelle.varoqu...@gmail.comwrote: I think including a gallery of published examples would be great, however, there will be some serious challenges with regards to copyright. It would be great to show MPL being used in high impact journals (which it is), but getting permission from them to show the plots on the MPL website may require some paperwork. So, a list of citations might be a good place to start. Here's mine: http://jeb.biologists.org/content/215/11/1783.full I just came back from a bioinformatics workshop: I was suprised by the amound of people using matplotlib to display results. I think it wouldn't be too hard to gather images and published them on matplotlib's website if the authors are OK with it. Also, in cancer research, publications and/or plots are often available publicly. I don't think citations would be as efficient: I personnally wouldn't bother looking at those. Here is an example on circos' website of how they advertise the use of their plotting library in research: http://circos.ca/intro/published_images/ Cheers, N I think citation based discipline specific listing would make a good simple start. For instance: Atmospheric Science: Article 1 citation [link1] Article 2 citation [link2] Bioinformatics: Article 1 citation [link1] Article 2 citation [link2] etc... Seeing mpl produced plots would be only 1 or 2 clicks away, plus this would provide context to the use of plots rather that extracting figures and putting them separately (dealing with copyright issues and such) on an alternative gallery page. The figures you linked look shinny but not much practical use in my field. Later, we can work on a more specific academic gallery page, once citation gallery grows to a critical limit. -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles
On Fri, Oct 5, 2012 at 1:23 PM, Damon McDougall damon.mcdoug...@gmail.comwrote: On Fri, Oct 5, 2012 at 8:11 PM, Gökhan Sever gokhanse...@gmail.com wrote: Seeing mpl produced plots would be only 1 or 2 clicks away, plus this would This is not true. A lot of articles are unavailable to certain institutions due to a lack of subscription. A major sticking point. I was only thinking open-access journals, which open-source users (i.e. users of python tools) tend to publish their articles in open-journals. Of course, there are subscription required articles but those are secondary concerns. Sometimes authors make their articles publicly available even the article is on a paid journal. provide context to the use of plots rather that extracting figures and putting them separately (dealing with copyright issues and such) on an alternative gallery page. The figures you linked look shinny but not much practical use in my field. Point taken on the context argument. I'll take that. To resolve it, make the figure/html image link to the underlying publication? Citation listing is easier for me, we can go both ways, a page listing only citations, another one a more experimental figure/citation if copyright issues can be resolved easily. In anyways, we will have to gather citations. Let's start doing that? -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles
On Fri, Oct 5, 2012 at 2:02 PM, Francesco Montesano franz.berges...@gmail.com wrote: I think that an official acknowledgment that people can copy and paste (and adapt) in their paper would be a great idea. Francesco Some open-access journals permit this: See for instance (also an example of a title that has all mpl produced figures): Dawe, J. T. and Austin, P. H.: Statistical analysis of an LES shallow cumulus cloud ensemble using a cloud tracking algorithm, Atmos. Chem. Phys., 12, 1101-1119, doi:10.5194/acp-12-1101-2012, 2012, http://www.atmos-chem-phys.net/12/1101/2012/acp-12-1101-2012.html -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles
On Fri, Oct 5, 2012 at 2:47 PM, Phil Austin mkpaus...@gmail.com wrote: Nice to see our matplotlib acknowledgement generating ripples. We've also got some mayavi animations and links to other matplotlib-plotted papers and posters at http://cafc.ubc.ca best, Phil Nice visuals Phil. Thanks for making your articles easily accessible from your page. In addition to your papers here are a couple more atmospheric science related open-access articles that uses matplotlib for figures: Mallet, V., Quélo, D., Sportisse, B., Ahmed de Biasi, M., Debry, É., Korsakissok, I., Wu, L., Roustan, Y., Sartelet, K., Tombette, M., and Foudhil, H.: Technical Note: The air quality modeling system Polyphemus, Atmos. Chem. Phys., 7, 5479-5487, doi:10.5194/acp-7-5479-2007, 2007. http://www.atmos-chem-phys.net/7/5479/2007/acp-7-5479-2007.html Batenburg, A. M., Walter, S., Pieterse, G., Levin, I., Schmidt, M., Jordan, A., Hammer, S., Yver, C., and Röckmann, T.: Temporal and spatial variability of the stable isotopic composition of atmospheric molecular hydrogen: observations at six EUROHYDROS stations, Atmos. Chem. Phys., 11, 6985-6999, doi:10.5194/acp-11-6985-2011, 2011. http://www.atmos-chem-phys.net/11/6985/2011/acp-11-6985-2011.html Jones, C. R., Bretherton, C. S., and Leon, D.: Coupled vs. decoupled boundary layers in VOCALS-REx, Atmos. Chem. Phys., 11, 7143-7153, doi:10.5194/acp-11-7143-2011, 2011. http://www.atmos-chem-phys.net/11/7143/2011/acp-11-7143-2011.html (All except the first plot is produced by matplotlib) Ungermann, J., Kalicinsky, C., Olschewski, F., Knieling, P., Hoffmann, L., Blank, J., Woiwode, W., Oelhaf, H., Hösen, E., Volk, C. M., Ulanovsky, A., Ravegnani, F., Weigel, K., Stroh, F., and Riese, M.: CRISTA-NF measurements with unprecedented vertical resolution during the RECONCILE aircraft campaign, Atmos. Meas. Tech., 5, 1173-1191, doi:10.5194/amt-5-1173-2012, 2012. http://www.atmos-meas-tech.net/5/1173/2012/amt-5-1173-2012.html Rautenhaus, M., Bauer, G., and Dörnbrack, A.: A web service based tool to plan atmospheric research flights, Geosci. Model Dev., 5, 55-71, doi:10.5194/gmd-5-55-2012, 2012. http://www.geosci-model-dev.net/5/55/2012/gmd-5-55-2012.html -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Matplotlib produced plots in academic journal articles
Hello, Is there any collection of articles that shows academic articles using matplotlib produced plots? I have come across a few recent articles in my field with plots produced by matplotlib. Though, the mpl page shows some nice examples of publication quality plots, it would be nice to have a discipline specific collection of academic paper citations/links (hopefully mostly open-access titles) to raise awareness of mpl usage in academia by attracting other language users. What do you think? -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control the position of a figure window
I was after a similar issue once, and asked this question at SO: http://stackoverflow.com/questions/7802366/matplotlib-window-layout-questions Manual positioning is fine sometimes if I want to really place windows side-by-side for comparison purposes. However it would be nicer if mpl were to remember positions of figures so that it would place the new figures exactly the same place where they were before closed. Actually, I have similar complaint for other windows opened in my Fedora 16 (Gnome 3.2) system. Say for instance I start a gvim instance, then move its window to my second monitor, but closing and re-opening it, the window's position is restored to the first monitor. Same thing is for evince, sometimes it opens pdf's on the first monitor, sometimes on the second, randomly position at least for my observation. I don't know where to look for a solution; in each specific program, or windows manager should handle / remember positions of windows on screens. On Tue, Oct 2, 2012 at 9:38 PM, Jianbao Tao jianbao@gmail.com wrote: Hi, Is it possible to specify the position of a figure window when one is created? This will be a killing feature if one wants to put the figure window at the right place in the screen automatically. It is annoying if ones has to drag a new figure to a comfortable place in the screen every time a new figure is created. Jianbao -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Accelerating PDF saved plots
There is one issue I spotted in this code. Although hard to notice from the produced plot, only the latest grid is updated when set_ydata is called. So a slight modification makes this code running correctly as originally intended. L1list = [] L2list = [] for i in range(nums): for j in range(xx*16, xx*16+16): if i == 0: L1list.append(grid[j%16].plot(dd1, conc1[j], color='r', lw=1.5)[0]) L2list.append(grid[j%16].plot(dd2, conc2[j], color='b', lw=1.5)[0]) grid[j% 16].set_xscale('log') grid[j%16].set_xticks([10, 100, 1000]) grid[j%16]. set_yticks([-25, 0, 25]) grid[j%16].yaxis.set_minor_locator(ticker. MultipleLocator(5)) grid[j%16].set_xlim(1,2000, auto=False) grid[j%16]. set_ylim(-50,50, auto=False) else: L1list(j%16).set_ydata(conc1[j]) L2list(j%16).set_ydata(conc2[j]) On Thu, Jul 5, 2012 at 11:15 AM, Fabrice Silva si...@lma.cnrs-mrs.frwrote: At end of the outer loop, instead of closing the figure, you should call remove() for each plot element you made. Essentially, as you loop over the inner loop, save the output of the plot() call to a list, and then when done with those plots, pop each element of that list and call remove() to take it out of the subplot. This will let the subplot axes retain the properties you set earlier. Instead of remove()'ing the graphical elements, you can also reuse them if the kind of plots you intend to do is the same along the figure for simple plots. See : http://paste.debian.net/177857/ -- 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 -- 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
Re: [Matplotlib-users] Accelerating PDF saved plots
Hi, What kind of outputs can these backends create? I don't use MAC, so my question is particularly for the Cairo backend. Could make a simple speed comparison between these backends and the original script that uses the PDF backend. I am assuming the changes you mention require quite some work to make the PDFbackend running faster. Thanks. On Sat, Jul 7, 2012 at 9:40 AM, Michiel de Hoon mjldeh...@yahoo.com wrote: One reason behind the lengthy plot creation times is likely the PDF backend itself. Whereas the Mac OS X and the Cairo backends make use of new_gc and gc.restore to keep track of the graphics context, the PDF backend uses check_gc and an internal stack of graphics contexts. Since nowadays matplotlib has gc.restore functionality, I don't think that that is needed any more. See this revision for when gc.restore was added to matplotlib: http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=revisionrevision=7112 In the same revision the Mac OS X and Cairo backends were modified to make use of gc.restore. The PDF backend (and the postscript backend also, btw) can be simplified in the same way to speed up these backends, as well as to reduce the output file sizes. Best, -Michiel. --- On *Thu, 7/5/12, Gökhan Sever gokhanse...@gmail.com* wrote: From: Gökhan Sever gokhanse...@gmail.com Subject: Re: [Matplotlib-users] Accelerating PDF saved plots To: Benjamin Root ben.r...@ou.edu Cc: matplotlib-users@lists.sourceforge.net Date: Thursday, July 5, 2012, 2:11 PM 38 * 16 = 608 80 / 608 = 0.1316 seconds per plot At this point, I doubt you are going to get much more speed-ups. Glad to be of help! Fabrice -- Good suggestion! I should have thought of that given how much I use that technique in doing animation. Ben Root I am including profiled runs for the records --only first 10 lines to keep e-mail shorter. Total times are longer comparing to the raw run -p executions. I believe profiled run has its own call overhead. I1 run -p test_speed.py 171889738 function calls (169109959 primitive calls) in 374.311 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 4548012 34.5830.000 34.5830.000 {numpy.core.multiarray.array} 1778401 21.0120.000 46.2270.000 path.py:86(__init__) 521816 17.8440.000 17.8440.000 artist.py:74(__init__) 2947090 15.4320.000 15.4320.000 weakref.py:243(__init__) 17784019.5150.0009.5150.000 {method 'all' of 'numpy.ndarray' objects} 136916698.6540.0008.6540.000 {getattr} 10852808.5500.000 17.6290.000 core.py:2749(_update_from) 12999047.8090.000 76.0600.000 markers.py:115(_recache) 387.3780.1947.3780.194 {gc.collect} 135648516.7680.0006.7680.000 {isinstance} I1 run -p test_speed3.py 61658708 function calls (60685172 primitive calls) in 100.934 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 9374146.6380.0006.6380.000 {numpy.core.multiarray.array} 3742274.3770.0007.5000.000 path.py:198(iter_segments) 69746133.8660.0003.8660.000 {getattr} 5426403.8090.0007.9000.000 core.py:2749(_update_from) 1413613.6650.0007.1360.000 transforms.py:99(invalidate) 324688/1611362.7800.000 27.7470.000 transforms.py:1729(transform) 644482.7530.000 64.9210.001 lines.py:463(draw) 2311952.7480.0007.0720.000 path.py:86(__init__) 684970/6794492.6790.0003.8880.000 backend_pdf.py:128(pdfRepr) 675262.6510.0007.5220.000 backend_pdf.py:1226(pathOperations) -- Gökhan -Inline Attachment Follows- -- 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/ -Inline Attachment Follows- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.nethttp://mc/compose?to=Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- 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
Re: [Matplotlib-users] Accelerating PDF saved plots
On Thu, Jul 5, 2012 at 8:45 AM, Gökhan Sever gokhanse...@gmail.com wrote: On Thu, Jul 5, 2012 at 7:29 AM, Benjamin Root ben.r...@ou.edu wrote: On Wed, Jul 4, 2012 at 1:17 PM, Gökhan Sever gokhanse...@gmail.comwrote: 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 Gokhan, Looking through your code, I see that you have all of the figure objects available all at once, rather than one at a time. In belowcloud_M0(), you create all of your figure objects and AxesGrid objects in list comprehensions, and then you have multiple for-loops that performs a particular action on each of these. Then you create your PdfPages object and loop over each of the figures, saving it to the page. I would do it quite differently. At the beginning of the function, create your PdfPages object. Then have a single loop over range(nums) where you create a figure object and an AxesGrid object. Do your 16 (or less) plots, and any other text you need for that figure. Save it to the PdfPage object, and then close the figure object. When the loop is done, close the PdfPages object. I think you will see huge performance improvement that way. Cheers! Ben Root Hi, Could you try the files again? I believe I have given read permission for outside access. http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.pdf Ben, Thanks for your suggestion. I will give it a try and report back here. -- Gökhan Hi, Please ignore the pass line in the first for loop in http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py I have the 2nd version of this script at http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed2.py following Ben's suggestion. Now there are two main loops, the former is for one Figure and AxesGrid object creation, then the inner loop is for plotting and decorating the grid objects. I am assuming that my inner loop is correct. Tracking the xx variable helps me to plot the right index from the concX data array on to the right grid element. Timings are below. As you can see, these are similar to my test_speed.py version of the runs. nums = 2 I1 time run test_speed2.py CPU times: user 10.85 s, sys: 0.10 s, total: 10.95 s Wall time: 11.19 s nums=38 I1 time run test_speed2.py CPU times: user 232.73 s, sys: 0.28 s, total: 233.01 s Wall time: 238.75 s However, I have my 3GB memory back free. Any other suggestions? -- 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
Re: [Matplotlib-users] Accelerating PDF saved plots
On Thu, Jul 5, 2012 at 11:15 AM, Fabrice Silva si...@lma.cnrs-mrs.frwrote: At end of the outer loop, instead of closing the figure, you should call remove() for each plot element you made. Essentially, as you loop over the inner loop, save the output of the plot() call to a list, and then when done with those plots, pop each element of that list and call remove() to take it out of the subplot. This will let the subplot axes retain the properties you set earlier. Instead of remove()'ing the graphical elements, you can also reuse them if the kind of plots you intend to do is the same along the figure for simple plots. See : http://paste.debian.net/177857/ I was close to getting the script run as you pasted. (One minor correction in your script is indexing L1 and L2, either L1[0] or L1, (comma) required in the assignments since grid.plot returns a list) The key here was reuse as you told. Memory consumption almost drops to half comparing to the test_speed2.py script run. Now I am down to ~1 minutes from about ~4 minutes execution times, which is indeed quite significant, provided that I experiment on 6 such 38 pages plots. nums = 2 I1 time run test_speed3.py CPU times: user 8.19 s, sys: 0.07 s, total: 8.26 s Wall time: 8.49 s nums=38 I1 time run test_speed3.py CPU times: user 78.84 s, sys: 0.19 s, total: 79.03 s Wall time: 80.88 s Thanks Fabrice for your feedback. -- 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
And you might get back more memory if you didn't have to have all the data in memory at once, but that may or may not help you. The only other suggestion I can make is to attempt to eliminate the overhead in the inner loop. Essentially, I would try making a single figure and a single AxesGrid object (before the outer loop). Then go over each subplot in the AxesGrid object and set the limits, the log scale, the ticks and the tick locater (I wouldn't be surprised if that is eating up cpu cycles). All of this would be done once before the loop you have right now. Then create the PdfPages object, and loop over all of the plots you have, essentially recycling the figure and AxesGrid object. At end of the outer loop, instead of closing the figure, you should call remove() for each plot element you made. Essentially, as you loop over the inner loop, save the output of the plot() call to a list, and then when done with those plots, pop each element of that list and call remove() to take it out of the subplot. This will let the subplot axes retain the properties you set earlier. I hope that made sense. Ben Root Hi Ben, I should have data the available at once, as I directly read that array from a netcdf file. The memory requirement for my data is small comparing to overhead added once plot creation is started. Fabrice's reply includes most of what you describe except the remove call part. These changes made big impact to lower my execution times. Thank you again for your explanation. -- 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
Re: [Matplotlib-users] Accelerating PDF saved plots
38 * 16 = 608 80 / 608 = 0.1316 seconds per plot At this point, I doubt you are going to get much more speed-ups. Glad to be of help! Fabrice -- Good suggestion! I should have thought of that given how much I use that technique in doing animation. Ben Root I am including profiled runs for the records --only first 10 lines to keep e-mail shorter. Total times are longer comparing to the raw run -p executions. I believe profiled run has its own call overhead. I1 run -p test_speed.py 171889738 function calls (169109959 primitive calls) in 374.311 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 4548012 34.5830.000 34.5830.000 {numpy.core.multiarray.array} 1778401 21.0120.000 46.2270.000 path.py:86(__init__) 521816 17.8440.000 17.8440.000 artist.py:74(__init__) 2947090 15.4320.000 15.4320.000 weakref.py:243(__init__) 17784019.5150.0009.5150.000 {method 'all' of 'numpy.ndarray' objects} 136916698.6540.0008.6540.000 {getattr} 10852808.5500.000 17.6290.000 core.py:2749(_update_from) 12999047.8090.000 76.0600.000 markers.py:115(_recache) 387.3780.1947.3780.194 {gc.collect} 135648516.7680.0006.7680.000 {isinstance} I1 run -p test_speed3.py 61658708 function calls (60685172 primitive calls) in 100.934 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 9374146.6380.0006.6380.000 {numpy.core.multiarray.array} 3742274.3770.0007.5000.000 path.py:198(iter_segments) 69746133.8660.0003.8660.000 {getattr} 5426403.8090.0007.9000.000 core.py:2749(_update_from) 1413613.6650.0007.1360.000 transforms.py:99(invalidate) 324688/1611362.7800.000 27.7470.000 transforms.py:1729(transform) 644482.7530.000 64.9210.001 lines.py:463(draw) 2311952.7480.0007.0720.000 path.py:86(__init__) 684970/6794492.6790.0003.8880.000 backend_pdf.py:128(pdfRepr) 675262.6510.0007.5220.000 backend_pdf.py:1226(pathOperations) -- 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
Re: [Matplotlib-users] Accelerating PDF saved plots
On Thu, Jul 5, 2012 at 12:17 PM, Benjamin Root ben.r...@ou.edu wrote: Actually, looking at Fabrice's code, you might be able to get it to be slightly faster. Lines 39-41 should be protected by a if i == 0 statement because it only needs to be done once. Furthermore, you might get some more improvements if you allow the subplots to share_all, in which case, you only need to set the limits and maybe the scale and the locator once. Cheers! Ben Root Good catch. Bringing lines 39-41 in the if i==0 block makes the label texts appear jagged. See my output for this case at - http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed3_jaggedlabels.pdf Putting these lines right below main fig and grid object creations make them look normal, and this case saves me 3-5 more seconds. Setting share_all option to 1 makes x-ticks unreasonably placed on the axes. As if the share_all option is applied only to the first plot call. See the example output at - http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed3_badxaxes.pdf I actually started with share_all=1 from this example - http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/examples/demo_axes_grid.py Particularly the construction given in def demo_grid_with_single_cbar(fig). However I noticed, this behavior earlier and explicit grid calls solved this issue. -- 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] Accelerating PDF saved plots
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.pyI 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
Re: [Matplotlib-users] how to set figure to appear on another monitor?
On Wed, May 23, 2012 at 8:32 AM, Chao YUE chaoyue...@gmail.com wrote: Dear all, I have two different monitors. How can I use plot command within terminal in this monitor and set the figure to show defaultly in another one? thanks, Chao Hello, I have a similar question posted on SO - http://stackoverflow.com/questions/7802366/matplotlib-window-layout-questions With few extra commands you can get your figures appearing on your second monitor. However, SetPosition behavior is somewhat unpredictable. When I pass a large x value it tendsmove the figure to my second monitor. What would be nice is to mpl to remember the last window position and size --say for instance for particular plots I always want to view figures in maximized window and placed on the second monitor. -- 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
Re: [Matplotlib-users] Plotting issue using recent matplotlib
Hi Mike, Could you inform me about your progress? I can test your sample script. I was thinking to test from v1.1.x branch downwards to spot the source of the issue, but I just don't know how to clone at particular commit in git. Thank you. On Wed, May 16, 2012 at 6:51 AM, Michael Droettboom md...@stsci.edu wrote: Nevermind -- I've got something to reproduce this and am looking into it now. Mike On 05/16/2012 08:13 AM, Michael Droettboom wrote: On 05/15/2012 07:57 PM, Gökhan Sever wrote: Hello, I have encountered a weird plotting issue recently using a recent mpl clone. See the linked pdfs for better demonstration of the issue: http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf newmpl file is created using the latest master branch (cloned and setup today) oldmpl is created using mpl v1.1.0 ( https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz ) Scroll down to page 4 in each file and you will see the wrong plotted behavior of alwp_lcl (black line) variable on newmpl file comparing to the correct version that is shown on oldmpl. I was trying to figure out a way to correct this and I raised y-axis max to 2400 and then the line looks fine. However I have other data that show similar wrong behaviors, so I decided to try earlier mpl versions since I know that those plots were looking correct earlier (at least a few months back). Trying v1.1.x branch gave me the same results. Note that these data contain nans. Are nan handling changed in recent mpl code or the way the data is plotted out of margins? I can't reproduce this with synthetic data. There have been changes to that code lately. Is there any way you can pack up a small script and data to reproduce this? Then I can poke at it and see what I find (it would also make a good regression test). Mike -- 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 listMatplotlib-users@lists.sourceforge.nethttps://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 -- 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
Re: [Matplotlib-users] Plotting issue using recent matplotlib
Hmm, how can I test this change the easiest way? Clone the master and replace with your changes? or can I directly clone your experimental branch? On Wed, May 16, 2012 at 8:52 AM, Michael Droettboom md...@stsci.edu wrote: I have a proposed solution here: https://github.com/matplotlib/matplotlib/pull/872 Git bisect found that the first commit where this happens was here: https://github.com/matplotlib/matplotlib/commit/4cd75cdf This is the script I used to reproduce -- I assume it's the same thing you're seeing: from matplotlib import pyplot as plt import numpy as np x = np.linspace(0, 3.14 * 2, 3000) y = np.sin(x) x[::100] = np.nan plt.plot(x, y) plt.ylim(-0.25, 0.25) plt.show() Mike On 05/16/2012 10:44 AM, Gökhan Sever wrote: Hi Mike, Could you inform me about your progress? I can test your sample script. I was thinking to test from v1.1.x branch downwards to spot the source of the issue, but I just don't know how to clone at particular commit in git. Thank you. On Wed, May 16, 2012 at 6:51 AM, Michael Droettboom md...@stsci.eduwrote: Nevermind -- I've got something to reproduce this and am looking into it now. Mike On 05/16/2012 08:13 AM, Michael Droettboom wrote: On 05/15/2012 07:57 PM, Gökhan Sever wrote: Hello, I have encountered a weird plotting issue recently using a recent mpl clone. See the linked pdfs for better demonstration of the issue: http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf newmpl file is created using the latest master branch (cloned and setup today) oldmpl is created using mpl v1.1.0 ( https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz ) Scroll down to page 4 in each file and you will see the wrong plotted behavior of alwp_lcl (black line) variable on newmpl file comparing to the correct version that is shown on oldmpl. I was trying to figure out a way to correct this and I raised y-axis max to 2400 and then the line looks fine. However I have other data that show similar wrong behaviors, so I decided to try earlier mpl versions since I know that those plots were looking correct earlier (at least a few months back). Trying v1.1.x branch gave me the same results. Note that these data contain nans. Are nan handling changed in recent mpl code or the way the data is plotted out of margins? I can't reproduce this with synthetic data. There have been changes to that code lately. Is there any way you can pack up a small script and data to reproduce this? Then I can poke at it and see what I find (it would also make a good regression test). Mike -- 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 listMatplotlib-users@lists.sourceforge.nethttps://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 -- Gökhan -- 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
Re: [Matplotlib-users] Plotting issue using recent matplotlib
Bisecting is definitely a better idea than my one-by-one setup iteration :) Thanks for sharing the tip. On Wed, May 16, 2012 at 8:54 AM, Michael Droettboom md...@stsci.edu wrote: On 05/16/2012 10:44 AM, Gökhan Sever wrote: Could you inform me about your progress? I can test your sample script. I was thinking to test from v1.1.x branch downwards to spot the source of the issue, but I just don't know how to clone at particular commit in git. Also, to answer this question directly -- git bisect is a great way to find this: http://git-scm.com/book/en/Git-Tools-Debugging-with-Git#Binary-Search Cheers, Mike Thank you. On Wed, May 16, 2012 at 6:51 AM, Michael Droettboom md...@stsci.eduwrote: Nevermind -- I've got something to reproduce this and am looking into it now. Mike On 05/16/2012 08:13 AM, Michael Droettboom wrote: On 05/15/2012 07:57 PM, Gökhan Sever wrote: Hello, I have encountered a weird plotting issue recently using a recent mpl clone. See the linked pdfs for better demonstration of the issue: http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf newmpl file is created using the latest master branch (cloned and setup today) oldmpl is created using mpl v1.1.0 ( https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz ) Scroll down to page 4 in each file and you will see the wrong plotted behavior of alwp_lcl (black line) variable on newmpl file comparing to the correct version that is shown on oldmpl. I was trying to figure out a way to correct this and I raised y-axis max to 2400 and then the line looks fine. However I have other data that show similar wrong behaviors, so I decided to try earlier mpl versions since I know that those plots were looking correct earlier (at least a few months back). Trying v1.1.x branch gave me the same results. Note that these data contain nans. Are nan handling changed in recent mpl code or the way the data is plotted out of margins? I can't reproduce this with synthetic data. There have been changes to that code lately. Is there any way you can pack up a small script and data to reproduce this? Then I can poke at it and see what I find (it would also make a good regression test). Mike -- 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 listMatplotlib-users@lists.sourceforge.nethttps://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 -- Gökhan -- 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
Re: [Matplotlib-users] Plotting issue using recent matplotlib
On Wed, May 16, 2012 at 9:30 AM, Michael Droettboom md...@stsci.edu wrote: Or, in an existing clone of the main repository, add my fork as a remote git remote add mdboom git://github.com/mdboom/matplotlib.git git fetch mdboom git checkout mdboom/clipping-bug Here are my steps following your 2nd suggestion: 1-) Cloned the master: git clone git://github.com/matplotlib/matplotlib.git 2-) go into matplotlib dir and then execute: sudo python setupegg.py develop Tested my existing code and verified that the plotting error I reported in the first message was still there. 3-) in the matplotlib dir I executed the 3 commands you typed to get your fork 4-) Removed the build dir in matplotlib folder then re-executed setupegg.py script 5-) Testing with your change my plot looks fine now, lines are drawn correctly. Thanks for easy to follow instructions and quick response. -- 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] Plotting issue using recent matplotlib
Hello, I have encountered a weird plotting issue recently using a recent mpl clone. See the linked pdfs for better demonstration of the issue: http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_newmpl.pdf http://atmos.uwyo.edu/~gsever/data/vocals_RF04_NU05_oldmpl.pdf newmpl file is created using the latest master branch (cloned and setup today) oldmpl is created using mpl v1.1.0 ( https://github.com/downloads/matplotlib/matplotlib/matplotlib-1.1.0.tar.gz) Scroll down to page 4 in each file and you will see the wrong plotted behavior of alwp_lcl (black line) variable on newmpl file comparing to the correct version that is shown on oldmpl. I was trying to figure out a way to correct this and I raised y-axis max to 2400 and then the line looks fine. However I have other data that show similar wrong behaviors, so I decided to try earlier mpl versions since I know that those plots were looking correct earlier (at least a few months back). Trying v1.1.x branch gave me the same results. Note that these data contain nans. Are nan handling changed in recent mpl code or the way the data is plotted out of margins? I can't reproduce this with synthetic data. Any ideas as to what could be going wrong here? 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
Re: [Matplotlib-users] CHANGELOG
This seems to be the most up-to-date: https://github.com/matplotlib/matplotlib/blob/master/CHANGELOG Another way of staying current with the changes is by following the commit messages from https://github.com/matplotlib/matplotlib/commits/master (I follow the changes via the RSS link) On Fri, Feb 24, 2012 at 7:37 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: Hi all, http://matplotlib.sourceforge.net/_static/CHANGELOG seems to be outdated. Am I mising something ? Nils -- 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 -- Gökhan -- 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] ScalarFormatter
Hello, Stealing a solution from - http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html This seems to produce nicer looking y tick-labels. I tend to switch to log-scale in cases like yours, but this one provides a clean solution as well. import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter def scinot(x,pos=None): if x == 0: s = '0' else: xp = int(np.floor(np.log10(np.abs(x mn = x/10.**xp # Here we truncate to 2 significant digits -- may not be enough # in all cases s = '$'+str('%.3f'%mn) +'\\times 10^{'+str(xp)+'}$' return s A = np.array([[ 1.e+00, 0.e+00, 1.99236400e-04], [ 2.e+00, 1.e+00, 2.00043800e-04], [ 3.e+00, 2.e+00, 2.00046000e-04], [ 4.e+00, 3.e+00, 2.00043900e-04]]) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(A[:,1],A[:,2]) ax.yaxis.set_major_formatter(FuncFormatter(scinot)) y_min,y_max = ax.get_ylim() print 'y range', y_max-y_min plt.show() On Mon, Feb 20, 2012 at 8:32 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: Hi all, How can I improve the presentation of yticks for a small y range, e.g. y_min,y_max = ax.get_ylim() y_max-y_min 8.6767e-07 I would like to avoid +1.992 x 10^{-4} in the attached figure. import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter formatter = ScalarFormatter(useMathText=**True) formatter.set_scientific(True) formatter.set_powerlimits((-**15,15)) #A = np.loadtxt('trash.dat') A = np.array([[ 1.e+00, 0.e+00, 1.99236400e-04], [ 2.e+00, 1.e+00, 2.00043800e-04], [ 3.e+00, 2.e+00, 2.00046000e-04], [ 4.e+00, 3.e+00, 2.00043900e-04]]) fig = plt.figure() ax = fig.add_subplot(111) ax.yaxis.set_major_formatter(**formatter) ax.plot(A[:,1],A[:,2]) y_min,y_max = ax.get_ylim() print 'y range', y_max-y_min plt.show() Nils -- 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 -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Partial coloring of text in matplotlib
This is the solution which requires the least modification to the original text inserting functions. The only drawback is like you said, it only works with ps backend. Any idea if this could be generalized for other backends? On Tue, Feb 7, 2012 at 3:44 PM, Yann Tambouret yannp...@bu.edu wrote: Along the lines of Mike's suggestion, I thought this could be done using Latex. I posted an answer on SO with an example of doing this, but it seems only to work with postscript backend. Other backends override the color with the mpl text color setting. Is there a way to prevent this override? For example don't try to use 'PS' backend, and look at hte figure interactively. It defaults to black. http://stackoverflow.com/a/9185143/717357 -Yann On Tue, Feb 7, 2012 at 4:46 PM, Paul Ivanov pivanov...@gmail.com wrote: Benjamin Root, on 2012-02-07 13:46, wrote: Also, how deep should this rabbit hole go? I could imagine one could want this for title() and figtitle(). Maybe it would be best to implement this at the Text() constructor level? For this reason, I would discourage even implementing such functionality in the core of matplotlib. This functionality doesn't strike me as something that ought to be available everywhere by default - if someone needs it, they can implement it as follows: - import matplotlib.pyplot as plt from matplotlib import transforms def rainbow_text(x,y,ls,lc,**kw): Take a list of strings ``ls`` and colors ``lc`` and place them next to each other, with text ls[i] being shown in color lc[i]. This example shows how to do both vertical and horizontal text, and will pass all keyword arguments to plt.text, so you can set the font size, family, etc. t = plt.gca().transData fig = plt.gcf() plt.show() #horizontal version for s,c in zip(ls,lc): text = plt.text(x,y, +s+ ,color=c, transform=t, **kw) text.draw(fig.canvas.get_renderer()) ex = text.get_window_extent() t = transforms.offset_copy(text._transform, x=ex.width, units='dots') #vertical version for s,c in zip(ls,lc): text = plt.text(x,y, +s+ ,color=c, transform=t, rotation=90,va='bottom',ha='center',**kw) text.draw(fig.canvas.get_renderer()) ex = text.get_window_extent() t = transforms.offset_copy(text._transform, y=ex.height, units='dots') plt.figure() rainbow_text(0.5,0.5,all unicorns poop rainbows ! ! !.split(), ['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'], size=40) best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Partial coloring of text in matplotlib
Is there a way in matplotlib to partially specify the color of a string? Example: plt.ylabel(Today is cloudy.) How can I show today as red, is as green and cloudy. as blue? Thanks. PS: Asked also on http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Partial coloring of text in matplotlib
Posted at https://github.com/matplotlib/matplotlib/issues/697 I think a syntax like: plt.ylabel(Sun is shining., color='rgb') would be a good start. (Assuming len of string == len of colors) On Tue, Feb 7, 2012 at 11:18 AM, Michael Droettboom md...@stsci.edu wrote: Nope. But it's something I've wanted to add for a while. Can you file an Issue in the github tracker? Mike On 02/07/2012 11:40 AM, Gökhan Sever wrote: Is there a way in matplotlib to partially specify the color of a string? Example: plt.ylabel(Today is cloudy.) How can I show today as red, is as green and cloudy. as blue? Thanks. PS: Asked also on http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Partial coloring of text in matplotlib
This works as well, as long as it functions :) My idea requires little less typing. But forgot previously, text string should be whitespace split. On Tue, Feb 7, 2012 at 11:43 AM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Feb 7, 2012 at 12:38 PM, Gökhan Sever gokhanse...@gmail.comwrote: Posted at https://github.com/matplotlib/matplotlib/issues/697 I think a syntax like: plt.ylabel(Sun is shining., color='rgb') would be a good start. (Assuming len of string == len of colors) Don't know if I like that. It becomes even more difficult to convert the color spec into rgb. How about this? plt.ylabel(['Sun, is, shining], color=['r', 'g', 'b']) By having the input label be an array, that would force ylabel to recognize that the color sequence should also be treated similarly. Ben Root -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Partial coloring of text in matplotlib
I was basing my whitespace split idea on single string assumption --eg. no list passing. I do not have a strong preference on the final argument passing, as long as it works instead of manually placing the texts on figure or axis :) On Tue, Feb 7, 2012 at 11:52 AM, Ryan May rma...@gmail.com wrote: On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever gokhanse...@gmail.com wrote: This works as well, as long as it functions :) My idea requires little less typing. But forgot previously, text string should be whitespace split. Right, but we shouldn't guess. If we automatically split on whitespace, this becomes harder: plt.ylabel([The sun is, yellow], ['k', 'y']) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Partial coloring of text in matplotlib
On Tue, Feb 7, 2012 at 12:46 PM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Feb 7, 2012 at 1:15 PM, Gökhan Sever gokhanse...@gmail.comwrote: I was basing my whitespace split idea on single string assumption --eg. no list passing. I do not have a strong preference on the final argument passing, as long as it works instead of manually placing the texts on figure or axis :) On Tue, Feb 7, 2012 at 11:52 AM, Ryan May rma...@gmail.com wrote: On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever gokhanse...@gmail.com wrote: This works as well, as long as it functions :) My idea requires little less typing. But forgot previously, text string should be whitespace split. Right, but we shouldn't guess. If we automatically split on whitespace, this becomes harder: plt.ylabel([The sun is, yellow], ['k', 'y']) Ryan I think the python mantra of explicit over implicit should be followed here. I don't think we currently allow list of strings, so there is no risk of breaking existing scripts, I think. We probably should confirm that just in case. Fair enough. Also, how deep should this rabbit hole go? I could imagine one could want this for title() and figtitle(). Maybe it would be best to implement this at the Text() constructor level? ylabel text coloring works for me for the time being. However, a general implementation would possibly fulfill other incoming requests. Ben Root -- Gökhan -- Keep Your Developer Skills Current with LearnDevNow! 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-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Contour label positioning
Hello group, I am trying to align contour labels on my plot. Using the latest git clone I was able to position the labels somewhat nicer than the default positioning. (Following from https://github.com/matplotlib/matplotlib/issues/613 ) However, it requires manual specification of right data coords to create this plot and it is not easy to align them properly. Is there a mechanism to position and align labels on a specified line? See the linked image for better demonstration. http://imageshack.us/photo/my-images/210/cimage.png/ Thanks -- Gökhan -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Removing ticks and frame (imshow)
On Thu, Nov 24, 2011 at 7:57 AM, Marianne C. mariyann...@gmail.com wrote: My name is Marianne, I am a beginner user of matplotlib. I am using imshow in pyplot. I am desperate to get rid of the ticks on both x and y axes (see attached picture). I do not need the black box around the data either. Should I use imshow in axes.Axes instead, to be able to call plt.axis('off') or ax = plt.gca() ax.set_axis_off() should clear the axis bounds and remove ticks as well. -- Gökhan -- 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] Meridians not show using Mercator projection
Thanks Jeff and Eric. Both solutions simply works :) -- Gökhan -- 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] MODIS data and true-color plotting
On Sun, Nov 13, 2011 at 12:40 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello groups, I have two questions about working with MODIS data. 1-) Is there any light Pythonic HDF-EOS wrapper to handle HDF-EOS data other than PyNIO [http://www.pyngl.ucar.edu/Nio.shtml] Although, I have managed to install that package from its source, it took me many hours to figure out all the installation quirks. Something simpler to build and mainly for HDFEOS data?? 2-) Another similar question: Has anybody attempted to create true-color MODIS images (like the ones shown at [ http://rapidfire.sci.gsfc.nasa.gov/realtime/]) in Python? So far, I have seen one clear tutorial [ ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] to create natural color images, but uses ms2gt [http://nsidc.org/data/modis/ms2gt/], NDVI and IDL. Except the reflectance correction via NDVI, ms2gt and IDL parts seem to be implemented in Python. Till now, I have some progress combining GOES imagery with aircraft data. My next task is to combine MODIS data with aircraft and radar data. I would be happy to get some guidance and code support if there is any previous work been done using Python. Thanks. Hello all, Here is my answer to my 2nd question: http://imageshack.us/photo/my-images/713/modistrue1km.png/ Python script is at http://code.google.com/p/ccnworks/source/browse/trunk/modis/true.py This code is based on TrueColor tutorial of Liam Gumley [ ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] and Peter Kuma's ccplot tool [http://ccplot.org/] Currently it only plots true color images from Aqua or Terra using Level 1B data. For the example image I use the data provided via TrueColor link. Notes: 1-) Using PyNIO to open hdf-eos files, from ccplot using cctk for 2D data interpolation, basemap for map plotting and numpy/scipy for other essentials. 2-) crefl.1km.hdf is reflectance corrected data using NVDI's crefl program. Set-up TrueColor tutorial and you should be able to get these correction applied data by calling its main script or set-up another. 3-) MOD03.hdf is the geolocation data. 4-) No need to run ms2gt or any other swath to grid conversion tools, since the interpolation routine handles this step. 5-) Code is in 100 lines. Unlike TrueColor tutorial it only works for 1KM resolution. HKM and QKM resolution plotting requires additional steps. It takes about 2.5 seconds to get the plot on my screen. Let me know if you have any comments or other suggestions. Thanks. -- Gökhan -- 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
[Matplotlib-users] Meridians not show using Mercator projection
Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- 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
[Matplotlib-users] MODIS data and true-color plotting
Hello groups, I have two questions about working with MODIS data. 1-) Is there any light Pythonic HDF-EOS wrapper to handle HDF-EOS data other than PyNIO [http://www.pyngl.ucar.edu/Nio.shtml] Although, I have managed to install that package from its source, it took me many hours to figure out all the installation quirks. Something simpler to build and mainly for HDFEOS data?? 2-) Another similar question: Has anybody attempted to create true-color MODIS images (like the ones shown at [ http://rapidfire.sci.gsfc.nasa.gov/realtime/]) in Python? So far, I have seen one clear tutorial [ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] to create natural color images, but uses ms2gt [ http://nsidc.org/data/modis/ms2gt/], NDVI and IDL. Except the reflectance correction via NDVI, ms2gt and IDL parts seem to be implemented in Python. Till now, I have some progress combining GOES imagery with aircraft data. My next task is to combine MODIS data with aircraft and radar data. I would be happy to get some guidance and code support if there is any previous work been done using Python. Thanks. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MODIS data and true-color plotting
On Sun, Nov 13, 2011 at 12:57 PM, Jeff Whitaker jsw...@fastmail.fm wrote: Gökhan: netcdf4-python can read hdf5-eos files, and even hdf4-eos files if the netcdf C lib is built with hdf4 support. -Jeff I can't build netcdf4 C libraries with HDF4 support. [gsever@ccn hdf-4.2.6]$ ./configure --prefix=/usr/local --includedir=/usr/local/ --with-zlib=/usr/local --with-jpeg=/usr/local --disable-fortran --with-szip=/usr/local/ CFLAGS=-fPIC I can't build HDF4 without disabling the fortran support. Then trying to build netcdf4 with HDF4: [gsever@ccn netcdf-4.1.3]$ ./configure --prefix=/usr/local/netcdf4 --enable-netcdf-4 --with-hdf5=/usr/local/ --enable-shared --enable-hdf4 --with-hdf4=/usr/local/ Fails: Making all in ncgen3 make[2]: Entering directory `/home/gsever/Downloads/netcdf-4.1.3/ncgen3' /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o ncgen3 main.o load.o escapes.o getfill.o init.o genlib.o ncgentab.o ../liblib/libnetcdf.la -lhdf5_hl -lhdf5 -lm -lz -lcurl libtool: link: gcc -g -O2 -o .libs/ncgen3 main.o load.o escapes.o getfill.o init.o genlib.o ncgentab.o ../liblib/.libs/libnetcdf.so -lhdf5_hl -lhdf5 -lm -lz -lcurl -Wl,-rpath -Wl,/usr/local/netcdf4/lib ../liblib/.libs/libnetcdf.so: undefined reference to `SDstart' ../liblib/.libs/libnetcdf.so: undefined reference to `SDend' ../liblib/.libs/libnetcdf.so: undefined reference to `SDattrinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDfileinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDreadattr' ../liblib/.libs/libnetcdf.so: undefined reference to `SDselect' ../liblib/.libs/libnetcdf.so: undefined reference to `SDreaddata' ../liblib/.libs/libnetcdf.so: undefined reference to `SDdiminfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetfillvalue' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetdimid' collect2: ld returned 1 exit status make[2]: *** [ncgen3] Error 1 make[2]: Leaving directory `/home/gsever/Downloads/netcdf-4.1.3/ncgen3' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/gsever/Downloads/netcdf-4.1.3' make: *** [all] Error 2 When I remove hdf4 part from config, it builds successfully. Any ideas? -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MODIS data and true-color plotting
On Sun, Nov 13, 2011 at 4:37 PM, klo uo klo...@gmail.com wrote: I think that paths needed to be passed to CPP/LDFLAGS like this: CPPFLAGS=-I/usr/include/hdf LDFLAGS=-L/usr/lib ./configure --enable-hdf4 make then also package is dependent on latest hdf5 to be build (1.8.7), so installing it globally would break possible dependencies in any packaging system, and lastly it's just pain to build it if it's worth On Sun, Nov 13, 2011 at 10:12 PM, Gökhan Sever gokhanse...@gmail.com wrote: When I remove hdf4 part from config, it builds successfully. Any ideas? This one still fails with the same error. I will make a clean Fedora 16 installation in the near future, then I will test these on the new system. Firstly, hoping that F16 will provide these packages already built :) Those -fPIC errors were killing me while building PyNIO... -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Time axis for imshow
Thanks Joe, I forgot to convert my numeric time array into a form that mpl can understand. I198 time O198 array([ 32643.78595805, 32643.82032609, 32643.85445309, ..., 32871.46535802, 32871.49946594, 32871.53384495]) I199 ncnt O199 array([0001-01-01 09:04:03+00:00, 0001-01-01 09:04:03+00:00, 0001-01-01 09:04:03+00:00, ..., 0001-01-01 09:07:51+00:00, 0001-01-01 09:07:51+00:00, 0001-01-01 09:07:51+00:00], dtype=object) Although, this doesn't give me millisecond precision. Is there any way to get ms precision via datetime module? This is not a matter for plotting, since second precision is good enough for eyes. Then setting extent properly and either calling ax.xaxis_date or calling setters manually I196 xmin = mdates.date2num(ncnt[0]) I197 xmax = mdates.date2num(ncnt[-1]) plt.imshow(z.T, interpolation='nearest', aspect='auto', origin='lower', extent=[xmin, xmax, 0, z.shape[1]]) ax = plt.gca() ax.xaxis.set_major_formatter(DateFormatter('%H:%M:%S')) ax.xaxis.set_major_locator(SecondLocator(interval=30)) ax.xaxis.set_minor_locator(SecondLocator(interval=5)) gives me better control over the major/minor ticks. On Thu, Nov 10, 2011 at 8:15 AM, Joe Kington jking...@wisc.edu wrote: On Wed, Nov 9, 2011 at 11:45 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Is there any easy way to specify a time-axis using imshow to plot 2D data? Sure, just call ax.xaxis_date() (or yaxis_date, depending on which axis you want to represent a date). As a quick example: import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np # Generate data... ny = 100 xmin, xmax = mdates.datestr2num(['01/01/2011', '11/10/2011']) data = np.random.random((ny, int(xmax-xmin)+1)) - 0.5 data = data.cumsum(axis=1) # Plot... fig, ax = plt.subplots() ax.imshow(data, extent=[xmin, xmax, 0, ny]) ax.xaxis_date() fig.autofmt_xdate() plt.show() Cheers, -Joe -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Time axis for imshow
On Thu, Nov 10, 2011 at 11:14 AM, Joe Kington jking...@wisc.edu wrote: snip Although, this doesn't give me millisecond precision. Is there any way to get ms precision via datetime module? snip Well, datetime objects, matplotlib's internal float dates, and numpy datetime64 objects all support microsecond resolution. I260 ncnt = np.array([num2date(1 + time[j]/86400.0) for j in range(len(time))]) I261 time[0] O261 32643.785958051682 I262 ncnt[0] O262 datetime.datetime(1, 1, 1, 9, 4, 3, 785958, tzinfo=matplotlib.dates._UTC object at 0x2da2610) int conversion for time[j] was eating my milliseconds. Now it is finely returning the ms part. However matplotlib's locator rules can't handle microsecond or millisecond resolution. There aren't any locators for less than second resolution. Also, imshow sets the aspect of the plot to 1 by default, which is probably why you're having to set the extents manually. If you specify aspect='auto' in the imshow call you can avoid that step. (However, strange things happen when the span of the extents drops below 100 microseconds... I'm guessing something is being cast to float32's somewhere?) plt.imshow(z.T, interpolation='nearest', aspect='auto', origin='lower', extent=[xmin, xmax, 0, z.shape[1]]) I need to set both aspect and extent for my case, without the extend I can't get the time axis placed. As a quick example to demonstrate using sub-second resolution (without a proper tick locator): import matplotlib.pyplot as plt import numpy as np import matplotlib.dates as mdates from datetime import datetime # Generate data... ny = 100 nx = 100 xmin, xmax = mdates.date2num([datetime(2011, 01, 01, microsecond=1), datetime(2011, 01, 01, microsecond=nx)]) data = np.random.random((ny, nx)) - 0.5 data = data.cumsum(axis=1) # Plot... fig, ax = plt.subplots() ax.imshow(data, aspect='auto', extent=[xmin, xmax, 0, ny]) ax.xaxis_date() plt.show() At any rate, you can write a quick-and-dirty millisecond locator... Give me a bit and I'll cobble one together. (It's turning out to be slightly more complex than I thought...) I am fine seeing the ticks at second resolution. It might be overkill for my plots to place millisecond ticks. It takes a while to render these ticks. On Thu, Nov 10, 2011 at 10:06 AM, Gökhan Sever gokhanse...@gmail.comwrote: Thanks Joe, I forgot to convert my numeric time array into a form that mpl can understand. I198 time O198 array([ 32643.78595805, 32643.82032609, 32643.85445309, ..., 32871.46535802, 32871.49946594, 32871.53384495]) I199 ncnt O199 array([0001-01-01 09:04:03+00:00, 0001-01-01 09:04:03+00:00, 0001-01-01 09:04:03+00:00, ..., 0001-01-01 09:07:51+00:00, 0001-01-01 09:07:51+00:00, 0001-01-01 09:07:51+00:00], dtype=object) Although, this doesn't give me millisecond precision. Is there any way to get ms precision via datetime module? This is not a matter for plotting, since second precision is good enough for eyes. Then setting extent properly and either calling ax.xaxis_date or calling setters manually I196 xmin = mdates.date2num(ncnt[0]) I197 xmax = mdates.date2num(ncnt[-1]) plt.imshow(z.T, interpolation='nearest', aspect='auto', origin='lower', extent=[xmin, xmax, 0, z.shape[1]]) ax = plt.gca() ax.xaxis.set_major_formatter(DateFormatter('%H:%M:%S')) ax.xaxis.set_major_locator(SecondLocator(interval=30)) ax.xaxis.set_minor_locator(SecondLocator(interval=5)) gives me better control over the major/minor ticks. On Thu, Nov 10, 2011 at 8:15 AM, Joe Kington jking...@wisc.edu wrote: On Wed, Nov 9, 2011 at 11:45 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Is there any easy way to specify a time-axis using imshow to plot 2D data? Sure, just call ax.xaxis_date() (or yaxis_date, depending on which axis you want to represent a date). As a quick example: import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np # Generate data... ny = 100 xmin, xmax = mdates.datestr2num(['01/01/2011', '11/10/2011']) data = np.random.random((ny, int(xmax-xmin)+1)) - 0.5 data = data.cumsum(axis=1) # Plot... fig, ax = plt.subplots() ax.imshow(data, extent=[xmin, xmax, 0, ny]) ax.xaxis_date() fig.autofmt_xdate() plt.show() Cheers, -Joe -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users
[Matplotlib-users] Time axis for imshow
Hello, Is there any easy way to specify a time-axis using imshow to plot 2D data? Thanks. -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Broken links on gallery
Hi, These two links seem to be broken here: http://matplotlib.sourceforge.net/examples/api/demo_affine_image_00.html http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout_00.html -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Gradient color on a line plot
Hi, I was wondering this about 2 years ago [ http://old.nabble.com/Gradient-color-on-a-line-object-td25630375.html] Just today, I have found a very simple way to do this in mpl. x = np.linspace(0, 2*np.pi, 3600) y = np.sin(x) plt.scatter(x,y,c=range(len(x)), marker='_', s=1) Setting the marker to underscore character and choosing a relatively low size value makes the line appear just like I wanted. (Provided, using lengthy data points) Is this a very known trick? If not so, what is your favorite color gradient approach for a simple plot? Cheers, -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Scrolling plot and colorbar
Hello, I slightly modified the example show at http://www.scipy.org/Cookbook/Matplotlib/ScrollingPlot to plot image data. My version of the code is at: http://code.google.com/p/ccnworks/source/browse/trunk/various/scroll.py What is the correct way to add a colorbar to this plot? A simple plt.colorbar(axes) yields no colorbar drawn. Thanks. -- Gökhan -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Scrolling plot and colorbar
A self response: self.fig.colorbar(self.plot_data) does the trick. On Wed, Nov 2, 2011 at 11:14 AM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, I slightly modified the example show at http://www.scipy.org/Cookbook/Matplotlib/ScrollingPlot to plot image data. My version of the code is at: http://code.google.com/p/ccnworks/source/browse/trunk/various/scroll.py What is the correct way to add a colorbar to this plot? A simple plt.colorbar(axes) yields no colorbar drawn. Thanks. -- Gökhan -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting two (x) axes for the same figure
Hi, Not directly answering your questions but the code below produces what you are trying to achieve: import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost plt.close('all') fig1 = plt.figure(figsize=(11, 8.5)) ax1 = SubplotHost(fig1, 111) fig1.add_subplot(ax1) ## define data x = np.arange(1,11) y = np.random.random(len(x)) # First X-axis ax1.plot(x, y) xmin, xmax = ax1.xaxis.get_view_interval() ax1.xaxis.set_label_text(First X-axis) ax1.yaxis.set_label_text(Sample data) # Second X-axis parx = ax1.twiny() offset = 0, -60 new_axisline = parx.get_grid_helper().new_fixed_axis parx.axis[bottom] = new_axisline(loc=bottom, axes=parx, offset=offset) parx.axis[bottom].label.set_text(Second X-axis) line1, = parx.plot((1./x), np.ones(len(x))) line1.set_visible(0) parx.set_xlim(xmin=xmax,xmax=xmin) parx.axis[top].set_visible(False) ax1.grid(1) plt.tight_layout() plt.show() A few notes: 1-) axes is plural for axis. I always get confused with these words. Tricky English :) 2-) This code uses the older AxisGrid toolkit functions, and not super efficient since it makes an empty plot call with a different x-units. However, using the same ideas and with some dedication you can create multi-axes like the one shown here - http://imageshack.us/photo/my-images/820/plot1r.png/ I had tried the newer AxisGrid approach as JJ suggested but I failed making the plot look pretty. Plus sometimes using the AffineTransforms are not very practical. 3-) I said empty plot call but it is actually where you convert your unit. (np.ones call is another dummy call since the line is made invisible after its call) To me it is more explicit than converting units via transforms. In this example I just assume x as wavelength and convert it to wavenumber with 1/x. You need to adjust that call according to your unit conversion as well as adjusting the limits of your newly scaled unit. As usual JJ can give a more elegant solution for your question, but sometimes practicality beats purity and you engineer your own solution. On Wed, Oct 12, 2011 at 11:36 PM, List Comprehension listcomprehens...@gmail.com wrote: Hello, I am interested in plotting two (x) axes for the same figure (one of is just showing linearly transformed values of the other); one of them offset from the plot if possible. For instance, I have the following code: import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.axisartist as AA ## define data x = np.array(range(11)) xlab = x*2 y = np.random.random(len(x)) fig = plt.figure() ## first axes which is only for drawing the axis axsecond = AA.Subplot(fig, 1,1,1) fig.add_subplot(axsecond) axsecond.set_xlim([min(xlab),max(xlab)]) axsecond.set_xticks(np.linspace(min(xlab),max(xlab),5)) axsecond.axis[bottom, top, left, right].set_visible(False) axsecond.axis[newx] = axsecond.new_floating_axis(nth_coord=0, value=1) axsecond.axis[newx].set_axis_direction(top) axsecond.set_clip_on(False) axsecond.axis[newx].toggle(all=True) axsecond.axis[newx].set_visible(True) plt.draw() ## the main set of axes containing the data axmain = fig.add_subplot(1,1,1) plt.plot(x,y) In this example I wonder 1) How to turn off the top axis of axmain so the ticks from axsecond are visible? Something like axmain[top].set_visible(False) (which does not work of course). 2) If I wanted to include an offset (below the main axis), I feel like something like the following should work but doesn't: ax.axis[newx] = ax.new_floating_axis(nth_coord=0, value=-0.2) ## outside of (0,1) ax.axis[newx].set_axis_direction(bottom) ax.set_clip_on(False) Thanks in advance! -- Gökhan -- 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. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib window layout questions
Hello, I have two questions regarding to the positioning of a mpl window (using WXAgg backend) 1-) How to create a maximized window, instead of me clicking on window to maximize it each time? 2-) I have two screens. Interestingly, my mpl windows tend to open on my small screen. How can I force mpl/ipython/WX/X-windows to open mpl windows on my 2nd and bigger monitor? Thanks. -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem with tick locater
One more update, before heading to the bed. I have managed to adjust my ticks to get what I was asking originally. See the code at http://pastebin.com/XjkDZ486 1-) ax1.yaxis.set_minor_locator(ticker.LogLocator(subs=np.arange(2.0, 10.0)) ) with this line I can get the desired number of minor ticks at the correct positions 2-) #ax1.xaxis.set_ticks(10.**np.arange(np.log10(xmin),np.log10(xmax)+1,1)) this line puts major at every decade but minors aren't printed correctly due to striding at major ticks. 3-) To get this one working I needed to modify the code within the ticker.LogLocator() particularly the two lines starting at https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/ticker.py#L1311 decades = np.arange(math.floor(vmin), math.ceil(vmax)+stride, stride) edited to decades = np.arange(math.floor(vmin), math.ceil(vmax)+1, 1) previously I was getting a major tick at every other decade. With this change I get a major tick at every decade plus the minor ticks look nicer. So my opinion is this stride should be parameter to the LogLocator(), so based on what people wants to plot it can be easily adjusted. Any comments/other solutions? Thanks. * * On Fri, Sep 23, 2011 at 10:47 PM, Gökhan Sever gokhanse...@gmail.comwrote: OK, This fixes the minor locations on y-axis ax1.yaxis.set_minor_locator(ticker.LogLocator(subs=np.arange(2.0, 10.0))) Independent of the data-range. It seems like ticker.LogLocator is trying to adjust the minor locs internally. On Fri, Sep 23, 2011 at 7:18 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hi, Another question is, what sets the tick-location on a log scaled axis? (that 10^-5, 10^-3, 10^-1, 10^1) It seems as if the range is greater than certain value ticks are located this way. Also in a similar way, the location of minor ticks are decided. (If the range is big, no minor ticks, if the range is not too big, put 4 minor ticks --which is very inconvenient to eye, if range is small then nicely locate 9 minor ticks.) Hah, the next probably will be manually forcing the _ticks or ticklocator functions. Anyone else experiencing similar behavior in mpl? On Fri, Sep 23, 2011 at 1:07 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/ How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis) For some reason axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output. Any hints? Thanks. -- Gökhan -- Gökhan -- Gökhan -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Multiple axes related questions
Hello, Please consider my attached examples. hw3.py nicely produces multiple axes electromagnetic spectrum with solar and terrestrial radiation plotted using Planck's function. However, the major and minor ticks placements are not nice in those plots and I have decided to use the new axis_grid1 interface. In the original hw3.py I do multiple plots of desired unit (e.g. wavelength to wavenumber etc...) I am quite sure that the units shown in the hw3.py are correctly converted. Now I am planning to produce these conversions with mpl transformations. Then test1-hw3.py comes into view once again. Can someone possibly (JJ) give little hint here as to converting from wavelength to wavenumber using Affine2D and correctly see the ticks located as the main x-axis. I do lots of extra lines to get this one working properly in the hw3.py as shown below: # multi x-axes # first wavenumber in cm^-1 parx = ax1.twiny() parx.axis[top].set_visible(False) offset = 0, -60 new_axisline = parx.get_grid_helper().new_fixed_axis parx.axis[bottom] = new_axisline(loc=bottom, axes=parx, offset=offset) parx.axis[bottom].label.set_visible(True) parx.axis[bottom].label.set_text(uWavenumber, cm⁻¹) parx.axis[bottom].label.set_fontsize(16) line1, = parx.plot(1/(wavelength[1:]*100), np.ones(len(wavelength[1:]))) line1.set_visible(0) parx.set_xlim(xmin=1e10,xmax=1/1e6) parx.set_xscale('log') Thanks. -- Gökhan #!/usr/bin/env python # -*- coding: utf-8 -*- # ATSC 5003 - Radiation HW 3 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost from matplotlib.transforms import Affine2D plt.close('all') fig1 = plt.figure(figsize=(11, 8.5)) ax1 = SubplotHost(fig1, 111) fig1.add_subplot(ax1) # Approximate surface temperatures of bodies [K] temp_earth = 288 temp_sun = 5800 # Define constants pi = np.pi c = 299792458.0 # speed of light [m/s] h = 6.62606896e-34 # Planck constant [J*s] k = 1.3806504e-23 # Boltzmann constant [J/K] eV = 1.602e-19 # 1 eV in J wavelength = np.linspace(0., 1e-3, 10) # [m] # Planck's function in wavelength domain (in spectral density form) def Plancks_wavelength(wavelength, temperature): return (8 * pi * h * c) / (wavelength**5 * (np.exp((h * c)/ (k * temperature * wavelength))-1)) # Plotting as *irradiance* --hence the c/4 normalization at the top of the atmosphere ax1.plot(wavelength[1:]*1e6, Plancks_wavelength(wavelength[1:], temp_earth)*c/4, 'k--') ax1.plot(wavelength[1:]*1e6, Plancks_wavelength(wavelength[1:], temp_sun)*(6.96e8/1.496e11)**2*c/4, 'k-.') ax1.set_yscale('log') ax1.set_xscale('log') ax1.set_ylim(ymin=1e1, ymax=1e10) ax1.set_xlim(xmin=1e-6, xmax=1e10) ax1.xaxis.set_label_text(uWavelength, μm) ax1.yaxis.set_label_text(uIrradiance, W / m²·m) ax1.axis[left].label.set_fontsize(16) ax1.axis[bottom].label.set_fontsize(16) ax1.plot(np.linspace(1e-6, 3e-5, 100), 1e9*np.ones(len(np.linspace(1e-6, 3e-5, 100))), k-, label=Gamma, lw=4.0) ax1.plot(np.linspace(4e-5, 4e-3, 100), 1e8*np.ones(len(np.linspace(3e-5, 4e-3, 100))), k-, label=X-Ray, lw=3.5) ax1.plot(np.linspace(1e-2, 3e-1, 100), 1e7*np.ones(len(np.linspace(1e-2, 4e-1, 100))), k-, label=UV, lw=3.0) ax1.plot(np.linspace(4e-1, 7e-1, 100), 1e6*np.ones(len(np.linspace(4e-1, 7e-1, 100))), k-, label=Vis, lw=2.5) ax1.plot(np.linspace(8e-1, 3e2, 100), 1e5*np.ones(len(np.linspace(7e-1, 3e2, 100))), k-, label=IR, lw=2.0) ax1.plot(np.linspace(3e4, 2e6, 100), 1e4*np.ones(len(np.linspace(3e4, 3e6, 100))), k-, label=Microwave, lw=1.5) ax1.plot(np.linspace(3e6, 3e9, 100), 1e3*np.ones(len(np.linspace(3e6, 3e9, 100))), k-, label=Radio, lw=1) ax1.legend(frameon=0) # multi x-axes # first wavenumber in cm^-1 parx = ax1.twiny() parx.axis[top].set_visible(False) offset = 0, -60 new_axisline = parx.get_grid_helper().new_fixed_axis parx.axis[bottom] = new_axisline(loc=bottom, axes=parx, offset=offset) parx.axis[bottom].label.set_visible(True) parx.axis[bottom].label.set_text(uWavenumber, cmâ»Â¹) parx.axis[bottom].label.set_fontsize(16) line1, = parx.plot(1/(wavelength[1:]*100), np.ones(len(wavelength[1:]))) line1.set_visible(0) parx.set_xlim(xmin=1e10,xmax=1/1e6) parx.set_xscale('log') # second frequency in s^-1 parx2 = ax1.twiny() parx2.axis[top].set_visible(False) offset = 0, -120 new_axisline = parx2.get_grid_helper().new_fixed_axis parx2.axis[bottom] = new_axisline(loc=bottom, axes=parx2, offset=offset) parx2.axis[bottom].label.set_visible(True) parx2.axis[bottom].label.set_text(uFrequency, sâ»Â¹) parx2.axis[bottom].label.set_fontsize(16) line2, = parx2.plot(c/(wavelength[1:]), np.ones(len(wavelength[1:]))) line2.set_visible(0) parx2.set_xlim(xmin=c/(1e-6*1e-6),xmax=c/(1e10*1e-6)) parx2.set_xscale('log') # third energy in J parx3 = ax1.twiny() parx3.axis[top].set_visible(False) offset = 0, -180 new_axisline = parx3.get_grid_helper().new_fixed_axis parx3.axis[bottom] = new_axisline(loc=bottom, axes=parx3, offset=offset) parx3.axis[bottom].label.set_visible(True)
[Matplotlib-users] Problem with tick locater
Hello, Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/ How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis) For some reason axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output. Any hints? Thanks. -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem with tick locater
On Fri, Sep 23, 2011 at 1:22 PM, Benjamin Root ben.r...@ou.edu wrote: On Fri, Sep 23, 2011 at 2:07 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/ How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis) For some reason axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output. Any hints? Thanks. -- Gökhan By default, setting the scale to log (e.g., ax.set_yscale('log')) should automatically turn the minor ticks on for you. Note that depending on your version of mpl, there may be a slight error in the documentation for LogLocator. Ben Root Hi, I set the log scales for both axes. However, as you see in the image y-axis has only 4 minor ticks (8 expected) where as x-axis has none. I am using a couple days old mpl build. -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem with tick locater
Hi, Another question is, what sets the tick-location on a log scaled axis? (that 10^-5, 10^-3, 10^-1, 10^1) It seems as if the range is greater than certain value ticks are located this way. Also in a similar way, the location of minor ticks are decided. (If the range is big, no minor ticks, if the range is not too big, put 4 minor ticks --which is very inconvenient to eye, if range is small then nicely locate 9 minor ticks.) Hah, the next probably will be manually forcing the _ticks or ticklocator functions. Anyone else experiencing similar behavior in mpl? On Fri, Sep 23, 2011 at 1:07 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/ How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis) For some reason axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output. Any hints? Thanks. -- Gökhan -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem with tick locater
OK, This fixes the minor locations on y-axis ax1.yaxis.set_minor_locator(ticker.LogLocator(subs=np.arange(2.0, 10.0))) Independent of the data-range. It seems like ticker.LogLocator is trying to adjust the minor locs internally. On Fri, Sep 23, 2011 at 7:18 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hi, Another question is, what sets the tick-location on a log scaled axis? (that 10^-5, 10^-3, 10^-1, 10^1) It seems as if the range is greater than certain value ticks are located this way. Also in a similar way, the location of minor ticks are decided. (If the range is big, no minor ticks, if the range is not too big, put 4 minor ticks --which is very inconvenient to eye, if range is small then nicely locate 9 minor ticks.) Hah, the next probably will be manually forcing the _ticks or ticklocator functions. Anyone else experiencing similar behavior in mpl? On Fri, Sep 23, 2011 at 1:07 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/ How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis) For some reason axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output. Any hints? Thanks. -- Gökhan -- Gökhan -- Gökhan -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2dcopy2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 2 x-axes
The master is here. JJ had showed me those multi axes tricks and he is back again with the plenty of changes to the axes_grid toolkit. The best thing to do is to make a new clone from the master repo and experiment. On Sun, Sep 11, 2011 at 1:37 PM, Neal Becker ndbeck...@gmail.com wrote: Jae-Joon Lee wrote: On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker ndbeck...@gmail.com wrote: Yes, that's very helpful. Just one thing. How would I get a bit more bottom margin on the main figure to leave more room for the extra axis? I'm using this as an example. I experimented with plt.subplots_adjust, which seems like it might do the right thing. Is this the 'best' approach? (I really don't know what all these methods do, just guessing) Yes, you need to fiddle with subplots_adjust command. The current development branch of matplotlib (not yet released) has a new function tight_layout, which does this automatically for you. Regards, -JJ Looking forward to that. Any idea of an ETA for a release? -- Using storage to extend the benefits of virtualization and iSCSI Virtualization increases hardware utilization and delivers a new level of agility. Learn what those decisions are and how to modernize your storage and backup environments for virtualization. http://www.accelacomm.com/jaw/sfnl/114/51434361/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 2 x-axes
Hi, The code below should create a properly placed 2nd x-axis. You might need to adjust the placement of the figure canvas to match into the window. import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost fig = plt.figure(figsize=(10,8)) host = SubplotHost(fig, 111) fig.add_subplot(host) parx = host.twiny() parx.axis[top].set_visible(False) offset = 0, -50 new_axisline = parx.get_grid_helper().new_fixed_axis parx.axis[bottom] = new_axisline(loc=bottom, axes=parx, offset=offset) parx.axis[bottom].label.set_visible(True) hplt, = host.plot(np.random.rand(100)) p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0, color='green') plt.show() There is also another example at: http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisartist-with-parasiteaxes Hope this helps. On Fri, Sep 9, 2011 at 12:50 PM, Neal Becker ndbeck...@gmail.com wrote: Neal Becker wrote: I have a semilog plot. I'd like to add a second x axis (maybe below the existing one, or else maybe on top of graph). This second x axis is simply describing the same existing data, in different units. For example imagine a plot of x - time in seconds y - velocity x2 - time in minutes This almost works: fig = plt.figure() ax = fig.add_subplot(111) ... ax2 = ax.twiny() min_x, max_x = ax.get_xlim() ax2.set_xlim (min_x-1, max_x-1) except the 2nd x axis is on the top, and prints right on top of the title -- Why Cloud-Based Security and Archiving Make Sense Osterman Research conducted this study that outlines how and why cloud computing security and archiving is rapidly being adopted across the IT space for its ease of implementation, lower cost, and increased reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Why Cloud-Based Security and Archiving Make Sense Osterman Research conducted this study that outlines how and why cloud computing security and archiving is rapidly being adopted across the IT space for its ease of implementation, lower cost, and increased reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] simple question about locator every 0.5
On Wed, Jul 20, 2011 at 5:41 PM, C M cmpyt...@gmail.com wrote: On Wed, Jul 20, 2011 at 7:24 PM, Buchholz, Greg gbuchh...@infiniacorp.com wrote: -Original Message- From: C M [mailto:cmpyt...@gmail.com] Sorry, this is super-simple, but I'm lost in the whole locator/formatter part of the docs. How can I make a locator that just places a tick at every multiple of 0.5 around the data? So the y axis would look like: 3.5 -- 3.0 -- 2.5 -- 2.0 -- 1.5 -- 1.0 -- Do you want something like: ylim(1.0,3.5) yticks(arrange(1.0,4.0,0.5)) I'm not sure, because I can't try it out--I'm using the OO matplotlib, not Pyplot. What's the equivalent of this in the OO API? ax.axis((xmin, xmax, ymin, ymax)) ax.yaxis.set_ticks(np.arange(1.0, 4.0, 0.5)) Thanks, Che -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] simple question about locator every 0.5
On Wed, Jul 20, 2011 at 7:17 PM, C M cmpyt...@gmail.com wrote: On Wed, Jul 20, 2011 at 7:56 PM, Gökhan Sever gokhanse...@gmail.com wrote: On Wed, Jul 20, 2011 at 5:41 PM, C M cmpyt...@gmail.com wrote: On Wed, Jul 20, 2011 at 7:24 PM, Buchholz, Greg gbuchh...@infiniacorp.com wrote: -Original Message- From: C M [mailto:cmpyt...@gmail.com] Sorry, this is super-simple, but I'm lost in the whole locator/formatter part of the docs. How can I make a locator that just places a tick at every multiple of 0.5 around the data? So the y axis would look like: 3.5 -- 3.0 -- 2.5 -- 2.0 -- 1.5 -- 1.0 -- Do you want something like: ylim(1.0,3.5) yticks(arrange(1.0,4.0,0.5)) I'm not sure, because I can't try it out--I'm using the OO matplotlib, not Pyplot. What's the equivalent of this in the OO API? ax.axis((xmin, xmax, ymin, ymax)) ax.yaxis.set_ticks(np.arange(1.0, 4.0, 0.5)) Thanks. But in order to use this, I have to know ymin and ymax, based on the data. But I thought this was the point of the locators--that they could assign the ticks based on the range of the data and then some rule about placement of ticks in that range. But when I look at the various kinds of locators in the docs, none have a parameter that is equivalent to the 0.5 above in set_ticks. Or do they and I just missed it? You can call min and max functions on your data arrays and make adjustments in your tick placement accordingly. -- Gökhan -- 5 Ways to Improve Secure Unified Communications Unified Communications promises greater efficiencies for business. UC can improve internal communications as well as offer faster, more efficient ways to interact with customers and streamline customer service. Learn more! http://www.accelacomm.com/jaw/sfnl/114/51426253/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] incremental colors for lines
On Mon, May 9, 2011 at 5:11 PM, Pythonified netdriverem...@gmail.comwrote: Pythonified wrote: I have been trying to assign different colors for each line I plot, where the colors are incrementally darkened (or lightened), or selected from a colorbar (e.g. rainbow). Any ideas? I have found a simple and better way. One can chose from colors from a color map: import pylab as pl import matplotlib.cm as cm xval = pl.arange(0, 20, 0.2) for i in range(256): ... pl.plot(xval, pl.sin(xval)+i, c=cm.hot(i), lw=5) This one if, for instance, picking from a color map called hot. If one wants to the colors to fade away, or darken, the alpha option can be utilized or another color map in which colors darken or fade into another color. There is no need for a long sophisticated script. Enjoy, Pythonified Nice trick. This can go into the gallery or somewhere else in scipy cookbook. -- Gökhan -- Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Radar and/or lidar data visualization
Hello, Anyone on the list works with radar and/or lidar data for atmospheric phenomenon visualisation? I am wondering if there is any 2D specific analysis and visualisation package out in the web. Thanks. -- Gökhan -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Numpy-discussion] Anybody going to PyCon?
Yung-Yu, We are advertised on this blog http://pycon.blogspot.com/2011/03/pycon-2011-outside-talks-poster-session.html I will be in the conference venue by tomorrow morning. There are many interesting talks and posters that I look forward seeing plus meeting those presenters. See you in Atlanta. On 3/9/11, Yung-Yu Chen y...@solvcon.net wrote: I will be there tomorrow, and giving a talk about solving PDEs on Saturday morning (plus a poster). Looking forward to meet you guys and to learn more about contribution to the community. with regards, Yung-Yu Chen -- Yung-Yu Chen PhD candidate of Mechanical Engineering The Ohio State University, Columbus, Ohio +1 (614) 859 2436 http://solvcon.net/yyc/ -- Gökhan -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Anybody going to PyCon?
Hello, I am going to the PyCon this week. I am presenting a poster about an atmospheric sciences related project -- the most active development from my coding site over at http://code.google.com/p/ccnworks/ Is there anybody in the community participating there as well? Any plans for sprinting or similar activities? See you at PyCon. -- Gökhan -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Make the area a bit larger
On Mon, Feb 28, 2011 at 10:48 AM, Andrea Crotti andrea.crott...@gmail.comwrote: So since I wanted some space on the borders of my graph, I did this really extremely convoluted thing, which apparently works... I get a 10% more area on each side, but I'm quite sure there's a better way to this, right? I didn't find any function to pass an increment to the size that's why I did this mess... --8---cut here---start-8--- old_axes = plt.axis() sizes = old_axes[1] - old_axes[0], old_axes[3] - old_axes[2] offset = lambda x: int((float(x) / 10)) new_axes = [] for i in range(len(old_axes)): new_val = old_axes[i] + (((-1) ** (i + 1)) * offset(sizes[i % 2])) new_axes.append(new_val) plt.axis(new_axes) --8---cut here---end---8--- -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Hi, You can try: fig, ax = plt.subplots(1,1) ax.plot(range(10)) fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95) If you choose WXAgg as your backend you get a nice config tool to adjust spacing in the figure. Then just pass those numbers into .subplots_adjust method once you are satisfied. -- Gökhan -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Any update on streamline plot
Hi, I see two related requests on: http://old.nabble.com/matplotlib-to-draw-streamlines--td28008708.html http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg07267.html a request filed on http://sourceforge.net/tracker/index.php?func=detailaid=3080981group_id=80706atid=560723 Is there any progress on this plot? Or source guides to implement such functionality in mpl? PS: The feature request @ http://sourceforge.net/tracker/?atid=560723group_id=80706func=browse looks spammed? Anyone works on clearing these? -- Gökhan -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Legend outside plot?
Hi, I would simply try to attach the legend to the figure object instead of the axis. On Thu, Feb 10, 2011 at 4:20 PM, Jeff Layton layto...@att.net wrote: Good evening, I've been trying to find a way to move the legend outside the plot so it doesn't cover it up. I've seen some things online but I can quite get them to work (probably just my lack of knowledge about matplotlib). The section of code creating the plot looks like, fig = plt.figure() ax = fig.add_subplot(1,1,1); p1 = ax.bar(ind, IO_Time_Plot, width, color=r, align='center'); p2 = ax.bar(ind, Diff_Plot, width, color=y, bottom=IO_Time_Plot, align='center'); ax.set_ylabel('Time (secs)'); ax.set_title('Elapsed Time and IO Time',fontstyle='italic'); ax.set_xticks(ind); group_labels = []; for item in names: group_labels.append(item); ax.set_xticklabels(group_labels); fig.autofmt_xdate(); #ax.legend( bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.); ax.legend( (p1[0], p2[0]), ('IO Time', 'Total Elapsed Time')); You can see my attempt at moving the legend outside the bounding box but when I try this, the legend never appears. TIA! Jeff -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] adding a number of minor tick marks between major tick marks feature
On Mon, Nov 29, 2010 at 3:01 PM, Matthew W. Priddy mwpri...@gmail.com wrote: Matplotlib developers, I really like using matplotlib to create quality plots, and it seems to have an option for just about everything. However, one thing that is not easy to change is the location of minor tick marks. To set major tick mark locations, one can simply use the xticks command. And now we can atleast turn on the minor tick marks with the minorticks_on() command. But, is there any way to implement something similar to xticks for minor tick marks? Even better would be a feature that allowed the user to simply specify the number of minor tick marks that are evenly spaced between the major tick marks? Thanks. --Matthew It is easy with MultipleLocator class. I[1]: y = np.random.randn(100) I[2]: plt.plot(y) O[2]: [matplotlib.lines.Line2D object at 0xa82ea6c] I[3]: from matplotlib.ticker import MultipleLocator I[4]: ax = plt.gca() I[5]: ax.xaxis.set_minor_locator(MultipleLocator(5)) -- Gökhan -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Use a marker symbol in a text string
On Wed, Nov 24, 2010 at 8:38 AM, Alejandro Weinstein alejandro.weinst...@gmail.com wrote: On Tue, Nov 23, 2010 at 9:37 AM, Gökhan Sever gokhanse...@gmail.com wrote: As I have learnt from Michael Droettboom, you can simply use unicode characters with a supported font set: In my setup I prefer DejaVu-Sans. First install these fonts into your system, then edit your matplotlibrc Thanks for the answer. But I think there must be an easier way without the need to install anything. After all, the legend command is able to create text using the markers. Alejandro. You have three options then: 1-) Figure out how legend handles symbol drawing. 2-) Use latex / mathtext to represent symbols. 3-) Install a font and more intuitively insert a sqaure box into your string. For me, as long as the expression that is drawn on screen is not complicated, I am very happy using the unicode text approach. -- Gökhan -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Use a marker symbol in a text string
On Tue, Nov 23, 2010 at 10:22 AM, Alejandro Weinstein alejandro.weinst...@gmail.com wrote: Hi: I want to use the symbol corresponding to a marker in a text annotation. Something like textstr = 'This is the square marker: ?' ax.text(0.05, 0.95, textstr) Is there something I can place where the question mark is above to get the actual square (or any other of the symbols you can use as a marker)? This is similar to what the legend command does, but I need more flexibility. Alejandro. As I have learnt from Michael Droettboom, you can simply use unicode characters with a supported font set: In my setup I prefer DejaVu-Sans. First install these fonts into your system, then edit your matplotlibrc font.family : sans-serif font.sans-serif : DejaVu Sans or alternatively using your favorite unicode font. then try this example (suggest using a unicode supported text editor (e.g., vim)): #!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt plt.plot(range(100)) plt.text(0.05, 0.95, uThis is the square marker: □, fontsize=20) plt.show() Unicode characters are great for putting units, but it is not easy to construct complex equations. Does anyone know if there is sub/super-script range alphabet (not only numbers) supported unicode font set? -- Gökhan -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Too long tick labels
On Fri, Oct 22, 2010 at 1:47 AM, Dmitry Vinokurov df6@gmail.com wrote: Hello, When I plot graph with values 10^5 and more at y axis, the labels are too long and run out of the picture borders. So I get 60 instead of 160 at y axis or something like this. Tried to use majorFormatter = ticker.FormatStrFormatter('%e') ax.yaxis.set_major_formatter(majorFormatter) but it became even worse -- 00e+00, 00e+05, 00e+06, i.e. first digits run out of picture border or I see only part of digit. Is it possible to make matplotlib automatically change picture size due to it's content? Or maybe there is some other way to solve my problem? Thanks. Simply you can log scale your axes for such big ranges. Other alternative would be shifting your subplot to left using figure subplots_adjust function. Both Wx and Qt4 backends provide graphical access to this function on navigation toolbar, so you can first experiment to make the visual fit your need (If you use WX backend actually you can see the numeric values to use in subplots_adjust function). You can also follow this thread: http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html to make fancier adjustments to tick labels. -- Gökhan -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Question about legend on histogram plot
On Fri, Oct 22, 2010 at 6:26 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: On Thu, Oct 21, 2010 at 4:31 AM, Gökhan Sever gokhanse...@gmail.com wrote: How could I change the appearance of the legend symbol in this case? It auto-uses a patch object (rectangle in this case). I would like to get a straight line instead. You may use proxy artists. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist Regards, -JJ Thanks for the suggestion JJ. I have actually changed my initial approach. Now I am just using colored text to create pseudo-legends, like shown below: ax1.text(0.40, 0.8, Cloud-base, fontsize=14, transform=ax1.transAxes) ax1.text(0.40, 0.7, BallVario, fontsize=14, color='b', transform=ax1.transAxes) ax1.text(0.40, 0.6, AIMMS, fontsize=14, color='g', transform=ax1.transAxes) By the way, from the linked construct, changing width and height of the rectangle doesn't have any affect. p = Rectangle((0, 0), 1, 1, fc=r) legend([p], [Red Rectangle]) p = Rectangle((0, 0), 10.0, 2.0, fc=r) plt.legend([p], [Red Rectangle]) or making trying a smaller rectangle: p = Rectangle((0, 0), 0.2, 1, fc=r) plt.figure(); plt.legend([p], [Red Rectangle]) -- Gökhan -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Question about legend on histogram plot
Hello, Consider these two simple lines in IPython -pylab: plt.hist(np.random.randn(1000), normed=1, histtype='step', label='test', lw=2) plt.legend() How could I change the appearance of the legend symbol in this case? It auto-uses a patch object (rectangle in this case). I would like to get a straight line instead. Thanks. -- Gökhan -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Log scaling error on rev8753
Sorry I have forgotten to add that you should issue a k key on the plot to scale the x-axis logarithmically. On Tue, Oct 19, 2010 at 7:42 AM, Michael Droettboom md...@stsci.edu wrote: I can't reproduce this here with trunk, though I get a different crash in the 1.x branch (which has an easy fix). Are there any additional steps required to reproduce? Mike On 10/18/2010 09:50 PM, Gökhan Sever wrote: Hello, I can't log scale my axes on rev8753. It was working on a previous check-out (possibly a month old). Using WXagg, but same as with Qt4Agg. Any ideas what could be wrong in the trunk? It seems to me that some recent changes on LogLocator [ http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log ]class causing this. I[5]: d_um_pcasp_midpoint O[5]: array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195, 0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 , 4.957 ]) I[6]: pcasp_spectral_density09d O[6]: array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583, 160.62733458, 48.77147359, 22.23106603, 7.56501192, 10.94637257, 8.47475684, 21.53335341, 32.950845 , 30.502102 , 28.90555459, 21.38636076]) I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d) O[7]: [matplotlib.lines.Line2D object at 0x14b2474c] I[8]: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (554, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) --- ValueError Traceback (most recent call last) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc in _onKeyDown(self, evt) 1254 key = self._get_key(evt) 1255 evt.Skip() - 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt) 1257 1258 def _onKeyUp(self, evt): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press_event(self, key, guiEvent) 1525 s = 'key_press_event' 1526 event = KeyEvent(s, self, key, self._lastx, self._lasty, guiEvent=guiEvent) - 1527 self.callbacks.process(s, event) 1528 1529 def key_release_event(self, key, guiEvent=None): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in process(self, s, *args, **kwargs) 260 del self.callbacks[s][cid] 261 else: -- 262 proxy(*args, **kwargs) 263 264 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in __call__(self, *args, **kwargs) 186 mtd = self.func 187 # invoke the callable and return the result -- 188 return mtd(*args, **kwargs) 189 190 def __eq__(self, other): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press(self, event) 2254 elif scalex == 'linear': 2255 ax.set_xscale('log') - 2256 ax.figure.canvas.draw() 2257 2258 elif (event.key.isdigit() and event.key!='0') or event.key in all: /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc in draw(self, drawDC) 57 58 DEBUG_MSG(draw(), 1, self) --- 59 FigureCanvasAgg.draw(self) 60 61 self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc in draw(self) 392 393 self.renderer = self.get_renderer() -- 394 self.figure.draw(self.renderer) 395 396 def get_renderer(self): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) --- 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc in draw(self, renderer) 872 dsu.sort(key=itemgetter(0)) 873 for zorder, func, args
Re: [Matplotlib-users] Log scaling error on rev8753
OK, I have just done an svn up and seen that this is fixed in http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?revision=8756view=revision Thanks for the fix. On Tue, Oct 19, 2010 at 10:06 AM, Gökhan Sever gokhanse...@gmail.com wrote: Sorry I have forgotten to add that you should issue a k key on the plot to scale the x-axis logarithmically. On Tue, Oct 19, 2010 at 7:42 AM, Michael Droettboom md...@stsci.edu wrote: I can't reproduce this here with trunk, though I get a different crash in the 1.x branch (which has an easy fix). Are there any additional steps required to reproduce? Mike On 10/18/2010 09:50 PM, Gökhan Sever wrote: Hello, I can't log scale my axes on rev8753. It was working on a previous check-out (possibly a month old). Using WXagg, but same as with Qt4Agg. Any ideas what could be wrong in the trunk? It seems to me that some recent changes on LogLocator [ http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log ]class causing this. I[5]: d_um_pcasp_midpoint O[5]: array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195, 0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 , 4.957 ]) I[6]: pcasp_spectral_density09d O[6]: array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583, 160.62733458, 48.77147359, 22.23106603, 7.56501192, 10.94637257, 8.47475684, 21.53335341, 32.950845 , 30.502102 , 28.90555459, 21.38636076]) I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d) O[7]: [matplotlib.lines.Line2D object at 0x14b2474c] I[8]: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (554, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) --- ValueError Traceback (most recent call last) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc in _onKeyDown(self, evt) 1254 key = self._get_key(evt) 1255 evt.Skip() - 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt) 1257 1258 def _onKeyUp(self, evt): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press_event(self, key, guiEvent) 1525 s = 'key_press_event' 1526 event = KeyEvent(s, self, key, self._lastx, self._lasty, guiEvent=guiEvent) - 1527 self.callbacks.process(s, event) 1528 1529 def key_release_event(self, key, guiEvent=None): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in process(self, s, *args, **kwargs) 260 del self.callbacks[s][cid] 261 else: -- 262 proxy(*args, **kwargs) 263 264 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in __call__(self, *args, **kwargs) 186 mtd = self.func 187 # invoke the callable and return the result -- 188 return mtd(*args, **kwargs) 189 190 def __eq__(self, other): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press(self, event) 2254 elif scalex == 'linear': 2255 ax.set_xscale('log') - 2256 ax.figure.canvas.draw() 2257 2258 elif (event.key.isdigit() and event.key!='0') or event.key in all: /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc in draw(self, drawDC) 57 58 DEBUG_MSG(draw(), 1, self) --- 59 FigureCanvasAgg.draw(self) 60 61 self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc in draw(self) 392 393 self.renderer = self.get_renderer() -- 394 self.figure.draw(self.renderer) 395 396 def get_renderer(self): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) --- 55 draw(artist, renderer, *args
Re: [Matplotlib-users] Format y-axis tick labels in 'comma' notation ie 234004 would be 234, 004 etc.
On Tue, Oct 19, 2010 at 1:31 PM, Dharhas Pothina dharhas.poth...@twdb.state.tx.us wrote: Hi All, I'm assuming this is possible and common but I'm not finding the correct combination of search terms to find any examples on the mailing list or online on how to do this. I'd like to display the y-axis tick labels in the 'comma' notation i.e. 234004 = 234,004 1237689 = 1,237,689 etc thanks, - dharhas Python 2.7 has format specifiers for thousands separation: http://docs.python.org/dev/whatsnew/2.7.html#pep-378-format-specifier-for-thousands-separator moneyfmt recipe http://docs.python.org/library/decimal.html#recipes might provide an alternative solution. In any case you should need to get yticklabels and set them with the converted values. -- Gökhan -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ticks Size
On Mon, Oct 18, 2010 at 5:36 PM, Eric Firing efir...@hawaii.edu wrote: setp(xticks, markeredgewidth=4) Ticks are markers. Eric Good catch. Thanks for the fix. -- Gökhan -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Log scaling error on rev8753
Hello, I can't log scale my axes on rev8753. It was working on a previous check-out (possibly a month old). Using WXagg, but same as with Qt4Agg. Any ideas what could be wrong in the trunk? It seems to me that some recent changes on LogLocator [ http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log ]class causing this. I[5]: d_um_pcasp_midpoint O[5]: array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195, 0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 , 4.957 ]) I[6]: pcasp_spectral_density09d O[6]: array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583, 160.62733458, 48.77147359, 22.23106603,7.56501192, 10.94637257,8.47475684, 21.53335341, 32.950845 , 30.502102 , 28.90555459, 21.38636076]) I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d) O[7]: [matplotlib.lines.Line2D object at 0x14b2474c] I[8]: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (554, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (555, 0)) --- ValueErrorTraceback (most recent call last) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc in _onKeyDown(self, evt) 1254 key = self._get_key(evt) 1255 evt.Skip() - 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt) 1257 1258 def _onKeyUp(self, evt): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press_event(self, key, guiEvent) 1525 s = 'key_press_event' 1526 event = KeyEvent(s, self, key, self._lastx, self._lasty, guiEvent=guiEvent) - 1527 self.callbacks.process(s, event) 1528 1529 def key_release_event(self, key, guiEvent=None): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in process(self, s, *args, **kwargs) 260 del self.callbacks[s][cid] 261 else: -- 262 proxy(*args, **kwargs) 263 264 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in __call__(self, *args, **kwargs) 186 mtd = self.func 187 # invoke the callable and return the result -- 188 return mtd(*args, **kwargs) 189 190 def __eq__(self, other): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc in key_press(self, event) 2254 elif scalex == 'linear': 2255 ax.set_xscale('log') - 2256 ax.figure.canvas.draw() 2257 2258 elif (event.key.isdigit() and event.key!='0') or event.key in all: /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc in draw(self, drawDC) 57 58 DEBUG_MSG(draw(), 1, self) --- 59 FigureCanvasAgg.draw(self) 60 61 self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc in draw(self) 392 393 self.renderer = self.get_renderer() -- 394 self.figure.draw(self.renderer) 395 396 def get_renderer(self): /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) --- 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc in draw(self, renderer) 872 dsu.sort(key=itemgetter(0)) 873 for zorder, func, args in dsu: -- 874 func(*args) 875 876 renderer.close_group('figure') /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) --- 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axes.pyc in draw(self, renderer, inframe) 1952 1953 for
Re: [Matplotlib-users] matplotlib import warning
I temporarily fixed this by commenting the following lines in pkg_resources.py folder in /site-packages/distribute.. folder. issue_warning( Module %s was already imported from %s, but %s is being added to sys.path % (modname, fn, self.location), ) Now, I don't get any dateutil imported messages each time I launch an IPython session. On Wed, Sep 8, 2010 at 1:26 PM, Gökhan Sever gokhanse...@gmail.com wrote: It is clear with python -c import matplotlib I can't seem to find any dateutil phrase occurring within the IPython installation folder (/site-packages/IPython) Where else to look for? On Wed, Sep 8, 2010 at 12:35 PM, Aman Thakral aman.thak...@gmail.com wrote: try this in the terminal: python -c import matplotlib -Aman On Wed, Sep 8, 2010 at 12:17 PM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, My usual ipython -pylab is giving me these warnings after I installed matplotlib from the source (matplotlib rev.8624 using python setupegg.py develop). /usr/lib/python2.6/site-packages/EPDLab-3.0.1.dev_r24658-py2.6.egg/enthought/__init__.py:7: UserWarning: Module dateutil was already imported from /home/user/Desktop/python-repo/matplotlib/lib/dateutil/__init__.pyc, but /usr/lib/python2.6/site-packages is being added to sys.path __import__('pkg_resources').declare_namespace(__name__) Under /site-packages in easy-install.pth I moved the /home/user/Desktop/python-repo/matplotlib/lib line to the very bottom of the file but this doesn't make any change. Any ideas how to remove this warning? -- Gökhan -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Aman Thakral B.Eng Biosci, M.Eng Design -- Gökhan -- Gökhan -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] axes in matplotlib
On Sun, Sep 26, 2010 at 3:49 AM, sa6113 s.payan...@gmail.com wrote: I want to use more than 2 axes in my plot, for example yleft,yright, butoom or top, is it possible? any body had done it before? I read in matplotlib's document that : matplotlib is organized around figures and axes. The figure contains an arbitrary number of axes, which can be placed anywhere in the figure you want, including over other axes. You can directly create and manage your own figures and axes. How? -- I suggest spending sometime going through the matplotlib gallery. [ http://matplotlib.sourceforge.net/gallery.html] This example should give you a good start for multiple axes plotting [ http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html ] Gökhan -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Sigmoid Curve Fitting
On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer chriss...@gmail.com wrote: Hi, Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve to a set of data points? Regards, Chris I am very curious to know how this is done. I have seen in many Cloud Condensation Nuclei (CCN) counter calibration experiments [e.g. Rose et. al. (2008) - p1156, fig2 http://www.atmos-chem-phys.net/8/1153/2008/acp-8-1153-2008.html] people use sigmoidal fits. Never seen a code is shared so far or how it is obtained. from scipy.optimize import leastsq could be a good point to start. To me this fit is very likely a least square minimization problem. You have your tanh(x) or 1/(1+e^-x) as a sigmoidal function, and you should find the points that will make the error minimal for a given discrete points/measurements. from scipy.optimize import curve_fit might be another way to approach. -- Gökhan -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users