Skip to content

Commit 045b08a

Browse files
committed
Use shortcut syntax for position
1 parent 5165727 commit 045b08a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pygmt/tests/test_legend.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,24 @@ def test_legend_width_height():
126126
fig = Figure()
127127
fig.basemap(projection="x1c", region=[0, 20, 0, 20], frame="g1")
128128
# Default width and height
129-
fig.legend(spec, position=Position("TL"), box=True)
129+
fig.legend(spec, position="TL", box=True)
130130

131131
# Width only
132-
fig.legend(spec, position=Position("TC"), width="6c", box=True)
132+
fig.legend(spec, position="TC", width="6c", box=True)
133133
# Width as percentage of plot width
134-
fig.legend(spec, position=Position("TR"), width="25%", box=True)
134+
fig.legend(spec, position="TR", width="25%", box=True)
135135

136136
# Height only, with automatic width
137-
fig.legend(spec, position=Position("ML"), height="4.5c", box=True)
137+
fig.legend(spec, position="ML", height="4.5c", box=True)
138138
# Height as percentage of legend width
139-
fig.legend(spec, position=Position("BL"), height="75%", box=True)
139+
fig.legend(spec, position="BL", height="75%", box=True)
140140

141141
# Both width and height
142-
fig.legend(spec, position=Position("MC"), width="6c", height="4.5c", box=True)
142+
fig.legend(spec, position="MC", width="6c", height="4.5c", box=True)
143143
# Height as percentage of legend width
144-
fig.legend(spec, position=Position("BC"), width="6c", height="75%", box=True)
144+
fig.legend(spec, position="BC", width="6c", height="75%", box=True)
145145
# Width as percentage of plot width and height as percentage of legend width
146-
fig.legend(spec, position=Position("BR"), width="25%", height="75%", box=True)
146+
fig.legend(spec, position="BR", width="25%", height="75%", box=True)
147147

148148
return fig
149149

0 commit comments

Comments
 (0)