# Scales

## QwtScaleWidget

class `qwt.scale_widget.``QwtScaleWidget`(*args)

  A Widget which contains a scale

  This Widget can be used to decorate composite widgets with a scale.

  Layout flags:

  > - QwtScaleWidget.TitleInverted: The title of vertical scales is painted from top to bottom. Otherwise it is painted from bottom to top.

  class `QwtScaleWidget`([parent=None])

    Alignment default is QwtScaleDraw.LeftScale.

    Parameters: | parent (QWidget or None) – Parent widget

  class `qwt.scale_widget.``QwtScaleWidget`(align, parent)

    Parameters:

    - align (int) – Alignment
    - parent (QWidget) – Parent widget

  `QwtScaleWidget.``initScale`(align)

    Initialize the scale

    Parameters: | align (int) – Alignment

  `QwtScaleWidget.``setLayoutFlag`(flag, on=True)

    Toggle an layout flag

    Parameters:

    - flag (int) – Layout flag
    - on (bool) – True/False

    See also

    `testLayoutFlag()`

  `QwtScaleWidget.``testLayoutFlag`(flag)

    Test a layout flag

    Parameters: | flag (int) – Layout flag
    Returns: | True/False

    See also

    `setLayoutFlag()`

  `QwtScaleWidget.``setTitle`(title)

    Give title new text contents

    Parameters: | title (qwt.text.QwtText or str) – New title

    See also

    `title()`

  `QwtScaleWidget.``setAlignment`(alignment)

    Change the alignment

    Parameters: | alignment (int) – New alignment

    Valid alignment values: see `qwt.scale_draw.QwtScaleDraw`

    See also

    `alignment()`

  `QwtScaleWidget.``alignment`()

    Returns: | position

    See also

    `setAlignment()`

  `QwtScaleWidget.``setBorderDist`(dist1, dist2)

    Specify distances of the scale’s endpoints from the widget’s borders. The actual borders will never be less than minimum border distance.

    Parameters:

    - dist1 (int) – Left or top Distance
    - dist2 (int) – Right or bottom distance

    See also

    `borderDist()`

  `QwtScaleWidget.``setMargin`(margin)

    Specify the margin to the colorBar/base line.

    Parameters: | margin (int) – Margin

    See also

    `margin()`

  `QwtScaleWidget.``setSpacing`(spacing)

    Specify the distance between color bar, scale and title

    Parameters: | spacing (int) – Spacing

    See also

    `spacing()`

  `QwtScaleWidget.``setLabelAlignment`(alignment)

    Change the alignment for the labels.

    Parameters: | spacing (int) – Spacing

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelAlignment()`, `setLabelRotation()`

  `QwtScaleWidget.``setLabelRotation`(rotation)

    Change the rotation for the labels.

    Parameters: | rotation (float) – Rotation

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelRotation()`, `setLabelFlags()`

  `QwtScaleWidget.``setLabelAutoSize`(state)

    Set the automatic size option for labels (default: on).

    Parameters: | state (bool) – On/off

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelAutoSize()`

  `QwtScaleWidget.``setScaleDraw`(scaleDraw)

    Set a scale draw

    scaleDraw has to be created with new and will be deleted in class destructor or the next call of setScaleDraw(). scaleDraw will be initialized with the attributes of the previous scaleDraw object.

    Parameters: | scaleDraw (qwt.scale_draw.QwtScaleDraw) – ScaleDraw object

    See also

    `scaleDraw()`

  `QwtScaleWidget.``scaleDraw`()

    Returns: | scaleDraw of this scale

    See also

    `qwt.scale_draw.QwtScaleDraw.setScaleDraw()`

  `QwtScaleWidget.``title`()

    Returns: | title

    See also

    `setTitle()`

  `QwtScaleWidget.``startBorderDist`()

    Returns: | start border distance

    See also

    `setBorderDist()`

  `QwtScaleWidget.``endBorderDist`()

    Returns: | end border distance

    See also

    `setBorderDist()`

  `QwtScaleWidget.``margin`()

    Returns: | margin

    See also

    `setMargin()`

  `QwtScaleWidget.``spacing`()

    Returns: | distance between scale and title

    See also

    `setSpacing()`

  `QwtScaleWidget.``draw`(painter)

    Draw the scale

    Parameters: | painter (QPainter) – Painter

  `QwtScaleWidget.``colorBarRect`(rect)

    Calculate the the rectangle for the color bar

    Parameters: | rect (QRectF) – Bounding rectangle for all components of the scale
    Returns: | Rectangle for the color bar

  `QwtScaleWidget.``layoutScale`(update_geometry=True)

    Recalculate the scale’s geometry and layout based on the current geometry and fonts.

    Parameters: | update_geometry (bool) – Notify the layout system and call update to redraw the scale

  `QwtScaleWidget.``drawColorBar`(painter, rect)

    Draw the color bar of the scale widget

    Parameters:

    - painter (QPainter) – Painter
    - rect (QRectF) – Bounding rectangle for the color bar

    See also

    `setColorBarEnabled()`

  `QwtScaleWidget.``drawTitle`(painter, align, rect)

    Rotate and paint a title according to its position into a given rectangle.

    Parameters:

    - painter (QPainter) – Painter
    - align (int) – Alignment
    - rect (QRectF) – Bounding rectangle

  `QwtScaleWidget.``scaleChange`()

    Notify a change of the scale

    This method can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget.

  `QwtScaleWidget.``titleHeightForWidth`(width)

    Find the height of the title for a given width.

    Parameters: | width (int) – Width
    Returns: | Height

  `QwtScaleWidget.``dimForLength`(length, scaleFont)

    Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.

    Parameters:

    - length (int) – width for horizontal, height for vertical scales
    - scaleFont (QFont) – Font of the scale

    Returns: | height for horizontal, width for vertical scales

  `QwtScaleWidget.``getBorderDistHint`()

    Calculate a hint for the border distances.

    This member function calculates the distance of the scale’s endpoints from the widget borders which is required for the mark labels to fit into the widget. The maximum of this distance an the minimum border distance is returned.

    Parameters:

    - start (int) – Return parameter for the border width at the beginning of the scale
    - end (int) – Return parameter for the border width at the end of the scale

    Warning

    The minimum border distance depends on the font.

    See also

    `setMinBorderDist()`, `getMinBorderDist()`, `setBorderDist()`

  `QwtScaleWidget.``setMinBorderDist`(start, end)

    Set a minimum value for the distances of the scale’s endpoints from the widget borders. This is useful to avoid that the scales are “jumping”, when the tick labels or their positions change often.

    Parameters:

    - start (int) – Minimum for the start border
    - end (int) – Minimum for the end border

    See also

    `getMinBorderDist()`, `getBorderDistHint()`

  `QwtScaleWidget.``getMinBorderDist`()

    Get the minimum value for the distances of the scale’s endpoints from the widget borders.

    Parameters:

    - start (int) – Return parameter for the border width at the beginning of the scale
    - end (int) – Return parameter for the border width at the end of the scale

    See also

    `setMinBorderDist()`, `getBorderDistHint()`

  `QwtScaleWidget.``setScaleDiv`(scaleDiv)

    Assign a scale division

    The scale division determines where to set the tick marks.

    Parameters: | scaleDiv (qwt.scale_div.QwtScaleDiv) – Scale Division

    See also

    For more information about scale divisions, see `qwt.scale_div.QwtScaleDiv`.

  `QwtScaleWidget.``setTransformation`(transformation)

    Set the transformation

    Parameters: | transformation (qwt.transform.Transform) – Transformation

    See also

    `qwt.scale_draw.QwtAbstractScaleDraw.scaleDraw()`, `qwt.scale_map.QwtScaleMap`

  `QwtScaleWidget.``setColorBarEnabled`(on)

    En/disable a color bar associated to the scale

    Parameters: | on (bool) – On/Off

    See also

    `isColorBarEnabled()`, `setColorBarWidth()`

  `QwtScaleWidget.``isColorBarEnabled`()

    Returns: | True, when the color bar is enabled

    See also

    `setColorBarEnabled()`, `setColorBarWidth()`

  `QwtScaleWidget.``setColorBarWidth`(width)

    Set the width of the color bar

    Parameters: | width (int) – Width

    See also

    `colorBarWidth()`, `setColorBarEnabled()`

  `QwtScaleWidget.``colorBarWidth`()

    Returns: | Width of the color bar

    See also

    `setColorBarWidth()`, `setColorBarEnabled()`

  `QwtScaleWidget.``colorBarInterval`()

    Returns: | Value interval for the color bar

    See also

    `setColorMap()`, `colorMap()`

  `QwtScaleWidget.``setColorMap`(interval, colorMap)

    Set the color map and value interval, that are used for displaying the color bar.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Value interval
    - colorMap (qwt.color_map.QwtColorMap) – Color map

    See also

    `colorMap()`, `colorBarInterval()`

  `QwtScaleWidget.``colorMap`()

    Returns: | Color map

    See also

    `setColorMap()`, `colorBarInterval()`

class `qwt.scale_widget.``QwtScaleWidget`(*args)

  A Widget which contains a scale

  This Widget can be used to decorate composite widgets with a scale.

  Layout flags:

  > - QwtScaleWidget.TitleInverted: The title of vertical scales is painted from top to bottom. Otherwise it is painted from bottom to top.

  class `QwtScaleWidget`([parent=None])

    Alignment default is QwtScaleDraw.LeftScale.

    Parameters: | parent (QWidget or None) – Parent widget

  class `qwt.scale_widget.``QwtScaleWidget`(align, parent)

    Parameters:

    - align (int) – Alignment
    - parent (QWidget) – Parent widget

  `QwtScaleWidget.``initScale`(align)

    Initialize the scale

    Parameters: | align (int) – Alignment

  `QwtScaleWidget.``setLayoutFlag`(flag, on=True)

    Toggle an layout flag

    Parameters:

    - flag (int) – Layout flag
    - on (bool) – True/False

    See also

    `testLayoutFlag()`

  `QwtScaleWidget.``testLayoutFlag`(flag)

    Test a layout flag

    Parameters: | flag (int) – Layout flag
    Returns: | True/False

    See also

    `setLayoutFlag()`

  `QwtScaleWidget.``setTitle`(title)

    Give title new text contents

    Parameters: | title (qwt.text.QwtText or str) – New title

    See also

    `title()`

  `QwtScaleWidget.``setAlignment`(alignment)

    Change the alignment

    Parameters: | alignment (int) – New alignment

    Valid alignment values: see `qwt.scale_draw.QwtScaleDraw`

    See also

    `alignment()`

  `QwtScaleWidget.``alignment`()

    Returns: | position

    See also

    `setAlignment()`

  `QwtScaleWidget.``setBorderDist`(dist1, dist2)

    Specify distances of the scale’s endpoints from the widget’s borders. The actual borders will never be less than minimum border distance.

    Parameters:

    - dist1 (int) – Left or top Distance
    - dist2 (int) – Right or bottom distance

    See also

    `borderDist()`

  `QwtScaleWidget.``setMargin`(margin)

    Specify the margin to the colorBar/base line.

    Parameters: | margin (int) – Margin

    See also

    `margin()`

  `QwtScaleWidget.``setSpacing`(spacing)

    Specify the distance between color bar, scale and title

    Parameters: | spacing (int) – Spacing

    See also

    `spacing()`

  `QwtScaleWidget.``setLabelAlignment`(alignment)

    Change the alignment for the labels.

    Parameters: | spacing (int) – Spacing

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelAlignment()`, `setLabelRotation()`

  `QwtScaleWidget.``setLabelRotation`(rotation)

    Change the rotation for the labels.

    Parameters: | rotation (float) – Rotation

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelRotation()`, `setLabelFlags()`

  `QwtScaleWidget.``setLabelAutoSize`(state)

    Set the automatic size option for labels (default: on).

    Parameters: | state (bool) – On/off

    See also

    `qwt.scale_draw.QwtScaleDraw.setLabelAutoSize()`

  `QwtScaleWidget.``setScaleDraw`(scaleDraw)

    Set a scale draw

    scaleDraw has to be created with new and will be deleted in class destructor or the next call of setScaleDraw(). scaleDraw will be initialized with the attributes of the previous scaleDraw object.

    Parameters: | scaleDraw (qwt.scale_draw.QwtScaleDraw) – ScaleDraw object

    See also

    `scaleDraw()`

  `QwtScaleWidget.``scaleDraw`()

    Returns: | scaleDraw of this scale

    See also

    `qwt.scale_draw.QwtScaleDraw.setScaleDraw()`

  `QwtScaleWidget.``title`()

    Returns: | title

    See also

    `setTitle()`

  `QwtScaleWidget.``startBorderDist`()

    Returns: | start border distance

    See also

    `setBorderDist()`

  `QwtScaleWidget.``endBorderDist`()

    Returns: | end border distance

    See also

    `setBorderDist()`

  `QwtScaleWidget.``margin`()

    Returns: | margin

    See also

    `setMargin()`

  `QwtScaleWidget.``spacing`()

    Returns: | distance between scale and title

    See also

    `setSpacing()`

  `QwtScaleWidget.``draw`(painter)

    Draw the scale

    Parameters: | painter (QPainter) – Painter

  `QwtScaleWidget.``colorBarRect`(rect)

    Calculate the the rectangle for the color bar

    Parameters: | rect (QRectF) – Bounding rectangle for all components of the scale
    Returns: | Rectangle for the color bar

  `QwtScaleWidget.``layoutScale`(update_geometry=True)

    Recalculate the scale’s geometry and layout based on the current geometry and fonts.

    Parameters: | update_geometry (bool) – Notify the layout system and call update to redraw the scale

  `QwtScaleWidget.``drawColorBar`(painter, rect)

    Draw the color bar of the scale widget

    Parameters:

    - painter (QPainter) – Painter
    - rect (QRectF) – Bounding rectangle for the color bar

    See also

    `setColorBarEnabled()`

  `QwtScaleWidget.``drawTitle`(painter, align, rect)

    Rotate and paint a title according to its position into a given rectangle.

    Parameters:

    - painter (QPainter) – Painter
    - align (int) – Alignment
    - rect (QRectF) – Bounding rectangle

  `QwtScaleWidget.``scaleChange`()

    Notify a change of the scale

    This method can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget.

  `QwtScaleWidget.``titleHeightForWidth`(width)

    Find the height of the title for a given width.

    Parameters: | width (int) – Width
    Returns: | Height

  `QwtScaleWidget.``dimForLength`(length, scaleFont)

    Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.

    Parameters:

    - length (int) – width for horizontal, height for vertical scales
    - scaleFont (QFont) – Font of the scale

    Returns: | height for horizontal, width for vertical scales

  `QwtScaleWidget.``getBorderDistHint`()

    Calculate a hint for the border distances.

    This member function calculates the distance of the scale’s endpoints from the widget borders which is required for the mark labels to fit into the widget. The maximum of this distance an the minimum border distance is returned.

    Parameters:

    - start (int) – Return parameter for the border width at the beginning of the scale
    - end (int) – Return parameter for the border width at the end of the scale

    Warning

    The minimum border distance depends on the font.

    See also

    `setMinBorderDist()`, `getMinBorderDist()`, `setBorderDist()`

  `QwtScaleWidget.``setMinBorderDist`(start, end)

    Set a minimum value for the distances of the scale’s endpoints from the widget borders. This is useful to avoid that the scales are “jumping”, when the tick labels or their positions change often.

    Parameters:

    - start (int) – Minimum for the start border
    - end (int) – Minimum for the end border

    See also

    `getMinBorderDist()`, `getBorderDistHint()`

  `QwtScaleWidget.``getMinBorderDist`()

    Get the minimum value for the distances of the scale’s endpoints from the widget borders.

    Parameters:

    - start (int) – Return parameter for the border width at the beginning of the scale
    - end (int) – Return parameter for the border width at the end of the scale

    See also

    `setMinBorderDist()`, `getBorderDistHint()`

  `QwtScaleWidget.``setScaleDiv`(scaleDiv)

    Assign a scale division

    The scale division determines where to set the tick marks.

    Parameters: | scaleDiv (qwt.scale_div.QwtScaleDiv) – Scale Division

    See also

    For more information about scale divisions, see `qwt.scale_div.QwtScaleDiv`.

  `QwtScaleWidget.``setTransformation`(transformation)

    Set the transformation

    Parameters: | transformation (qwt.transform.Transform) – Transformation

    See also

    `qwt.scale_draw.QwtAbstractScaleDraw.scaleDraw()`, `qwt.scale_map.QwtScaleMap`

  `QwtScaleWidget.``setColorBarEnabled`(on)

    En/disable a color bar associated to the scale

    Parameters: | on (bool) – On/Off

    See also

    `isColorBarEnabled()`, `setColorBarWidth()`

  `QwtScaleWidget.``isColorBarEnabled`()

    Returns: | True, when the color bar is enabled

    See also

    `setColorBarEnabled()`, `setColorBarWidth()`

  `QwtScaleWidget.``setColorBarWidth`(width)

    Set the width of the color bar

    Parameters: | width (int) – Width

    See also

    `colorBarWidth()`, `setColorBarEnabled()`

  `QwtScaleWidget.``colorBarWidth`()

    Returns: | Width of the color bar

    See also

    `setColorBarWidth()`, `setColorBarEnabled()`

  `QwtScaleWidget.``colorBarInterval`()

    Returns: | Value interval for the color bar

    See also

    `setColorMap()`, `colorMap()`

  `QwtScaleWidget.``setColorMap`(interval, colorMap)

    Set the color map and value interval, that are used for displaying the color bar.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Value interval
    - colorMap (qwt.color_map.QwtColorMap) – Color map

    See also

    `colorMap()`, `colorBarInterval()`

  `QwtScaleWidget.``colorMap`()

    Returns: | Color map

    See also

    `setColorMap()`, `colorBarInterval()`

## QwtScaleDiv

class `qwt.scale_div.``QwtScaleDiv`(*args)

  A class representing a scale division

  A Qwt scale is defined by its boundaries and 3 list for the positions of the major, medium and minor ticks.

  The upperLimit() might be smaller than the lowerLimit() to indicate inverted scales.

  Scale divisions can be calculated from a QwtScaleEngine.

  See also

  `qwt.scale_engine.QwtScaleEngine.divideScale()`, `qwt.plot.QwtPlot.setAxisScaleDiv()`

  Scale tick types:

  > - QwtScaleDiv.NoTick: No ticks
  > - QwtScaleDiv.MinorTick: Minor ticks
  > - QwtScaleDiv.MediumTick: Medium ticks
  > - QwtScaleDiv.MajorTick: Major ticks
  > - QwtScaleDiv.NTickTypes: Number of valid tick types

  class `QwtScaleDiv`

    Basic constructor. Lower bound = Upper bound = 0.

  class `qwt.scale_div.``QwtScaleDiv`(interval, ticks)

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - ticks (list) – list of major, medium and minor ticks

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound, ticks)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary
    - ticks (list) – list of major, medium and minor ticks

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound, minorTicks, mediumTicks, majorTicks)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary
    - minorTicks (list) – list of minor ticks
    - mediumTicks (list) – list of medium ticks
    - majorTicks (list) – list of major ticks

  Note

  lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``setInterval`(*args)

    Change the interval

    `setInterval`(lowerBound, upperBound)

      Parameters:

      - lowerBound (float) – First boundary
      - upperBound (float) – Second boundary

    `setInterval`(interval)

      Parameters: | interval (qwt.interval.QwtInterval) – Interval

    Note

    lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``interval`()

    Returns: | Interval

  `QwtScaleDiv.``setLowerBound`(lowerBound)

    Set the first boundary

    Parameters: | lowerBound (float) – First boundary

    See also

    `lowerBound()`, `setUpperBound()`

  `QwtScaleDiv.``lowerBound`()

    Returns: | the first boundary

    See also

    `upperBound()`

  `QwtScaleDiv.``setUpperBound`(upperBound)

    Set the second boundary

    Parameters: | lowerBound (float) – Second boundary

    See also

    `upperBound()`, `setLowerBound()`

  `QwtScaleDiv.``upperBound`()

    Returns: | the second boundary

    See also

    `lowerBound()`

  `QwtScaleDiv.``range`()

    Returns: | upperBound() - lowerBound()

  `QwtScaleDiv.``isEmpty`()

    Check if the scale division is empty( lowerBound() == upperBound() )

  `QwtScaleDiv.``isIncreasing`()

    Check if the scale division is increasing( lowerBound() <= upperBound() )

  `QwtScaleDiv.``contains`(value)

    Return if a value is between lowerBound() and upperBound()

    Parameters: | value (float) – Value
    Returns: | True/False

  `QwtScaleDiv.``invert`()

    Invert the scale division

    See also

    `inverted()`

  `QwtScaleDiv.``inverted`()

    Returns: | A scale division with inverted boundaries and ticks

    See also

    `invert()`

  `QwtScaleDiv.``bounded`(lowerBound, upperBound)

    Return a scale division with an interval [lowerBound, upperBound] where all ticks outside this interval are removed

    Parameters:

    - lowerBound (float) – First boundary
    - lowerBound – Second boundary

    Returns: | Scale division with all ticks inside of the given interval

    Note

    lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``setTicks`(tickType, ticks)

    Assign ticks

    Parameters:

    - type (int) – MinorTick, MediumTick or MajorTick
    - ticks (list) – Values of the tick positions

  `QwtScaleDiv.``ticks`(tickType)

    Return a list of ticks

    Parameters: | type (int) – MinorTick, MediumTick or MajorTick
    Returns: | Tick list

