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 74023b1 commit c2dc353Copy full SHA for c2dc353
1 file changed
lib/matplotlib/tests/test_offsetbox.py
@@ -82,5 +82,27 @@ def test_offsetbox_clip_children():
82
da.clip_children = True
83
assert_true(fig.stale)
84
85
+
86
+@cleanup
87
+def test_offsetbox_loc_codes():
88
+ # Check that valid string location codes all work with an AnchoredOffsetbox
89
+ codes = {'upper right': 1,
90
+ 'upper left': 2,
91
+ 'lower left': 3,
92
+ 'lower right': 4,
93
+ 'right': 5,
94
+ 'center left': 6,
95
+ 'center right': 7,
96
+ 'lower center': 8,
97
+ 'upper center': 9,
98
+ 'center': 10,
99
+ }
100
+ fig, ax = plt.subplots()
101
+ da = DrawingArea(100, 100)
102
+ for code in codes:
103
+ anchored_box = AnchoredOffsetbox(loc=code, child=da)
104
+ ax.add_artist(anchored_box)
105
+ fig.canvas.draw()
106
107
if __name__ == '__main__':
108
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
0 commit comments