-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: add title_fontsize to legend #10715
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
ENH: add title_fontsize to legend #10715
Conversation
3f551ea
to
08dc4f4
Compare
08dc4f4
to
25bce55
Compare
9faa09d
to
4ca96a4
Compare
@@ -471,6 +471,7 @@ def test_if_rctemplate_would_be_valid(tmpdir): | |||
with open(fname, "w") as f: | |||
f.writelines(newlines) | |||
with pytest.warns(None) as record: | |||
print(fname) |
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.
Is this print intended?
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.
Nope, thanks for catching that.
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.
conditionally on CI
0a1bece
to
f1dfcc0
Compare
f1dfcc0
to
3d810eb
Compare
Rebased... |
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.
Anyone can dismiss this once handled.
lib/matplotlib/legend.py
Outdated
# figure out title fontsize: | ||
if title_fontsize is None: | ||
title_fontsize = rcParams['legend.title_fontsize'] | ||
print(self.prop) |
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.
remove that print
3d810eb
to
f84982d
Compare
Frankly I'm not particularly keen on the rcparam (then we'll get title.fontstyle, title.fontfamily, etc?) and would rather have one pass in a fontproperties (see also #10249 for my thoughts on that matter), but I accept that practicality purity etc :-) |
31e1d88
to
03742ea
Compare
I could be easily convinced to leave the rcparam out. I never set anything via rcparam as I think it kills reproducibility. |
03742ea
to
156131c
Compare
Let's leave the rcparam out then for now at least.
0c39ad6
to
fcdf8c3
Compare
Are there any plans to make a |
PR Summary
closes #8699
In master, a legend will have the fontsize of the title, set by the default axes fontsize, and will ignore the
fontsize
kwarg for legend:Here we implement the
title_fontsize
kwarg:and the
:rc:legend.title_fontsize
rcParam:PR Checklist