class `qwt.scale_div.``QwtScaleDiv`(*args)

  A class representing a scale division

  A Qwt scale is defined by its boundaries and 3 list for the positions of the major, medium and minor ticks.

  The upperLimit() might be smaller than the lowerLimit() to indicate inverted scales.

  Scale divisions can be calculated from a QwtScaleEngine.

  See also

  `qwt.scale_engine.QwtScaleEngine.divideScale()`, `qwt.plot.QwtPlot.setAxisScaleDiv()`

  Scale tick types:

  > - QwtScaleDiv.NoTick: No ticks
  > - QwtScaleDiv.MinorTick: Minor ticks
  > - QwtScaleDiv.MediumTick: Medium ticks
  > - QwtScaleDiv.MajorTick: Major ticks
  > - QwtScaleDiv.NTickTypes: Number of valid tick types

  class `QwtScaleDiv`

    Basic constructor. Lower bound = Upper bound = 0.

  class `qwt.scale_div.``QwtScaleDiv`(interval, ticks)

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - ticks (list) – list of major, medium and minor ticks

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound, ticks)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary
    - ticks (list) – list of major, medium and minor ticks

  class `qwt.scale_div.``QwtScaleDiv`(lowerBound, upperBound, minorTicks, mediumTicks, majorTicks)

    Parameters:

    - lowerBound (float) – First boundary
    - upperBound (float) – Second boundary
    - minorTicks (list) – list of minor ticks
    - mediumTicks (list) – list of medium ticks
    - majorTicks (list) – list of major ticks

  Note

  lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``setInterval`(*args)

    Change the interval

    `setInterval`(lowerBound, upperBound)

      Parameters:

      - lowerBound (float) – First boundary
      - upperBound (float) – Second boundary

    `setInterval`(interval)

      Parameters: | interval (qwt.interval.QwtInterval) – Interval

    Note

    lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``interval`()

    Returns: | Interval

  `QwtScaleDiv.``setLowerBound`(lowerBound)

    Set the first boundary

    Parameters: | lowerBound (float) – First boundary

    See also

    `lowerBound()`, `setUpperBound()`

  `QwtScaleDiv.``lowerBound`()

    Returns: | the first boundary

    See also

    `upperBound()`

  `QwtScaleDiv.``setUpperBound`(upperBound)

    Set the second boundary

    Parameters: | lowerBound (float) – Second boundary

    See also

    `upperBound()`, `setLowerBound()`

  `QwtScaleDiv.``upperBound`()

    Returns: | the second boundary

    See also

    `lowerBound()`

  `QwtScaleDiv.``range`()

    Returns: | upperBound() - lowerBound()

  `QwtScaleDiv.``isEmpty`()

    Check if the scale division is empty( lowerBound() == upperBound() )

  `QwtScaleDiv.``isIncreasing`()

    Check if the scale division is increasing( lowerBound() <= upperBound() )

  `QwtScaleDiv.``contains`(value)

    Return if a value is between lowerBound() and upperBound()

    Parameters: | value (float) – Value
    Returns: | True/False

  `QwtScaleDiv.``invert`()

    Invert the scale division

    See also

    `inverted()`

  `QwtScaleDiv.``inverted`()

    Returns: | A scale division with inverted boundaries and ticks

    See also

    `invert()`

  `QwtScaleDiv.``bounded`(lowerBound, upperBound)

    Return a scale division with an interval [lowerBound, upperBound] where all ticks outside this interval are removed

    Parameters:

    - lowerBound (float) – First boundary
    - lowerBound – Second boundary

    Returns: | Scale division with all ticks inside of the given interval

    Note

    lowerBound might be greater than upperBound for inverted scales

  `QwtScaleDiv.``setTicks`(tickType, ticks)

    Assign ticks

    Parameters:

    - type (int) – MinorTick, MediumTick or MajorTick
    - ticks (list) – Values of the tick positions

  `QwtScaleDiv.``ticks`(tickType)

    Return a list of ticks

    Parameters: | type (int) – MinorTick, MediumTick or MajorTick
    Returns: | Tick list

