diff --git a/pygmt/tests/baseline/test_legend_entries.png b/pygmt/tests/baseline/test_legend_entries.png deleted file mode 100644 index 0ac7e1928c9..00000000000 Binary files a/pygmt/tests/baseline/test_legend_entries.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_legend_entries.png.dvc b/pygmt/tests/baseline/test_legend_entries.png.dvc new file mode 100644 index 00000000000..8d1ed261703 --- /dev/null +++ b/pygmt/tests/baseline/test_legend_entries.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: 4d1ed417fd2625d0b2fa5c17dafd32fd + size: 73728 + path: test_legend_entries.png diff --git a/pygmt/tests/test_legend.py b/pygmt/tests/test_legend.py index 60479814b0d..8e269b62382 100644 --- a/pygmt/tests/test_legend.py +++ b/pygmt/tests/test_legend.py @@ -5,7 +5,6 @@ from pygmt import Figure from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import GMTTempFile -from pygmt.helpers.testing import check_figures_equal @pytest.mark.mpl_image_compare @@ -44,42 +43,25 @@ def test_legend_default_position(): return fig -@check_figures_equal() +@pytest.mark.mpl_image_compare def test_legend_entries(): """ Test different marker types/shapes. """ - fig_ref, fig_test = Figure(), Figure() - - # Use single-character arguments for the reference image - fig_ref = Figure() - fig_ref.basemap(J="x1i", R="0/7/3/7", B="") - fig_ref.plot( - data="@Table_5_11.txt", - S="c0.15i", - G="lightgreen", - W="faint", - l="Apples", - ) - fig_ref.plot(data="@Table_5_11.txt", W="1.5p,gray", l='"My lines"') - fig_ref.plot(data="@Table_5_11.txt", S="t0.15i", G="orange", l="Oranges") - fig_ref.legend(D="JTR+jTR") - - fig_test.basemap(projection="x1i", region=[0, 7, 3, 7], frame=True) - fig_test.plot( + fig = Figure() + fig.basemap(projection="x1i", region=[0, 7, 3, 7], frame=True) + fig.plot( data="@Table_5_11.txt", style="c0.15i", color="lightgreen", pen="faint", label="Apples", ) - fig_test.plot(data="@Table_5_11.txt", pen="1.5p,gray", label='"My lines"') - fig_test.plot( - data="@Table_5_11.txt", style="t0.15i", color="orange", label="Oranges" - ) - fig_test.legend(position="JTR+jTR") + fig.plot(data="@Table_5_11.txt", pen="1.5p,gray", label='"My lines"') + fig.plot(data="@Table_5_11.txt", style="t0.15i", color="orange", label="Oranges") + fig.legend(position="JTR+jTR") - return fig_ref, fig_test + return fig @pytest.mark.mpl_image_compare