1
"""This example demonstrates using dates as labels for the axis ticks using
2
the chaco shell subpackage.
4
Try zooming in and out using the mouse wheel and see the resolution of
5
the dates gradually changing from days to years.
8
# Major library imports
9
from numpy import linspace, pi, sin
11
# Enthought library imports
12
from chaco.shell import show, plot, title, curplot
13
from chaco.scales.api import CalendarScaleSystem
17
x = linspace(-2*pi, 2*pi, numpoints)
23
dt = 24 * 3600 # data points are spaced by 1 day
24
dates = linspace(now, now + numpoints*dt, numpoints)
26
# Create some line plots
27
plot(dates, y1, "b-", bgcolor="white")
30
title("Plotting Dates")
32
# Set the plot's horizontal axis to be a time scale
33
curplot().x_axis.tick_generator.scale = CalendarScaleSystem()
35
#This command is only necessary if running from command line