@@ -110,15 +110,15 @@ def test_plot3d_fail_no_data(data, region):
110
110
111
111
def test_plot3d_fail_color_size_intensity (data , region ):
112
112
"""
113
- Should raise an exception if array color, sizes and intensity are used with
113
+ Should raise an exception if array color, size and intensity are used with
114
114
matrix.
115
115
"""
116
116
fig = Figure ()
117
117
kwargs = dict (data = data , region = region , projection = "X10c" , frame = "afg" )
118
118
with pytest .raises (GMTInvalidInput ):
119
119
fig .plot3d (style = "c0.2c" , color = data [:, 2 ], ** kwargs )
120
120
with pytest .raises (GMTInvalidInput ):
121
- fig .plot3d (style = "cc" , sizes = data [:, 2 ], color = "red" , ** kwargs )
121
+ fig .plot3d (style = "cc" , size = data [:, 2 ], color = "red" , ** kwargs )
122
122
with pytest .raises (GMTInvalidInput ):
123
123
fig .plot3d (style = "cc" , intensity = data [:, 2 ], color = "red" , ** kwargs )
124
124
@@ -178,7 +178,7 @@ def test_plot3d_sizes(data, region):
178
178
z = data [:, 2 ],
179
179
zscale = 5 ,
180
180
perspective = [225 , 30 ],
181
- sizes = 0.5 * data [:, 2 ],
181
+ size = 0.5 * data [:, 2 ],
182
182
region = region ,
183
183
projection = "X10c" ,
184
184
# Using inches instead of cm because of upstream bug at
@@ -203,7 +203,7 @@ def test_plot3d_colors_sizes(data, region):
203
203
zscale = 5 ,
204
204
perspective = [225 , 30 ],
205
205
color = data [:, 2 ],
206
- sizes = 0.5 * data [:, 2 ],
206
+ size = 0.5 * data [:, 2 ],
207
207
region = region ,
208
208
projection = "X6c" ,
209
209
# Using inches instead of cm because of upstream bug at
@@ -231,7 +231,7 @@ def test_plot3d_colors_sizes_proj(data, region):
231
231
projection = "M20c" ,
232
232
frame = ["af" , "zaf" ],
233
233
color = data [:, 2 ],
234
- sizes = data [:, 2 ],
234
+ size = data [:, 2 ],
235
235
# Using inches instead of cm because of upstream bug at
236
236
# https://github.com/GenericMappingTools/gmt/issues/4386
237
237
style = "ui" ,
@@ -343,7 +343,7 @@ def test_plot3d_sizes_colors_transparencies():
343
343
frame = True ,
344
344
style = "uc" ,
345
345
color = color ,
346
- sizes = size ,
346
+ size = size ,
347
347
cmap = "gray" ,
348
348
transparency = transparency ,
349
349
)
@@ -458,3 +458,30 @@ def test_plot3d_scalar_xyz():
458
458
x = 1.5 , y = - 1.5 , z = 1.5 , style = "s1c" , color = "blue" , zscale = True , perspective = True
459
459
)
460
460
return fig
461
+
462
+
463
+ @pytest .mark .mpl_image_compare (filename = "test_plot3d_sizes.png" )
464
+ def test_plot3d_deprecate_sizes_to_size (data , region ):
465
+ """
466
+ Make sure that the old parameter "sizes" is supported and it reports an
467
+ warning.
468
+
469
+ Modified from the test_plot3d_sizes() test.
470
+ """
471
+ fig = Figure ()
472
+ with pytest .warns (expected_warning = FutureWarning ) as record :
473
+ fig .plot3d (
474
+ x = data [:, 0 ],
475
+ y = data [:, 1 ],
476
+ z = data [:, 2 ],
477
+ zscale = 5 ,
478
+ perspective = [225 , 30 ],
479
+ sizes = 0.5 * data [:, 2 ],
480
+ region = region ,
481
+ projection = "X10c" ,
482
+ style = "ui" ,
483
+ color = "blue" ,
484
+ frame = ["af" , "zaf" ],
485
+ )
486
+ assert len (record ) == 1 # check that only one warning was raised
487
+ return fig
0 commit comments