Skip to content

Scatter plot filltozeroy fails on multi-signed values #2322

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

Open
MattAmos opened this issue Mar 27, 2020 · 3 comments
Open

Scatter plot filltozeroy fails on multi-signed values #2322

MattAmos opened this issue Mar 27, 2020 · 3 comments
Labels
bug something broken P3 backlog

Comments

@MattAmos
Copy link

Apologies if this is a duplicate issue, but a similar one could not be found.

For scatter plot data containing both positive and negative values, fill="tozeroy" does not correctly fill under the trace as I expected. I'm not sure if this is a future feature or current bug, but I couldn't find documentation which states that scatter plot filling for both negative and positive values was not supported.

plotly.__version__

4.5.4

from plotly import graph_objects as go
import numpy as np

x = np.linspace(0, 100)
y = np.random.rand(100) - 0.5

fig = go.Figure(data=go.Scattergl(x=x, y=y, fill="tozeroy"))
fig.show()

image

@MattAmos MattAmos changed the title Scatter plot fill to zero y fails on negative values Scatter plot filltozeroy fails on negative values Mar 27, 2020
@MattAmos MattAmos changed the title Scatter plot filltozeroy fails on negative values Scatter plot filltozeroy fails on multi-signed values Mar 27, 2020
@marcus-maro
Copy link

@MattAmos did you find a solution to this problem? I am experiencing the same issue.

@MattAmos
Copy link
Author

@MattAmos did you find a solution to this problem? I am experiencing the same issue.

Hi @marcus-maro, I didn't find a solution using go.Scattergl, but did find a workaround using go.Scatter.

from plotly import graph_objects as go
import numpy as np

x = np.linspace(0, 100)
y = np.random.rand(100) - 0.5

fig = go.Figure(data=go.Scattergl(x=x, y=y, fill="tozeroy"))
fig.show()

fig = go.Figure(data=go.Scatter(x=x, y=y, fill="tozeroy"))
fig.show()

image
image

I'll reopen this issue as it seems like this is a genuine issue with go.Scattergl not performing in the same manner as go.Scatter.

@MattAmos MattAmos reopened this Sep 16, 2020
@nicolaskruchten
Copy link
Contributor

Indeed, scattergl does not have as good support for filled areas as scatter and this is a bug, although it'll have to be fixed in Plotly.js... there are a few current known shortcomings with this combination of features: plotly/plotly.js#2291 and plotly/plotly.js#4017

@gvwilson gvwilson self-assigned this Jun 18, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog bug something broken labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

4 participants