-
Notifications
You must be signed in to change notification settings - Fork 633
Ordering of traces is wrong #225
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
Comments
Sorry to hear that you are experiencing problems. Do you have code and images that you can share with us? |
@jpevitt Thanks for your reply. But I cannot find the attached folder. All I see if a a bunch of numbers. Can you post the code directly to this issue or upload your folder as a repo or a gist on GitHub? |
Sorry, answered through email, didn't realize it wouldn't display properly. |
Thanks for sharing. I will look into this. |
Ah, this is related to the order in which the traces are drawn. If you hover over the example I provide above, you'll see hover info for all the traces. @13bzhang does that make sense? Feel free to tackle this one if you'd like. |
Yeah I can take this one. |
I have been working on this one for the past few days. So I noticed that stacked densities also don't work with the current code. For instance: p <- ggplot(data = movies, aes(x = rating, fill = mpaa,)) +
geom_density(position = "stack")
py$ggplotly(p) The problem is that the order of the traces are laid in reverse. I played around with the code in if (g$geom == "area" | g$geom == "density"){
traces <- rev(traces)
} Again, this is really unsophisticated but just a first cut. I was able to produce the following: Note some problems still left:
Maybe the solution is to make special cases for these types of geoms like in |
It looks like this problem isn't necessarily specific to a geom. For example, qplot(wt, drat, color = gear, data = mtcars) leads to That legend should have 3 at the top and 1 at the bottom. I think you can fix this by having trace "3" be the first trace, trace "2" be the second, and trace "1" be the third. You may also need to add some special handling for the area geom, but I'm not sure. |
@cpsievert If it's a more general problem, then the fix should be somewhat easier. |
Fixed via a4a9a1d |
Hey guys, I'm pretty new to the plotly API so if I'm missing something please let me know. I have a 100% stacked area chart in ggplot2 that I'm trying to convert into a plotly plot. I followed the - pretty simple - steps on your API site which took me to the URL for it, except on the site my colors and/or lines entirely disappear leaving me with the entire plot blacked out in some random color.
The text was updated successfully, but these errors were encountered: