Skip to content

Commit 7a1a06d

Browse files
authored
Figure.plot3d: Update parameter 'color' to 'fill' in test_plot3d.py (#2193)
1 parent 5055aad commit 7a1a06d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

pygmt/tests/test_plot3d.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_plot3d_red_circles_zscale(data, region):
4343
region=region,
4444
projection="X10c",
4545
style="c0.2c",
46-
color="red",
46+
fill="red",
4747
frame=["afg", "zafg"],
4848
)
4949
return fig
@@ -62,27 +62,27 @@ def test_plot3d_red_circles_zsize(data, region):
6262
region=region,
6363
projection="X10c",
6464
style="c0.2c",
65-
color="red",
65+
fill="red",
6666
frame=["afg", "zafg"],
6767
)
6868
return fig
6969

7070

7171
def test_plot3d_fail_1d_array_with_data(data, region):
7272
"""
73-
Should raise an exception if array color, size, intensity and transparency
73+
Should raise an exception if array fill, size, intensity and transparency
7474
are used with matrix.
7575
"""
7676
fig = Figure()
7777
kwargs = dict(data=data, region=region, projection="X10c", frame="afg")
7878
with pytest.raises(GMTInvalidInput):
79-
fig.plot3d(style="c0.2c", color=data[:, 2], **kwargs)
79+
fig.plot3d(style="c0.2c", fill=data[:, 2], **kwargs)
8080
with pytest.raises(GMTInvalidInput):
81-
fig.plot3d(style="cc", size=data[:, 2], color="red", **kwargs)
81+
fig.plot3d(style="cc", size=data[:, 2], fill="red", **kwargs)
8282
with pytest.raises(GMTInvalidInput):
83-
fig.plot3d(style="cc", intensity=data[:, 2], color="red", **kwargs)
83+
fig.plot3d(style="cc", intensity=data[:, 2], fill="red", **kwargs)
8484
with pytest.raises(GMTInvalidInput):
85-
fig.plot3d(style="cc", color="red", transparency=data[:, 2] * 100, **kwargs)
85+
fig.plot3d(style="cc", fill="red", transparency=data[:, 2] * 100, **kwargs)
8686

8787

