File: plot_ascii.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 (27 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (2)
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
"""Make plot of a curve in pure text format (ASCII)."""
# this is the same example as in the scitools.aplotter doc string

from scitools.aplotter import plot
from numpy import linspace, exp, cos, pi
x = linspace(-2, 2, 81)
y = exp(-0.5*x**2)*cos(pi*x)
plot(x, y)

plot(x, y, draw_axes=False)

# plot symbols (the dot argument) at data points:
plot(x, y, plot_slope=False)
 
# drop axis labels:
plot(x, y, plot_labels=False)

plot(x, y, dot='o', plot_slope=False)

# store plot in a string:
p = plot(x, y, output=str)
print p