using PyPlot
using Dates
# Create Data
dt = Millisecond(200)
time = [DateTime(2014,11,20):dt:DateTime(2014,11,24)]
y = fill!(Array(Float64,length(time)),42)
#y = floor(100*rand(length(time))) # Causes error: "OverflowError:
Allocated too many blocks"
font1 = ["fontname"=>"Sans","style"=>"normal"]
time = float64(time)/1000/60/60/24 # Convert time from milliseconds from
day 0 to days from day 0
# Plot
fig = figure("Test Plot",figsize=(16,10)) # Create a figure and save the
handle
ax1 = axes()
p1 = plot_date(time,y,linestyle="-",marker="None",label="test")
axis("tight")
title("Random Data Against Time\n" * timespan)
grid("on")
xlabel("Time")
ylabel("Stuff",fontdict=font1)
fig[:autofmt_xdate](bottom=0.2,rotation=30,ha="right")
fig[:canvas][:draw]() # Update the figure
PyPlot.tight_layout()
It would be much easier to have midnight be the date and every 4, 6, or 8
hours be time of day. I would be happy with just the dates part though.