Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [pyplot] using f1=figure(1)

Reply
Thread Tools

[pyplot] using f1=figure(1)

 
 
Giacomo Boffi
Guest
Posts: n/a
 
      03-28-2011
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

<matplotlib.figure.Figure object at 0xb745668c>
>>> f2

<matplotlib.figure.Figure object at 0x8df834c>
>>> plot(sin(linspace(0,10)),figure=f1)

[<matplotlib.lines.Line2D object at 0x8df8fac>]
>>> plot(cos(linspace(0,10)),figure=f2)

[<matplotlib.lines.Line2D object at 0x8df8f0c>]
>>> show()
>>>


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

 
Reply With Quote
 
 
 
 
Blockheads Oi Oi
Guest
Posts: n/a
 
      03-28-2011
On 28/03/2011 17:04, Giacomo Boffi wrote:
> 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

> <matplotlib.figure.Figure object at 0xb745668c>
>>>> f2

> <matplotlib.figure.Figure object at 0x8df834c>
>>>> plot(sin(linspace(0,10)),figure=f1)

> [<matplotlib.lines.Line2D object at 0x8df8fac>]
>>>> plot(cos(linspace(0,10)),figure=f2)

> [<matplotlib.lines.Line2D object at 0x8df8f0c>]
>>>> show()
>>>>

>
> 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/...tplotlib-users.

 
Reply With Quote
 
 
 
 
Giacomo Boffi
Guest
Posts: n/a
 
      03-28-2011
Blockheads Oi Oi <(E-Mail Removed)> writes:

> 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/...tplotlib-users.


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

--
Fan culo a quelli che quando si svegliano la mattina, non importa se
sono leoni o gazzelle, sono comunque delle bestie. -- Zonker, in IHC
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Link Button to redirect to another page by using data from =?Utf-8?B?R1REcml2ZXI=?= ASP .Net 1 02-16-2005 07:04 PM
Error page using the Application_Error void dosnt work when using DIV for a please wait message s_erez@hotmail.com ASP .Net 2 12-24-2004 12:11 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Using GetOleDbSchemaTable to get SQL Server Field Description - using pete ASP .Net 1 08-29-2003 10:50 AM
Re: MVP? Index error on nested element using System.xml but NOT using msxml??? William F. Robertson, Jr. ASP .Net 1 06-25-2003 08:08 PM



Advertisments