## QwtScaleEngine

class `qwt.scale_engine.``QwtScaleEngine`(base=10)

  Base class for scale engines.

  A scale engine tries to find “reasonable” ranges and step sizes for scales.

  The layout of the scale can be varied with setAttribute().

  PythonQwt offers implementations for logarithmic and linear scales.

  Layout attributes:

  > - QwtScaleEngine.NoAttribute: No attributes
  > - QwtScaleEngine.IncludeReference: Build a scale which includes the reference() value
  > - QwtScaleEngine.Symmetric: Build a scale which is symmetric to the reference() value
  > - QwtScaleEngine.Floating: The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is not set, the endpoints of the scale will be integer multiples of the step size.
  > - QwtScaleEngine.Inverted: Turn the scale upside down

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `setTransformation`(transform)

    Assign a transformation

    Parameters: | transform (qwt.transform.QwtTransform) – Transformation

    The transformation object is used as factory for clones that are returned by transformation()

    The scale engine takes ownership of the transformation.

    See also

    `QwtTransform.copy()`, `transformation()`

  `transformation`()

    Create and return a clone of the transformation of the engine. When the engine has no special transformation None is returned, indicating no transformation.

    Returns: | A clone of the transfomation

    See also

    `setTransformation()`

  `lowerMargin`()

    Returns: | the margin at the lower end of the scale

    The default margin is 0.

    See also

    `setMargins()`

  `upperMargin`()

    Returns: | the margin at the upper end of the scale

    The default margin is 0.

    See also

    `setMargins()`

  `setMargins`(lower, upper)

    Specify margins at the scale’s endpoints

    Parameters:

    - lower (float) – minimum distance between the scale’s lower boundary and the smallest enclosed value
    - upper (float) – minimum distance between the scale’s upper boundary and the greatest enclosed value

    Returns: | A clone of the transfomation

    Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale.

    Warning

    QwtLogScaleEngine measures the margins in decades.

    See also

    `upperMargin()`, `lowerMargin()`

  `divideInterval`(intervalSize, numSteps)

    Calculate a step size for a given interval

    Parameters:

    - intervalSize (float) – Interval size
    - numSteps (float) – Number of steps

    Returns: | Step size

  `contains`(interval, value)

    Check if an interval “contains” a value

    Parameters:

    - intervalSize (float) – Interval size
    - value (float) – Value

    Returns: | True, when the value is inside the interval

  `strip`(ticks, interval)

    Remove ticks from a list, that are not inside an interval

    Parameters:

    - ticks (list) – Tick list
    - interval (qwt.interval.QwtInterval) – Interval

    Returns: | Stripped tick list

  `buildInterval`(value)

    Build an interval around a value

    In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v]

    Parameters: | value (float) – Initial value
    Returns: | Calculated interval

  `setAttribute`(attribute, on=True)

    Change a scale attribute

    Parameters:

    - attribute (int) – Attribute to change
    - on (bool) – On/Off

    Returns: | Calculated interval

    See also

    `testAttribute()`

  `testAttribute`(attribute)

    Parameters: | attribute (int) – Attribute to be tested
    Returns: | True, if attribute is enabled

    See also

    `setAttribute()`

  `setAttributes`(attributes)

    Change the scale attribute

    Parameters: | attributes – Set scale attributes

    See also

    `attributes()`

  `attributes`()

    Returns: | Scale attributes

    See also

    `setAttributes()`, `testAttribute()`

  `setReference`(r)

    Specify a reference point

    Parameters: | r (float) – new reference value

    The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0.

  `reference`()

    Returns: | the reference value

    See also

    `setReference()`, `setAttribute()`

  `setBase`(base)

    Set the base of the scale engine

    While a base of 10 is what 99.9% of all applications need certain scales might need a different base: f.e 2

    The default setting is 10

    Parameters: | base (int) – Base of the engine

    See also

    `base()`

  `base`()

    Returns: | Base of the scale engine

    See also

    `setBase()`

