Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a92bf03 commit 5d38073Copy full SHA for 5d38073
lib/matplotlib/tests/test_colorbar.py
@@ -979,3 +979,15 @@ def test_colorbar_set_formatter_locator():
979
fmt = LogFormatter()
980
cb.minorformatter = fmt
981
assert cb.ax.yaxis.get_minor_formatter() is fmt
982
+
983
984
+def test_offset_text_loc():
985
+ fig, ax = plt.subplots()
986
+ np.random.seed(seed=19680808)
987
+ pc = ax.pcolormesh(np.random.randn(10, 10)*1e6)
988
+ cb = fig.colorbar(pc, location='right', extend='max')
989
+ fig.draw_without_rendering()
990
+ # check that the offsetText is in the proper place above the
991
+ # colorbar axes. In this case the colorbar axes is the same
992
+ # height as the parent, so use the parents bbox.
993
+ assert cb.ax.yaxis.offsetText.get_position()[1] > ax.bbox.y1
0 commit comments