-
Notifications
You must be signed in to change notification settings - Fork 633
Bubble plot miscalculates size when all points within a color group are the same size #1133
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
Oh wow, I thought I was the only one having this issue. Thanks for your examples, it helped me solved it! I tried to post about it on the plotly community forum, but nobody replied... Also, great find on the added noise! |
Sorry for the late response and thanks for the thorough report! Note how those problematic traces (e.g., carb of 6 or 8) have just one data point. For those traces, Maybe someday this will fixed in plotly.js itself, but I think the right way to proceed is to make sure the R package always translates |
Thanks for the update. A minor (probably quibbling) point - I don't think having just one data point in a group is a requirement for this to occur, for example in the second |
This bug can occur when creating a bubble plot where a discrete variable determines color and a continuous variable determines size. If all of the points within a given color are the same size (or if there is only one point within that group) then the bubbles are sized incorrectly. When using
sizemode = 'diameter'
this issue does not occur, it only happens with the defaultsizemode = 'area'
. Based on the experiments shown below it appears that these problematic points are having the size computed as diameter instead of area in either case, as they appear to have the same size in both modes.I first asked about this on SO at (https://stackoverflow.com/questions/46571892/r-plotly-scatter-plot-marker-size-appears-to-depend-on-color-when-color-is-discr)
I did not include examples where color is based on a numeric or integer instead of factor or character, but I can attest this bug does not occur in those cases. (In cases where the legend is a gradient instead of discrete values.)
Possibly related to #755 about size of bubbles in the legend?
The text was updated successfully, but these errors were encountered: