Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect fill rendering caused by gaps in data #2736

Open
acarapetis opened this issue Jun 14, 2018 · 9 comments
Open

Incorrect fill rendering caused by gaps in data #2736

acarapetis opened this issue Jun 14, 2018 · 9 comments
Labels
bug something broken P2 considered for next cycle

Comments

@acarapetis
Copy link

acarapetis commented Jun 14, 2018

I'm using Plotly.js to display some time series data with the following relevant properties:

  • Large gaps in the data, and
  • Non-symmetric uncertainty (i.e. each data point has min,avg,max values).

I'm attempting to plot this by adapting this example, but I seem to have come across a bug: when using data with gaps (and connectgaps: false) at the same time as fill: 'tonexty', the gaps cause the fill to be drawn incorrectly:
screenshot from 2018-06-14 15-28-40

(The section of data at the very end of the graph is rendered correctly, but everything before the last gap is messed up.) For a simple example that reproduces this issue, see this codepen.

Interestingly, adding fill: 'tozeroy' to the bottom trace seems to resolve the obviously broken aspect of this issue:
screenshot from 2018-06-14 15-39-04

I would still argue that the expected behaviour is that connectgaps: false should result in no fill crossing the gaps.

@acarapetis acarapetis changed the title Gaps in data break filled areas Incorrect fill rendering caused by gaps in data Jun 14, 2018
@alexcjohnson alexcjohnson added the bug something broken label Jun 14, 2018
@alexcjohnson
Copy link
Collaborator

Confirmed, thanks @acarapetis - and the pared-down codepen is much appreciated! Seems to be a problem specifically with gaps in the lower trace.

I'm probably going to need to muck with fills for #1217, perhaps I can fix this at the same time (along with the many other fill bugs)

@yarl
Copy link

yarl commented Jul 31, 2018

We have similar similar issue with two data series that should look like one, continuous data series. We use fill: 'tozeroy', one series ends with many nulls, one series starts with many nulls.

Effect as shown below:

screenshot 2018-07-31 15 21 11

@nickrussler
Copy link

nickrussler commented Nov 29, 2019

I encountered a similar problem and as @acarapetis mentioned adding fill: 'tozeroy' to the bottom trace mitigated the problem for me in combination with fillcolor: 'transparent' for the bottom trace. Also mapping the null values to some very small number (-99999999) to "pinch" the area off worked for me.

@jhannink
Copy link

Any update on this issue in the meantime?

I encountered a similar problem and as @acarapetis mentioned adding fill: 'tozeroy' to the bottom trace mitigated the problem for me in combination with fillcolor: 'transparent' for the bottom trace. Also mapping the null values to some very small number (-99999999) to "pinch" the area off worked for me.

The workaround above does somehow mitigate the problem. However, the gaps are also filled:
grafik
Any idea on how to avoid that?

@leoyala
Copy link

leoyala commented May 10, 2023

I was wondering if there is an update regarding this bug. I am still facing this issue in plotly==5.14.1

@Noahkoole
Copy link

I am also having this issue still, any update on this?

michael-nml added a commit to NannyML/nannyml that referenced this issue Feb 14, 2024
Plotly doesn't correctly handle fills with gaps. This is an issue for
confidence bands as they are being plotted currently. Work around is to
tell Plotly to fill the gaps, which causes correct rendering.
Unfortunately it does fill the gap, but this is the easiest work around
for now.

See plotly/plotly.js#2736 for context.
nnansters pushed a commit to NannyML/nannyml that referenced this issue Feb 16, 2024
Plotly doesn't correctly handle fills with gaps. This is an issue for
confidence bands as they are being plotted currently. Work around is to
tell Plotly to fill the gaps, which causes correct rendering.
Unfortunately it does fill the gap, but this is the easiest work around
for now.

See plotly/plotly.js#2736 for context.
@Brax94
Copy link

Brax94 commented Feb 19, 2024

We are also experiencing this issue. The fill options does not respect gaps, and will fill across them.
We have been using a workaround for a while, which is basically to add a graph for each continuous part of the data.

Is anyone looking in on this?

@faebebin
Copy link

faebebin commented Feb 28, 2024

Same problem here using fill="tonexty" to fill between to lines with data gaps being unwillingly filled.

Using plotly-python on plotly==5.18.0

@wbeardall
Copy link

Is there any progress on this?

@gvwilson gvwilson self-assigned this Jun 11, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P2 considered for next cycle label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests