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.

Spacing of subplots is too small, titles of subplots overlap with tick labels

See original GitHub issue

Describe the bug Whenever I make an arviz plot using az.plot_trace(data,compact=True) the title of subplots overlap with tick labels of the respective subplot above.

See plot below, the spacing between subplots seems wrong, don’t know why: hierarchical_numpyro_trace

Additional context arviz 0.11.4 macOS 12.1 Python 3.10.1 IPython 7.30.1 VSCode 1.63.2

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
OriolAbrilcommented, Dec 27, 2021

constrained layout is still experimental so matplotlib doesn’t set it to true as a default (yet?). I’m not sure there is a way to fix this within ArviZ. We do provide those opinionated extra themes, but we rely on matplotlib styles so using those changes the look of any matplotlib/seaborn/… plot, so loading one of those at import on our side would probably be confusing. plots would change appearance with no apparent reason to many users importing arviz.

we have some ideas for new pages in the documentation related to plotting (https://github.com/arviz-devs/arviz/issues/1488) covering how to overlay plots for example. we could have a section on constrained_layout/tight_layout. Or maybe faq page with common questions on plotting, stats, inferencedata…?

2reactions
corneliusroemercommented, Dec 27, 2021

Thanks for the tips!

Is there a reason why I need to custom set these parameters? Are my defaults messed up for some reason or does every user have to do this?

If it’s just me, then we can close this issue, but if it affects others, would it be possible to fix this within arviz?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matplotlib subplots_adjust hspace so titles and xlabels don't ...
With, say, 3 rows of subplots in matplotlib, xlabels of one row can overlap the title of the next. One has to fiddle...
Read more >
How to Adjust Spacing Between Matplotlib Subplots - Statology
This tutorial explains how to adjust the spacing between subplots in Matplotlib, ... function tends to cause the subplot titles to overlap:
Read more >
Tight Layout guide — Matplotlib 3.6.2 documentation
In matplotlib, the location of axes (including subplots) are specified in normalized figure coordinates. It can happen that your axis labels or titles...
Read more >
How to set the spacing between subplots in Matplotlib in ...
Using subplots_adjust() method to set the spacing between subplots. We can use the plt. subplots_adjust() method to change the space between ...
Read more >
Tight Layout guide — Matplotlib 1.3.1 documentation
In matplotlib, the location of axes (including subplots) are specified in normalized figure coordinates. It can happen that your axis labels or titles...
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