Axis

class leather.Axis(ticks=None, tick_formatter=None, name=None)

Bases: object

A horizontal or vertical chart axis.

Parameters:
  • ticks – Instead of inferring tick values from the data, use exactly this sequence of ticks values. These will still be passed to the tick_formatter.
  • tick_formatter – An optional tick_format_function().
estimate_label_margin(scale, orient)

Estimate the space needed for the tick labels.

to_svg(width, height, scale, orient)

Render this axis to SVG elements.