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

« back to all changes in this revision

Viewing changes to examples/demo/shell/loglog.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 createa log-log plot using the chaco
2
 
`shell` subpackage."""
3
 
 
4
 
# Major library imports
5
 
from numpy import linspace, exp
6
 
 
7
 
# Enthought library imports
8
 
from chaco.shell import show, title, loglog, hold
9
 
 
10
 
 
11
 
# Create some data
12
 
x = linspace(1, 15, 200)
13
 
 
14
 
# Create some line plots
15
 
loglog(x, x**2, "b-.", name="y=x**2", bgcolor="white")
16
 
hold(True)
17
 
loglog(x, x**4+3*x+2, "r-", name="y=x**4+3x+2", bgcolor="white")
18
 
loglog(x, exp(x), "g-", name="y=exp(x)", bgcolor="white")
19
 
loglog(x, x, "m--", name="y=x", bgcolor="white")
20
 
 
21
 
# Add some titles
22
 
title("simple loglog plots")
23
 
 
24
 
#This command is only necessary if running from command line
25
 
show()