## QwtLinearScaleEngine

class `qwt.scale_engine.``QwtLinearScaleEngine`(base=10)

  > A scale engine for linear scales

  > The step size will fit into the pattern

  $left{ 1,2,5 ight} cdot 10^{n} $, where n is an integer.

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

    See also

    `setAttribute()`

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division for an interval

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `buildTicks`(interval, stepSize, maxMinorSteps)

    Calculate ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size
    - maxMinorSteps (int) – Maximum number of minor steps

    Returns: | Calculated ticks

  `buildMajorTicks`(interval, stepSize)

    Calculate major ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Calculated ticks

  `buildMinorTicks`(ticks, maxMinorSteps, stepSize)

    Calculate minor ticks for an interval

    Parameters:

    - ticks (list) – Major ticks (returned)
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size

  `align`(interval, stepSize)

    Align an interval to a step size

    The limits of an interval are aligned that both are integer multiples of the step size.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Aligned interval

## QwtLogScaleEngine

class `qwt.scale_engine.``QwtLogScaleEngine`(base=10)

  A scale engine for logarithmic scales

  The step size is measured in decades and the major step size will be adjusted to fit the pattern {1,2,3,5}.10**n, where n is a natural number including zero.

  Warning

  The step size as well as the margins are measured in decades.

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

    See also

    `setAttribute()`

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division for an interval

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `buildTicks`(interval, stepSize, maxMinorSteps)

    Calculate ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size
    - maxMinorSteps (int) – Maximum number of minor steps

    Returns: | Calculated ticks

  `buildMajorTicks`(interval, stepSize)

    Calculate major ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Calculated ticks

  `buildMinorTicks`(ticks, maxMinorSteps, stepSize)

    Calculate minor ticks for an interval

    Parameters:

    - ticks (list) – Major ticks (returned)
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size

  `align`(interval, stepSize)

    Align an interval to a step size

    The limits of an interval are aligned that both are integer multiples of the step size.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Aligned interval

`qwt.scale_engine.``qwtStepSize`(intervalSize, maxSteps, base)

  this version often doesn’t find the best ticks: f.e for 15: 5, 10

`qwt.scale_engine.``ceilEps`(value, intervalSize)

  Ceil a value, relative to an interval

  Parameters:

  - value (float) – Value to be ceiled
  - intervalSize (float) – Interval size

  Returns: | Rounded value

  See also

  `qwt.scale_engine.floorEps()`

`qwt.scale_engine.``floorEps`(value, intervalSize)

  Floor a value, relative to an interval

  Parameters:

  - value (float) – Value to be floored
  - intervalSize (float) – Interval size

  Returns: | Rounded value

  See also

  `qwt.scale_engine.ceilEps()`

`qwt.scale_engine.``divideEps`(intervalSize, numSteps)

  Divide an interval into steps

  stepSize = (intervalSize - intervalSize * 10**-6) / numSteps

  Parameters:

  - intervalSize (float) – Interval size
  - numSteps (float) – Number of steps

  Returns: | Step size

`qwt.scale_engine.``divideInterval`(intervalSize, numSteps, base)

  Calculate a step size for a given interval

  Parameters:

  - intervalSize (float) – Interval size
  - numSteps (float) – Number of steps
  - base (int) – Base for the division (usually 10)

  Returns: | Calculated step size

