-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Legend default style change: smaller, no border #6424
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
Conversation
The test failure is unrelated. In /Users/efiring/work/programs/py/mpl/tests/result_images/test_axes_grid1/ there has been a change in the size of the test figure that apparently hasn't been propagated. |
#legend.loc : best | ||
#legend.isaxes : True |
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 not a thing anymore?
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.
Correct. I don't know how long it has been gone, but it is inactive, and marked as such in rcsetup. It would make no sense for it to be an rcParam; it is entirely internal to legend. It is a flag to tell whether it is a figure legend or an axes legend.
Probably the validator for it should emit a warning.
Can you post an example image? |
Another question about legend defaults: presently scatterpoints is 3 and numpoints is 1. Is there any good reason why scatterpoints should not also be 1? |
If the size varies then multiple sized markers are shown in the scatter legend, but there is no scale on it so it is not super helpful. I am 👍 on making scatter points also default to 1 |
I think this change is an improvement. The large font size in the legend is overkill and the legend border isn't needed. Only question, what does this look like when the legend box starts to sit on top of data? |
# the relative size of legend markers vs. original | ||
'legend.markerscale': [1.0, validate_float], | ||
'legend.shadow': [False, validate_bool], | ||
# whether or not to draw a frame around legend | ||
'legend.frameon': [True, validate_bool], | ||
'legend.frameon': [False, validate_bool], |
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.
maybe leave this true and change legend.edgecolor
to 'w' (or 'inherit')?
I definitely prefer having 1 marker in the legend. |
Nice! I like using alpha for this and wouldn't worry about PS not On Tue, May 17, 2016 at 12:15 PM, Eric Firing [email protected]
Brian E. Granger |
Definitely 👍 on the font size change. I'm a little more iffy on dropping the frame, but agree it fits with "less junk by default"; given that, I think the translucent box is a good approach. |
+1 for a smaller legend font. I always end up doing it for publication plots. Removing the border is fine (alternative I've used often : a light gray border instead of black). Alpha 0.8 looks great. |
@@ -861,7 +861,7 @@ def matplotlib_fname(): | |||
_deprecated_ignore_map = { | |||
} | |||
|
|||
_obsolete_set = set(['tk.pythoninspect', ]) | |||
_obsolete_set = set(['tk.pythoninspect', 'legend.isaxes']) |
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.
We don't need 2.6 support, right? You could use a set literal here.
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.
Correct.
I actually find it a bit strange looking that the proposed legend fontsize is so much smaller than the tick labels, axis labels, and title. I think I would prefer to change the default legend fontsize to medium rather than small, or alternatively I would prefer to change the default fontsize of all the text objects to one size smaller, with my absolute preference being the latter option. |
Yes, I like the 10pt font. |
Actually, I kinda like that last one On Fri, May 20, 2016 at 2:19 PM, Eric Firing [email protected]
|
Worms swarm out of the can... Selecting default font size, figure size, and dpi is difficult because so much depends on how the resulting plot will be displayed and used, and on what sort of content it will have. There are questions of proportion, and of absolute size. Will the figure be displayed via projector in a presentation? If so, will it occupy the whole slide, or will it be scaled down? Will it go in a tech report, typically formatted in single-column mode, where space is not at a premium? Or is the target a publication, with text in two columns and every figure shrunken to near-invisibility? Maybe what we really need here is to have the full set of defaults tuned for the 12 pt case (probably with legend-medium, not small) and then a style that provides the corresponding set of size-related parameters all tuned for the 10 pt case. |
👍 to a 12pt and 10pt tuned styles so long as it does not take too much extra work. |
The first step is just getting one of the two working. We are closest to the 12-pt version in our present defaults, but it still needs tweaking because of side effects of the outward ticks. |
I am going to merge this as-is. It is clearly an improvement, looks decent (modulo the axes size issues which is being addressed else where). |
Addresses #5269
This is just a proposal; it changes the default font size from large to small, and removes the boundary. I think that having a smaller font for the legend is a good default, particularly in conjunction with removal of the boundary, because it helps it stand out. Regardless of the boundary, the motivation for the small font is to keep the legend from being too large and obtrusive. I could be convinced to change the font size to medium, but the original default of large made no sense at all.