Classes for the ticks and x and y axis
Bases: matplotlib.artist.Artist
Public attributes
Init the axis with the parent Axes instance
Sets up x-axis ticks and labels that treat the x data as dates. tz is a tzinfo instance or a timezone string. This timezone is used to create date labels.
clear the current axis
Draw the axis lines, grid lines, tick lines and labels
return the Interval instance for this axis data limits
Return the grid lines as a list of Line2D instance
Return the axis label as a Text instance
Get the text of the label
Get the formatter of the major ticker
Get the locator of the major ticker
get the tick instances; grow as necessary
Return a list of Text instances for the major ticklabels
Return the major tick lines as a list of Line2D instances
Get the major tick locations in data coordinates as a numpy array
Get the formatter of the minor ticker
Get the locator of the minor ticker
get the minor tick instances; grow as necessary
Return a list of Text instances for the minor ticklabels
Return the minor tick lines as a list of Line2D instances
Get the minor tick locations in data coordinates as a numpy array
Return the axis offsetText as a Text instance
Return the depth of the axis used by the picker
get whether the axis has smart bounds
Get the extents of the tick labels on either side of the axes.
Get the x tick labels as a list of Text instances.
Parameters: | minor : bool
which : None, (‘minor’, ‘major’, ‘both’)
|
---|---|
Returns: | ret : list
|
Return the tick lines as a list of Line2D instances
Get the tick locations in data coordinates as a numpy array
Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.
return the units for axis
return the Interval instance for this axis view limits
Set the axis grid on or off; b is a boolean. Use which = ‘major’ | ‘minor’ | ‘both’ to set the grid for major or minor ticks.
If b is None and len(kwargs)==0, toggle the grid state. If kwargs are supplied, it is assumed you want the grid on and b will be set to True.
kwargs are used to set the line properties of the grids, e.g.,
xax.grid(color=’r’, linestyle=’-‘, linewidth=2)
Iterate through all of the major and minor ticks.
Pan numsteps (can be positive or negative)
set the axis data limits
set the default limits for the axis data and view interval if they are not mutated
Set the coordinates of the label. By default, the x coordinate of the y label is determined by the tick label bounding boxes, but this can lead to poor alignment of multiple ylabels if there are multiple axes. Ditto for the y coodinate of the x label.
You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system (0,0) is (left,bottom), (0.5, 0.5) is middle, etc
Sets the text value of the axis label
ACCEPTS: A string value for the label
Set the depth of the axis used by the picker
ACCEPTS: a distance in points
Deprecated since version 1.3: The set_scale function was deprecated in version 1.3.
This should be a private function (moved to _set_scale)
set the axis to have smart bounds
Set appearance parameters for ticks and ticklabels.
For documentation of keyword arguments, see matplotlib.axes.Axes.tick_params().
Set the text values of the tick labels. Return a list of Text instances. Use kwarg minor=True to select minor ticks. All other kwargs are used to update the text object properties. As for get_ticklabels, label1 (left or bottom) is affected for a given tick only if its label1On attribute is True, and similarly for label2. The list of returned label text objects consists of all such label1 objects followed by all such label2 objects.
The input ticklabels is assumed to match the set of tick locations, regardless of the state of label1On and label2On.
ACCEPTS: sequence of strings
Set the locations of the tick marks from sequence ticks
ACCEPTS: sequence of floats
set the units for axis
ACCEPTS: a units tag
introspect data for units converter and update the axis.converter instance if necessary. Return True if data is registered for unit conversion.
Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Bases: matplotlib.artist.Artist
Abstract base class for the axis ticks, grid lines and labels
1 refers to the bottom of the plot for xticks and the left for yticks 2 refers to the top of the plot for xticks and the right for yticks
Publicly accessible attributes:
- tick1line
- a Line2D instance
- tick2line
- a Line2D instance
- gridline
- a Line2D instance
- label1
- a Text instance
- label2
- a Text instance
- gridOn
- a boolean which determines whether to draw the tickline
- tick1On
- a boolean which determines whether to draw the 1st tickline
- tick2On
- a boolean which determines whether to draw the 2nd tickline
- label1On
- a boolean which determines whether to draw tick label
- label2On
- a boolean which determines whether to draw tick label
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
Calculate self._pad and self._tickmarkers
Test whether the mouse event occurred in the Tick marks.
This function always returns false. It is more useful to test if the axis as a whole contains the mouse rather than the set of tick marks.
Return the tick location (data coords) as a scalar
Get the value of the tick label pad in points
return the view Interval instance for the axis this tick is ticking
Set the artist’s clip path, which may be:
For efficiency, if the path happens to be an axis-aligned rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to None.
Set the text of ticklabel
ACCEPTS: str
Set the text of ticklabel
ACCEPTS: str
Set the text of ticklabel2
ACCEPTS: str
Set the tick label pad in points
ACCEPTS: float
Bases: matplotlib.axis.Axis
Init the axis with the parent Axes instance
Test whether the mouse event occured in the x axis.
return the Interval instance for this axis data limits
Return the label position (top or bottom)
Returns the amount of space one should reserve for text above and below the axes. Returns a tuple (above, below)
Return the ticks position (top, bottom, default or unknown)
return the Interval instance for this axis view limits
set the axis data limits
set the default limits for the axis interval if they are not mutated
Set the label position (top or bottom)
ACCEPTS: [ ‘top’ | ‘bottom’ ]
Set the ticks position (top, bottom, both, default or none) both sets the ticks to appear on both positions, but does not change the tick labels. ‘default’ resets the tick positions to the default: ticks on both positions, labels at bottom. ‘none’ can be used if you don’t want any ticks. ‘none’ and ‘both’ affect only the ticks, not the labels.
ACCEPTS: [ ‘top’ | ‘bottom’ | ‘both’ | ‘default’ | ‘none’ ]
If ignore is False, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In addition, the view limits can be expanded, but will not be reduced. This method is for mpl internal use; for normal use, see set_xlim().
use ticks only on bottom
use ticks only on top
Bases: matplotlib.axis.Tick
Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
return the Interval instance for this axis view limits
Set the location of tick in data coords with scalar loc
Bases: matplotlib.axis.Axis
Init the axis with the parent Axes instance
Test whether the mouse event occurred in the y axis.
Returns True | False
return the Interval instance for this axis data limits
Return the label position (left or right)
Return the ticks position (left, right, both or unknown)
return the Interval instance for this axis view limits
set the axis data limits
set the default limits for the axis interval if they are not mutated
Set the label position (left or right)
ACCEPTS: [ ‘left’ | ‘right’ ]
Set the ticks position (left, right, both, default or none) ‘both’ sets the ticks to appear on both positions, but does not change the tick labels. ‘default’ resets the tick positions to the default: ticks on both positions, labels at left. ‘none’ can be used if you don’t want any ticks. ‘none’ and ‘both’ affect only the ticks, not the labels.
ACCEPTS: [ ‘left’ | ‘right’ | ‘both’ | ‘default’ | ‘none’ ]
If ignore is False, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In addition, the view limits can be expanded, but will not be reduced. This method is for mpl internal use; for normal use, see set_ylim().
use ticks only on left
use ticks only on right
Bases: matplotlib.axis.Tick
Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
return the Interval instance for this axis view limits
Set the location of tick in data coords with scalar loc