class `qwt.scale_engine.``QwtScaleEngine`(base=10)

  Base class for scale engines.

  A scale engine tries to find “reasonable” ranges and step sizes for scales.

  The layout of the scale can be varied with setAttribute().

  PythonQwt offers implementations for logarithmic and linear scales.

  Layout attributes:

  > - QwtScaleEngine.NoAttribute: No attributes
  > - QwtScaleEngine.IncludeReference: Build a scale which includes the reference() value
  > - QwtScaleEngine.Symmetric: Build a scale which is symmetric to the reference() value
  > - QwtScaleEngine.Floating: The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is not set, the endpoints of the scale will be integer multiples of the step size.
  > - QwtScaleEngine.Inverted: Turn the scale upside down

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `setTransformation`(transform)

    Assign a transformation

    Parameters: | transform (qwt.transform.QwtTransform) – Transformation

    The transformation object is used as factory for clones that are returned by transformation()

    The scale engine takes ownership of the transformation.

    See also

    `QwtTransform.copy()`, `transformation()`

  `transformation`()

    Create and return a clone of the transformation of the engine. When the engine has no special transformation None is returned, indicating no transformation.

    Returns: | A clone of the transfomation

    See also

    `setTransformation()`

  `lowerMargin`()

    Returns: | the margin at the lower end of the scale

    The default margin is 0.

    See also

    `setMargins()`

  `upperMargin`()

    Returns: | the margin at the upper end of the scale

    The default margin is 0.

    See also

    `setMargins()`

  `setMargins`(lower, upper)

    Specify margins at the scale’s endpoints

    Parameters:

    - lower (float) – minimum distance between the scale’s lower boundary and the smallest enclosed value
    - upper (float) – minimum distance between the scale’s upper boundary and the greatest enclosed value

    Returns: | A clone of the transfomation

    Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale.

    Warning

    QwtLogScaleEngine measures the margins in decades.

    See also

    `upperMargin()`, `lowerMargin()`

  `divideInterval`(intervalSize, numSteps)

    Calculate a step size for a given interval

    Parameters:

    - intervalSize (float) – Interval size
    - numSteps (float) – Number of steps

    Returns: | Step size

  `contains`(interval, value)

    Check if an interval “contains” a value

    Parameters:

    - intervalSize (float) – Interval size
    - value (float) – Value

    Returns: | True, when the value is inside the interval

  `strip`(ticks, interval)

    Remove ticks from a list, that are not inside an interval

    Parameters:

    - ticks (list) – Tick list
    - interval (qwt.interval.QwtInterval) – Interval

    Returns: | Stripped tick list

  `buildInterval`(value)

    Build an interval around a value

    In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v]

    Parameters: | value (float) – Initial value
    Returns: | Calculated interval

  `setAttribute`(attribute, on=True)

    Change a scale attribute

    Parameters:

    - attribute (int) – Attribute to change
    - on (bool) – On/Off

    Returns: | Calculated interval

    See also

    `testAttribute()`

  `testAttribute`(attribute)

    Parameters: | attribute (int) – Attribute to be tested
    Returns: | True, if attribute is enabled

    See also

    `setAttribute()`

  `setAttributes`(attributes)

    Change the scale attribute

    Parameters: | attributes – Set scale attributes

    See also

    `attributes()`

  `attributes`()

    Returns: | Scale attributes

    See also

    `setAttributes()`, `testAttribute()`

  `setReference`(r)

    Specify a reference point

    Parameters: | r (float) – new reference value

    The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0.

  `reference`()

    Returns: | the reference value

    See also

    `setReference()`, `setAttribute()`

  `setBase`(base)

    Set the base of the scale engine

    While a base of 10 is what 99.9% of all applications need certain scales might need a different base: f.e 2

    The default setting is 10

    Parameters: | base (int) – Base of the engine

    See also

    `base()`

  `base`()

    Returns: | Base of the scale engine

    See also

    `setBase()`

class `qwt.scale_engine.``QwtLinearScaleEngine`(base=10)

  > A scale engine for linear scales

  > The step size will fit into the pattern

  $left{ 1,2,5 ight} cdot 10^{n} $, where n is an integer.

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

    See also

    `setAttribute()`

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division for an interval

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `buildTicks`(interval, stepSize, maxMinorSteps)

    Calculate ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size
    - maxMinorSteps (int) – Maximum number of minor steps

    Returns: | Calculated ticks

  `buildMajorTicks`(interval, stepSize)

    Calculate major ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Calculated ticks

  `buildMinorTicks`(ticks, maxMinorSteps, stepSize)

    Calculate minor ticks for an interval

    Parameters:

    - ticks (list) – Major ticks (returned)
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size

  `align`(interval, stepSize)

    Align an interval to a step size

    The limits of an interval are aligned that both are integer multiples of the step size.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Aligned interval

class `qwt.scale_engine.``QwtLogScaleEngine`(base=10)

  A scale engine for logarithmic scales

  The step size is measured in decades and the major step size will be adjusted to fit the pattern {1,2,3,5}.10**n, where n is a natural number including zero.

  Warning

  The step size as well as the margins are measured in decades.

  `autoScale`(maxNumSteps, x1, x2, stepSize)

    Align and divide an interval

    Parameters:

    - maxNumSteps (int) – Max. number of steps
    - x1 (float) – First limit of the interval (In/Out)
    - x2 (float) – Second limit of the interval (In/Out)
    - stepSize (float) – Step size

    Returns: | tuple (x1, x2, stepSize)

    See also

    `setAttribute()`

  `divideScale`(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)

    Calculate a scale division for an interval

    Parameters:

    - x1 (float) – First interval limit
    - x2 (float) – Second interval limit
    - maxMajorSteps (int) – Maximum for the number of major steps
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size. If stepSize == 0.0, the scaleEngine calculates one

    Returns: | Calculated scale division

  `buildTicks`(interval, stepSize, maxMinorSteps)

    Calculate ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size
    - maxMinorSteps (int) – Maximum number of minor steps

    Returns: | Calculated ticks

  `buildMajorTicks`(interval, stepSize)

    Calculate major ticks for an interval

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Calculated ticks

  `buildMinorTicks`(ticks, maxMinorSteps, stepSize)

    Calculate minor ticks for an interval

    Parameters:

    - ticks (list) – Major ticks (returned)
    - maxMinorSteps (int) – Maximum number of minor steps
    - stepSize (float) – Step size

  `align`(interval, stepSize)

    Align an interval to a step size

    The limits of an interval are aligned that both are integer multiples of the step size.

    Parameters:

    - interval (qwt.interval.QwtInterval) – Interval
    - stepSize (float) – Step size

    Returns: | Aligned interval

## QwtAbstractScaleDraw

class `qwt.scale_draw.``QwtAbstractScaleDraw`

  A abstract base class for drawing scales

  QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.

  After a scale division has been specified as a QwtScaleDiv object using setScaleDiv(), the scale can be drawn with the draw() member.

  Scale components:

  > - QwtAbstractScaleDraw.Backbone: Backbone = the line where the ticks are located
  > - QwtAbstractScaleDraw.Ticks: Ticks
  > - QwtAbstractScaleDraw.Labels: Labels

  class `QwtAbstractScaleDraw`

    The range of the scale is initialized to [0, 100], The spacing (distance between ticks and labels) is set to 4, the tick lengths are set to 4,6 and 8 pixels

  `QwtAbstractScaleDraw.``extent`(font)

    Calculate the extent

    The extent is the distance from the baseline to the outermost pixel of the scale draw in opposite to its orientation. It is at least minimumExtent() pixels.

    Parameters: | font (QFont) – Font used for drawing the tick labels
    Returns: | Number of pixels

    See also

    `setMinimumExtent()`, `minimumExtent()`

  `QwtAbstractScaleDraw.``drawTick`(painter, value, len_)

    Draw a tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value of the tick
    - len (float) – Length of the tick

    See also

    `drawBackbone()`, `drawLabel()`

  `QwtAbstractScaleDraw.``drawBackbone`(painter)

    Draws the baseline of the scale

    Parameters: | painter (QPainter) – Painter

    See also

    `drawTick()`, `drawLabel()`

  `QwtAbstractScaleDraw.``drawLabel`(painter, value)

    Draws the label for a major scale tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value

    See also

    `drawTick()`, `drawBackbone()`

  `QwtAbstractScaleDraw.``enableComponent`(component, enable)

    En/Disable a component of the scale

    Parameters:

    - component (int) – Scale component
    - enable (bool) – On/Off

    See also

    `hasComponent()`

  `QwtAbstractScaleDraw.``hasComponent`(component)

    Check if a component is enabled

    Parameters: | component (int) – Component type
    Returns: | True, when component is enabled

    See also

    `enableComponent()`

  `QwtAbstractScaleDraw.``setScaleDiv`(scaleDiv)

    Change the scale division

    Parameters: | scaleDiv (qwt.scale_div.QwtScaleDiv) – New scale division

  `QwtAbstractScaleDraw.``setTransformation`(transformation)

    Change the transformation of the scale

    Parameters: | transformation (qwt.transform.QwtTransform) – New scale transformation

  `QwtAbstractScaleDraw.``scaleMap`()

    Returns: | Map how to translate between scale and pixel values

  `QwtAbstractScaleDraw.``scaleDiv`()

    Returns: | scale division

  `QwtAbstractScaleDraw.``setPenWidth`(width)

    Specify the width of the scale pen

    Parameters: | width (int) – Pen width

    See also

    `penWidth()`

  `QwtAbstractScaleDraw.``penWidth`()

    Returns: | Scale pen width

    See also

    `setPenWidth()`

  `QwtAbstractScaleDraw.``draw`(painter, palette)

    Draw the scale

    Parameters:

    - painter (QPainter) – The painter
    - palette (QPalette) – Palette, text color is used for the labels, foreground color for ticks and backbone

  `QwtAbstractScaleDraw.``setSpacing`(spacing)

    Set the spacing between tick and labels

    The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

    Parameters: | spacing (float) – Spacing

    See also

    `spacing()`

  `QwtAbstractScaleDraw.``spacing`()

    Get the spacing

    The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

    Returns: | Spacing

    See also

    `setSpacing()`

  `QwtAbstractScaleDraw.``setMinimumExtent`(minExtent)

    Set a minimum for the extent

    The extent is calculated from the components of the scale draw. In situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale), setting an upper limit as minimum extent will avoid jumps of the layout.

    Parameters: | minExtent (float) – Minimum extent

    See also

    `extent()`, `minimumExtent()`

  `QwtAbstractScaleDraw.``minimumExtent`()

    Get the minimum extent

    Returns: | Minimum extent

    See also

    `extent()`, `setMinimumExtent()`

  `QwtAbstractScaleDraw.``setTickLength`(tickType, length)

    Set the length of the ticks

    Parameters:

    - tickType (int) – Tick type
    - length (float) – New length

    Warning

    the length is limited to [0..1000]

  `QwtAbstractScaleDraw.``tickLength`(tickType)

    Returns: | Length of the ticks

    See also

    `setTickLength()`, `maxTickLength()`

  `QwtAbstractScaleDraw.``maxTickLength`()

    Returns: | Length of the longest tick

    Useful for layout calculations

    See also

    `tickLength()`, `setTickLength()`

  `QwtAbstractScaleDraw.``label`(value)

    Convert a value into its representing label

    The value is converted to a plain text using QLocale().toString(value). This method is often overloaded by applications to have individual labels.

    Parameters: | value (float) – Value
    Returns: | Label string

  `QwtAbstractScaleDraw.``tickLabel`(font, value)

    Convert a value into its representing label and cache it.

    The conversion between value and label is called very often in the layout and painting code. Unfortunately the calculation of the label sizes might be slow (really slow for rich text in Qt4), so it’s necessary to cache the labels.

    Parameters:

    - font (QFont) – Font
    - value (float) – Value

    Returns: | Tick label

  `QwtAbstractScaleDraw.``invalidateCache`()

    Invalidate the cache used by tickLabel()

    The cache is invalidated, when a new QwtScaleDiv is set. If the labels need to be changed. while the same QwtScaleDiv is set, invalidateCache() needs to be called manually.

