From: Emmanuel Favre-N. <man...@gm...> - 2007-06-27 12:36:35
|
Hi, I didn't find any tip for preparation of simple black and white 2D plot, especially for nice output in eps for publication. Any suggestions are welcome. |
From: <par...@fr...> - 2008-11-06 15:35:54
|
Hi everybody, I have a problem with my application using Tkinter. To simplify, here follows a small program showing the encountered problem: ################ from pylab import * a = arange( 10 ) plot( 0.5*a, cos(a) ) gca().set_autoscale_on(False) plot( a, cos(a), 'r' ) gca().set_autoscale_on(True) show() ################ At this time, the problem is that by clicking on the "house" (first button in the pylab toolbar), it is impossible to get the two curves completely, whereas the "pan/zoom mode" (the cross button) shows that the red curve has been drawn completely. Is there a function to obtain a "true" autoscale, i.e. that looks at all data on the plot, and computes the best view? Thanks a lot Julien |
From: Michael D. <md...@st...> - 2008-11-06 15:45:16
|
Why are you turning autoscaling off and on? When you turn it off, the autoscale mechanism effectively "ignores" any plots until you turn it back on. If you remove gca().set_autoscale_on(False) all seems to work fine. Is your question that you want to autoscale to a plot after creating it? Mike par...@fr... wrote: > Hi everybody, > > I have a problem with my application using Tkinter. > > To simplify, here follows a small program showing the encountered problem: > > ################ > from pylab import * > > a = arange( 10 ) > > plot( 0.5*a, cos(a) ) > > gca().set_autoscale_on(False) > > plot( a, cos(a), 'r' ) > gca().set_autoscale_on(True) > show() > ################ > > At this time, the problem is that by clicking on the "house" (first button in > the pylab toolbar), it is impossible to get the two curves completely, > whereas the "pan/zoom mode" (the cross button) shows that the red curve has > been drawn completely. > > Is there a function to obtain a "true" autoscale, i.e. that looks at all data > on the plot, and computes the best view? > > Thanks a lot > > Julien > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
From: TP <par...@fr...> - 2008-11-07 09:40:10
|
Michael Droettboom wrote: > Why are you turning autoscaling off and on? When you turn it off, the > autoscale mechanism effectively "ignores" any plots until you turn it > back on. If you remove > > gca().set_autoscale_on(False) > > all seems to work fine. > > Is your question that you want to autoscale to a plot after creating it? I want to be able to "freeze" the plot when adding another curve (because I want to compare the added curve and a previous one in a small portion of the X/Y plane, this portion may have been chosen by a zoom of the user before adding the curve). Once this comparison has been performed, the user may want to autoscale the complete plot. If the added curve is larger than the previous one, the autoscale should take into account the larger curve. Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z (55l4('])" "When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong." (first law of AC Clarke) |
From: massimo s. <mas...@un...> - 2007-06-27 12:50:01
Attachments:
massimo.sandal.vcf
|
Emmanuel Favre-Nicolin ha scritto: > Hi, > > I didn't find any tip for preparation of simple black and white 2D plot, > especially for nice output in eps for publication. > > Any suggestions are welcome. I don't get it. What kind of tips do you need? How to change the plot colour? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: mas...@un... tel: +39-051-2094388 fax: +39-051-2094387 |
From: Ryan K. <rya...@gm...> - 2007-06-27 16:03:40
|
Sorry, forgot to copy the list. On 6/27/07, Ryan Krauss <rya...@gm...> wrote: > I think what you are asking is how to make mpl plot different line > types in colors and styles that are easily distinguishable when > plotted in grayscale. I had tinkered with this a bit in the past and > the final suggestion was to write some helper functions so that I > could do the following: > > from mycyclers import colorcycler, linecycler > > for data in mydata: > ax.plot(data, linestyle=linecycler(), color=colorcycler()) > > so that by writing a linecycler function I could control the line > types plotted each time and the same with the color. Color would be > specified as a grayscale such as '#808080' for a medium gray or > '#000000' for black. > > I didn't actually do it this way or I would post the code (I was in a > hurry and did something hackish). I think that linecycler and > colorcycler would be helper classes thta increment there own internal > count when called and return a linestyle or color. > > I think what you want in the end is a simple way to do this: > > t=arange(0,1,0.01) > y=sin(2*pi*t) > x=cos(2*pi*t) > plot(t,x,color='#000000',linestyle='-') > plot(t,y,color='#808080',linestyle=':') > > where color and line style would increment pseudo-automatically > through lists you have defined and that you like. > > A slightly better approach might be: > t=arange(0,1,0.01) > y=sin(2*pi*t) > x=cos(2*pi*t) > data=[x,y] > mycolors=['#000000','#808080'] > mytypes=['-',':'] > > def grayscaleplot(data,t): > for n,item in enumerate(data): > plot(t,item, color=mycolors[n], linestyle=mytypes[n]) > > FWIW, > > Ryan > > > On 6/27/07, Emmanuel Favre-Nicolin <man...@gm...> wrote: > > Hi, > > > > I didn't find any tip for preparation of simple black and white 2D plot, > > especially for nice output in eps for publication. > > > > Any suggestions are welcome. > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > |