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.

Automargin clipping ticklabels

See original GitHub issue

I’m trying to use *axis.automargin to get the minimum necessary margin to display all tick labels/axis titles.

To do that I set layout.margin.[tblr] to 0 and then set layout.[xy]axis.automargin to true.

When I do this and do not have axis titles, the tick labels are slightly clipped. See this pen for an example: https://codepen.io/anon/pen/XPzEeN

When in the pen if you uncomment the line that sets layout.yaxis.title = "", you’ll notice that the ticks are no longer clipped.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
etpinardcommented, Jan 31, 2019

Ah there is it:

image

My bad. I’ll see If I can get a quick fix in for this thing. Thanks for reporting!

0reactions
wbrgsscommented, Jan 31, 2019

@etpinard Thanks for taking a look. I don’t think this will work for us though; it seems any margin smaller than the tick size will mean clipped ticks — see the x-axis ticks on https://codepen.io/anon/pen/GzrjxN

I’ve tried the layout.yaxis.title = "" trick, which appears to work well for most graphs, but that’s not going to work for us with components that make use of plots flush with their container, such as the following (sorry for the lack of codepen) datacard

If layout.yaxis.title = "" hack really is the best solution for now I think I’ll do my best to work around the above issue with the flush-with-border plots.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Long tick labels getting cut off in plotly.js chart - Stack Overflow
Given the nature of my charts, I need to use a horizontal orientation. So a solution I can't use is a vertical orientation...
Read more >
Long tick labels getting cut off in plotly.js chart
Hello ! You can play with the layout margin function to move the margin of the graph and correctly read your labels: Example....
Read more >
matplotlib.pyplot.margins — Matplotlib 3.6.2 documentation
Rotating custom tick labels. On this page. margins(); Examples using matplotlib.pyplot.margins. © Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, ...
Read more >
changelog - QCustomPlot
... (15 px) when auto margin is enabled - Added Flags type QCPAxis::AxisTypes ... beta: - Fixed bug that clipped the rightmost pixel...
Read more >
plotly.js-geo-dist-min | Yarn - Package Manager
... namely support pseudo-html, fix textfont.color and avoid clipping [#5531] ... Fix axis automargin push offset which resulted in clipped tick labels in ......
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