Skip to content

Commit 9adf272

Browse files
committed
Add a test for array-like intensity
1 parent 3503319 commit 9adf272

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

pygmt/tests/test_plot.py

+36
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,42 @@ def test_plot_colors_sizes_proj(data, region):
231231
return fig
232232

233233

234+
@check_figures_equal()
235+
def test_plot_varying_intensity():
236+
"""
237+
Plot the data with array-like intensity.
238+
"""
239+
x = np.arange(1, 10)
240+
y = np.arange(1, 10)
241+
intensity = np.linspace(-1, 1, len(x))
242+
243+
fig_ref, fig_test = Figure(), Figure()
244+
# Use single-character arguments for the reference image
245+
with GMTTempFile() as tmpfile:
246+
np.savetxt(tmpfile.name, np.c_[x, y, intensity], fmt="%s")
247+
fig_ref.plot(
248+
data=tmpfile.name,
249+
R="0/10/0/10",
250+
J="X4i",
251+
B="",
252+
S="c0.2c",
253+
G="blue",
254+
I="",
255+
)
256+
257+
fig_test.plot(
258+
x=x,
259+
y=y,
260+
region=[0, 10, 0, 10],
261+
projection="X4i",
262+
frame=True,
263+
style="c0.2c",
264+
color="blue",
265+
intensity=intensity,
266+
)
267+
return fig_ref, fig_test
268+
269+
234270
@check_figures_equal()
235271
def test_plot_transparency():
236272
"""

0 commit comments

Comments
 (0)