Hi there,
I have a list with some tuples like [(datetime.date, int), (datetime.date, int),].
I can already plot one date per tick, but I want to have the correct distance between two different dates.
def __init__(self, dates):
self.dates = dates
self.setLabelAlignment(Qt.AlignLeft | Qt.AlignBottom)
self.setLabelRotation(270)
def label(self, value):
if value % 1 == 0 and int(value) < len(self.dates):
return QwtText(str
(self.
dates[int(value
)])) else:
class TimeScaleDraw(QwtScaleDraw):
def __init__(self, dates):
QwtScaleDraw.__init__(self)
self.dates = dates
self.setLabelAlignment(Qt.AlignLeft | Qt.AlignBottom)
self.setLabelRotation(270)
def label(self, value):
if value % 1 == 0 and int(value) < len(self.dates):
return QwtText(str(self.dates[int(value)]))
else:
return QwtText('')
To copy to clipboard, switch view to plain text mode
I have no idea how I can create a 'time true' axis.
The dates for example are 2010-02-01, 2010-10-14, 2010-11-11, 2011-03-28.
I am using PyQt4.Qwt5.
Bookmarks