question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a "stick-inside" mode for ticks labels

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
walter9388commented, Apr 29, 2020

any update on this?

0reactions
EBoisseauSierracommented, 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]…)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Matplotlib - Setting Ticks and Tick Labels - GeeksforGeeks
In this article, we are going to discuss how set Ticks and Tick labels in a graph. Ticks are the markers denoting data...
Read more >
Ticks: left-align first, right align last on x-axis - Plotly Python
Currently, all ticks are by default “text-centered”: This makes that the ... request #1278 Create a “stick-inside” mode for ticks labels.
Read more >
Specify Axis Tick Values and Labels - MATLAB & Simulink
Change Tick Value Locations and Labels. Create x as 200 linearly spaced values between -10 and 10. Create y as the cosine of...
Read more >
LabelZone Labeldirect Howto LabelDirect_howTo - UserManual.wiki
Height: (height of the label you wish to create) ... and tick 'Copy Fit Text Within Frame'. ... A. Use the print only...
Read more >
Use tack in a sentence - RhymeZone
A ticky tick tack ticky tick tack again ... —Small Gardens, and How to Make the Most of Them by Violet Purton Biddle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found