Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to make sure the incols parameter works for pandas.DataFrame #1771

Merged
merged 1 commit into from
Feb 27, 2022
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_plot_dataframe_incols.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: bad6889287951b3c888032af6b1fa945
size: 7674
path: test_plot_dataframe_incols.png
15 changes: 15 additions & 0 deletions pygmt/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,18 @@ def test_plot_ogrgmt_file_multipoint_non_default_style():
style="c0.2c",
)
return fig


@pytest.mark.mpl_image_compare
def test_plot_dataframe_incols():
"""
Make sure that the incols parameter works for pandas.DataFrame.

See https://github.com/GenericMappingTools/pygmt/issues/1440.
"""
data = pd.DataFrame(data={"col1": [-0.5, 0, 0.5], "col2": [-0.75, 0, 0.75]})
fig = Figure()
fig.plot(
data=data, frame=True, region=[-1, 1, -1, 1], projection="X5c", incols=[1, 0]
)
return fig