Ignore skips (weekends etc) on axis

16 views
Skip to first unread message

Ioannis Syranidis

unread,
May 20, 2019, 10:10:39 AM5/20/19
to pyqtgraph
Hello team,

Thanks for the great work with pyqtgraph.

Is there a way to implement the "skip gaps" part of this standard matplotlib solution with pyqtgraph: https://matplotlib.org/gallery/ticks_and_spines/date_index_formatter.html ?

I'm aware of subclassing pg.AxisItem and using strings for axis ticks but I haven't found a straightforward way to not show the graph parts without data. I have tried to workaround this by directly accessing the index from the plot data (pandas dataframe in my case) and by using an integer continuous index in my dataframe. Then using tickStrings I can get the string representation of the index from the corresponding column. My problem using this approach is that the dataframe index and subsequently the axis values cannot be a continuous integer but needs to be a unix epoch time. This is the part where I'm stuck.

Any help is appreciated.

Best regards
Ioannis
Reply all
Reply to author
Forward
0 new messages