Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96af3d3

Browse files
committed
Modify axis aspect and fraction for colorsquare
1 parent daef751 commit 96af3d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from matplotlib.image import FigureImage
3636

3737
import matplotlib.colorbar as cbar
38+
import matplotlib.colors as mcolors
3839

3940
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
4041
from matplotlib.blocking_input import BlockingMouseInput, BlockingKeyMouseInput
@@ -1834,6 +1835,9 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
18341835
# Store the value of gca so that we can set it back later on.
18351836
current_ax = self.gca()
18361837

1838+
if isinstance(mappable.norm, mcolors.BivariateNorm):
1839+
kw['fraction'] = 0.30
1840+
kw['aspect'] = 1
18371841
if cax is None:
18381842
if use_gridspec and isinstance(ax, SubplotBase):
18391843
cax, kw = cbar.make_axes_gridspec(ax, **kw)

0 commit comments

Comments
 (0)