"""This example demonstrates creating a filled contour plot using the chaco
shell subpackage.
"""

# Major library Imports
from numpy import linspace, meshgrid, tanh

# Enthought Library Imports
from chaco.shell import contourf, colormap, title, show
from chaco.default_colormaps import jet

# Crate some scalar data
xs = linspace(-10, 10, 200)
ys = linspace(-10, 10, 400)
x, y = meshgrid(xs, ys)
z = x * tanh(y)

# Create a filled contour plot
contourf(x, y, z)
colormap(jet)

# Add some titles
title("filled contour plot")

#This command is only necessary if running from command line
show()
Ejemplo n.º 2
0
# Mayor Library Imports
from numpy import linspace, meshgrid, tanh

# Enthought Library Imports
from chaco.shell import contourf, colormap, title, show
from chaco.default_colormaps import jet


# Crate some scalar data
xs = linspace(-10, 10, 200)
ys = linspace(-10, 10, 400)
x, y = meshgrid(xs, ys)
z = x * tanh(y)

# Create a filled contour plot
contourf(x, y, z)
colormap(jet)

# Add some titles
title("filled contour plot")

# This command is only necessary if running from command line
show()
Ejemplo n.º 3
0
with some basic interactivity without using the object-oriented core of Chaco.
"""

# Major library imports
from numpy import linspace, meshgrid, sin

# Enthought library imports
from chaco.shell import show, title, pcolor, colormap
from chaco.default_colormaps import viridis

# Crate some scalar data
xs = linspace(0, 10, 200)
ys = linspace(0, 20, 400)
x, y = meshgrid(xs, ys)
z = sin(x) * y

# Create a pseudo-color-map
pcolor(x, y, z)

#change the color mapping
colormap(viridis)

# Add some titles
title("pseudo colormap image plot")

# If running this from the command line and outside of a wxPython
# application or process, the show() command is necessary to keep
# the plot from disappearing instantly.  If a wxPython mainloop
# is already running, then this command is not necessary.
show()