mpl_toolkits.axisartist.axis_artist.Ticks#

classmpl_toolkits.axisartist.axis_artist.Ticks(ticksize,tick_out=False,*,axis=None,**kwargs)[source]#

Bases:AttributeCopier,Line2D

Ticks are derived fromLine2D, and note that ticks themselvesare markers. Thus, you should use set_mec, set_mew, etc.

To change the tick size (length), you need to useset_ticksize. To change the direction of the ticks (ticks arein opposite direction of ticklabels by default), useset_tick_out(False)

draw(renderer)[source]#

Draw the Artist (and its children) using the given renderer.

This has no effect if the artist is not visible (Artist.get_visiblereturns False).

Parameters:
rendererRendererBase subclass.

Notes

This method is overridden in the Artist subclasses.

get_color()[source]#

Return the line color.

See alsoset_color.

get_markeredgecolor()[source]#

Return the marker edge color.

See alsoset_markeredgecolor.

get_markeredgewidth()[source]#

Return the marker edge width in points.

See alsoset_markeredgewidth.

get_ref_artist()[source]#

Return the underlying artist that actually defines some properties(e.g., color) of this artist.

get_tick_out()[source]#

Return whether ticks are drawn inside or outside the axes.

get_ticksize()[source]#

Return length of the ticks in points.

set(*,agg_filter=<UNSET>,alpha=<UNSET>,animated=<UNSET>,antialiased=<UNSET>,clip_box=<UNSET>,clip_on=<UNSET>,clip_path=<UNSET>,color=<UNSET>,dash_capstyle=<UNSET>,dash_joinstyle=<UNSET>,dashes=<UNSET>,data=<UNSET>,drawstyle=<UNSET>,fillstyle=<UNSET>,gapcolor=<UNSET>,gid=<UNSET>,in_layout=<UNSET>,label=<UNSET>,linestyle=<UNSET>,linewidth=<UNSET>,locs_angles=<UNSET>,marker=<UNSET>,markeredgecolor=<UNSET>,markeredgewidth=<UNSET>,markerfacecolor=<UNSET>,markerfacecoloralt=<UNSET>,markersize=<UNSET>,markevery=<UNSET>,mouseover=<UNSET>,path_effects=<UNSET>,picker=<UNSET>,pickradius=<UNSET>,rasterized=<UNSET>,sketch_params=<UNSET>,snap=<UNSET>,solid_capstyle=<UNSET>,solid_joinstyle=<UNSET>,tick_out=<UNSET>,ticksize=<UNSET>,transform=<UNSET>,url=<UNSET>,visible=<UNSET>,xdata=<UNSET>,ydata=<UNSET>,zorder=<UNSET>)[source]#

Set multiple properties at once.

Supported properties are

Property

Description

agg_filter

a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image

alpha

float or None

animated

bool

antialiased oraa

bool

clip_box

BboxBase or None

clip_on

bool

clip_path

Patch or (Path, Transform) or None

color orc

unknown

dash_capstyle

CapStyle or {'butt', 'projecting', 'round'}

dash_joinstyle

JoinStyle or {'miter', 'round', 'bevel'}

dashes

sequence of floats (on/off ink in points) or (None, None)

data

(2, N) array or two 1D arrays

drawstyle ords

{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'

figure

Figure orSubFigure

fillstyle

{'full', 'left', 'right', 'bottom', 'top', 'none'}

gapcolor

color or None

gid

str

in_layout

bool

label

object

linestyle orls

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidth orlw

float

locs_angles

unknown

marker

marker style string,Path orMarkerStyle

markeredgecolor ormec

color

markeredgewidth ormew

float

markerfacecolor ormfc

color

markerfacecoloralt ormfcalt

color

markersize orms

float

markevery

None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]

mouseover

bool

path_effects

list ofAbstractPathEffect

picker

float or callable[[Artist, Event], tuple[bool, dict]]

pickradius

float

rasterized

bool

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

solid_capstyle

CapStyle or {'butt', 'projecting', 'round'}

solid_joinstyle

JoinStyle or {'miter', 'round', 'bevel'}

tick_out

unknown

ticksize

unknown

transform

Transform

url

str

visible

bool

xdata

1D array

ydata

1D array

zorder

float

set_color(color)[source]#

Set the color of the line.

Parameters:
colorcolor
set_locs_angles(locs_angles)[source]#
set_tick_out(b)[source]#

Set whether ticks are drawn inside or outside the axes.

set_ticksize(ticksize)[source]#

Set length of the ticks in points.