Hi lubos,

you can avoid (auto-)rescaling in matplotlib:
-------------------------------------------------------------------------------------------------------
import pylab
ax = pylab.subplot(111, autoscale_on=False)
# or for an already existing axes instance 'ax' : ax.set_autoscale_on(False)
--------------------------------------------------------------------------------------------------------

If you want to plot in background you have to skip interactive mode (up to my 
knowledge).  If you nevertheless would like to change the results you can use 
pylab.show() as last line in your script and change you data via 
event-control - something like:
--------------------------------------------------------------------------------------
def function(event):
       if event.key == "c":
             pylab.cla()
       elif event.key == "u":
             # update the data
             pass
pylab.connect("key_press_event", function)
pylab.show()
----------------------------------------------------------------------------------------

best regards 
Matthias

On Monday 07 July 2008 14:57:30 Lubos Vrbka wrote:
> hi guys,
>
> is it somehow possible to force matplotlib (pylab) not to rescale the
> axes while adding some data to an existing plot? currently i have to do
> in a cycle (simplified example):
> for (all data):
>          p_U_ij.append(pylab.plot(r, data)
>          pylab.xlim((0, 10))
>          pylab.ylim((-5,10))
>
> because after pylab.plot the plot axes are rescaled according to the
> data read in. i'd prefer setting it beforehand (with xlim, ylim) and
> then to do only pylab.plot in the cycle:
>
> pylab.xlim((0, 10))
> pylam.ylim((-5, 10))
> for (all data):
>          p_U_ij.append(pylab.plot(r, data)
>
> is it somehow possible? even better would be to do the plotting in the
> background (not showing the window until the plotting is completely
> finished) - but i wasn't succesful in doing that. i'm using interactive
> mode because after creation of all plots using the code above, i'm
> updating the graphics during the calculation...
>
> thanks for any hints!
>
> best,
> lubos



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to