clearplot.axis_label module

class Axis_Label(ax, orient)

Bases: object

Axis label class

__init__(ax, orient)

Instantiates an axis label object

Parameters:
  • ax (axes object) – Axes the label pertains to.
  • orient (float) – angle in radians specifying the orientation of the axis label (should be 0 for a horizontal axis label or pi/2 for a vertical axis label)
gen_arrow(x, cs, length='auto', head_length='auto', head_aspect_ratio=3.0, color=[0, 0, 0])

Creates an arrow whose head has a curved back. The arrow can be placed relative to several coordinate systems, yet it retains it’s shape, even when the data limits, axes, or figure window change size.

Parameters:
  • x (1x2 numpy array) – Coordinates for tip of arrowhead
  • cs (string or 1x2 list) – Specifies the coordinate system for the coordinates in x. See the description of cs_1 in the axes.annotate method for more information.
  • length (float, optional) – Length of the arrow from tip to tail in mm
  • color (1x3 list, optional) – RGB value for the arrow
Returns:

arrow

Return type:

annotation object

gen_label(str_list, font_size=16.0)

Generates an axis label with or without units in parenthesis

Parameters:
  • str_list (list of str) – Label text and units in LaTeX syntax.
  • font_size (float, optional) – font size (in points)
place_label()

Places the axis label

position

Sets/gets the axis label position. If the axis label has an arrow, then the position is the arrow tip. Otherwise the position is the lower left most item in the axis label. Input a 1x2 numpy array, in mm units, to alter the axis label position.