Skip to content

[Doc] link style sheets reference to customization tutorial #26195

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

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

pierre-haessig
Copy link
Contributor

PR summary

While sharing the Style sheets reference gallery page to a colleague, I realized it's not self-contained in the sense that it doesn't explain how to use style sheets nor does it link to the corresponding Customizing Matplotlib with style sheets tutorial.

In this small expansion of the top docstring of style_sheets_reference.py, I added:

  • a short repl code example for plt.style.use and a mention to matplotlib.style.available (which is used in the script, but it's quite buried)
  • a link to the Customizing Matplotlib tutotorial (to the subsection on style sheet usage)

PR checklist

However, since I don't have a proper devel setup, I unfortunately didn't check that the Sphinx compilation runs fine. Hopefully my change is small enough that I didn't introduce a syntax error, but it's far from sure...

@pierre-haessig
Copy link
Contributor Author

As for the linting error with flake8, I don't know how to cut a long line which contains a reference:

See more details in :ref:`Customizing Matplotlib using style sheets<customizing-with-style-sheets>`.

in the list `matplotlib.style.available`
(they are also printed in the corner of each plot below).

See more details in :ref:`Customizing Matplotlib using style sheets<customizing-with-style-sheets>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See more details in :ref:`Customizing Matplotlib using style sheets<customizing-with-style-sheets>`.
See more details in
:ref:`Customizing Matplotlib using style sheets<customizing-with-style-sheets>`.

should work (in the sense that there will not be a line break there in the rendered page).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can break anywhere in the backticks, so just break normally on spaces.

@pierre-haessig
Copy link
Contributor Author

pierre-haessig commented Jun 28, 2023

Thanks for the feedback. I've cut in the backticks. Let's see what flake8 think of it...
[edit]: flake8 is happy!

@pierre-haessig
Copy link
Contributor Author

@pierre-haessig
Copy link
Contributor Author

The built doc looks correct: https://output.circle-artifacts.com/output/job/93ee1604-39b1-4990-b7d7-1c41df1111f5/artifacts/0/doc/build/html/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py

and the link to matplotlib.style.available while the matplotlib.style doc page is also fine (no missing matplotlib.style prefix in the text)

@pierre-haessig
Copy link
Contributor Author

Are there some remaining changes (like rebasing?) that I need to do for having this PR ready to merge?

@ksunden ksunden added this to the v3.7-doc milestone Jul 12, 2023
@ksunden ksunden merged commit 02d2e13 into matplotlib:main Jul 12, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 12, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 12, 2023
rcomer added a commit that referenced this pull request Jul 12, 2023
…195-on-v3.7.2-doc

Backport PR #26195 on branch v3.7.2-doc ([Doc] link style sheets reference to customization tutorial)
rcomer added a commit that referenced this pull request Jul 12, 2023
…195-on-v3.7.x

Backport PR #26195 on branch v3.7.x ([Doc] link style sheets reference to customization tutorial)
@pierre-haessig
Copy link
Contributor Author

Thanks for the merge @ksunden!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants