File: plotdemo0_matlab.py

package info (click to toggle)
scitools 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,252 kB
  • ctags: 2,871
  • sloc: python: 28,744; sh: 112; makefile: 15
file content (23 lines) | stat: -rw-r--r-- 447 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from scitools.std import *

# plot two curves in the same plot:
x = seq(0, 15, 0.2)   # 0, 0.2, 0.4, ...., 15
y1 = sin(x)*x
y2 = sin(x)*sqrt(x)

# use Matlab syntax:
plot(x, y1, 'b-')
hold('on')
plot(x, y2, 'ro')
legend('x*sin(x)', 'sqrt(x)*sin(x)')
title('Simple Plot Demo')
axis([0, 15, -25, 25])
xlabel('X')
ylabel('Y')
show()

hardcopy('tmp1.ps')  # this one can be included in latex
hardcopy('tmp1.png') # this one can be included in HTML