vispy.visuals.axis module

class vispy.visuals.axis.AxisVisual(pos=None, domain=(0.0, 1.0), tick_direction=(- 1.0, 0.0), scale_type='linear', axis_color=(1, 1, 1), tick_color=(0.7, 0.7, 0.7), text_color='w', minor_tick_length=5, major_tick_length=10, tick_width=2, tick_label_margin=12, tick_font_size=8, axis_width=3, axis_label=None, axis_label_margin=35, axis_font_size=10, font_size=None, anchors=None)

Bases: vispy.visuals.visual.CompoundVisual

Axis visual

Parameters
posarray

Co-ordinates of start and end of the axis.

domaintuple

The data values at the beginning and end of the axis, used for tick labels. i.e. (5, 10) means the axis starts at 5 and ends at 10. Default is (0, 1).

tick_directionarray

The tick direction to use (in document coordinates).

scale_typestr

The type of scale. For now only ‘linear’ is supported.

axis_colortuple

RGBA values for the axis colour. Default is black.

tick_colortuple

RGBA values for the tick colours. The colour for the major and minor ticks is currently fixed to be the same. Default is a dark grey.

text_colorColor

The color to use for drawing tick and axis labels

minor_tick_lengthfloat

The length of minor ticks, in pixels

major_tick_lengthfloat

The length of major ticks, in pixels

tick_widthfloat

Line width for the ticks

tick_label_marginfloat

Margin between ticks and tick labels

tick_font_sizefloat

The font size to use for rendering tick labels.

axis_widthfloat

Line width for the axis

axis_labelstr

Text to use for the axis label

axis_label_marginfloat

Margin between ticks and axis labels

axis_font_sizefloat

The font size to use for rendering axis labels.

font_sizefloat

Font size for both the tick and axis labels. If this is set, tick_font_size and axis_font_size are ignored.

anchorsiterable

A 2-element iterable (tuple, list, etc.) giving the horizontal and vertical alignment of the tick labels. The first element should be one of ‘left’, ‘center’, or ‘right’, and the second element should be one of ‘bottom’, ‘middle’, or ‘top’. If this is not specified, it is determined automatically.

property axis_color
property axis_font_size
axis_label

Text to use for the axis label.

axis_label_margin

Margin between ticks and axis labels

property axis_width
domain

The data values at the beginning and end of the axis, used for tick labels.

major_tick_length

The length of major ticks, in pixels

minor_tick_length

The length of minor ticks, in pixels

pos

Co-ordinates of start and end of the axis.

property text_color
property tick_color
tick_direction

The tick direction to use (in document coordinates).

property tick_font_size
tick_label_margin

Margin between ticks and tick labels

property tick_width
class vispy.visuals.axis.MaxNLocator(nbins=10, steps=None, trim=True, integer=False, symmetric=False, prune=None)

Bases: object

Select no more than N intervals at nice locations.

bin_boundaries(vmin, vmax)
tick_values(vmin, vmax)
view_limits(dmin, dmax)
class vispy.visuals.axis.Ticker(axis, anchors=None)

Bases: object

Class to determine tick marks

Parameters
axisinstance of AxisVisual

The AxisVisual to generate ticks for.

get_update()
vispy.visuals.axis.scale_range(vmin, vmax, n=1, threshold=100)