-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Changes to the pyplot api documentation #11620
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
doc/api/pyplot_api.rst
Outdated
autoscale | ||
axhline | ||
axhspan | ||
axis |
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.
Those are no plotting functions: axis, cla, grid, sci, polar, xlabel, ylabel, set_cmap, title, xscale, yscale etc.
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, thats true. They are in the plotting section of pyplot though and I haven't look through that part in much detail.
Are you proposing to delete the "Colors" section? Or where would you put it instead? |
The color section where mostly the docstring for the One possibility if a section with that name should exist somewhere due to links is to put it on its own page in the api list. |
Yes that was already the idea in the last PR. But simply deleting it is not an option. |
44bd036
to
db07723
Compare
I took out the non plotting functions from the plotting functions. I hope I got it mostly correct. About the color section. I thought that the discussion in that pr was mostly about other things. The only part I delete in this PR is
The rest is in The problems I see with my approach.
I am not sure of either of these two problems but I don't see how that section could have been linked and there are already a I can look through the information that exist today and propose a solution. |
I have a preference for keeping this content in the file |
I am very 👍 on the overall idea and the organization! |
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.
Thanks! This is a great improvement.
I'm pondering if we should group the functions a bit differently, e.g. put all the image functions together. But that could still be done later on if desired.
doc/api/pyplot_api.rst
Outdated
setp | ||
xkcd | ||
|
||
Making figures |
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.
"Creating figures" is the more common term.
doc/api/pyplot_api.rst
Outdated
|
||
.. currentmodule:: matplotlib.pyplot | ||
|
||
.. automodule:: matplotlib.pyplot |
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 module description is a bit out of place now. It should probably be a one-sentence description and reference the pyplot API section in API overview and maybe the pyplot tutorial.
A discussion vs the OOP approach and an example are unnecessary here.
doc/api/pyplot_api.rst
Outdated
:template: autosummary.rst | ||
:nosignatures: | ||
|
||
getp |
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.
getp
does not link because it does not live in pyplot. It's just imported. Can we do something about this?
doc/api/pyplot_api.rst
Outdated
savefig | ||
waitforbuttonpress | ||
|
||
Putting things in figures |
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.
Sound a bit clumsy. Maybe "Adding elements to figures"?
doc/api/pyplot_api.rst
Outdated
sci | ||
set_cmap | ||
|
||
Putting things in axes |
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.
Adding elements to axes?
doc/api/pyplot_api.rst
Outdated
figtext | ||
suptitle | ||
|
||
Working with axes |
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.
Should this be capital "Axes"?
Possibly as well in other headlines?
Old: https://matplotlib.org/devdocs/api/pyplot_summary.html (for anyone else who wants to review) |
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.
This looks so much better, thanks a lot 👍 . I have a few small comments, which I've put inline.
|
||
Any artist |
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 does this mean? Functions that can be used by any artist? Or functions that are applied to every artist on the plot?
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.
They are functions that can be applied to every artist. The name was just taken from thepyplot
file.
doc/api/pyplot_summary.rst
Outdated
|
||
For a more in-depth look at colormaps, see the | ||
:doc:`/tutorials/colors/colormaps` tutorial. | ||
Making figures |
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.
I would say this should be moved to the top, since this is the one bit of the pyplots
stuff everyone has to use even if they then use the object oriented API.
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.
And it's the first thing to do in a plot 😄
Generally, I would roughly sort the sections by how often a typical user may need them. While on the other hand, keeping related topics together. e.g. putting things in figures either next to putting things in axes or next to working with figures.
By the way, do you want to stick to the putting things wording?
|
||
Working with axes | ||
================= | ||
|
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.
Might be worth putting a single sentence here saying what an axes
is (as opposed to an axis
)
|
||
Working with axis | ||
================= | ||
|
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.
Might be worth putting a single sentence here saying what an axis
is (as opposed to an axes
)
|
||
Current image | ||
============= | ||
|
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.
Current image doesn't mean much to me, might be worth putting a single sentence here too.
imread | ||
imsave | ||
|
||
Plotting functions |
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.
Might be worth moving this up too, since these are probably the second most common set of functions that people use.
aaf0652
to
2bc5466
Compare
I finally did some changes. I kind of like the ordering in I looked through the color documentation and I think that the docstring in I made the links to the two most important color tutorials on the It was not clearly documented that the |
@fredrik-1 Thanks so much for your efforts with the docs. This is really out of date, so I'm going to close, but please feel free to rebase if you think there are helpful changes to the current docs in here... Sorry this didn't get over the line! |
I did some formatting to the
pyplot
api page. The sections are mostly taken from the sections in thepyplot.py
file.I took away the colormaps section as it is a function in
pyplot
anyway.These changes make it much easier to find out about the pyplot functions.