Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Align titles #22376#25591

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
d1067a6
Used previous pull request and now trying to figure out why savefigur…
AlextheGreat1509Mar 28, 2023
e84960d
Fixed bbox issue not being updated when title position is changed.
SirSkillfulMar 30, 2023
d6d5d7f
Renamed align_titles to avoid confusion with the axis labels. Also re…
SirSkillfulMar 30, 2023
065d992
Added tests from original pull request to test our solution
AlextheGreat1509Mar 30, 2023
7f5220a
Changed test to try different way of accessing savefig function as cu…
AlextheGreat1509Mar 30, 2023
838ace3
Updated code comments
AlextheGreat1509Mar 31, 2023
9decc20
Refactoring of align_titles function
SirSkillfulMar 31, 2023
e8042f8
Merge branch 'matplotlib:main' into align_titles
AlextheGreat1509Mar 31, 2023
52164fa
Fixed flake8 issues
AlextheGreat1509Mar 31, 2023
b44fb00
Fixed flake8 issues
AlextheGreat1509Mar 31, 2023
3741239
Fixed flake8 formating issues
SirSkillfulMar 31, 2023
4eb53e6
Changed fix for savefig
SirSkillfulApr 3, 2023
938d9e5
Merge remote-tracking branch 'origin/align_titles' into align_titles
AlextheGreat1509Apr 6, 2023
1fe094a
Changed tests to use new styling standard. Titles now align as expect…
AlextheGreat1509Apr 6, 2023
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
PrevPrevious commit
NextNext commit
Fixed flake8 issues
  • Loading branch information
@AlextheGreat1509
AlextheGreat1509 committedMar 31, 2023
commit52164fa86337048e08bc0337f1121a1285d6b30c
3 changes: 2 additions & 1 deletionlib/matplotlib/figure.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,7 +186,8 @@ def __init__(self, **kwargs):
# groupers to keep track of x, y and title labels we want to align.
# see self.align_xlabels, self.align_ylabels, self.align_titles and
# axis._get_tick_boxes_siblings
self._align_label_groups = {"x": cbook.Grouper(), "y": cbook.Grouper(), "title": cbook.Grouper()}
self._align_label_groups = {"x": cbook.Grouper(), "y": cbook.Grouper()
, "title": cbook.Grouper()}

self.figure = self
self._localaxes = [] # track all axes
Expand Down
5 changes: 4 additions & 1 deletionlib/matplotlib/tests/test_figure.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ def test_align_labels_stray_axes():
np.testing.assert_allclose(xn[:2], xn[2:])
np.testing.assert_allclose(yn[::2], yn[1::2])


## TODO add image comparison
def test_align_titles():
fig, axs = plt.subplots(2, 2,
Expand All@@ -115,7 +116,9 @@ def test_align_titles():
axs[0][1].set_title('Title2', loc="left")
fig.align_titles()
fig.savefig("./result_images/test_figure/figure_align_titles")
compare_images("./lib/matplotlib/tests/baseline_images/figure_align_titles.png", "./result_images/test_figure/figure_align_titles.png", 0)
compare_images("./lib/matplotlib/tests/baseline_images/figure_align_titles.png",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think we need to not use relative paths for this test

"./result_images/test_figure/figure_align_titles.png", 0)


## TODO add image comparison
@image_comparison(['figure_align_titles_param'], extensions=['png', 'svg'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The test failures that are directly related to this PR are due to the baseline images for this image comparison not being added to the repo

If it is passing locally, those two files (png, svg) should be added in thebaseline_images folder

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp