subplot(2, 1, 1) conflicts with subplot(2, 1, 2)

11 views
Skip to first unread message

Sandy

unread,
May 27, 2010, 12:44:32 PM5/27/10
to scitools

pls help to draw 2 and more subplots the problem is that when second
subplot is created the first subplot disappears


from numpy import *
from scitools.easyviz import *
from scitools.easyviz.gnuplot_ import * # work with Gnuplot

t = linspace(0, 3, 51) # 51 points between 0 and 3
y1 = t**2*exp(-t**2)

y2 = t**4*exp(-t**2)


#figure() # new, third figure
# plot y1 and y2 as two axis in the same figure:
subplot(2, 1, 1)
plot(t, y1, xlabel='t', ylabel='y')
#show()
subplot(2, 1, 2)
plot(t, y2, xlabel='t', ylabel='y')
title('A figure with two plots')
show()
hardcopy('tmp2_3.png')

print(33333)

Johannes Ring

unread,
May 28, 2010, 3:08:55 AM5/28/10
to scit...@googlegroups.com
Hi Sandy,

Your script below works fine for me. On what platform are you running
into this problem?

Johannes

> --
> You received this message because you are subscribed to the Google Groups "scitools" group.
> To post to this group, send email to scit...@googlegroups.com.
> To unsubscribe from this group, send email to scitools+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scitools?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages