axis_artist.py module provides axis-related artists. They are
The main artist classes are
GridlinesCollection is responsible for drawing grid lines,
AxisArtist is responsible for all other artists.
AxisArtist has attributes that are associated with each type of artists:
where ax is an instance of
ax.axis["bottom"].line is an artist associated with the axis line, and
ax.axis["bottom"].major_ticks is an artist associated with the major tick lines.
You can change the colors, fonts, line widths, etc. of these artists by calling suitable set method. For example, to change the color of the major ticks of the bottom axis to red, use
However, things like the locations of ticks, and their ticklabels need to be changed from the side of the grid_helper.
TickLabels have an axis_direction attribute, which adjusts the location, angle, etc.,. The axis_direction must be one of "left", "right", "bottom", "top", and follows the Matplotlib convention for rectangular axis.
For example, for the bottom axis (the left and right is relative to the direction of the increasing coordinate),
The text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
Ticks are by default direct opposite side of the ticklabels. To make ticks to the same side of the ticklabels,
The following attributes can be customized (use the
||An artist which draws axis (a line along which the n-th axes coord is constant) line, ticks, ticklabels, and axis label.|
||which : "major" or "minor" axis : "both", "x" or "y"|
||A base class for AxisLabel and TickLabels.|
||Ticks are derived from Line2D, and note that ticks themselves are markers.|
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.