问题
I want to plot a trading timeseries, e.g. close of 5 min bars. The markets are closed over night. So I have two queries:
How to plot time in MatPlotLib (as well as date). E.g. so I need to implement a new axis or new hourLocators etc.
How to remove overnight gaps from my plot. I.e. I want the last bar on Monday evening to be visually contiguous with the first bar of Tuesday morning. (Multiple plots won't work here as I need to display several days and pan the view.)
回答1:
Look at this example. It skips weekend gaps in a series of daily data and is very easy to adapt to your case.
来源:https://stackoverflow.com/questions/4152396/plotting-sparce-time-with-matplotlib