99from pygmt import Figure
1010from pygmt .exceptions import GMTInvalidInput , GMTTypeError
1111from pygmt .helpers import GMTTempFile
12- from pygmt .params import Position
1312
1413
1514@pytest .fixture (scope = "module" , name = "legend_spec" )
@@ -74,7 +73,7 @@ def test_legend_entries():
7473 )
7574 fig .plot (data = "@Table_5_11.txt" , pen = "1.5p,gray" , label = "My lines" )
7675 fig .plot (data = "@Table_5_11.txt" , style = "t0.15i" , fill = "orange" , label = "Oranges" )
77- fig .legend (position = Position ( "TR" , cstype = "outside" , anchor = "TR" ) )
76+ fig .legend (position = "TR" )
7877 return fig
7978
8079
@@ -87,11 +86,7 @@ def test_legend_specfile(legend_spec):
8786 Path (specfile .name ).write_text (legend_spec , encoding = "utf-8" )
8887 fig = Figure ()
8988 fig .basemap (projection = "x6i" , region = [0 , 1 , 0 , 1 ], frame = True )
90- fig .legend (
91- specfile .name ,
92- position = Position ("MC" , cstype = "outside" , anchor = "MC" ),
93- width = "5i" ,
94- )
89+ fig .legend (specfile .name , position = "MC" , width = "5i" )
9590 return fig
9691
9792
@@ -103,7 +98,7 @@ def test_legend_stringio(legend_spec):
10398 spec = io .StringIO (legend_spec )
10499 fig = Figure ()
105100 fig .basemap (projection = "x6i" , region = [0 , 1 , 0 , 1 ], frame = True )
106- fig .legend (spec , position = Position ( "MC" , cstype = "outside" , anchor = "MC" ) , width = "5i" )
101+ fig .legend (spec , position = "MC" , width = "5i" )
107102 return fig
108103
109104
@@ -180,8 +175,8 @@ def test_legend_position_mixed_syntax(legend_spec):
180175 fig = Figure ()
181176 fig .basemap (projection = "x6i" , region = [0 , 1 , 0 , 1 ], frame = True )
182177 with pytest .raises (GMTInvalidInput ):
183- fig .legend (spec , position = "JMC " , width = "5i" )
178+ fig .legend (spec , position = "jTL " , width = "5i" )
184179 with pytest .raises (GMTInvalidInput ):
185- fig .legend (spec , position = "JMC " , height = "5i" )
180+ fig .legend (spec , position = "jTL " , height = "5i" )
186181 with pytest .raises (GMTInvalidInput ):
187- fig .legend (spec , position = "JMC " , line_spacing = 2.0 )
182+ fig .legend (spec , position = "jTL " , line_spacing = 2.0 )
0 commit comments