Improve tight layout algorithm handling of empty gridspec slots
See original GitHub issueDescription
When some subplots have colorbar and some don’t, the position will be wrong.
Steps to reproduce
import proplot as pplt
import numpy as np
# Colorbars
fig, axs = pplt.subplots(nrows=2, ncols=2)
state = np.random.RandomState(51423)
m = axs.heatmap(state.rand(10, 10), cmap='dusk')
axs[0].colorbar(m[0], loc='r', label='test')
axs[1].colorbar(m[0], loc='r', label='test')
axs[3].colorbar(m[0], loc='l', label='test')
axs[3].colorbar(m[0], loc='r', label='test')
axs[3].colorbar(m[0], loc='r', label='test')
Actual behavior:
Proplot version
Paste the results of import matplotlib; print(matplotlib.__version__); import proplot; print(proplot.version)
here.
3.5.0
0.9.5.post105
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Improve tight layout algorithm handling of empty gridspec slots
The solution is: If a gridspec slot is empty, instead of just skipping the tight layout test, I should jump to the next...
Read more >proplot.gridspec — ProPlot documentation
If :rcraw:`subplots.tight` is ``True``, the space is determined by the tight layout algorithm. Otherwise, a sensible default value is chosen.
Read more >CSS Grid Layout Module Level 1 - W3C
This CSS module defines a two-dimensional grid-based layout system, ... arbitrary slots in a predefined flexible or fixed-size layout grid.
Read more >Exercise: Working with External Libraries Daily - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from No attached data sources.
Read more >Figure subfigures — Matplotlib 3.6.2 documentation
Sometimes it is desirable to have a figure with two different layouts in it. ... in the empty gridspec slots: subfig = fig.add_subfigure(gridspec[:, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done! Here’s how this looks now:
Nice idea of equalspace and groupspace!