## QwtScaleDraw

class `qwt.scale_draw.``QwtScaleDraw`

  A class for drawing scales

  QwtScaleDraw can be used to draw linear or logarithmic scales. A scale has a position, an alignment and a length, which can be specified . The labels can be rotated and aligned to the ticks using setLabelRotation() and setLabelAlignment().

  After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw.setScaleDiv(scaleDiv), the scale can be drawn with the QwtAbstractScaleDraw.draw() member.

  Alignment of the scale draw:

  > - QwtScaleDraw.BottomScale: The scale is below
  > - QwtScaleDraw.TopScale: The scale is above
  > - QwtScaleDraw.LeftScale: The scale is left
  > - QwtScaleDraw.RightScale: The scale is right

  class `QwtAbstractScaleDraw`

    The range of the scale is initialized to [0, 100], The position is at (0, 0) with a length of 100. The orientation is QwtAbstractScaleDraw.Bottom.

  `QwtScaleDraw.``alignment`()

    Returns: | Alignment of the scale

    See also

    `setAlignment()`

  `QwtScaleDraw.``setAlignment`(align)

    Set the alignment of the scale

    Parameters: | align (int) – Alignment of the scale

    Alignment of the scale draw:

    > > - QwtScaleDraw.BottomScale: The scale is below
    > > - QwtScaleDraw.TopScale: The scale is above
    > > - QwtScaleDraw.LeftScale: The scale is left
    > > - QwtScaleDraw.RightScale: The scale is right

    > The default alignment is QwtScaleDraw.BottomScale

    See also

    `alignment()`

  `QwtScaleDraw.``orientation`()

    Return the orientation

    TopScale, BottomScale are horizontal (Qt.Horizontal) scales, LeftScale, RightScale are vertical (Qt.Vertical) scales.

    Returns: | Orientation of the scale

    See also

    `alignment()`

  `QwtScaleDraw.``getBorderDistHint`(font)

    Determine the minimum border distance

    This member function returns the minimum space needed to draw the mark labels at the scale’s endpoints.

    Parameters: | font (QFont) – Font
    Returns: | tuple (start, end)

    Returned tuple:

    > - start: Start border distance
    > - end: End border distance

  `QwtScaleDraw.``minLabelDist`(font)

    Determine the minimum distance between two labels, that is necessary that the texts don’t overlap.

    Parameters: | font (QFont) – Font
    Returns: | The maximum width of a label

    See also

    `getBorderDistHint()`

  `QwtScaleDraw.``extent`(font)

    Calculate the width/height that is needed for a vertical/horizontal scale.

    The extent is calculated from the pen width of the backbone, the major tick length, the spacing and the maximum width/height of the labels.

    Parameters: | font (QFont) – Font used for painting the labels
    Returns: | Extent

    See also

    `minLength()`

  `QwtScaleDraw.``minLength`(font)

    Calculate the minimum length that is needed to draw the scale

    Parameters: | font (QFont) – Font used for painting the labels
    Returns: | Minimum length that is needed to draw the scale

    See also

    `extent()`

  `QwtScaleDraw.``labelPosition`(value)

    Find the position, where to paint a label

    The position has a distance that depends on the length of the ticks in direction of the alignment().

    Parameters: | value (float) – Value
    Returns: | Position, where to paint a label

  `QwtScaleDraw.``drawTick`(painter, value, len_)

    Draw a tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value of the tick
    - len (float) – Length of the tick

    See also

    `drawBackbone()`, `drawLabel()`

  `QwtScaleDraw.``drawBackbone`(painter)

    Draws the baseline of the scale

    Parameters: | painter (QPainter) – Painter

    See also

    `drawTick()`, `drawLabel()`

  `QwtScaleDraw.``move`(*args)

    Move the position of the scale

    The meaning of the parameter pos depends on the alignment:

    > - QwtScaleDraw.LeftScale:

    >   The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and labels are drawn at the left of the backbone.

    > - QwtScaleDraw.RightScale:

    >   The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and labels are drawn at the right of the backbone.

    > - QwtScaleDraw.TopScale:

    >   The origin is the leftmost point of the backbone. The backbone is a horizontal line. Scale marks and labels are drawn above the backbone.

    > - QwtScaleDraw.BottomScale:

    >   The origin is the leftmost point of the backbone. The backbone is a horizontal line Scale marks and labels are drawn below the backbone.

    `move`(x, y)

      Parameters:

      - x (float) – X coordinate
      - y (float) – Y coordinate

    `move`(pos)

      Parameters: | pos (QPointF) – position

    See also

    `pos()`, `setLength()`

  `QwtScaleDraw.``pos`()

    Returns: | Origin of the scale

    See also

    `pos()`, `setLength()`

  `QwtScaleDraw.``setLength`(length)

    Set the length of the backbone.

    The length doesn’t include the space needed for overlapping labels.

    Parameters: | length (float) – Length of the backbone

    See also

    `move()`, `minLabelDist()`

  `QwtScaleDraw.``length`()

    Returns: | the length of the backbone

    See also

    `setLength()`, `pos()`

  `QwtScaleDraw.``drawLabel`(painter, value)

    Draws the label for a major scale tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value

    See also

    `drawTick()`, `drawBackbone()`, `boundingLabelRect()`

  `QwtScaleDraw.``boundingLabelRect`(font, value)

    Find the bounding rectangle for the label.

    The coordinates of the rectangle are absolute (calculated from pos()) in direction of the tick.

    Parameters:

    - font (QFont) – Font used for painting
    - value (float) – Value

    Returns: | Bounding rectangle

    See also

    `labelRect()`

  `QwtScaleDraw.``labelTransformation`(pos, size)

    Calculate the transformation that is needed to paint a label depending on its alignment and rotation.

    Parameters:

    - pos (QPointF) – Position where to paint the label
    - size (QSizeF) – Size of the label

    Returns: | Transformation matrix

    See also

    `setLabelAlignment()`, `setLabelRotation()`

  `QwtScaleDraw.``labelRect`(font, value)

    Find the bounding rectangle for the label. The coordinates of the rectangle are relative to spacing + tick length from the backbone in direction of the tick.

    Parameters:

    - font (QFont) – Font used for painting
    - value (float) – Value

    Returns: | Bounding rectangle that is needed to draw a label

  `QwtScaleDraw.``labelSize`(font, value)

    Calculate the size that is needed to draw a label

    Parameters:

    - font (QFont) – Label font
    - value (float) – Value

    Returns: | Size that is needed to draw a label

  `QwtScaleDraw.``setLabelRotation`(rotation)

    Rotate all labels.

    When changing the rotation, it might be necessary to adjust the label flags too. Finding a useful combination is often the result of try and error.

    Parameters: | rotation (float) – Angle in degrees. When changing the label rotation, the label flags often needs to be adjusted too.

    See also

    `setLabelAlignment()`, `labelRotation()`, `labelAlignment()`

  `QwtScaleDraw.``labelRotation`()

    Returns: | the label rotation

    See also

    `setLabelRotation()`, `labelAlignment()`

  `QwtScaleDraw.``setLabelAlignment`(alignment)

    Change the label flags

    Labels are aligned to the point tick length + spacing away from the backbone.

    The alignment is relative to the orientation of the label text. In case of an flags of 0 the label will be aligned depending on the orientation of the scale:

    > - QwtScaleDraw.TopScale: Qt.AlignHCenter | Qt.AlignTop
    > - QwtScaleDraw.BottomScale: Qt.AlignHCenter | Qt.AlignBottom
    > - QwtScaleDraw.LeftScale: Qt.AlignLeft | Qt.AlignVCenter
    > - QwtScaleDraw.RightScale: Qt.AlignRight | Qt.AlignVCenter

    Changing the alignment is often necessary for rotated labels.

    :param Qt.Alignment alignment Or’d Qt.AlignmentFlags

    See also

    `setLabelRotation()`, `labelRotation()`, `labelAlignment()`

    Warning

    The various alignments might be confusing. The alignment of the label is not the alignment of the scale and is not the alignment of the flags (QwtText.flags()) returned from QwtAbstractScaleDraw.label().

  `QwtScaleDraw.``labelAlignment`()

    Returns: | the label flags

    See also

    `setLabelAlignment()`, `labelRotation()`

  `QwtScaleDraw.``setLabelAutoSize`(state)

    Set label automatic size option state

    When drawing text labels, if automatic size mode is enabled (default behavior), the axes are drawn in order to optimize layout space and depends on text label individual sizes. Otherwise, width and height won’t change when axis range is changing.

    This option is not implemented in Qwt C++ library: this may be used either as an optimization (updating plot layout is faster when this option is enabled) or as an appearance preference (with Qwt default behavior, the size of axes may change when zooming and/or panning plot canvas which in some cases may not be desired).

    Parameters: | state (bool) – On/off

    See also

    `labelAutoSize()`

  `QwtScaleDraw.``labelAutoSize`()

    Returns: | True if automatic size option is enabled for labels

    See also

    `setLabelAutoSize()`

  `QwtScaleDraw.``maxLabelWidth`(font)

    Parameters: | font (QFont) – Font
    Returns: | the maximum width of a label

  `QwtScaleDraw.``maxLabelHeight`(font)

    Parameters: | font (QFont) – Font
    Returns: | the maximum height of a label

