-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[BUG]: Shift box_aspect according to vertical_axis #28041
Changes from 9 commits
717e20e
df6dcb1
349975d
2db9d1a
2f71739
11d996f
373651f
3589da5
491395a
0080cd9
8833023
9f6354a
f904414
2f49d87
f7259e4
68b26df
57c7a65
1137dce
7405597
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2250,6 +2250,23 @@ def test_view_init_vertical_axis( | |
np.testing.assert_array_equal(tickdir_expected, tickdir_actual) | ||
|
||
|
||
@pytest.mark.parametrize("vertical_axis", ["x", "y", "z"]) | ||
def test_set_box_aspect_vertical_axis(vertical_axis: str) -> None: | ||
ax = plt.subplot(1, 1, 1, projection="3d") | ||
ax.view_init(elev=0, azim=0, roll=0, vertical_axis=vertical_axis) | ||
ax.figure.canvas.draw() | ||
|
||
aspect_old = tuple(ax._box_aspect) | ||
aspect_expected = np.roll( | ||
aspect_old, -1 * (ax._axis_names.index(vertical_axis) - 2) | ||
) | ||
|
||
ax.set_box_aspect(None) | ||
aspect_new = tuple(ax._box_aspect) | ||
|
||
np.testing.assert_allclose(aspect_expected, aspect_new) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this test have semantic meaning? I can't see by itself that I think there are two ways to make this better: Either
|
||
|
||
|
||
@image_comparison(baseline_images=['arc_pathpatch.png'], | ||
remove_text=True, | ||
style='mpl20') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming
sign
is purely technical but does not explain what it's doing.