Exemple #1
0
def test_shift_origin():
    "Test if fig.shift_origin works"
    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")
    return fig
Exemple #2
0
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 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