class `qwt.scale_draw.``QwtAbstractScaleDraw`

  A abstract base class for drawing scales

  QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.

  After a scale division has been specified as a QwtScaleDiv object using setScaleDiv(), the scale can be drawn with the draw() member.

  Scale components:

  > - QwtAbstractScaleDraw.Backbone: Backbone = the line where the ticks are located
  > - QwtAbstractScaleDraw.Ticks: Ticks
  > - QwtAbstractScaleDraw.Labels: Labels

  class `QwtAbstractScaleDraw`

    The range of the scale is initialized to [0, 100], The spacing (distance between ticks and labels) is set to 4, the tick lengths are set to 4,6 and 8 pixels

  `QwtAbstractScaleDraw.``extent`(font)

    Calculate the extent

    The extent is the distance from the baseline to the outermost pixel of the scale draw in opposite to its orientation. It is at least minimumExtent() pixels.

    Parameters: | font (QFont) – Font used for drawing the tick labels
    Returns: | Number of pixels

    See also

    `setMinimumExtent()`, `minimumExtent()`

  `QwtAbstractScaleDraw.``drawTick`(painter, value, len_)

    Draw a tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value of the tick
    - len (float) – Length of the tick

    See also

    `drawBackbone()`, `drawLabel()`

  `QwtAbstractScaleDraw.``drawBackbone`(painter)

    Draws the baseline of the scale

    Parameters: | painter (QPainter) – Painter

    See also

    `drawTick()`, `drawLabel()`

  `QwtAbstractScaleDraw.``drawLabel`(painter, value)

    Draws the label for a major scale tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value

    See also

    `drawTick()`, `drawBackbone()`

  `QwtAbstractScaleDraw.``enableComponent`(component, enable)

    En/Disable a component of the scale

    Parameters:

    - component (int) – Scale component
    - enable (bool) – On/Off

    See also

    `hasComponent()`

  `QwtAbstractScaleDraw.``hasComponent`(component)

    Check if a component is enabled

    Parameters: | component (int) – Component type
    Returns: | True, when component is enabled

    See also

    `enableComponent()`

  `QwtAbstractScaleDraw.``setScaleDiv`(scaleDiv)

    Change the scale division

    Parameters: | scaleDiv (qwt.scale_div.QwtScaleDiv) – New scale division

  `QwtAbstractScaleDraw.``setTransformation`(transformation)

    Change the transformation of the scale

    Parameters: | transformation (qwt.transform.QwtTransform) – New scale transformation

  `QwtAbstractScaleDraw.``scaleMap`()

    Returns: | Map how to translate between scale and pixel values

  `QwtAbstractScaleDraw.``scaleDiv`()

    Returns: | scale division

  `QwtAbstractScaleDraw.``setPenWidth`(width)

    Specify the width of the scale pen

    Parameters: | width (int) – Pen width

    See also

    `penWidth()`

  `QwtAbstractScaleDraw.``penWidth`()

    Returns: | Scale pen width

    See also

    `setPenWidth()`

  `QwtAbstractScaleDraw.``draw`(painter, palette)

    Draw the scale

    Parameters:

    - painter (QPainter) – The painter
    - palette (QPalette) – Palette, text color is used for the labels, foreground color for ticks and backbone

  `QwtAbstractScaleDraw.``setSpacing`(spacing)

    Set the spacing between tick and labels

    The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

    Parameters: | spacing (float) – Spacing

    See also

    `spacing()`

  `QwtAbstractScaleDraw.``spacing`()

    Get the spacing

    The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

    Returns: | Spacing

    See also

    `setSpacing()`

  `QwtAbstractScaleDraw.``setMinimumExtent`(minExtent)

    Set a minimum for the extent

    The extent is calculated from the components of the scale draw. In situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale), setting an upper limit as minimum extent will avoid jumps of the layout.

    Parameters: | minExtent (float) – Minimum extent

    See also

    `extent()`, `minimumExtent()`

  `QwtAbstractScaleDraw.``minimumExtent`()

    Get the minimum extent

    Returns: | Minimum extent

    See also

    `extent()`, `setMinimumExtent()`

  `QwtAbstractScaleDraw.``setTickLength`(tickType, length)

    Set the length of the ticks

    Parameters:

    - tickType (int) – Tick type
    - length (float) – New length

    Warning

    the length is limited to [0..1000]

  `QwtAbstractScaleDraw.``tickLength`(tickType)

    Returns: | Length of the ticks

    See also

    `setTickLength()`, `maxTickLength()`

  `QwtAbstractScaleDraw.``maxTickLength`()

    Returns: | Length of the longest tick

    Useful for layout calculations

    See also

    `tickLength()`, `setTickLength()`

  `QwtAbstractScaleDraw.``label`(value)

    Convert a value into its representing label

    The value is converted to a plain text using QLocale().toString(value). This method is often overloaded by applications to have individual labels.

    Parameters: | value (float) – Value
    Returns: | Label string

  `QwtAbstractScaleDraw.``tickLabel`(font, value)

    Convert a value into its representing label and cache it.

    The conversion between value and label is called very often in the layout and painting code. Unfortunately the calculation of the label sizes might be slow (really slow for rich text in Qt4), so it’s necessary to cache the labels.

    Parameters:

    - font (QFont) – Font
    - value (float) – Value

    Returns: | Tick label

  `QwtAbstractScaleDraw.``invalidateCache`()

    Invalidate the cache used by tickLabel()

    The cache is invalidated, when a new QwtScaleDiv is set. If the labels need to be changed. while the same QwtScaleDiv is set, invalidateCache() needs to be called manually.

