Skip to content

Commit c306352

Browse files
authored
Add a test to make sure the incols parameter works for pandas.DataFrame (#1771)
1 parent ab23aa8 commit c306352

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
outs:
2+
- md5: bad6889287951b3c888032af6b1fa945
3+
size: 7674
4+
path: test_plot_dataframe_incols.png

pygmt/tests/test_plot.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,18 @@ def test_plot_ogrgmt_file_multipoint_non_default_style():
540540
style="c0.2c",
541541
)
542542
return fig
543+
544+
545+
@pytest.mark.mpl_image_compare
546+
def test_plot_dataframe_incols():
547+
"""
548+
Make sure that the incols parameter works for pandas.DataFrame.
549+
550+
See https://github.com/GenericMappingTools/pygmt/issues/1440.
551+
"""
552+
data = pd.DataFrame(data={"col1": [-0.5, 0, 0.5], "col2": [-0.75, 0, 0.75]})
553+
fig = Figure()
554+
fig.plot(
555+
data=data, frame=True, region=[-1, 1, -1, 1], projection="X5c", incols=[1, 0]
556+
)
557+
return fig

0 commit comments

Comments
 (0)