Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pygmt/tests/baseline/test_figure_shift_origin.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: 07df92baab0051531f6c8023f4108332
size: 9876
path: test_figure_shift_origin.png
Binary file removed pygmt/tests/baseline/test_shift_origin.png
Binary file not shown.
21 changes: 11 additions & 10 deletions pygmt/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,22 @@ def test_figure_show():


@pytest.mark.mpl_image_compare
def test_shift_origin():
def test_figure_shift_origin():
"""
Test if fig.shift_origin works.
"""
kwargs = dict(region=[0, 3, 0, 5], projection="X3c/5c", frame=0)
fig = Figure()
# First call shift_origin without projection and region.
# Test the issue https://github.com/GenericMappingTools/pygmt/issues/514
fig.shift_origin(xshift="2i", yshift="3i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(xshift="4i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(yshift="6i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(xshift="-4i", yshift="6i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
# Test issue https://github.com/GenericMappingTools/pygmt/issues/514
fig.shift_origin(xshift="2c", yshift="3c")
fig.basemap(**kwargs)
fig.shift_origin(xshift="4c")
fig.basemap(**kwargs)
fig.shift_origin(yshift="6c")
fig.basemap(**kwargs)
fig.shift_origin(xshift="-4c", yshift="6c")
fig.basemap(**kwargs)
return fig


Expand Down