AxisLabel module

class lys.widgets.canvas.interface.AxisLabel.CanvasAxisLabel(canvas)[source]

Bases: CanvasPart

Interface to access axis label of canvas. All methods in this interface can be accessed from CanvasBase instance.

getAxisLabel(axis)[source]

Get the label of axis

Parameters

axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

Returns

The text of the label.

Return type

str

getAxisLabelCoords(axis)[source]

Get the position of the label.

Parameters

axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

Returns

The position of the label. Usually negative around -0.2.

Return type

float

getAxisLabelFont(axis)[source]

Get the font of the label.

Parameters

axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

Returns

The information of font. See setAxisLabelFont()

Return type

dict

getAxisLabelVisible(axis)[source]

Get the visibility of the label.

Parameters

axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

Returns

True if the label is shown.

Return type

bool

setAxisLabel(axis, text)[source]

Set the label of axis.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • text (str) – Label to be set.

setAxisLabelCoords(axis, pos)[source]

Set the position of the label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • pos (float) – The position of the label. Usually negative around -0.2.

setAxisLabelFont(axis, fname, size=10, color='black')[source]

Set the font of the label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • fname (str) – The name of the font.

  • size (int) – The size of the font.

  • color (str) – The color of the font such as #111111.

setAxisLabelVisible(axis, show)[source]

Show/hide the label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • show (bool) – The label is shown when show is True.

class lys.widgets.canvas.interface.AxisLabel.CanvasTickLabel(canvas)[source]

Bases: CanvasPart

Interface to access tick label of canvas. All methods in this interface can be accessed from CanvasBase instance.

getTickLabelFont(axis)[source]

Get the font of the label.

Parameters

axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

Returns

The information of font. See setTickLabelFont()

Return type

dict

getTickLabelVisible(axis, mirror=False)[source]

Get the visibility of the tick label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • mirror (bool) – return the visibility of mirror label when it is True.

Returns

visibility of the tick label.

Return type

bool

setTickLabelFont(axis, fname, size=9, color='#000000')[source]

Set the font of the label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • fname (str) – The name of the font.

  • size (int) – The size of the font.

  • color (str) – The color of the font such as #111111.

setTickLabelVisible(axis, tf, mirror=False)[source]

Show/hide the tick label.

Parameters
  • axis ('Left' or 'Right' or 'Top' or 'Bottom') – The axis.

  • tf (bool) – The label is shown when show is True.

  • mirror (bool) – show/hide mirror label when it is True.