Exemplo n.º 1
0
def test_velo_without_spec(dataframe):
    """
    Check that velo fails when the spec parameter is not given.
    """
    fig = Figure()
    with pytest.raises(GMTInvalidInput):
        fig.velo(data=dataframe)
Exemplo n.º 2
0
def test_velo_numpy_array_text_column(dataframe):
    """
    Check that velo fails when plotting a numpy.ndarray with a text column.
    """
    fig = Figure()
    with pytest.raises(GMTInvalidInput):
        fig.velo(
            data=dataframe.to_numpy(),
            spec="e0.2/0.39/18",
            vector="0.3c+p1p+e+gred",
        )
Exemplo n.º 3
0
def test_velo_numpy_array_numeric_only(dataframe):
    """
    Plot velocity arrow and confidence ellipse from a numpy.ndarray.
    """
    fig = Figure()
    fig.velo(
        data=dataframe.iloc[:, :-1].to_numpy(),
        spec="e0.2/0.39/18",
        vector="0.3c+p1p+e+gred",
        frame="1g1",
    )
    return fig
Exemplo n.º 4
0
def test_velo_pandas_dataframe(dataframe):
    """
    Plot velocity arrow and confidence ellipse from a pandas.DataFrame.
    """
    fig = Figure()
    fig.velo(
        data=dataframe,
        spec="e0.2/0.39/18",
        vector="0.3c+p1p+e+gred",
        frame=["WSne", "2g2f"],
        region=[-10, 8, -10, 6],
        projection="x0.8c",
        pen="0.6p,red",
        uncertaintycolor="lightblue1",
        line=True,
    )
    return fig