[pyplot] using f1=figure(1)

G

Giacomo Boffi

i executed the following interactions and i remained disappointed

$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from pylab import *
f1=figure(1)
f2=figure(2)
f1
plot(sin(linspace(0,10)),figure=f1)
[ said:
plot(cos(linspace(0,10)),figure=f2)
[ said:

i'm surely off by one in my understanding of the plot command, as i
expected a sine in figure 1 and a cosine in 2, while what i got was a
blank figure 1 and both the sine and the cosine in figure 2

can anyone help me? tia
gb
 
B

Blockheads Oi Oi

i executed the following interactions and i remained disappointed

$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from pylab import *
f1=figure(1)
f2=figure(2)
f1
plot(sin(linspace(0,10)),figure=f1)
[ said:
plot(cos(linspace(0,10)),figure=f2)
[ said:

i'm surely off by one in my understanding of the plot command, as i
expected a sine in figure 1 and a cosine in 2, while what i got was a
blank figure 1 and both the sine and the cosine in figure 2

can anyone help me? tia
gb
I don't know why but this works fine.
f1=figure(1)
plot(sin(linspace(0,10)),figure=f1)
f2=figure(2)
plot(cos(linspace(0,10)),figure=f2)
show()

You're also likely to get more answers if you ask on the mailing list
here https://lists.sourceforge.net/lists/listinfo/matplotlib-users.
 
G

Giacomo Boffi

Blockheads Oi Oi said:
I don't know why but this works fine.
f1=figure(1)
plot(sin(linspace(0,10)),figure=f1)
f2=figure(2)
plot(cos(linspace(0,10)),figure=f2)
show()

it works as well (with a proper t...)

plot(sin(t);figure(2);plot(cos(t));show()

because that's the way it is advised to do

in help(plot) one can read that in the named arguments that are
accepted from plot, you can say also figure=figurehandle, but it is
evident that i misundertood the issue
You're also likely to get more answers if you ask on the mailing list
here https://lists.sourceforge.net/lists/listinfo/matplotlib-users.

another mailing list? really i have to? <smilies, lots of>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top