Skip to content
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

Create a "stick-inside" mode for ticks labels #3292

Closed
EBoisseauSierra opened this issue Nov 26, 2018 · 6 comments
Closed

Create a "stick-inside" mode for ticks labels #3292

EBoisseauSierra opened this issue Nov 26, 2018 · 6 comments

Comments

@EBoisseauSierra
Copy link

Context

Say we have a first quadrant chart:

ticks1

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:

ticks3

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:
    ticks3

  • bottom and top aligned, respectively, for the vertical axis:
    ticks4

Our first example would then look like this:
ticks5

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:
ticks6

@etpinard
Copy link
Contributor

Thanks for writing in.

This request seems very related to #1673

@EBoisseauSierra
Copy link
Author

@etpinard Indeed! (The catch is here to provide a separate tickalign value for each tick).

@etpinard
Copy link
Contributor

.. or do something like https://plot.ly/javascript/reference/#layout-xaxis-showexponent with values "all" | "first" | "last" | "none"

@EBoisseauSierra
Copy link
Author

EBoisseauSierra commented Nov 27, 2018

that could be a solution.

My initial thoughts were to be able to:

  • 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]…)

@walter9388
Copy link

any update on this?

@gvwilson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants