I’m trying to build an interactive plot from a pandas dataframe
of financial data. The dataframe index has some gap when market are closed, or during weekends. The problem is that Bokeh always autofill those gaps when I use the dataframe index as xasis, making it visually ugly.
How can I print my data without gaps? In my index I don’t have datetime values for when the markets are closed, or weekends or holidays, but it’s like Bokeh automatically creates them just to connect the y value of the last
day that I have, with the first y value of the next day.
I don’t think that possible out-of-the-box. You need a non-continuous axis, and only non-continuous axis that Bokeh offers is CategoricalAxis that is definitely not for your case.
A workaround would be to patch the data itself to make it continuous, and then set a custom ticker for the x-axis that would display all values continuously, apart from those gaps
Regards,
Eugene
···
On Wednesday, January 31, 2018 at 11:54:07 PM UTC+7, Thomas Cercato wrote:
I’m trying to build an interactive plot from a pandas dataframe
of financial data. The dataframe index has some gap when market are closed, or during weekends. The problem is that Bokeh always autofill those gaps when I use the dataframe index as xasis, making it visually ugly.
How can I print my data without gaps? In my index I don’t have datetime values for when the markets are closed, or weekends or holidays, but it’s like Bokeh automatically creates them just to connect the y value of the last
day that I have, with the first y value of the next day.
As noted, it's not "out of the box" basically you will have to use the integer index as the x-axis and then add tick label overrides to label them as dates.
Thanks,
Bryan
···
On Jan 31, 2018, at 11:02, Eugene Pakhomov <[email protected]> wrote:
I don't think that possible out-of-the-box. You need a non-continuous axis, and only non-continuous axis that Bokeh offers is CategoricalAxis that is definitely not for your case.
A workaround would be to patch the data itself to make it continuous, and then set a custom ticker for the x-axis that would display all values continuously, apart from those gaps
Regards,
Eugene
On Wednesday, January 31, 2018 at 11:54:07 PM UTC+7, Thomas Cercato wrote:
I'm trying to build an interactive plot from a pandas dataframe of financial data. The dataframe index has some gap when market are closed, or during weekends. The problem is that Bokeh always autofill those gaps when I use the dataframe index as xasis, making it visually ugly.
How can I print my data without gaps? In my index I don't have datetime values for when the markets are closed, or weekends or holidays, but it's like Bokeh automatically creates them just to connect the y value of the last day that I have, with the first y value of the next day.