|
From: Pierre GM <pgm...@gm...> - 2006-12-11 03:03:29
|
On Sunday 10 December 2006 21:14, Chuang wrote:
> Hi there,
>
> I wanna plot two curves, and save to 2 different files. However, when I
> used the following code, the 2nd file contains both the 2 curves.
>
> plot(X1,Y1)
> savefig('file1.png')
> plot(X2,Y2)
> savefig('file2.png')
>
> It seems like the program memorize both of the two curves and save to
> the 2nd file. How can I save only the 2nd curve in the 2nd file?
Possibility #1: Create a new figure before the second plot
>>>plot(x1,y1)
>>>figure()
>>>plot(x2,y2)
Possibility #2: Clear the figure before the second plot
>>>plot(x1,y1)
>>>clf()
>>>plot(x2,y2)
Possibility #3: Force the current axes to refresh, by setting its "hold"
property to "False"
>>>plot(x1,y1)
>>>gca().hold(False)
>>>plot(x2,y2)
Possibiltiy #4: Get familiar with the more pythonesque functions.
|