Set facecolor of FilledArrow axisline style and fix tight layout#24085
Merged
Conversation
bdcafbc to
0d5f40a
Compare
QuLogic
reviewed
Oct 4, 2022
9140a3d to
e06bfc6
Compare
e06bfc6 to
ec114ab
Compare
ec114ab to
fe7c9ed
Compare
36c0201 to
2c59421
Compare
ksunden
reviewed
Dec 2, 2022
2c59421 to
8744b18
Compare
Member
|
Something seems very wrong with the subplotzero test image as the Axiss appear doubled? |
Member
Author
|
That is the exact code (and result) of #7617. Although strange, I wasn't sure how to modify it to make sure that the issue was tested exactly as it should be. |
Member
|
Oh, 🐑 I'm apparently deeply confused about what it "should" do. |
Contributor
|
If you want to test for #7617 (that y axis label is incorrectly set), below is the minimum I can think of and that also looks okay. import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import SubplotZero
fig = plt.figure()
ax = fig.add_subplot(111, axes_class=SubplotZero)
ax.set(xlim=(-3, 7), ylim=(-3, 7), xlabel="x", ylabel="y")
zero_axis = ax.axis["xzero", "yzero"]
zero_axis.set_visible(True) # they are hidden by defaultwhich should give you below. I would add ax.axis["left", "right", "bottom", "top"].set_visible(False)
zero_axis.set_axisline_style("->")
zero_axis.major_ticks.set_tickdir("inout")which will give |
8744b18 to
f55f98a
Compare
Member
Author
|
Thank you very much! I've updated the test (dropped set_tickdir as that gave an error |
f55f98a to
164a28c
Compare
164a28c to
5d163cd
Compare
Co-authored-by: Jae-Joon Lee <[email protected]>
tacaswell
approved these changes
Dec 15, 2022
ksunden
approved these changes
Jan 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


PR Summary
Original purpose was to test axisline style, but as part of that:
Add support for providing
facecolorto aFilledArrow, defaulting to the same color as the axes edgecolor.Make tight (and other) layouts work for axislines by fixing get_window_extents, thanks to @leejjoon
Closes #7617 (fixed elsewhere, but adding test here).
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).