Skip to content

Area charts: area() got an unexpected keyword argument 'stackgaps' #4141

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

Closed
Skrattoune opened this issue Apr 2, 2023 · 2 comments
Closed

Comments

@Skrattoune
Copy link

Hi, I have issues with different area charts which I'm using to monitor the presence of different types of events.

My data in my area charts are going all over the place because values seem by default to be interpolated for the traces which have no data at one "location" (for a given month, in my case)
image
image
in this examples, each time there is no data, the curves should go back to zero
Instead, the area extends for each trace to the next point where there is some data.

I would like to insert a zero at locations at which other traces in this group have data but this one does not

from plotly/plotly.js#1217
and from https://plotly.com/python/reference/scatter/#scatter-line

I understood that I should use stackgaps="infer zero" to avoid have my data in my area chart going all over the place because values are by default interpolated for the traces which have no data at one "location" (for a given month, in my case)

I'm declaring my chart as a plotly express area chart.
It seems that under the hood, it a a scatter plot, and it links to the reference for scatter plots.

So I don't really undertand why my stackgaps parameter is not recognized, either in the fig = px.area definition or in the fig.update_traces(stackgaps="infer zero",)

Is that a bug? What am I doing wrong?

@nicolaskruchten
Copy link
Contributor

Can you please share some sample code/representative data so I can see what's going on?

@gvwilson
Copy link
Contributor

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants