-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: correct linestyle example and reference rcParams #28971
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
See also `.Line2D.set_linestyle`. | ||
See also `.Line2D.set_linestyle`. The specific on off sequence of the | ||
"dotted", "dashed" and "dashdot" styles may be configured using | ||
``rcParams["lines.{style}_pattern"]``. |
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.
The f-string replacer here is a little mysterious - maybe add an example?
``rcParams["lines.{style}_pattern"]``. | |
``rcParams["lines.{style}_pattern"]``, eg. `rcParams["lines.dotted_pattern"] = (0, (1, 10))`. |
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.
What do you think about listing them all out with the :rc:
directive? I quite like that we can see the defaults for free, but not sure if it's just too much...
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.
sure, explicit is probably fine.
536cac4
to
368cb39
Compare
The names and original pattern values are taken over from TikZ in #7087. That somehow got lost in #12586. But I suggest that we keep these relations and possibly also mention that again. |
While you're here, can you shrink the figure width to under 7 inches? It is currently being scaled down to fit the page content width, which doesn't look good, and I don't see any reason it needs to be this wide specifically. Possibly add |
Pydata-sphinx-theme has a smaller main content width than our previous website layout. There may well be a number of figures that don't fit anymore. |
So I double checked on a wide image and the width is actually 896px, which at 100 dpi is just under 9 inches, so it shouldn't be too much different with constrained layout on. I also went through our sphinx gallery results, and we have 76 images over the limit. |
I think sometimes it's fine to shrink an image. Usually instead of shrinking all the fonts and linewidths. In this case I'm sure the figure could simply be smaller. |
@timhoffm AFAICS the patterns we currently have here still match #7087, but not what is given in that StackExchange answer. Edit: I found my local file, which seems to match the SE answer.
|
I find it somewhat confusing that the names under "named line styles" are repeated in the "parametrized linestyles " but have different patterns.Obviously, we cannot change the patterns for the matplotlib names. If they are different to the tikz patterns, we should clearly communicate that the above are Matplotlib named linestyles and that the pattern section are examples to reproduce the tikz linestyles. |
As I understand it, we specify our dash lengths in multiples of linewidth whereas Tikz specifies dash length in points (with only "dot" specified as linewidth). So we can only go so far to match the Tikz styles. We could put the Tikz numbers in and say these are "adapted from Tikz styles"? Edit: though we also have "long dash with offset" which was added more recently and has nothing to do with Tikz. |
If the repeated name is the issue, we could also just update the parametrized "dotted" to e.g. "medium dotted". |
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.
Ok, let's not overthink this. We can still improve later.
PR summary
Today I had reason to want to know exactly what the "dotted" pattern is and thought this example could have been more helpful. So I
rcParams
PR checklist