2009/5/22 Alexander Brankov <[email protected]>:
> I converted the data to Unix timestamp, but than I cannot tell which
> data comes from which day.
>
> My question is there a way to draw the time data on the X axis and to
> keep the time ratio?
I am very interested in a solution for this, too. My approach has been
very innocent: create some manualticks and put them in a custom axis.
import time
from pyx import *
format="%d %b %Y"
(...)
time2006=time.mktime(time.strptime("01 Jan 2006", format))
time2007=time.mktime(time.strptime("01 Jan 2007", format))
time2008=time.mktime(time.strptime("01 Jan 2008", format))
time2009=time.mktime(time.strptime("01 Jan 2009", format))
minRange=time2006
maxRange= (...)
(...)
myticksDate = [graph.axis.tick.tick(time2006, label="2006"),
graph.axis.tick.tick(time2007, label="2007"),
graph.axis.tick.tick(time2008, label="2008"),
graph.axis.tick.tick(time2009, label="2009"),
]
xaxis=graph.axis.linear(title=r"Date",min=minRange,max=maxRange,manualticks=myticksDate,density=1)
(...)
g = graph.graphxy(width=8,x=xaxis,x2=x2axis,y=yaxis)
g.plot(graph.data.file("data",x=1,y="B"), ...
--
Francisco Vila. Badajoz (Spain)
www.paconet.org
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user