-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Make marker size absolute in scatterplot #3535
Comments
+1 would love to see this as well. Would love a way to set their absolute size without having to dig too deep into plotly internals or plotly.js callbacks. |
+1 I looked into this for some time a little while back with no success :(. It would be amazing to finally find a solution to this! |
+2 tried to forge a hand-made solution for this but failed |
+1, also looking for a solution |
+1 d3 does this out of the box. |
|
kiiiiind of a 'solution' would be to draw shapes instead of scatter points for each scatter point with add_shape() |
+1 this would be very nice to have |
I currently need this feature for work :) |
+1 Drawing spheres do provide a solution. However, it can be too heavy when I have to draw over tens of thousands of points in the 3D plot. Waiting for an upgrade. |
+1 This would be a big help in a dataset I'm working with where the size-generating data spans orders of magnitude and where there are dense regions of smaller-size markers. |
This would be very useful! |
Came here to see a solution. Looks like they've added documentation based on @luggie's solution https://plotly.com/python/shapes/#circles-positioned-relative-to-the-axis-data |
Useful when there is little data. |
This would be also useful in order to be able to become independent of rescaling the figure dpi after plotting |
+1 I have been searching for a solution to this problem and am yet to find one. This should be standard behaviour. |
I could imagine 2 different APIs for this.
|
For those of you interested in this feature: the key next step is to design the API, and for that we need to know a bit more about the use cases you have in mind. The crux of the issue is that zooming in and out does not generally preserve aspect ratio, so if we're trying to set the marker size in reference to the axis scaling rather than pixels, the question is which axis? I guess the options could be:
And for all variants, I bet it'll also be important to constrain the max and min resulting sizes. For array-sized markers we already have a |
I can't imagine any use case where somebody wants an absolute scale, but not absolute in both axes. What I would use is a fixed radius, which means, r = xscale = yscale. That means it would be an ellipse when zoomed in. What's the situation when you might want a fixed scale in one axis but not the other? That said, if you want an ellipse API and a circle API, just make two different shapes? |
I would also like to have this feature. |
Unfortunately, this only really works for small datasets. I managed to plot >100k datapoints as circles using this stack overflow answer but there are so many shapes in the figure that it is essentially impossible to render. |
+1 Is there any updates? Thanks! |
I make it with GeoJSON and it works!
|
+1 This feature would be very useful. |
Is there a way to get the user-modified zoom level out of a Plotly figure (specifically a map), and to access this server-side via a callback? Then it would be easy to make a custom scale dependency, even other than linear, and simply update_traces with a new marker size. NB Looking for a widget based solution, not Dash-only. |
I view this as the most useful option. Here's a real world example that I've been trying to visualize for the last few hours.
This would give me a graph intuitively showing me the I/O pattern over time. Zooming into sections would show me useful information like...
I agree wholeheartedly. If my graph is covering a large timespan, I still want to see the trend of the requests, even though the duration of an individual request might make it be less than a pixel without capping the minimum size. For example, I might have an hours worth of data covering requests which individually span milliseconds. I think that it's important to keep this cap in display-space, not axis-space for that reason. I don't personally understand why you would ever want a maximum size in this kind of setup, but maybe someone else has a use-case. |
It seems that when creating a scatterplot, the marker sizes are always in pixels. The result is that when zooming into the plot, the points remain small. Is there a way to have them dynamically resize? Or set the size to be absolute instead of pixel?
A code snippet to showcase the point
Zoomed out, this is a nice graph that shows the distribution clearly, but when zooming in, the points are so small it's nearly impossible to interact with any individual one.
Screen.Recording.2021-12-29.at.5.58.42.PM.mov
Is there a way for those points to have absolute sizes instead of fixed ones? Such that zooming in would cause them to increase (as would be intuitive naturally)?
Thanks!
The text was updated successfully, but these errors were encountered: