|
From: Nikolai H. <nik...@ma...> - 2006-03-07 10:59:12
|
Hi Mark, hi everyone
The code I posted was taken from one of my programs
and for the sake of simplicity I left a few parts out.
That may have made my intention a bit unclear.
I'm sorry for that.
Here are all the relevant parts:
def main():
if cts['show_qm']: qmx, qmy = read_qm()
if cts['show_cm']: cmx, cmy = read_cm()
figure(1)
ax = subplot(111)
axis((-0.25,2.0,0.0,1.3))
axis('scaled')
ax.set_autoscale_on(False)
for i in range(100):
if cts['show_qm']: plot((qmx[i],qmx[i]),(qmy[i],qmy[i]),'bo')
if cts['show_cm']: plot((cmx[i],cmx[i]),(cmy[i],cmy[i]),'go')
raw_input('Press <enter> to continue')
if __name__ == "__main__":
ion()
main()
show()
The program reads two lists of points and plots them one
by one so I can compare them, which is why I need axis('scaled'). The
autoscale property on the other hand is used that the plot commands in
the for loop don't thouch the axis. The program does exactly what I want
it to do and is fast enough despite my inefficient code since it only
has to plot 100 points.
But since there is only one axis in the figure I thought it would be a
good idea if I could disable autoscaling in the way the limits and the
'scaled' property were set.
The other point I wrote this was because I couldn't find any
documentation on the autoscale behaviour except for an old thread on
this list. If autoscale would be an option of the axis command it could
be found on:
http://matplotlib.sourceforge.net/pylab_commands.html
Best regards,
Nikolai
--
"1984" is not a howto!
|