8888
@pytest.mark.mpl_image_compare
@@ -100,7 +100,7 @@ def test_plot3d_projection(data, region):
100100
region=region,
101101
projection="R270/10c",
102102
style="s1c",
103-
color="green",
103+
fill="green",
104104
frame=["ag", "zag"],
105105
)
106106
return fig
@@ -109,7 +109,7 @@ def test_plot3d_projection(data, region):
109109
@pytest.mark.mpl_image_compare
110110
def test_plot3d_colors(data, region):
111111
"""
112-
Plot the data using z as colors.
112+
Plot the data using z as fills.
113113
"""
114114
fig = Figure()
115115
fig.plot3d(
@@ -118,7 +118,7 @@ def test_plot3d_colors(data, region):
118118
z=data[:, 2],
119119
zscale=5,
120120
perspective=[225, 30],
121-
color=data[:, 2],
121+
fill=data[:, 2],
122122
region=region,
123123
projection="X6c",
124124
style="c0.5c",
@@ -146,7 +146,7 @@ def test_plot3d_sizes(data, region):
146146
# Using inches instead of cm because of upstream bug at
147147
# https://github.com/GenericMappingTools/gmt/issues/4386
148148
style="ui",
149-
color="blue",
149+
fill="blue",
150150
frame=["af", "zaf"],
151151
)
152152
return fig
@@ -155,7 +155,7 @@ def test_plot3d_sizes(data, region):
155155
@pytest.mark.mpl_image_compare
156156
def test_plot3d_colors_sizes(data, region):
157157
"""
158-
Plot the data using z as sizes and colors.
158+
Plot the data using z as sizes and fills.
159159
"""
160160
fig = Figure()
161161
fig.plot3d(
@@ -164,7 +164,7 @@ def test_plot3d_colors_sizes(data, region):
164164
z=data[:, 2],
165165
zscale=5,
166166
perspective=[225, 30],
167-
color=data[:, 2],
167+
fill=data[:, 2],
168168
size=0.5 * data[:, 2],
169169
region=region,
170170
projection="X6c",
@@ -180,7 +180,7 @@ def test_plot3d_colors_sizes(data, region):
180180
@pytest.mark.mpl_image_compare
181181
def test_plot3d_colors_sizes_proj(data, region):
182182
"""
183-
Plot the data using z as sizes and colors with a projection.
183+
Plot the data using z as sizes and fills with a projection.
184184
"""
185185
fig = Figure()
186186
fig.plot3d(
@@ -192,7 +192,7 @@ def test_plot3d_colors_sizes_proj(data, region):
192192
region=region,
193193
projection="M20c",
194194
frame=["af", "zaf"],
195-
color=data[:, 2],
195+
fill=data[:, 2],
196196
size=data[:, 2],
197197
# Using inches instead of cm because of upstream bug at
198198
# https://github.com/GenericMappingTools/gmt/issues/4386
@@ -223,7 +223,7 @@ def test_plot3d_varying_intensity():
223223
perspective=[135, 30],
224224
frame=["Sltr", "xaf+lIntensity"],
225225
style="c0.5c",
226-
color="blue",
226+
fill="blue",
227227
intensity=intensity,
228228
)
229229
return fig
@@ -244,7 +244,7 @@ def test_plot3d_transparency():
244244
y=y,
245245
z=z,
246246
style="u0.2c",
247-
color="blue",
247+
fill="blue",
248248
region=[0, 10, 0, 10, 10, 90],
249249
projection="X10c",
250250
zscale=0.1,
@@ -270,7 +270,7 @@ def test_plot3d_varying_transparency():
270270
y=y,
271271
z=z,
272272
style="o0.2c+B5",
273-
color="blue",
273+
fill="blue",
274274
region=[0, 10, 0, 10, 10, 90],
275275
projection="X10c",
276276
zscale=0.1,
@@ -284,12 +284,12 @@ def test_plot3d_varying_transparency():
284284
@pytest.mark.mpl_image_compare
285285
def test_plot3d_sizes_colors_transparencies():
286286
"""
287-
Plot the data with varying sizes and colors using z as transparency.
287+
Plot the data with varying sizes and fills using z as transparency.
288288
"""
289289
x = np.arange(1.0, 10.0)
290290
y = np.arange(1.0, 10.0)
291291
z = np.arange(1, 10) * 10
292-
color = np.arange(1, 10) * 0.15
292+
fill = np.arange(1, 10) * 0.15
293293
size = np.arange(1, 10) * 0.2
294294
transparency = np.arange(1, 10) * 10
295295

@@ -304,7 +304,7 @@ def test_plot3d_sizes_colors_transparencies():
304304
perspective=[135, 30],
305305
frame=True,
306306
style="uc",
307-
color=color,
307+
fill=fill,
308308
size=size,
309309
cmap="gray",
310310
transparency=transparency,
@@ -314,8 +314,8 @@ def test_plot3d_sizes_colors_transparencies():
314314

315315
@pytest.mark.mpl_image_compare
316316
@pytest.mark.mpl_image_compare(filename="test_plot3d_matrix.png")
317-
@pytest.mark.parametrize("color", ["#aaaaaa", 170])
318-
def test_plot3d_matrix(data, region, color):
317+
@pytest.mark.parametrize("fill", ["#aaaaaa", 170])
318+
def test_plot3d_matrix(data, region, fill):
319319
"""
320320
Plot the data passing in a matrix and specifying incols.
321321
"""
@@ -327,7 +327,7 @@ def test_plot3d_matrix(data, region, color):
327327
region=region,
328328
projection="M20c",
329329
style="c1c",
330-
color=color,
330+
fill=fill,
331331
frame=["a", "za"],
332332
incols="0,1,2",
333333
)
@@ -367,7 +367,7 @@ def test_plot3d_from_file(region):
367367
region=region,
368368
projection="X20c",
369369
style="d1c",
370-
color="yellow",
370+
fill="yellow",
371371
frame=["af", "zaf"],
372372
incols=[0, 1, 2],
373373
)
@@ -396,7 +396,7 @@ def test_plot3d_vectors():
396396
region=[-2, 2, -2, 2, -2, 2],
397397
projection="X10c",
398398
style="V1c+e+n",
399-
color="black",
399+
fill="black",
400400
frame=["af", "zaf"],
401401
)
402402
return fig
@@ -415,11 +415,11 @@ def test_plot3d_scalar_xyz():
415415
perspective=[225, 30],
416416
)
417417
fig.plot3d(
418-
x=-1.5, y=1.5, z=-1.5, style="c1c", color="red", zscale=True, perspective=True
418+
x=-1.5, y=1.5, z=-1.5, style="c1c", fill="red", zscale=True, perspective=True
419419
)
420-
fig.plot3d(x=0, y=0, z=0, style="t1c", color="green", zscale=True, perspective=True)
420+
fig.plot3d(x=0, y=0, z=0, style="t1c", fill="green", zscale=True, perspective=True)
421421
fig.plot3d(
422-
x=1.5, y=-1.5, z=1.5, style="s1c", color="blue", zscale=True, perspective=True
422+
x=1.5, y=-1.5, z=1.5, style="s1c", fill="blue", zscale=True, perspective=True
423423
)
424424
return fig
425425

0 commit comments

Comments
 (0)