I'd like to plot some financial data. Only the weekdays are relevant. I'm 
using the DateAxisItem for the x axis. Is it possible to completely omit 
the weekends and holidays somehow? These items should just be omitted.

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/7f910049-c2a1-4717-accb-ab0397cf077bn%40googlegroups.com.
import sys, os
import numpy as np
from pyqtgraph import DateAxisItem
import datetime
import time
import pyqtgraph as pg


def getData():
    today = datetime.date.today()
    dates = [today + datetime.timedelta(days=x) for x in range(20)]
    x = [time.mktime(d.timetuple()) for d in dates] #convert to unix time
    y = np.arange(10, 20, 0.5)
    return x, y


if __name__ == '__main__':
    app = pg.mkQApp('Time axis test')
    axis = DateAxisItem(orientation='bottom')
    fig1 = pg.PlotWidget(axisItems={'bottom': axis})
    x, y = getData()
    fig1.plot(x,y)
    fig1.show()
    sys.exit(app.exec_())

Reply via email to