File tree 1 file changed +15
-0
lines changed 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -982,6 +982,7 @@ def test_colorbar_set_formatter_locator():
982
982
983
983
984
984
def test_offset_text_loc ():
985
+ plt .style .use ('mpl20' )
985
986
fig , ax = plt .subplots ()
986
987
np .random .seed (seed = 19680808 )
987
988
pc = ax .pcolormesh (np .random .randn (10 , 10 )* 1e6 )
@@ -991,3 +992,17 @@ def test_offset_text_loc():
991
992
# colorbar axes. In this case the colorbar axes is the same
992
993
# height as the parent, so use the parents bbox.
993
994
assert cb .ax .yaxis .offsetText .get_position ()[1 ] > ax .bbox .y1
995
+
996
+
997
+ def test_title_text_loc ():
998
+ plt .style .use ('mpl20' )
999
+ fig , ax = plt .subplots ()
1000
+ np .random .seed (seed = 19680808 )
1001
+ pc = ax .pcolormesh (np .random .randn (10 , 10 ))
1002
+ cb = fig .colorbar (pc , location = 'right' , extend = 'max' )
1003
+ cb .ax .set_title ('Aardvark' )
1004
+ fig .draw_without_rendering ()
1005
+ # check that the title is in the proper place above the
1006
+ # colorbar axes, including its extend triangles....
1007
+ assert (cb .ax .title .get_window_extent (fig .canvas .get_renderer ()).ymax >
1008
+ cb .ax .spines ['outline' ].get_window_extent ().ymax )
You can’t perform that action at this time.
0 commit comments