-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Option to prevent symbol truncation at ternary axis boundaries #1385
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
Thanks for pointing this out. |
My pleasure! I appreciate your taking the time to consider the issue. What do you think about the idea of having a boolean attribute to provide the desired behavior? The default value could be true to be consistent with the current implementation but false would produce a plot analogous to the "desired display" example above. In most cases my guess is that you would either want no truncation of markers at the axes at all on the plot or to have the plot behave as it does now so this attribute could be defined at the top level of layout (markeraxistrunctate?). I suppose, however, that having the ability to define this attribute on the axis (markertruncate?) or the trace marker (axistruncate?) levels would allow for finer-grained control at the expense of a more verbose configuration. |
Hi Étienne. Thanks for the question. The marker points near the axis boundaries should go on top of the axis line and tick labels. My rationale is that this seems to be more consistent with the objective of ensuring that they have visual weights that are equivalent to their counterparts near the center of the plot region. |
I've made some solid progress on this ticket this week. You can track my WIP branch here: https://github.com/plotly/plotly.js/compare/cliponaxis-false At this stage,
Quick question: how should we determine if a non-clipped marker is visible or not? Intuitively, markers that have
|
Great to see that you've made such good progress Étienne! The Regarding your question, if a marker point has a value that puts it outside of the axis range (i.e., its center is outside of the plot range) it should be removed irrespective of the symbol size. As you say, points that sit exactly on an axis, however, should be visible. |
Thanks very much for the prompt response 👍 |
After some thoughts, maybe implementing Error bars positions are set in data coordinates unlike marker symbols and text size (which are set in pixel coordinates). Furthermore, in matplotlib's |
@etpinard sorry to revive the old ticket but is it possible to also support this in scattergl? |
Old indeed - feel free to open a new issue if you want to continue the discussion, but my hunch is this would be pretty hard in scattergl, as the rectangular viewport is baked in at a fairly low level |
I have scoured the documentation but have been unable to find a way to prevent symbols from being truncated by axis boundaries. While you can avoid the problem by extending the boundaries beyond what you would normally use for the 'scatter' plot type (to slightly below zero for instance for cases where zero is the minimum data value), this is not a possibility with the 'scatterternary' type, at least for cases where points lie on an axis or apex.
To see the impact of the symbol truncation consider the plot below left where points at the apices are almost invisible and those in the middle of the axes also are quite small. This display is problematic because the center point has much greater visual heft compared to the remaining points, particularly compared to those on the apices. The preferred plotting approach is depicted on the right where each point has an equal visual weight irrespective of its position on the plot.
The text was updated successfully, but these errors were encountered: