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

Add ability to toggle legend in the figure options dialog box#30128

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

Open
ritvi-alagusankar wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromritvi-alagusankar:add-ability-legend-toggle-figure-options
Open
Changes fromall commits
Commits
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
6 changes: 6 additions & 0 deletionslib/matplotlib/backends/qt_editor/figureoptions.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,7 @@
)
for name, axis in axis_map.items()
]),
('Legend visible', axes.legend_ is not None),
('(Re-)Generate automatic legend', False),
]

Expand DownExpand Up@@ -196,6 +197,7 @@
title = general.pop(0)
axes.set_title(title)
generate_legend = general.pop()
legend_visible = general.pop()

Check warning on line 200 in lib/matplotlib/backends/qt_editor/figureoptions.py

View check run for this annotation

Codecov/ codecov/patch

lib/matplotlib/backends/qt_editor/figureoptions.py#L200

Added line #L200 was not covered by tests

for i, (name, axis) in enumerate(axis_map.items()):
axis_min = general[4*i]
Expand DownExpand Up@@ -256,6 +258,10 @@
if new_legend:
new_legend.set_draggable(draggable)

# toggle legend visibility
if axes.legend_ is not None:
axes.legend_.set_visible(legend_visible)

Check warning on line 263 in lib/matplotlib/backends/qt_editor/figureoptions.py

View check run for this annotation

Codecov/ codecov/patch

lib/matplotlib/backends/qt_editor/figureoptions.py#L263

Added line #L263 was not covered by tests

# Redraw
figure = axes.get_figure()
figure.canvas.draw()
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp