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

Skip to content

Commit b44a511

Browse files
committed
Modify axis aspect and fraction for colorsquare
1 parent be84803 commit b44a511

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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
@@ -1822,6 +1823,9 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
18221823
# Store the value of gca so that we can set it back later on.
18231824
current_ax = self.gca()
18241825

1826+
if isinstance(mappable.norm, mcolors.BivariateNorm):
1827+
kw['fraction'] = 0.30
1828+
kw['aspect'] = 1
18251829
if cax is None:
18261830
if use_gridspec and isinstance(ax, SubplotBase):
18271831
cax, kw = cbar.make_axes_gridspec(ax, **kw)

0 commit comments

Comments
 (0)