You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to add the cliponaxis (as has been implemented for scatter ternary plots - see issue #1385plotly/plotly.js#1385). This would allow the markers not to be cut off by the plot area when the showmarkers tag is set to true.
Currently I have a plot like so:
However, as he edge markers are cut off, it looks like I have less points. The plot below shows which points are plotted:
It would be really great to add this tag to the ff.ternary_contour plot, as it is so useful in the scatter ternary. If there is also a work around that I have missed, please let me know (I have had a go at this but can't find any way to get the markers not to be cut off).
@alexcjohnson thanks for the suggestion, unfortunately this doesn't work (the code will run but the cliponaxis is not implemented). I believe this is to do with the fact the ternary_contour plot is part of the figure factory set and therefore might need to be implemented directly in the ff backend?
Ah, I see - looks like whatever we did to create those contour lines includes lines around the border that don't really add any value... and to compensate we clip them and add border lines. If we undo that, you can see the unclipped markers. Here's one of the examples from https://plotly.com/python/ternary-contour/ but taking that out and adding cliponaxis=False:
Ah that's good to know. I was using the line mode to see the points more clearly, however, filling the contours makes the lines on the edge less noticeable. I have then added a scatter over the top using your solution:
Here is the final output which looks great:
I think this is a workable solution, so I'm happy to close this. Thanks for the help and quick responses @alexcjohnson
Activity
alexcjohnson commentedon Nov 21, 2022
fig.update_traces(cliponaxis=False)after making the figure?is95t commentedon Nov 21, 2022
@alexcjohnson thanks for the suggestion, unfortunately this doesn't work (the code will run but the cliponaxis is not implemented). I believe this is to do with the fact the ternary_contour plot is part of the figure factory set and therefore might need to be implemented directly in the ff backend?
alexcjohnson commentedon Nov 21, 2022
Ah, I see - looks like whatever we did to create those contour lines includes lines around the border that don't really add any value... and to compensate we clip them and add border lines. If we undo that, you can see the unclipped markers. Here's one of the examples from https://plotly.com/python/ternary-contour/ but taking that out and adding
cliponaxis=False:I haven't looked into how hard it would be to remove those so this gives the exact behavior you want.
is95t commentedon Nov 21, 2022
Ah that's good to know. I was using the line mode to see the points more clearly, however, filling the contours makes the lines on the edge less noticeable. I have then added a scatter over the top using your solution:
Here is the final output which looks great:
I think this is a workable solution, so I'm happy to close this. Thanks for the help and quick responses @alexcjohnson