1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
from scitools.std import *
from time import sleep
x = seq(0, 15, 0.2)
y = sin(x)*x
v = sin(x)*sqrt(x)
w = sin(x)*x**0.33333333
plot(x, y, 'r-', x, v, 'b--', x, w, 'g--',
legend=('sin(x)*x', 'sin(x)*sqrt(x)', 'sin(x)*x**(1/3)'),
title='plot demo 5', xlabel='X', ylabel='Y')
sleep(3)
# get backend and fine-tune the plot:
g = get_backend()
print type(g), g # Gnuplot instance
g('set key left box')
g('set grid')
g('set xlabel "X" font "Helvetica,14"')
g('set ylabel ""')
g.replot()
g('set output "tmp.png"')
g('set term png small')
g.replot()
|