Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
A Ground Hog movie moment? Deja vu all over again (Quoting Yega Berra.). I went right through John Hunter's comment of a day or two ago about the need to solve this with ipython. That has to be taken into consideration; otherwise, this is a no-go.. I suppose an interesting aside though on what I discovered through the debugger. When the program hit show(), it went back to the first line in the calling def instead of after where it was called. I suppose in some dim way one could use a global variable to detect that occurrence, and remedy matters. I'll defer to ipython. On 2/10/2010 7:08 PM, Wayne Watson wrote: Foiled again. I clicked on the previous version, which has no MPL code in the same def. The show() is where things go wrong though. The question now is where did the program go after the show()? Maybe it's time to put the interactive debugger into play, which I've barely used. I have used others. On 2/10/2010 6:44 PM, Wayne Watson wrote: I chronicled some of my MPL problems here. It appeared that show() could be the problem. The problem is apparently the difference between running the program in IDLE and executing it from the folder (Maybe there's a name for that?). There are only about 8 lines of MPL code to the show() in a def. I inserted and moved a return down each line, executing the program afterwords. It behaved as expected, no plot. Once I removed the plot, I got the unexpected behavior. A video clip not played. So off to a direct py file execution. It worked fully. What this amounts to is that we need to find a better way for users to execute the program than through IDLE. Tomorrow I'll pass this by the original developer. -- Crime is way down. War is declining. And that's far from the good news. -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Ways of updating legends
Hi, I am re-using a scatter plot in the same figure for interactively displaying results without ending up with 30 windows open. The legend is relevant, and so it must be also updated. So far the only way I found was to use the set_label() method and then using plt.legend(). Is this the only way to get a legend updated from a label? I am curious, since generally there is the pyplot way and a more OO way of achieving things, but I could't find it this time. The snippet below shows what I am using right now: import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt data = np.random.randn(3,10) fig = plt.figure() ax = fig.add_subplot(111) s, = ax.plot([]) ax.axis([0,10,-1,1]) ax.legend([s],[''], loc=0) for i in range(data.shape[0]): s.set_data([np.arange(data.shape[1]),data[i]]) s.set_label(str(i)) plt.legend() plt.draw() plt.ginput(timeout=0) -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
On Thu, Feb 11, 2010 at 2:41 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: A Ground Hog movie moment? Deja vu all over again (Quoting Yega Berra.). I went right through John Hunter's comment of a day or two ago about the need to solve this with ipython. That has to be taken into consideration; otherwise, this is a no-go.. Instead of focusing on show, you should describe the problem you are trying to solve. From previous posts, it sounds like you are trying to use pyplot in a mode is was not designed to handle. You said you are delivering a python application that uses matplotlib to users who do not know python, and using Idle to run the app. Why? Why use idle in an app for users who do not know python since it is a python IDE. You also said that this was not your design decision and so it sounds like you are working on code someone else developed so you may be suffering from someone else's bad design decisions. My guess is you would have much more success embedding matplotlib in a GUI toolkit of your choice and then you have complete control over the mainloop, the threading, how and when windows are raised in what order. http://matplotlib.sourceforge.net/examples/user_interfaces/index.html show is meant to be the last line of a script and raise all of the figures generated in that script at once. interactive mode including ipython in pylab mode is meant for python coders who want to create and modify figures typing python code at the interactive shell prompt. User interface embedding is for developers who want to deploy mpl in an application to users who may or may not know python where the developer wants complete control of figure and window management -- this sounds like your use case. Trying to shoehorn one mode into another will lead to frustration. Writing user interface applications can be hard and tedious (though there are tools like enthought traits to make it less so). pyplot is technically a user interface application which is a scripting language to make figures. Because it is easy, some people who want to write more complex applications only using pyplot and this can be done up to a point with judicious use of event handling and GUI idle handlers, etc (see http://matplotlib.sourceforge.net/users/event_handling.html). But at some point you will hit the wall because you are trying to make pyplot do something it is not designed to do, but don't blame pyplot (or pyplot.show). matplotlib is readily usable in complex user interface applications -- in fact that is what it was designed for -- and pyplot is just an interface sitting on top of that, but you must use the matplotlib API and directly embed the matplotlib canvas and toolbar in your application to reach this potential. JDH -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib axis define
Hi all I'm noob on matplotlib on python and I need to do excel graphic like (model.jpg) that I send attached. I send it too my test code for that My problem is to set the values on y and x axis how I do it? thanks in advanced # -*- coding: utf-8 -*- from decimal import Decimal y=[Decimal('0.3041997084285048793446312110'), Decimal('0.3041811120982812429734672735'), Decimal('0.3041586008929715390350375366'), Decimal('0.3041326478700651884918449742'), Decimal('0.3041035792459110687414956042'), Decimal('0.3040716389305317969883516979'), Decimal('0.3040370190056943726355391828'), Decimal('0.3039998763354236109640693846'), Decimal('0.3039603425231051434729103751'), Decimal('0.3039185303035350714640090501'), Decimal('0.3038745378649594754802712117'), Decimal('0.3038284518931050349228492634'), Decimal('0.3037303013157358388145146537'), Decimal('0.3036783698876388202495693043'), Decimal('0.3036246135388058002644503367'), Decimal('0.3035690857187649546055776374'), Decimal('0.3035118359225733232985072989'), Decimal('0.3034529102064387430820630960'), Decimal('0.3027798308296002483823593898'), Decimal('0.3019747799126658047321072371'), Decimal('0.3010595626751769086882851904'), Decimal('0.3000504843910340202763428443'), Decimal('0.2989606698104426040434113406'), Decimal('0.2978011455914110301509835818'), Decimal('0.2965814242208845926010044833'), Decimal('0.2953098521515828700938805931'), Decimal('0.2939938339016535952485540052'), Decimal('0.2926399857027685846714651451'), Decimal('0.2912542467050261664773915582'), Decimal('0.2898419633541847137900856664'), Decimal('0.288407956091484767905372'), Decimal('0.2869565739529259676416421710'), Decimal('0.2854917405773616724446679145'), Decimal('0.2840169938920561838932972437'), Decimal('0.2825355209776950316856977412'), Decimal('0.2810501891298752300565699492'), Decimal('0.2530398800717247021535893133'), Decimal('0.2309593282901911270323471566'), Decimal('0.2142248288114558358413671724'), Decimal('0.2013198591032495347111055987'), Decimal('0.1911048080932635279916693404'), Decimal('0.1828168101439619902156148570'), Decimal('0.1759472033051957360143949273'), Decimal('0.1701494956228995244136332946'), Decimal('0.1651812738049817427569102300'), Decimal('0.1480327912592802041987336541'), Decimal('0.1377158741268375390344888336'), Decimal('0.1306910617724526170054856744'), Decimal('0.1255330889933308327695803461'), Decimal('0.1215487905337388255028562821'), Decimal('0.1183569033660768681595931242'), Decimal('0.1157287111457510779727799369'), Decimal('0.1135178566558123755075563813'), Decimal('0.1116258850568561542189771708'), Decimal('0.1099838725178337221454044654'), Decimal('0.1085419726700384590105347580'), Decimal('0.1072631467404932434072879819'), Decimal('0.1061192356086297651474504552'), Decimal('0.1050884072158080865363934958'), Decimal('0.1043334716140861254810893687'), Decimal('0.1033005693930824423996036004'), Decimal('0.1025186055369403393962066223'), Decimal('0.1017983854707960971280910413'), Decimal('0.09940010650120277239400512213'), Decimal('0.09755584274949988113748876745'), Decimal('0.09608280592970019748916863039'), Decimal('0.09487248638771297021511871199'), Decimal('0.09385595137090260551637864016'), Decimal('0.09298707461257284768573005693'), Decimal('0.09223369403246902869720064622'), Decimal('0.09157262184937054787957562771'), Decimal('0.09098667068685246134841009967'), Decimal('0.09046279979357594355255331919'), Decimal('0.08999091520111926307741922487'), Decimal('0.08956306789557021895282081016'), Decimal('0.08917290300510101286609973635'), Decimal('0.08881527223605659165755623012'), Decimal('0.08839214273205423057465385692'), Decimal('0.08818145632861301828547916695'), Decimal('0.08789885141864609564589281926'), Decimal('0.08763567457015281090584469616'), Decimal('0.08738982949516953082784067755'), Decimal('0.08715952155240858367614678101'), Decimal('0.08694320432541564991702617169'), Decimal('0.08673953730326870462655463881'), Decimal('0.08654735203979727709035602654'), Decimal('0.08636562485710431638877620200'), Decimal('0.08619345465056452099941506608'), Decimal('0.08603004470711568574821284350'), Decimal('0.08587468770771509864601566552'), Decimal('0.08572675327619531920987689779'), Decimal('0.08558567757959197545385559924'), Decimal('0.08545095459267629930008504016'), Decimal('0.08532212872131176389071802292'), Decimal('0.08519878854207047655135178819'), Decimal('0.08508056146411939254364355471'), Decimal('0.08496710915723189654691208846'), Decimal('0.08485812361947675422749917393'), Decimal('0.08475332378159534560914071150'), Decimal('0.08465245256372754764842491632'), Decimal('0.08455527431506202470084773481'), Decimal('0.08446157257898387425834816114'), Decimal('0.08437114813599492559990198572'), Decimal('0.08428381728456899879544582613'), Decimal('0.08419941032654730116548635256'), Decimal('0.08411777022896698490334200456'),
Re: [Matplotlib-users] logarithmic plotting and the grid
I think he wants to turn the grid on for both major and minor ticks. I'm interested in that also. Is there a way to do that? Lee Jae-Joon Lee lee.j.j...@gmail.com 02/10/2010 08:10 PM To K L klu1...@gmail.com cc matplotlib-users@lists.sourceforge.net Subject Re: [Matplotlib-users] logarithmic plotting and the grid Caterpillar: Confidential Green Retain Until: 03/12/2010 grid takes an optional argument which. Unfortunately this is not properly documented with pylab.grid and Axes.grid. But see http://matplotlib.sourceforge.net/api/axis_api.html?highlight=grid#matplotlib.axis.Axis.grid grid(True) # this turns on gridlines for major ticks grid(True, which=minor) # this turns on gridlines for minor ticks. -JJ On Wed, Feb 10, 2010 at 6:18 PM, K L klu1...@gmail.com wrote: Hi, I want a more detailed grid for my logarithmic plotting. The following code: from pylab import * semilogy(range(10)) grid(True) show() will produce output like this: http://i49.tinypic.com/2dpd3r.png Notice that the grid uniformly slices the image. And some ticks on the y-axis doesn't have grid lines. This is not want I want. Conversely, something like this is preferred: http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/bert_mat_explot1.gif Thanks! -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib axis define
Hello, It is not clear what exactly does not work in your file. I assumed it was the logarithmic scaling in x. Here is the code to produce that. A complete documentation is available on http:// matplotlib.sourceforge.net/ , you might be especially interested by the examples http://matplotlib.sf.net/examples/index.html and the gallery http://matplotlib.sourceforge.net/gallery.html that provide codes to perform a wide range of graphics. Pierre from decimal import Decimal from matplotlib import pyplot as pp x = ... y = ... pp.xscale('log') pp.plot(x,y) pp.xlabel('h') pp.ylabel('q') pp.show() Le 11 févr. 10 à 13:51, Samuel Teixeira Santos a écrit : Hi all I'm noob on matplotlib on python and I need to do excel graphic like (model.jpg) that I send attached. I send it too my test code for that My problem is to set the values on y and x axis how I do it? thanks in advancedtest.pymodel.jpg-- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris- dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] logarithmic plotting and the grid
On Thu, Feb 11, 2010 at 8:13 AM, Lee Boger boger_...@cat.com wrote: I think he wants to turn the grid on for both major and minor ticks. I'm interested in that also. Is there a way to do that? ax.grid(True, which='major') ax.grid(True, which='minor') JDH -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
On Thu, Feb 11, 2010 at 9:18 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Yes, certainly,as you explained a few days ago, the present use is incompatible with idle usage. Further, you mentioned the need for ipython and the backend to make it work (in IDLE?). The way we are using problem seems a bit ambiguous, so let me tell what I want the application to do. From the screenshots, this appears to be a tk app that is being run from idle. If you are trying to integrate pyplot with this, it is a mode of usage that is *explicitly not supported*. Rather, you should embed matplotlib in the app following the embedding_in_tk*.py examples at http://matplotlib.sourceforge.net/examples/user_interfaces/index.html JDH -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Legend placement on graphs with fill_between
Hi all, I'm trying to generate graphs from my test results, with regions coloured with succeeded and failing tests. It nearly works, but I have the following problem. I am providing the data with fill_between, which returns PolyCollection objects which cannot be provided to a legend. So I use the proxy artist trick, as described here http://matplotlib.sourceforge.net/users/legend_guide.html#plotting-guide-legend The problem is that my legend then gets placed over the graph. As it has been generated from proxy artists, it presumably doesn't take account of the real artists when deciding where to place itself. I tried plotting lines as well as filling regions (commented lines in the code below) which works for the legend placement but leaves an ugly red line inside the green region, where presumably it is trying to show me that it's plotted a line. As I in general have no idea what the data will look like I believe I need to use the best placement for the legend, I cannot hardcode it. Any advice greatly appreciated. I paste below exactly what my program does (this is autogenerated from my real program). Regards, Geoff Bache #!/usr/bin/env python import pylab pylab.clf() figure4 = pylab.figure(1) figure4.set_figwidth(9.4488188976377945) figure4.set_figheight(7.8740157480314963) axessubplot4 = pylab.subplot(111) text4 = pylab.title(Test results for Application: 'Application One' Version: 'version2', fontsize=10, family='monospace') #axessubplot4.plot([0, 1, 2, 3, 4, 5], [2, 2, 2, 8, 8, 15], color='#CEEFBD', linewidth=2, linestyle='-', label='Succeeded tests') #axessubplot4.plot([1, 2, 3], [2, 4, 8], color='#FF3118', linewidth=2, linestyle='-', label='Failed tests') #axessubplot4.plot([4, 5], [8, 18], color='#FF3118', linewidth=2, linestyle='-', label='Failed tests') axessubplot4.fill_between([0, 1, 2, 3, 4, 5], [0, 0, 0, 0, 0, 0], [2, 2, 2, 8, 8, 15], color='#CEEFBD', linewidth=2, linestyle='-') axessubplot4.fill_between([1, 2, 3], [2, 2, 8], [2, 4, 8], color='#FF3118', linewidth=2, linestyle='-') axessubplot4.fill_between([4, 5], [8, 15], [8, 18], color='#FF3118', linewidth=2, linestyle='-') pylab.xticks([0, 1, 2, 3, 4, 5], ['14Jan2006', '15Jan2006', '16Jan2006', '17Jan2006', '18Jan2006', '19Jan2006']) silent_list8 = axessubplot4.get_xticklabels() pylab.setp(silent_list8, 'rotation', 90, fontsize=7) p = pylab.Rectangle((0, 0), 1, 1, fc=#FF3118) p2 = pylab.Rectangle((0, 0), 1, 1, fc=#CEEFBD) legend4 = axessubplot4.legend([ p, p2 ], ('Failed tests', 'Succeeded tests'), 'best', shadow=False) fancybboxpatch4 = legend4.get_frame() fancybboxpatch4.set_alpha(0.5) figure4.subplots_adjust(bottom=0.25) figure4.savefig('results.app1.version2.png', dpi=100) -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Legend placement on graphs with fill_between
On Thu, Feb 11, 2010 at 9:43 AM, Geoff Bache geoff.ba...@jeppesen.com wrote: Hi all, I'm trying to generate graphs from my test results, with regions coloured with succeeded and failing tests. It nearly works, but I have the following problem. I am providing the data with fill_between, which returns PolyCollection objects which cannot be provided to a legend. So I use the proxy artist trick, as described here http://matplotlib.sourceforge.net/users/legend_guide.html#plotting-guide-legend What about creating a proxy artist which is a simple polygon that has the same outline as your fill_between polygon? In [539]: t = np.arange(0, 1, 0.05) In [540]: y = np.sin(2*np.pi*t) In [541]: verts = zip(t, y) In [542]: proxy = mpatches.Polygon(verts, facecolor='yellow') The only reason fill_between uses a PolyCollection is to support the where keyword argument for non-contiguous fill regions, which you do not appear to be using. Thus you could simply create the polygon yourself with a little calculation (see mlab.poly_between for a helper function) and then just add that patch to the axes rather than using fill_between:: t = np.arange(0, 1, 0.05) ymin = np.sin(2*np.pi*t)-5 ymax = np.sin(2*np.pi*t)+5 xs, ys = mlab.poly_between(t, ymin, ymax) verts = zip(xs, ys) poly = mpatches.Polygon (verts, facecolor='red', label='my poly') ax = subplot(111) ax.add_patch(poly) ax.legend(loc='best') ax.axis([0, 1, -6, 6]) plt.draw() -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
Definitely tkinter. I'll look at the link. Interestingly though, and I think I mentioned this. There is another plot that's been working fine. I seldom use it, but when I have, it seems to work. The developer stated this in a msg this morning. Either way should work. Double clicking the py file is probably more convenient, but you can more easily see error messages if you open it with IDLE On 2/11/2010 7:38 AM, John Hunter wrote: On Thu, Feb 11, 2010 at 9:18 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Yes, certainly,as you explained a few days ago, the present use is incompatible with idle usage. Further, you mentioned the need for ipython and the "backend" to make it work (in IDLE?). The way we are using problem seems a bit ambiguous, so let me tell what I want the application to do. From the screenshots, this appears to be a tk app that is being run from idle. If you are trying to integrate pyplot with this, it is a mode of usage that is *explicitly not supported*. Rather, you should embed matplotlib in the app following the embedding_in_tk*.py examples at http://matplotlib.sourceforge.net/examples/user_interfaces/index.html JDH -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib axis define
Pierre You right look on excel grahic, I found a logarithmic scale option marked my bad. really thanks see ya 2010/2/11 Samuel Teixeira Santos arcano...@gmail.com hi again accuatly, I want redefine my axis points ( it's seems call 'ticks' on pyplot, I want redefine his range ) to be the same as my excel graphic. I did it's not a logaritmic because to calc thats 'y' points I use another formula... and on Excel it's X Y Scatter Graphic type... I'm trying now change th xticks and yticks... thanks :D 2010/2/11 Pierre de Buyl pdeb...@ulb.ac.be Here is what my code does. (attached file). But, There isn't a way to just setting the x,y values' axis easily? Do you mean the limits of the axes ? Add pp.axis([0.01,1,0,1]) before pp.show() Because isn't a logaritmic (I think)... the x-axis is logarithmic in model.jpg. And I would like to mantain the same axis coord as in model.jpg, if it's possible... thanks anyway! :D You're welcome. Pierre 2010/2/11 Pierre de Buyl pdeb...@ulb.ac.be Hello, It is not clear what exactly does not work in your file. I assumed it was the logarithmic scaling in x. Here is the code to produce that. A complete documentation is available on http:// matplotlib.sourceforge.net/ , you might be especially interested by the examples http://matplotlib.sf.net/examples/index.html and the gallery http://matplotlib.sourceforge.net/gallery.html that provide codes to perform a wide range of graphics. Pierre from decimal import Decimal from matplotlib import pyplot as pp x = ... y = ... pp.xscale('log') pp.plot(x,y) pp.xlabel('h') pp.ylabel('q') pp.show() Le 11 févr. 10 à 13:51, Samuel Teixeira Santos a écrit : Hi all I'm noob on matplotlib on python and I need to do excel graphic like (model.jpg) that I send attached. I send it too my test code for that My problem is to set the values on y and x axis how I do it? thanks in advancedtest.pymodel.jpg-- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris- dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
That link has no reference to tkinter. tk and tk2, plus a few others with tk in their names, but nothing else.A search in the box produced nothing. On 2/11/2010 8:36 AM, Wayne Watson wrote: Definitely tkinter. I'll look at the link. Interestingly though, and I think I mentioned this. There is another plot that's been working fine. I seldom use it, but when I have, it seems to work. The developer stated this in a msg this morning. Either way should work. Double clicking the py file is probably more convenient, but you can more easily see error messages if you open it with IDLE On 2/11/2010 7:38 AM, John Hunter wrote: On Thu, Feb 11, 2010 at 9:18 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Yes, certainly,as you explained a few days ago, the present use is incompatible with idle usage. Further, you mentioned the need for ipython and the "backend" to make it work (in IDLE?). The way we are using problem seems a bit ambiguous, so let me tell what I want the application to do. From the screenshots, this appears to be a tk app that is being run from idle. If you are trying to integrate pyplot with this, it is a mode of usage that is *explicitly not supported*. Rather, you should embed matplotlib in the app following the embedding_in_tk*.py examples at http://matplotlib.sourceforge.net/examples/user_interfaces/index.html JDH -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
On Thu, Feb 11, 2010 at 10:42 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: That link has no reference to tkinter. tk and tk2, plus a few others with tk in their names, but nothing else.A search in the box produced nothing. As I said in my last email, the embedding_in_tk* files are the ones you want. JDH -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How Does One Learn to Use MatPlotLib?
Thanks for the info. I'm semi-resistant to ipython. I tried if for a few hours, and it seemed a bit too much like linux. Years ago I used linux a lot, and enjoyed it. I'll consider it. Windows is the game now. Yes, actual use is good, but the needed imports seem a bit baffling. scipy, pylab, matplotlib, ...? What components do I only need for a particular use? The videos you mentioned could be helpful. I do not belong to any group, and my small town is a long way from any educational resources.What I learn is from a few books, FAQs, and recently the MPL Guide. Within a 50 mile radius, I know exactly one other person who knows Python. He's a very bright high school student. On 2/9/2010 10:33 PM, Gökhan Sever wrote: On Tue, Feb 9, 2010 at 8:15 PM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Subject is the question. As I see it, it's useful to know MatLab. A simple query with matplotlib tutorial shows a number of hits. The first, reference to v0.99.a documentation barely qualifies. Examples galore and a pretty minimal introduction. In the first 10 or so hits ther's a blog and mention of a video. The blog may appeal to some, but it seems unelementary. The video basically asks to sign in. Who knows where that goes? I've seen a few videos for MPL, but they all look tied into $$. I've made some reasonable progress on MPL, but am still far short of being confident of using it. Too much try this and see. I know of exactly one book on MPL ( for scientists. sounds interesting). It was published recently by a foreign author. It is not yet widely distributed. Your turn. Comments? -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users For me best way to learn is to use it actually :) Especially on homework and projects. Mailing lists are also very helpful as you are already doing. Try with ipython --pylab option. Also check SciPy09 (http://conference.scipy.org/SciPy2009/) videos. There are one introductory and advanced tutorials that you can see online (without registering) or downloading to your computer. -- Gökhan -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ways of updating legends
You're already using ax.legend, what kind of OO way do you want? Instead of calling plt.legend, you may do ax.legend([s],[str(i)]) Or, if you know what you're doing, you can do leg = ax.legend([s],[''], loc=0) and in the for loop, leg.texts[0].set_text(str(i)) Regards, -JJ On Thu, Feb 11, 2010 at 5:56 AM, Jorge Scandaliaris jorgesmbox...@yahoo.es wrote: Hi, I am re-using a scatter plot in the same figure for interactively displaying results without ending up with 30 windows open. The legend is relevant, and so it must be also updated. So far the only way I found was to use the set_label() method and then using plt.legend(). Is this the only way to get a legend updated from a label? I am curious, since generally there is the pyplot way and a more OO way of achieving things, but I could't find it this time. The snippet below shows what I am using right now: import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt data = np.random.randn(3,10) fig = plt.figure() ax = fig.add_subplot(111) s, = ax.plot([]) ax.axis([0,10,-1,1]) ax.legend([s],[''], loc=0) for i in range(data.shape[0]): s.set_data([np.arange(data.shape[1]),data[i]]) s.set_label(str(i)) plt.legend() plt.draw() plt.ginput(timeout=0) -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] mplot3d: large numbers scatter plot
Hi, I was hoping to use mplot3d to visually examine the density of points in a 3D plot. However, the number of points i am displaying is of the order 10,000-100,000. I use scatter or scatter3D to plot x,y,z for the points. The pan and zoom functions become unworkable. Does anyone have any bright ideas as to how i could get round this problem? In 2D, i would use histogram2D and either contour or pcolor to show densities. Could something similar be done in 3D too? Thanks, Jon. -- View this message in context: http://old.nabble.com/mplot3d%3A-large-numbers-scatter-plot-tp27551324p27551324.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] bar plot in log scale
I figured now that this was the bottom zero, hence I used other value instead. But here we are - there is a conceptual problem with stacked bar plots in the log scale - the stacked areas lose their proportions and are no longer illustrative. On 11 Feb 2010, at 17:06, phob...@geosyntec.com phob...@geosyntec.com wrote: -Original Message- From: Tomasz Koziara [mailto:t.kozi...@civil.gla.ac.uk] Hi I am having a trouble with making a bar plot with log scale enabled. When setting simply log=True in the bar () command, all bars have junk values of kind 1E-100. When using semilogy () on the other hand, not all stacked bar elements get drawn, plus what is being drawn starts in the air above the zero level (attached two eps files). I must be doing the wrong thing, I suppose. Are you specifying the bottom keyword argument? -paul h -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] x,y ticklabel too close
Hello list, For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap http://yfrog.com/5zimageykp for now I'm padding spaces to fix the plot, like this: newtick = [-10 , -5, 0 , 5 , 10 ] pos =[-10, -5, 0, 5, 10] yticks(pos, newtick) However I was wondering if there is any automatic way to avoid or fix this overlap. Thanks, Filipe -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Legend placement on graphs with fill_between
Or, you may fool the algorithm to find the best location by adding invisible lines. For example, axessubplot4.set_autoscale_on(False) l1, = axessubplot4.plot([4, 5], [8, 18]) l1.set_visible(False) axessubplot4.set_autoscale_on(True) Regards, -JJ On Thu, Feb 11, 2010 at 10:58 AM, John Hunter jdh2...@gmail.com wrote: On Thu, Feb 11, 2010 at 9:43 AM, Geoff Bache geoff.ba...@jeppesen.com wrote: Hi all, I'm trying to generate graphs from my test results, with regions coloured with succeeded and failing tests. It nearly works, but I have the following problem. I am providing the data with fill_between, which returns PolyCollection objects which cannot be provided to a legend. So I use the proxy artist trick, as described here http://matplotlib.sourceforge.net/users/legend_guide.html#plotting-guide-legend What about creating a proxy artist which is a simple polygon that has the same outline as your fill_between polygon? In [539]: t = np.arange(0, 1, 0.05) In [540]: y = np.sin(2*np.pi*t) In [541]: verts = zip(t, y) In [542]: proxy = mpatches.Polygon(verts, facecolor='yellow') The only reason fill_between uses a PolyCollection is to support the where keyword argument for non-contiguous fill regions, which you do not appear to be using. Thus you could simply create the polygon yourself with a little calculation (see mlab.poly_between for a helper function) and then just add that patch to the axes rather than using fill_between:: t = np.arange(0, 1, 0.05) ymin = np.sin(2*np.pi*t)-5 ymax = np.sin(2*np.pi*t)+5 xs, ys = mlab.poly_between(t, ymin, ymax) verts = zip(xs, ys) poly = mpatches.Polygon (verts, facecolor='red', label='my poly') ax = subplot(111) ax.add_patch(poly) ax.legend(loc='best') ax.axis([0, 1, -6, 6]) plt.draw() -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
Thanks. Got detoured by not supported. I think I'll be printing our your messages in the future. I just went back to one just now, and had forgotten about your mentio of pyLab, model. On 2/11/2010 7:38 AM, John Hunter wrote: On Thu, Feb 11, 2010 at 9:18 AM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Yes, certainly,as you explained a few days ago, the present use is incompatible with idle usage. Further, you mentioned the need for ipython and the backend to make it work (in IDLE?). The way we are using problem seems a bit ambiguous, so let me tell what I want the application to do. From the screenshots, this appears to be a tk app that is being run from idle. If you are trying to integrate pyplot with this, it is a mode of usage that is *explicitly not supported*. Rather, you should embed matplotlib in the app following the embedding_in_tk*.py examples at http://matplotlib.sourceforge.net/examples/user_interfaces/index.html JDH -- Crime is way down. War is declining. And that's far from the good news. -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
On 2/11/2010 11:36 AM, Wayne Watson wrote: you can more easily see error messages if you open it with IDLE Why? Just call it from the command line of a console window that you will leave open. (Or write the error to file.) Alan Isaac -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] A Menagerie of Imports
For newbies to MPL, needed imports seem a bit baffling. scipy, pylab, matplotlib, ...? What libs or lib components do I only need for a particular use? Suppose I want to produce a scatter, contour, or 3d plot. What do I need minimally or more widely? I'm assuming that I don't want to use import matplotlib a lot, but something selectively like from matplotlib.image import AxesImage, or from matplotlib.plot import figure, show. What did I miss in my Python upbringing? -- Crime is way down. War is declining. And that's far from the good news. -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
On 2/11/2010 11:42 AM, Wayne Watson wrote: That link has no reference to tkinter http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html Read down a half dozen lines or so. Alan Isaac -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] A Menagerie of Imports
Hi, For newbies to MPL, needed imports seem a bit baffling. scipy, pylab, matplotlib, ...? What libs or lib components do I only need for a particular use? Suppose I want to produce a scatter, contour, or 3d Like you said: Depends on the particular use. How to give a universal answer? Matplotlib does very much for you, but you still need to use your head a little bit. Nobody forces you to from pylab import * if a from pylab import linspace was enough. So take a look at you code, that should be enough. If you are still not satisfied maybe you try to search for python unused imports, maybe you find a profiler or something like that that helps you. In addition, reading the documentation text to the functions (with ?func or help func in ipython) helps to find out where the modules come from if you did excessive importing jobs before. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] A Menagerie of Imports
On 2/11/2010 1:24 PM, Wayne Watson wrote: Suppose I want to produce a scatter, contour, or 3d plot. What do I need minimally or more widely? If you just want to work on these in isolation, you just need import matplotlib.pyplot as plt Nothing more. You can now use e.g. plt.plot whenever you want. http://matplotlib.sourceforge.net/users/pyplot_tutorial.html But if you want to embed Matplotlib in a GUI (for example, to make a Tkinter application), you will have to learn some additional details. GUI is best learned by modifying examples, and Matplotlib provides *many* examples. Here are a few extra hints: http://econpy.googlecode.com/svn/trunk/software4econ.xhtml#mpl_hints Alan Isaac -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Finding the Supposed MPL show() bug.
Wayne Watson wrote: The developer stated this in a msg this morning. Either way should work. Double clicking the py file is probably more convenient, but you can more easily see error messages if you open it with IDLE option 3: Start it up in a command window (DOS box on Windows), and then you won't have the mainloop interaction issues, and you'll see the output. open a dos box, cd to the directory where your script is, and type: python name_of_script. If it can't find python, then you need to tell it where to look by adding it to your PATH or typing the whole thing: C:\Python25\bin\python.exe or something like that (not on Windows at the moment) Note that this is not an MPL issue it is an IDLE (and many other IDEs) issue -- any Python IDE that runs your code in the same process as the IDE itself is going to have these issues. IPython has gone to great pains to make interactive use with GUI programs work -- I don't any other tool that has. Wayne Watson wrote: That link has no reference to tkinter. tk and tk2, plus a few others with tk in their names, but nothing else.A search in the box produced nothing. tkinter is the python binding to the Tk GUI toolkit -- so tkiniter and tk mean about the same thing when talking about Python. Wayne Watson wrote: Thanks for the info. I'm semi-resistant to ipython. I tried if for a few hours, and it seemed a bit too much like linux. ipython is an interactive command line interface to Python -- it is much nicer than the raw interpreter, but it is what it is, and it is very good at it. It can be very helpful to experiment with stuff in an interactive environment, but once you go beyond tiny stuff, you need to write a program. To do that you need an editor, and a wya to run and debug it. An IDE integrates these functions, and there are many of them. Personally, I use an editor to edit the code, the commend line (or IPython) to run the code, and do most of my debugging with print statements. I suggest you take a bit of a break from the problem at hand, and go through a couple intro tutoroal sit python, write a couple small programs (tkinter-based, if that's what you're going to need), and get a handle on how to do it. lot, and enjoyed it. I'll consider it. Windows is the game now. frankly, not all that different from a programming in Python point of view. Yes, actual use is good, but the needed imports seem a bit baffling. scipy, pylab, matplotlib, ...? What components do I only need for a particular use? you need what you need -- you need numpy for amost eveything you'll ever do if you work with numbers. You need matplotlib if you need to plot, you need scipy if you need any of the more complicated numerical routines it provides. pyplot dumps a bunch of these into the same namespace, which is nice for interactive use, but Id stay away from it for writing programs. Wayne Watson wrote: I'm assuming that I don't want to use import matplotlib a lot, but something selectively like from matplotlib.image import AxesImage, or from matplotlib.plot import figure, show. What did I miss in my Python upbringing? It's really a matter of taste. YOu either do: import matplotlib fig = matplotlib.figure or from matplotlib import figure fig = figure. You'll need a lot of things in matplotlib if you're doing much of anything, and namespaces are one honking great idea, so I do: import matplotlib as mpl fig = mpl.figure() etc.. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] pyplot.yticks ignoring font if labels are supplied, any ideas?
import matplotlib.pyplot as pyplot fprop=matplotlib.font_manager.FontProperties(size='xx-small') pyplot.yticks((70,80,90,100),('70%','80%','90%','100%'), color=#8c949d,horizontalalignment='right',fontproperties=fprop ) This will cause all the kwargs to be ignored, so the color, alignment and fonts are all at their default values. pyplot.yticks((70,80,90,100),color=#8c949d,horizontalalignment='right',fontproperties=fprop ) this on, on the other hand, works fine. This is showing that when you provide labels for the ticks (second arg to yticks), the kwargs are ignored. Does anyone have any idea why this is the case? -- View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27553479.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pyplot.yticks ignoring font if labels are supplied, any ideas? SOLVED
ristretto wrote: import matplotlib.pyplot as pyplot fprop=matplotlib.font_manager.FontProperties(size='xx-small') pyplot.yticks((70,80,90,100),('70%','80%','90%','100%'), color=#8c949d,horizontalalignment='right',fontproperties=fprop ) This will cause all the kwargs to be ignored, so the color, alignment and fonts are all at their default values. pyplot.yticks((70,80,90,100),color=#8c949d,horizontalalignment='right',fontproperties=fprop ) this on, on the other hand, works fine. This is showing that when you provide labels for the ticks (second arg to yticks), the kwargs are ignored. Does anyone have any idea why this is the case? I'm not sure I'll ever really understand Matplotlib. Why I had to do this, I don't really know. It's hard to spec out projects when you think that setting the font on some text should take no time at all, but it takes hours due to stupid complexities. Rant over, here's what I did pyplot.yticks((70,80,90,100), color=#8c949d,horizontalalignment='right',fontproperties=fprop2 ) ax.set_yticklabels(('70%','80%','90%','100%'),color=#8c949d,horizontalalignment='right') The first line doesn't specify the labels, this works in that it puts 70 80 90 100 as labels, but with correct color and font. The second line sets the label text, but not the font or color. This seems to work. -- View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27554596.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Ways of updating legends
El 11/02/10 18:28, Jae-Joon Lee escribió: You're already using ax.legend, what kind of OO way do you want? Instead of calling plt.legend, you may do ax.legend([s],[str(i)]) Thanks Jae-Joon. You're right. I tried this before, but I must have done something wrong then, because when I tried the result were new legends stacked upon the old ones, which didn't look nice when the new legend was shorter than previous ones. Or, if you know what you're doing, you can do leg = ax.legend([s],[''], loc=0) and in the for loop, leg.texts[0].set_text(str(i)) This is even nicer. I tried something similar but somehow overlooked the texts[0] part, so it didn't work. I'll have to go back to the docs... Regards, Jorge -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Selectable contour(f) divisions
In using the contour as in: contour(X,Y,Z,N) N is a number of automatically chosen levels. I would like to contour based on data divisions. For instance, perhaps I'd like to use a contour or color-fill (contourf) every 2 units. I'm not seeing how to accomplish this. Any points in the right direction would be appreciated. Thanks! Bruce --- Bruce W. Ford Clear Science, Inc. br...@clearscienceinc.com http://www.ClearScienceInc.com 8241 Parkridge Circle N. Jacksonville, FL 32211 Skype: bruce.w.ford Google Talk: for...@gmail.com -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] x,y ticklabel too close
Hi, 11/02/10 @ 12:40 (-0500), thus spake Filipe Pires Alvarenga Fernandes: Hello list, For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap http://yfrog.com/5zimageykp for now I'm padding spaces to fix the plot, like this: newtick = [-10 , -5, 0 , 5 , 10 ] pos =[-10, -5, 0, 5, 10] yticks(pos, newtick) However I was wondering if there is any automatic way to avoid or fix this overlap. Not that I'm aware of, other than changing the font size, or the axis limits. Thanks, Filipe -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pyplot.yticks ignoring font if labels are supplied, any ideas? SOLVED
On Thu, Feb 11, 2010 at 3:55 PM, ristretto ristretto...@gmail.com wrote: I'm not sure I'll ever really understand Matplotlib. Why I had to do this, I don't really know. It's hard to spec out projects when you think that setting the font on some text should take no time at all, but it takes hours due to stupid complexities. While developers are working hard to fix any bugs, Matplolib is not a perfect, bug-free library. And I doubt if it ever will be (to clarify, I'm one of the developers). And with the 0.99 maintenance branch and the current svn, I cannot reproduce your problem, so I guess this is a known bug that has been fixed already. -JJ -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] x,y ticklabel too close
The current matplotlib does not have any automatic way as far as I know (any contribution will be appreciated). On the other hand, instead of explicitly specifying the ticks and ticklabels, you may try to reduce the number of ticks. gca().xaxis.get_major_locator()._nbins=4 Regards, -JJ On Thu, Feb 11, 2010 at 12:40 PM, Filipe Pires Alvarenga Fernandes ocef...@gmail.com wrote: Hello list, For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap http://yfrog.com/5zimageykp for now I'm padding spaces to fix the plot, like this: newtick = [-10 , -5 , 0 , 5 , 10 ] pos =[-10, -5, 0, 5, 10] yticks(pos, newtick) However I was wondering if there is any automatic way to avoid or fix this overlap. Thanks, Filipe -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pyplot.yticks ignoring font if labels are supplied, any ideas? SOLVED
While developers are working hard to fix any bugs, Matplolib is not a perfect, bug-free library. And I doubt if it ever will be (to clarify, I'm one of the developers). And with the 0.99 maintenance branch and the current svn, I cannot reproduce your problem, so I guess this is a known bug that has been fixed already. -JJ Hi, I hear you. I'm a developer too (not on matplotlib.) It's hard to keep it all together all the time, and keep everyone happy. I wish you the best. I'm using python-matplotlib 0.99.0-1ubuntu1 on Ubuntu 9.10 -- View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27555804.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] x,y ticklabel too close
On Thu, Feb 11, 2010 at 12:40 PM, Filipe Pires Alvarenga Fernandes ocef...@gmail.com wrote: Hello list, For the following plotI using a large font for the tick-label that causes the first x,y tick-labels to overlap http://yfrog.com/5zimageykp for now I'm padding spaces to fix the plot, like this: newtick = [-10 , -5 , 0 , 5 , 10 ] pos =[-10, -5, 0, 5, 10] yticks(pos, newtick) However I was wondering if there is any automatic way to avoid or fix this overlap. Thanks, Filipe This is also not automatic, and maybe more work than it's worth, but could it be helpful to use spines, as shown in the example down the page a bit here: http://matplotlib.sourceforge.net/users/whats_new.html It seems there would be no way for the numbers to overlap if spines were used this way. Che -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How Does One Learn to Use MatPlotLib? (PUG)
Well, here's an interesting twist on help, PUG, Python Users Groups. A world wide list is at http://wiki.python.org/moin/LocalUserGroups., The nearest one to me is near San Jose, CA about 180 miles from here, and meets the fourth Thursday of the month. Fortunately, I travel down there fairly often to visit friends and family. I think I'll mark my calendar. -- Crime is way down. War is declining. And that's far from the good news. -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Maximize plotwindow hot to plot figure by figure?
2 Problems: 1. How is it possible to maximize the window of the plot? 2. First I want to plot only figure 0, after 5 seconds figure 0 has to be closed and figure 1 to be shown. Any suggestions? from pylab import * import time ion() figure(0) plot([1,2,3]) figure(1) plot([10, 20, 30]) figure(0) plot([4, 5, 6]) figure(1) plot([40, 50, 60]) draw(0) time.sleep(5) close() draw(1) show() -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users