You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AAPL_1H.zip
Here is a pickle file, I just tried with the code above and it seems okay. However, i was seeing the described behavior above yesterday. Let me reproduce and provide an example.
I had the exact same problem and fixed it in the following way: I changed the order of the arguments that I passed to the function such as in the following example:
fig.update_xaxes(
rangebreaks=[
dict(values=["2022-12-25"]), # hide holidays (Christmas and New Year's, etc)
dict(bounds=["sat", "mon"]), # hide weekends, eg. hide sat to before mon
dict(bounds=[18, 6], pattern="hour") # hide hours outside of 6pm-6am
]
)
Activity
fjafferi commentedon Jun 14, 2021
Any update on this? it seems the problem still exists.
nicolaskruchten commentedon Jun 14, 2021
I'm having trouble loading the pickle file... can someone provide a simple reproducible example of this please?
fjafferi commentedon Jun 14, 2021
AAPL_1H.zip
Here is a pickle file, I just tried with the code above and it seems okay. However, i was seeing the described behavior above yesterday. Let me reproduce and provide an example.
fjafferi commentedon Jun 14, 2021
`import pandas as pd
import plotly.graph_objects as go
df = pd.read_pickle('AAPL_1H.pkl')
fig = go.Figure(data=[go.Candlestick(x=df.index, open=df['open'], high=df['high'], low=df['low'], close=df['close'])])
fig.update_xaxes(
rangebreaks=[
dict(bounds=[15, 9], pattern="hour"),
# dict(bounds=["sat", "mon"]),
dict(values=["2021-06-03"])
]
)
fig.show()`
So it seems the problem appears to be when passing the dates list, and if the date falls within the x range.

@nicolaskruchten
nicolaskruchten commentedon Jun 15, 2021
@fjafferi Thanks for the zipfile but the problem is that I can't unpickle it :) Can you send me a CSV please?
nicolaskruchten commentedon Jun 29, 2021
OK, I found the time to get this file parsed. With Plotly.py 5.1 (powered by Plotly.js 2.2) I'm not seeing this behaviour any more:
nicolaskruchten commentedon Jun 29, 2021
Ah but when uncomment the weekend exclusion I do see a problem:
I've logged the issue in the underlying Javascript library as plotly/plotly.js#5783
Lucasdesard commentedon May 15, 2023
I had the exact same problem and fixed it in the following way: I changed the order of the arguments that I passed to the function such as in the following example:
fig.update_xaxes(
rangebreaks=[
dict(values=["2022-12-25"]), # hide holidays (Christmas and New Year's, etc)
dict(bounds=["sat", "mon"]), # hide weekends, eg. hide sat to before mon
dict(bounds=[18, 6], pattern="hour") # hide hours outside of 6pm-6am
]
)
jinseo99 commentedon Feb 1, 2024
I am having similar issue as well.
For me the issue is when the holiday and weekend are in consecutive order.
There's two cases:
It seems the reordering of the rangebreaks arguments fixes them but only conditionally.
For example for case 1:
The following order works:
and the following causes a bug and shows y-value overlaps:
This occurs reversely for case 2:
The following order works:
and the following causes a bug and shows y-value overlaps:
Coding-with-Adam commentedon Feb 5, 2024
hi @jinseo99
Thanks for reporting. This seems related to the plotly.js #5783 issue
I've updated the priority of that bug.