Skip to content

Commit

Permalink
TST: add test for colorbar orientation in multi-panel plot
Browse files Browse the repository at this point in the history
  • Loading branch information
xshaokun committed Sep 7, 2024
1 parent c47732d commit 28443c2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions yt/visualization/tests/test_image_comp_2D_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ def test_particleprojectionplot_set_colorbar_properties():
return p.plots[field].figure


@pytest.mark.skipif(
mpl.__version_info__ < (3, 7),
reason="colorbar cannot currently be set horizontal in multi-panel plot with matplotlib newer than 3.7.0",
)
@pytest.mark.parametrize("cbar_location", ["top", "bottom", "left", "right"])
@pytest.mark.mpl_image_compare
def test_multipanelplot_colorbar_orientation(cbar_location):
ds = fake_random_ds(16)
fields = [
("gas", "density"),
("gas", "velocity_x"),
("gas", "velocity_y"),
("gas", "velocity_magnitude"),
]
p = SlicePlot(ds, "z", fields)
return p.export_to_mpl_figure((2, 2), cbar_location=cbar_location)


class TestProfilePlot:
@classmethod
def setup_class(cls):
Expand Down

0 comments on commit 28443c2

Please sign in to comment.