~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to examples/demo/shell/semilog.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""This example shows how to create a semi-log plot using the `shell` package.
2
 
"""
3
 
 
4
 
# Major library imports
5
 
from numpy import linspace, exp
6
 
 
7
 
# Enthought library imports
8
 
from chaco.shell import semilogy, hold, title, show
9
 
 
10
 
 
11
 
# Create some data
12
 
x = linspace(1, 10, 200)
13
 
 
14
 
# Create some line plots
15
 
semilogy(x, exp(x), "b-", name="y=exp(x)", bgcolor="white")
16
 
hold(True)
17
 
semilogy(x, x**x, "r--", name="y=x**x")
18
 
semilogy(x, x, "g-", name="y=x")
19
 
 
20
 
# Add some titles
21
 
title("simple semilog plots")
22
 
 
23
 
#This command is only necessary if running from command line
24
 
show()
25