Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9565bc8

Browse files
authored
Merge pull request #19732 from anntzer/aad
Reword the axis_artist module docstring.
2 parents dd552b2 + e4d4485 commit 9565bc8

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,24 @@
11
"""
2-
axis_artist.py module provides axis-related artists. They are
2+
The :mod:`.axis_artist` module implements custom artists to draw axis elements
3+
(axis lines and labels, tick lines and labels, grid lines).
34
4-
* axis line
5-
* tick lines
6-
* tick labels
7-
* axis label
8-
* grid lines
5+
Axis lines and labels and tick lines and labels are managed by the `AxisArtist`
6+
class; grid lines are managed by the `GridlinesCollection` class.
97
10-
The main artist classes are `AxisArtist` and `GridlinesCollection`. While
11-
`GridlinesCollection` is responsible for drawing grid lines, `AxisArtist`
12-
is responsible for all other artists. `AxisArtist` has attributes that are
13-
associated with each type of artists:
8+
There is one `AxisArtist` per Axis; it can be accessed through
9+
the ``axis`` dictionary of the parent Axes (which should be a
10+
`mpl_toolkits.axislines.Axes`), e.g. ``ax.axis["bottom"]``.
1411
15-
* line: axis line
16-
* major_ticks: major tick lines
17-
* major_ticklabels: major tick labels
18-
* minor_ticks: minor tick lines
19-
* minor_ticklabels: minor tick labels
20-
* label: axis label
12+
Children of the AxisArtist are accessed as attributes: ``.line`` and ``.label``
13+
for the axis line and label, ``.major_ticks``, ``.major_ticklabels``,
14+
``.minor_ticks``, ``.minor_ticklabels`` for the tick lines and labels (e.g.
15+
``ax.axis["bottom"].line``).
2116
22-
Typically, the `AxisArtist` associated with an axes will be accessed with the
23-
*axis* dictionary of the axes, i.e., the `AxisArtist` for the bottom axis is ::
17+
Children properties (colors, fonts, line widths, etc.) can be set using
18+
setters, e.g. ::
2419
25-
ax.axis["bottom"]
26-
27-
where *ax* is an instance of `mpl_toolkits.axislines.Axes`. Thus,
28-
``ax.axis["bottom"].line`` is an artist associated with the axis line, and
29-
``ax.axis["bottom"].major_ticks`` is an artist associated with the major tick
30-
lines.
31-
32-
You can change the colors, fonts, line widths, etc. of these artists
33-
by calling suitable set method. For example, to change the color of the major
34-
ticks of the bottom axis to red, use ::
35-
36-
ax.axis["bottom"].major_ticks.set_color("r")
20+
# Make the major ticks of the bottom axis red.
21+
ax.axis["bottom"].major_ticks.set_color("red")
3722
3823
However, things like the locations of ticks, and their ticklabels need to be
3924
changed from the side of the grid_helper.

0 commit comments

Comments
 (0)