class `qwt.scale_draw.``QwtScaleDraw`

  A class for drawing scales

  QwtScaleDraw can be used to draw linear or logarithmic scales. A scale has a position, an alignment and a length, which can be specified . The labels can be rotated and aligned to the ticks using setLabelRotation() and setLabelAlignment().

  After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw.setScaleDiv(scaleDiv), the scale can be drawn with the QwtAbstractScaleDraw.draw() member.

  Alignment of the scale draw:

  > - QwtScaleDraw.BottomScale: The scale is below
  > - QwtScaleDraw.TopScale: The scale is above
  > - QwtScaleDraw.LeftScale: The scale is left
  > - QwtScaleDraw.RightScale: The scale is right

  class `QwtAbstractScaleDraw`

    The range of the scale is initialized to [0, 100], The position is at (0, 0) with a length of 100. The orientation is QwtAbstractScaleDraw.Bottom.

  `QwtScaleDraw.``alignment`()

    Returns: | Alignment of the scale

    See also

    `setAlignment()`

  `QwtScaleDraw.``setAlignment`(align)

    Set the alignment of the scale

    Parameters: | align (int) – Alignment of the scale

    Alignment of the scale draw:

    > > - QwtScaleDraw.BottomScale: The scale is below
    > > - QwtScaleDraw.TopScale: The scale is above
    > > - QwtScaleDraw.LeftScale: The scale is left
    > > - QwtScaleDraw.RightScale: The scale is right

    > The default alignment is QwtScaleDraw.BottomScale

    See also

    `alignment()`

  `QwtScaleDraw.``orientation`()

    Return the orientation

    TopScale, BottomScale are horizontal (Qt.Horizontal) scales, LeftScale, RightScale are vertical (Qt.Vertical) scales.

    Returns: | Orientation of the scale

    See also

    `alignment()`

  `QwtScaleDraw.``getBorderDistHint`(font)

    Determine the minimum border distance

    This member function returns the minimum space needed to draw the mark labels at the scale’s endpoints.

    Parameters: | font (QFont) – Font
    Returns: | tuple (start, end)

    Returned tuple:

    > - start: Start border distance
    > - end: End border distance

  `QwtScaleDraw.``minLabelDist`(font)

    Determine the minimum distance between two labels, that is necessary that the texts don’t overlap.

    Parameters: | font (QFont) – Font
    Returns: | The maximum width of a label

    See also

    `getBorderDistHint()`

  `QwtScaleDraw.``extent`(font)

    Calculate the width/height that is needed for a vertical/horizontal scale.

    The extent is calculated from the pen width of the backbone, the major tick length, the spacing and the maximum width/height of the labels.

    Parameters: | font (QFont) – Font used for painting the labels
    Returns: | Extent

    See also

    `minLength()`

  `QwtScaleDraw.``minLength`(font)

    Calculate the minimum length that is needed to draw the scale

    Parameters: | font (QFont) – Font used for painting the labels
    Returns: | Minimum length that is needed to draw the scale

    See also

    `extent()`

  `QwtScaleDraw.``labelPosition`(value)

    Find the position, where to paint a label

    The position has a distance that depends on the length of the ticks in direction of the alignment().

    Parameters: | value (float) – Value
    Returns: | Position, where to paint a label

  `QwtScaleDraw.``drawTick`(painter, value, len_)

    Draw a tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value of the tick
    - len (float) – Length of the tick

    See also

    `drawBackbone()`, `drawLabel()`

  `QwtScaleDraw.``drawBackbone`(painter)

    Draws the baseline of the scale

    Parameters: | painter (QPainter) – Painter

    See also

    `drawTick()`, `drawLabel()`

  `QwtScaleDraw.``move`(*args)

    Move the position of the scale

    The meaning of the parameter pos depends on the alignment:

    > - QwtScaleDraw.LeftScale:

    >   The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and labels are drawn at the left of the backbone.

    > - QwtScaleDraw.RightScale:

    >   The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and labels are drawn at the right of the backbone.

    > - QwtScaleDraw.TopScale:

    >   The origin is the leftmost point of the backbone. The backbone is a horizontal line. Scale marks and labels are drawn above the backbone.

    > - QwtScaleDraw.BottomScale:

    >   The origin is the leftmost point of the backbone. The backbone is a horizontal line Scale marks and labels are drawn below the backbone.

    `move`(x, y)

      Parameters:

      - x (float) – X coordinate
      - y (float) – Y coordinate

    `move`(pos)

      Parameters: | pos (QPointF) – position

    See also

    `pos()`, `setLength()`

  `QwtScaleDraw.``pos`()

    Returns: | Origin of the scale

    See also

    `pos()`, `setLength()`

  `QwtScaleDraw.``setLength`(length)

    Set the length of the backbone.

    The length doesn’t include the space needed for overlapping labels.

    Parameters: | length (float) – Length of the backbone

    See also

    `move()`, `minLabelDist()`

  `QwtScaleDraw.``length`()

    Returns: | the length of the backbone

    See also

    `setLength()`, `pos()`

  `QwtScaleDraw.``drawLabel`(painter, value)

    Draws the label for a major scale tick

    Parameters:

    - painter (QPainter) – Painter
    - value (float) – Value

    See also

    `drawTick()`, `drawBackbone()`, `boundingLabelRect()`

  `QwtScaleDraw.``boundingLabelRect`(font, value)

    Find the bounding rectangle for the label.

    The coordinates of the rectangle are absolute (calculated from pos()) in direction of the tick.

    Parameters:

    - font (QFont) – Font used for painting
    - value (float) – Value

    Returns: | Bounding rectangle

    See also

    `labelRect()`

  `QwtScaleDraw.``labelTransformation`(pos, size)

    Calculate the transformation that is needed to paint a label depending on its alignment and rotation.

    Parameters:

    - pos (QPointF) – Position where to paint the label
    - size (QSizeF) – Size of the label

    Returns: | Transformation matrix

    See also

    `setLabelAlignment()`, `setLabelRotation()`

  `QwtScaleDraw.``labelRect`(font, value)

    Find the bounding rectangle for the label. The coordinates of the rectangle are relative to spacing + tick length from the backbone in direction of the tick.

    Parameters:

    - font (QFont) – Font used for painting
    - value (float) – Value

    Returns: | Bounding rectangle that is needed to draw a label

  `QwtScaleDraw.``labelSize`(font, value)

    Calculate the size that is needed to draw a label

    Parameters:

    - font (QFont) – Label font
    - value (float) – Value

    Returns: | Size that is needed to draw a label

  `QwtScaleDraw.``setLabelRotation`(rotation)

    Rotate all labels.

    When changing the rotation, it might be necessary to adjust the label flags too. Finding a useful combination is often the result of try and error.

    Parameters: | rotation (float) – Angle in degrees. When changing the label rotation, the label flags often needs to be adjusted too.

    See also

    `setLabelAlignment()`, `labelRotation()`, `labelAlignment()`

  `QwtScaleDraw.``labelRotation`()

    Returns: | the label rotation

    See also

    `setLabelRotation()`, `labelAlignment()`

  `QwtScaleDraw.``setLabelAlignment`(alignment)

    Change the label flags

    Labels are aligned to the point tick length + spacing away from the backbone.

    The alignment is relative to the orientation of the label text. In case of an flags of 0 the label will be aligned depending on the orientation of the scale:

    > - QwtScaleDraw.TopScale: Qt.AlignHCenter | Qt.AlignTop
    > - QwtScaleDraw.BottomScale: Qt.AlignHCenter | Qt.AlignBottom
    > - QwtScaleDraw.LeftScale: Qt.AlignLeft | Qt.AlignVCenter
    > - QwtScaleDraw.RightScale: Qt.AlignRight | Qt.AlignVCenter

    Changing the alignment is often necessary for rotated labels.

    :param Qt.Alignment alignment Or’d Qt.AlignmentFlags

    See also

    `setLabelRotation()`, `labelRotation()`, `labelAlignment()`

    Warning

    The various alignments might be confusing. The alignment of the label is not the alignment of the scale and is not the alignment of the flags (QwtText.flags()) returned from QwtAbstractScaleDraw.label().

  `QwtScaleDraw.``labelAlignment`()

    Returns: | the label flags

    See also

    `setLabelAlignment()`, `labelRotation()`

  `QwtScaleDraw.``setLabelAutoSize`(state)

    Set label automatic size option state

    When drawing text labels, if automatic size mode is enabled (default behavior), the axes are drawn in order to optimize layout space and depends on text label individual sizes. Otherwise, width and height won’t change when axis range is changing.

    This option is not implemented in Qwt C++ library: this may be used either as an optimization (updating plot layout is faster when this option is enabled) or as an appearance preference (with Qwt default behavior, the size of axes may change when zooming and/or panning plot canvas which in some cases may not be desired).

    Parameters: | state (bool) – On/off

    See also

    `labelAutoSize()`

  `QwtScaleDraw.``labelAutoSize`()

    Returns: | True if automatic size option is enabled for labels

    See also

    `setLabelAutoSize()`

  `QwtScaleDraw.``maxLabelWidth`(font)

    Parameters: | font (QFont) – Font
    Returns: | the maximum width of a label

  `QwtScaleDraw.``maxLabelHeight`(font)

    Parameters: | font (QFont) – Font
    Returns: | the maximum height of a label