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
Changing the legend fontsize "hides" dotted lines in the legend #3171
Comments
You can fix it by using numpoints=1 as part of the legend call but this should not happen in the first place if you ask me. |
I don't see what is wrong. Please post code + images directly on github, the link to your notebook will rot making this report useless. |
Well, the URL encodes the unique ID of the gist, so this notebook with rot much like github could do. The plotting code:
One time with
and once with
Here are the pictures from the notebook. |
The difference is in the legend itself. The second example does somehow not show the full line, so "--" is kind of crippled towards "-." |
The way that the legend is drawn is it adds another The length of the handle is controlled by the rcparam
|
As written before, there are workarounds, though the question is whether matplotlib could do anything to prevent this from happening. |
I disagree that what I suggested is a 'workaround', in all cases the library is doing exactly what you are (implicitly through rcparams) telling it to do. That is, all of the code in behaving as-advertised so there is no bug. Currently the legend code does not make any attempt introspect the artists being used as handles to guess at what 'good' value are. |
Good point. Thank you for the detailed explanation. On Mon, Jun 30, 2014 at 3:00 PM, Thomas A Caswell notifications@github.com
|
I would like to note that even I have never notice the handlelength feature And no, just simply presenting the attributes in a table isn't On Mon, Jun 30, 2014 at 9:18 AM, Daniel Wehner notifications@github.com
|
Well yeah as a user of matplotlib I love how simple things can be done really easy but it is kind of sad how many details you have to know to get done slightly more complex things. |
I wanted to point out, that when using
|
@pmreyes2 Are you talking about the thickness of the lines? If so, does the following (running against matplotlib 2.0rc2) look better? |
@dopplershift In your plot I still see different size of lines (in thickness and in dash spacing) I would prefer if the lines in the legend match the lines in the plot as it does when using |
this is probably fall out from making the dash pattern scale with line width and the LineCollection legend handler pulling linestyle instead of dash pattern. @pmreyes2 You are definitely hitting a different issue that the OP, can you please open a new issue? |
@tacaswell I've just created a new issue: #7814 |
When you change the fontsize of legends using matplotlib.rcParams['legend.fontsize'] you get some kind of crippled result bag. The line in the legend is not shown 100%
http://nbviewer.ipython.org/76ad2a8053ef0b01a7bd
It seems to be that the font properties are somehow applied to the line itself.
The text was updated successfully, but these errors were encountered: