-
-
Notifications
You must be signed in to change notification settings - Fork 8k
DOC : whole bunch of documentation clean up #3170
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
Changes from 1 commit
a727bdc
9e1c9cf
5f60a1e
0c85dfe
050f3af
6cfccbf
284135e
d11fc1a
9aa5f70
81e963b
23a63da
b1f0a60
b21e34d
5b613d4
ed65167
6d0503b
a9b25e1
6fcd723
a26114d
19e8ad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Added map of major parts of a figure
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,75 @@ For even more control -- which is essential for things like embedding | |
matplotlib plots in GUI applications -- the pyplot level may be dropped | ||
completely, leaving a purely object-oriented approach. | ||
|
||
.. _figure_parts: | ||
|
||
Parts of a Figure | ||
================= | ||
.. image:: fig_map.png | ||
|
||
:class:`~matplotlib.figure.Figure` | ||
---------------------------------- | ||
|
||
The _whole_ figure (marked as the outer red box). The figure keeps | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to be a little more positive with this whole paragraph. Maybe we can talk during the scipy sprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by positive? |
||
track of all the child :class:`~matplotlib.axes.Axes`, a smattering of | ||
'special' artists (titles, figure legends, etc), and the **canvas**. | ||
(Don't worry too much about the canvas, it is crucial as it is the | ||
object that actually does the drawing to get you your plot, but as the | ||
user it is more-or-less invisible to you). A figure can have any | ||
number of :class:`~matplotlib.axes.Axes`, but to be useful should have | ||
at least one. | ||
|
||
The easiest way to create a new figure is with pyplot:: | ||
|
||
fig = plt.figure() # an empty figure with no axes | ||
fig, ax_lst = plt.subplots(2, 2) # a figure with a 2x2 grid of Axes | ||
|
||
|
||
:class:`~matplotlib.axes.Axes` | ||
------------------------------ | ||
|
||
This is what you think of as 'a plot', it is the region of the image | ||
with the data space (marked as the inner blue box). A given figure | ||
can contain many Axes, but a given :class:`~matplotlib.axes.Axes` | ||
object can only be in one :class:`~matplotlib.figure.Figure`. The | ||
axes contains two (or three in the case of 3D) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Capitalize "Axes" here for consistency? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, I should probably squash all of these commits down. |
||
:class:`~matplotlib.axis.Axis` objects (be aware of the difference | ||
between **Axes** and **Axis**) which take care of the data limits (the | ||
data limits can also be controlled via set via the | ||
:func:`~matplotlib.axes.Axes.set_xlim` and | ||
:func:`~matplotlib.axes.Axes.set_ylim` member :class:`Axes` member | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "member Axes member functions.". It'd be good to make this more pythonic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy and paste text editing! |
||
functions). Each :class:`Axes` has a title (set via | ||
:func:`~matplotlib.axes.Axes.set_title`), an x-label (set via | ||
:func:`~matplotlib.axes.Axes.set_xlabel`), and a y-label set via | ||
:func:`~matplotlib.axes.Axes.set_ylabel`). | ||
|
||
The :class:`Axes` class and it's member functions are the primary entry | ||
point to working with the OO interface. | ||
|
||
:class:`~matplotlib.axis.Axis` | ||
------------------------------ | ||
|
||
These are the number line like objects (circled in green). They take | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hyphenate, "number-line-like". |
||
care of setting the graph limits and generating the ticks (the marks | ||
on the axis) and ticklabels (strings labeling the ticks). The | ||
location of the ticks is determined by a | ||
:class:`~matplotlib.ticker.Locator` object and the ticklabel strings | ||
are formatted by a :class:`~matplotlib.ticker.Formatter`. The | ||
combination of the correct :class:`Locator` and :class:`Formatter` gives | ||
very fine control over the tick labels. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> "tick locations and labels" |
||
|
||
:class:`~matplotlib.artist.Artist` | ||
---------------------------------- | ||
|
||
Basically everything you can see on the figure is an artist (even the | ||
:class:`Figure`, :class:`Axes`, and :class:`Axis` objects). This | ||
includes :class:`Text` objects, :class:`Line2D` objects, | ||
:class:`collection` objects, :class:`Patch` objects ... (you get the idea). | ||
When the figure is rendered, all of the artists are drawn | ||
(recursively) to the **canvas**. A given artist can only be in one | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete the "(recursively)". I know what you mean, but this is not quite the right way to say it, and it doesn't need to be said here anyway. Also, suggested to replace "A given artist...": |
||
`Axes`. | ||
|
||
|
||
.. _pylab: | ||
|
||
Matplotlib, pyplot and pylab: how are they related? | ||
|
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.
Generally I agree with the need for this document, but I'm not 100% comfortable with the approach taken. It might be worth getting a novice onboard to help get some coherent structure to the way things are introduced.
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 started at the outside and worked my way in. Even if this is not perfect, we need to have this marked up figure someplace in the docs.