diff --git a/lib/mpl_toolkits/axes_grid1/axes_grid.py b/lib/mpl_toolkits/axes_grid1/axes_grid.py index 1d6d6265e86f..ed6eacea3d57 100644 --- a/lib/mpl_toolkits/axes_grid1/axes_grid.py +++ b/lib/mpl_toolkits/axes_grid1/axes_grid.py @@ -22,23 +22,14 @@ def __init__(self, *args, orientation, **kwargs): self.orientation = orientation super().__init__(*args, **kwargs) - def colorbar(self, mappable, *, ticks=None, **kwargs): - orientation = ( - "horizontal" if self.orientation in ["top", "bottom"] else - "vertical") - cb = self.figure.colorbar(mappable, cax=self, orientation=orientation, - ticks=ticks, **kwargs) - return cb + def colorbar(self, mappable, **kwargs): + return self.figure.colorbar( + mappable, cax=self, location=self.orientation, **kwargs) def toggle_label(self, b): axis = self.axis[self.orientation] axis.toggle(ticklabels=b, label=b) - def cla(self): - orientation = self.orientation - super().cla() - self.orientation = orientation - _cbaraxes_class_factory = cbook._make_class_factory(CbarAxesBase, "Cbar{}") diff --git a/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/image_grid_each_left_label_mode_all.png b/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/image_grid_each_left_label_mode_all.png index 23abe8b9649d..f9a4524b5812 100644 Binary files a/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/image_grid_each_left_label_mode_all.png and b/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/image_grid_each_left_label_mode_all.png differ diff --git a/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/imagegrid_cbar_mode.png b/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/imagegrid_cbar_mode.png index eb16727ed407..9cb576faa49a 100644 Binary files a/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/imagegrid_cbar_mode.png and b/lib/mpl_toolkits/axes_grid1/tests/baseline_images/test_axes_grid1/imagegrid_cbar_mode.png differ diff --git a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py index be41b245d3b6..d1554020cd46 100644 --- a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py +++ b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py @@ -701,11 +701,7 @@ def test_insetposition(): @image_comparison(['imagegrid_cbar_mode.png'], remove_text=True, style='mpl20', tol=0.3) def test_imagegrid_cbar_mode_edge(): - # Remove this line when this test image is regenerated. - plt.rcParams['pcolormesh.snap'] = False - - X, Y = np.meshgrid(np.linspace(0, 6, 30), np.linspace(0, 6, 30)) - arr = np.sin(X) * np.cos(Y) + 1j*(np.sin(3*Y) * np.cos(Y/2.)) + arr = np.arange(16).reshape((4, 4)) fig = plt.figure(figsize=(18, 9)) @@ -721,12 +717,12 @@ def test_imagegrid_cbar_mode_edge(): cbar_location=location, cbar_size='20%', cbar_mode='edge') - ax1, ax2, ax3, ax4, = grid + ax1, ax2, ax3, ax4 = grid - ax1.imshow(arr.real, cmap='nipy_spectral') - ax2.imshow(arr.imag, cmap='hot') - ax3.imshow(np.abs(arr), cmap='jet') - ax4.imshow(np.arctan2(arr.imag, arr.real), cmap='hsv') + ax1.imshow(arr, cmap='nipy_spectral') + ax2.imshow(arr.T, cmap='hot') + ax3.imshow(np.hypot(arr, arr.T), cmap='jet') + ax4.imshow(np.arctan2(arr, arr.T), cmap='hsv') # In each row/column, the "first" colorbars must be overwritten by the # "second" ones. To achieve this, clear out the axes first. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy