Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC: rename Usage Guide to Basic Usage and update#21641

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:mainfromjklymak:doc-basic-usage
Nov 27, 2021

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedNov 15, 2021
edited
Loading

PR Summary

Renames Usage Guide tutorial to Basic Usage (tutorials/introductory/usage.py). This addsextensively to this guide to provide a short overview of how to use Matplotlib, with links to other tutorials or examples where appropriate or necessary. This is meant to be on par with the pyplot tutorial, but doesn't follow it slavishly.

History

This page used to have a bunch of explanatory material. A lot of this was moved in#21335 to/docs/users leaving this page quite thin. There is already the pyplot tutorial, and the "lifecycle of a plot" tutorial, but the pyplot tutorial is not the style we'd prefer people to use, and "lifecycle" goes deep in a couple of directions. (Actually, I'd like to remove that tutorial as well, or make it more "scientific" by not just making a bar plot of all things, but that is lower priority)

Goal

Not completeness, but enough ideas of what the library can do to point users to more complete resources.

Use default styles wherever possible. Only exception are the figure sizes, which are usually unsuitable for a website tutorial (in my opinion).

If there is a majorpart of the library forbasic usage, feel free to comment.

Outline:

Basic usage

  • plot
  • anatomy
  • Note on coding styles
  • styling artists
    • colors
    • linestyles
    • markerstyles
  • labelling plots
    • xlabel, ylabel and title
    • axis: ticks and ticklabels (locators and formatters)
      • units: categorical and dates
    • text
    • annotations
    • legends
  • colormapping data
    • basic and colormaps
    • vmin, vmax
    • norms
    • colorbars
  • arranging axes
    • subplots
    • subplot_mosaic

[NOTE: depends on#21631 - I'll rebase when that is done. Only file to change istutorials/introductory/usage.py]

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@jklymakjklymak added the Documentation: websitelayout/behavior/styling changes labelNov 15, 2021
@jklymakjklymakforce-pushed thedoc-basic-usage branch 3 times, most recently from0b339f7 to85de443CompareNovember 15, 2021 15:15
@jklymakjklymak marked this pull request as draftNovember 15, 2021 15:18
@jklymakjklymak changed the titleDOC: rename Usage Guide to Basic Usage...DOC: rename Usage Guide to Basic Usage and updateNov 16, 2021
@jklymakjklymak marked this pull request as ready for reviewNovember 16, 2021 12:56
@jklymakjklymak added this to thev3.5-doc milestoneNov 17, 2021
@jklymak
Copy link
MemberAuthor

rebased on main...



def my_plotter(ax, data1, data2, param_dict):
"""
A helper function to make a graph
A helper function to make a graph.
Copy link
Member

Choose a reason for hiding this comment

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

I have mixed feeling about dropping the docstring. On one hand, I see the reason to make it terser, on the other hand we should model best practices.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't feel strongly about this, and am happy to add it back in. However, I think for a little in-script utility its OK to not have a numpydoc compliant docstring, and I found it distracting for a tutorial.

Comment on lines 294 to 297
ax.set_xlabel('Smarts')
ax.set_ylabel('Probability')
ax.set_title('Histogram of IQ')
ax.text(60, .025, r'$\mu=100,\ \sigma=15$')
Copy link
Member

@tacaswelltacaswellNov 26, 2021
edited
Loading

Choose a reason for hiding this comment

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

Suggested change
ax.set_xlabel('Smarts')
ax.set_ylabel('Probability')
ax.set_title('Histogram ofIQ')
ax.text(60,.025,r'$\mu=100,\ \sigma=15$')
ax.set_xlabel('Value')
ax.set_ylabel('Probability')
ax.set_title('Histogram ofnormal distribution')
ax.text(60,.025,r'$\mu=100,\ \sigma=15$')

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Changed to aardvark length (with a caveat that the distribution was not real, though I changed the mean to be correct for aardvarks).

tacaswell reacted with laugh emoji
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

I think this a big improvement.

I left one additional comment changing the text in an example (IQ can be controversial and is non-material to the point we are trying to make so might as well avoid courting controversy), but won't block merging over that.

@jklymak can self-merge either taking the suggestion or not.

@jklymak
Copy link
MemberAuthor

jklymak commentedNov 26, 2021
edited
Loading

Yeah that one was left over from before so I didn't change it. But I wondered about it as well and am happy to switch to aardvark length or something.

We actually have a gender one somewhere which strikes me as even more potentially contentious - i will try and remember to open an issue for that

@tacaswelltacaswell merged commitedd5a70 intomatplotlib:mainNov 27, 2021
@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.5.xgit pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -m1 edd5a70b0a9ef03f7146268e8e9f52ab32e83d0d
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #21641: DOC: rename Usage Guide to Basic Usage and update'
  1. Push to a named branch:
git push YOURFORK v3.5.x:auto-backport-of-pr-21641-on-v3.5.x
  1. Create a PR against branch v3.5.x, I would have named this PR:

"Backport PR#21641 on branch v3.5.x (DOC: rename Usage Guide to Basic Usage and update)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove theStill Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free tosuggest an improvement.

@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.5.0-docgit pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -m1 edd5a70b0a9ef03f7146268e8e9f52ab32e83d0d
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #21641: DOC: rename Usage Guide to Basic Usage and update'
  1. Push to a named branch:
git push YOURFORK v3.5.0-doc:auto-backport-of-pr-21641-on-v3.5.0-doc
  1. Create a PR against branch v3.5.0-doc, I would have named this PR:

"Backport PR#21641 on branch v3.5.0-doc (DOC: rename Usage Guide to Basic Usage and update)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove theStill Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free tosuggest an improvement.

@jklymakjklymak deleted the doc-basic-usage branchNovember 27, 2021 07:44
jklymak pushed a commit to jklymak/matplotlib that referenced this pull requestNov 30, 2021
DOC: rename Usage Guide to Basic Usage and update
jklymak pushed a commit to jklymak/matplotlib that referenced this pull requestNov 30, 2021
jklymak added a commit that referenced this pull requestNov 30, 2021
jklymak added a commit that referenced this pull requestNov 30, 2021
…3.5.0-docBackport PR#21641: DOC: rename Usage Guide to Basic Usage and update
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

Assignees
No one assigned
Labels
Documentation: websitelayout/behavior/styling changes
Projects
None yet
Milestone
v3.5-doc
Development

Successfully merging this pull request may close these issues.

2 participants
@jklymak@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp