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
{{ message }}
Repository navigation
Create a "stick-inside" mode for ticks labels #3292
One can notice that ticks' labels are horizontally/vertically centred (compared to the ticks themselves) on the horizontal/vertical axis, respectively.
This makes that first and last ticks value "stick out" from the graph; what can be a bit ungainly — especially if one shows one axis only:
This is also inconvenient when you want to precisely align you axes with elements surrounding your picture (e.g., in the example above, if you want the 0% tick mark to be the most-left point of the picture).
Question
➥ Could it be possible to have a "stick inside" mode for ticks values?
The idea is to change the vertical/horizontal alignment of the first and last ticks values:
left and right aligned, respectively, for the horizontal axis:
bottom and top aligned, respectively, for the vertical axis:
Our first example would then look like this:
Variant
An even more super-duper mode would enable us to choose which end on the axis to "stick inside", so that one could make such graph:
either set tickalign as a single [0,1] float, and apply this value to all ticks,
or set tickalign as a list of [0,1] floats (list with a length equal to the number of ticks displayed) and apply each tickalign respectively.
(This might not be the best way to go, though, as it might be difficult to know in advance the number of ticks. Plus it's not efficient if you want to customise the last tick only… A workaround — yet limiting the "customisability" — would be to provide a list of length 3 only, for [first, middles, last]…)
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Activity
etpinard commentedon Nov 26, 2018
Thanks for writing in.
This request seems very related to #1673
EBoisseauSierra commentedon Nov 27, 2018
@etpinard Indeed! (The catch is here to provide a separate
tickalignvalue for each tick).etpinard commentedon Nov 27, 2018
.. or do something like https://plot.ly/javascript/reference/#layout-xaxis-showexponent with values
"all" | "first" | "last" | "none"EBoisseauSierra commentedon Nov 27, 2018
that could be a solution.
My initial thoughts were to be able to:
tickalignas a single [0,1] float, and apply this value to all ticks,tickalignas a list of [0,1] floats (list with a length equal to the number of ticks displayed) and apply eachtickalignrespectively.(This might not be the best way to go, though, as it might be difficult to know in advance the number of ticks. Plus it's not efficient if you want to customise the last tick only… A workaround — yet limiting the "customisability" — would be to provide a list of length 3 only, for [first, middles, last]…)
walter9388 commentedon Apr 29, 2020
any update on this?
gvwilson commentedon Jun 11, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson