Scales — PythonQwt 0.14 Manual (original) (raw)

QwtScaleMap

class qwt.scale_map.QwtScaleMap(*args)[source]

A scale map

QwtScaleMap offers transformations from the coordinate system of a scale into the linear coordinate system of a paint device and vice versa.

The scale and paint device intervals are both set to [0,1].

class QwtScaleMap([_other=None_])

Constructor (eventually, copy constructor)

Parameters:

other (qwt.scale_map.QwtScaleMap) – Other scale map

class QwtScaleMap(p1, p2, s1, s2)

Constructor (was provided by PyQwt but not by Qwt)

Parameters:

s1()[source]

Returns:

First border of the scale interval

s2()[source]

Returns:

Second border of the scale interval

p1()[source]

Returns:

First border of the paint interval

p2()[source]

Returns:

Second border of the paint interval

pDist()[source]

Returns:

abs(p2() - p1())

sDist()[source]

Returns:

abs(s2() - s1())

transform_scalar(s)[source]

Transform a point related to the scale interval into an point related to the interval of the paint device

Parameters:

s (float) – Value relative to the coordinates of the scale

Returns:

Transformed value

invTransform_scalar(p)[source]

Transform an paint device value into a value in the interval of the scale.

Parameters:

p (float) – Value relative to the coordinates of the paint device

Returns:

Transformed value

See also

transform_scalar()

isInverting()[source]

Returns:

True, when ( p1() < p2() ) != ( s1() < s2() )

setTransformation(transform)[source]

Initialize the map with a transformation

Parameters:

transform (qwt.transform.QwtTransform) – Transformation

transformation()[source]

Returns:

the transformation

setScaleInterval(s1, s2)[source]

Specify the borders of the scale interval

Parameters:

Warning

Scales might be aligned to transformation depending boundaries

setPaintInterval(p1, p2)[source]

Specify the borders of the paint device interval

Parameters:

transform(*args)[source]

Transform a rectangle from scale to paint coordinates.

Transfom a scalar:

Parameters:

scalar (float) – Scalar

Transfom a rectangle:

Parameters:

Transfom a point:

Parameters:

invTransform(*args)[source]

Transform from paint to scale coordinates

Scalar: scalemap.invTransform(scalar) Point (QPointF): scalemap.invTransform(xMap, yMap, pos) Rectangle (QRectF): scalemap.invTransform(xMap, yMap, rect)

QwtScaleWidget

class qwt.scale_widget.QwtScaleWidget(*args)[source]

A Widget which contains a scale

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

Layout flags:

class QwtScaleWidget([_parent=None_])

Alignment default is QwtScaleDraw.LeftScale.

Parameters:

parent (QWidget or None) – Parent widget

class QwtScaleWidget(align, parent)

Parameters:

initScale(align)[source]

Initialize the scale

Parameters:

align (int) – Alignment

setLayoutFlag(flag, on=True)[source]

Toggle an layout flag

Parameters:

See also

testLayoutFlag()

testLayoutFlag(flag)[source]

Test a layout flag

Parameters:

flag (int) – Layout flag

Returns:

True/False

setTitle(title)[source]

Give title new text contents

Parameters:

title (qwt.text.QwtText or str) – New title

setAlignment(alignment)[source]

Change the alignment

Parameters:

alignment (int) – New alignment

Valid alignment values: see qwt.scale_draw.QwtScaleDraw

alignment()[source]

Returns:

position

setBorderDist(dist1, dist2)[source]

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

Parameters:

setMargin(margin)[source]

Specify the margin to the colorBar/base line.

Parameters:

margin (int) – Margin

setSpacing(spacing)[source]

Specify the distance between color bar, scale and title

Parameters:

spacing (int) – Spacing

setLabelAlignment(alignment)[source]

Change the alignment for the labels.

Parameters:

spacing (int) – Spacing

setLabelRotation(rotation)[source]

Change the rotation for the labels.

Parameters:

rotation (float) – Rotation

See also

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

setLabelAutoSize(state)[source]

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

Parameters:

state (bool) – On/off

setScaleDraw(scaleDraw)[source]

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

scaleDraw()[source]

Returns:

scaleDraw of this scale

See also

qwt.scale_draw.QwtScaleDraw.setScaleDraw()

title()[source]

Returns:

title

startBorderDist()[source]

Returns:

start border distance

endBorderDist()[source]

Returns:

end border distance

margin()[source]

Returns:

margin

spacing()[source]

Returns:

distance between scale and title

paintEvent(self, a0: QPaintEvent | None)[source]

draw(painter)[source]

Draw the scale

Parameters:

painter (QPainter) – Painter

colorBarRect(rect)[source]

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

resizeEvent(self, a0: QResizeEvent | None)[source]

layoutScale(update_geometry=True)[source]

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

drawColorBar(painter, rect)[source]

Draw the color bar of the scale widget

Parameters:

drawTitle(painter, align, rect)[source]

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

Parameters:

scaleChange()[source]

Notify a change of the scale

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

sizeHint(self) → QSize[source]

minimumSizeHint(self) → QSize[source]

titleHeightForWidth(width)[source]

Find the height of the title for a given width.

Parameters:

width (int) – Width

Returns:

Height

dimForLength(length, scaleFont)[source]

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

Parameters:

Returns:

height for horizontal, width for vertical scales

getBorderDistHint()[source]

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:

Warning

The minimum border distance depends on the font.

setMinBorderDist(start, end)[source]

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:

getMinBorderDist()[source]

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

Parameters:

setScaleDiv(scaleDiv)[source]

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.

setTransformation(transformation)[source]

Set the transformation

Parameters:

transformation (qwt.transform.Transform) – Transformation

See also

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

setColorBarEnabled(on)[source]

En/disable a color bar associated to the scale

Parameters:

on (bool) – On/Off

isColorBarEnabled()[source]

Returns:

True, when the color bar is enabled

setColorBarWidth(width)[source]

Set the width of the color bar

Parameters:

width (int) – Width

colorBarWidth()[source]

Returns:

Width of the color bar

colorBarInterval()[source]

Returns:

Value interval for the color bar

setColorMap(interval, colorMap)[source]

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

Parameters:

colorMap()[source]

Returns:

Color map

QwtScaleDiv

class qwt.scale_div.QwtScaleDiv(*args)[source]

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.

Scale tick types:

class QwtScaleDiv

Basic constructor. Lower bound = Upper bound = 0.

class QwtScaleDiv(interval, ticks)

Parameters:

class QwtScaleDiv(lowerBound, upperBound)

Parameters:

class QwtScaleDiv(lowerBound, upperBound, ticks)

Parameters:

class QwtScaleDiv(lowerBound, upperBound, minorTicks, mediumTicks, majorTicks)

Parameters:

Note

lowerBound might be greater than upperBound for inverted scales

setInterval(*args)[source]

Change the interval

setInterval(lowerBound, upperBound)[source]

Parameters:

setInterval(interval)[source]

Parameters:

interval (qwt.interval.QwtInterval) – Interval

Note

lowerBound might be greater than upperBound for inverted scales

interval()[source]

Returns:

Interval

setLowerBound(lowerBound)[source]

Set the first boundary

Parameters:

lowerBound (float) – First boundary

lowerBound()[source]

Returns:

the first boundary

setUpperBound(upperBound)[source]

Set the second boundary

Parameters:

lowerBound (float) – Second boundary

upperBound()[source]

Returns:

the second boundary

range()[source]

Returns:

upperBound() - lowerBound()

isEmpty()[source]

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

isIncreasing()[source]

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

contains(value)[source]

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

Parameters:

value (float) – Value

Returns:

True/False

invert()[source]

Invert the scale division

inverted()[source]

Returns:

A scale division with inverted boundaries and ticks

bounded(lowerBound, upperBound)[source]

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

Parameters:

Returns:

Scale division with all ticks inside of the given interval

Note

lowerBound might be greater than upperBound for inverted scales

setTicks(tickType, ticks)[source]

Assign ticks

Parameters:

ticks(tickType)[source]

Return a list of ticks

Parameters:

type (int) – MinorTick, MediumTick or MajorTick

Returns:

Tick list

QwtScaleEngine

class qwt.scale_engine.QwtScaleEngine(base=10)[source]

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:

autoScale(maxNumSteps, x1, x2, stepSize, relativeMargin=0.0)[source]

Align and divide an interval

Parameters:

Returns:

tuple (x1, x2, stepSize)

divideScale(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)[source]

Calculate a scale division

Parameters:

Returns:

Calculated scale division

setTransformation(transform)[source]

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()[source]

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

lowerMargin()[source]

Returns:

the margin at the lower end of the scale

The default margin is 0.

upperMargin()[source]

Returns:

the margin at the upper end of the scale

The default margin is 0.

setMargins(lower, upper)[source]

Specify margins at the scale’s endpoints

Parameters:

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.

divideInterval(intervalSize, numSteps)[source]

Calculate a step size for a given interval

Parameters:

Returns:

Step size

contains(interval, value)[source]

Check if an interval “contains” a value

Parameters:

Returns:

True, when the value is inside the interval

strip(ticks, interval)[source]

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

Parameters:

Returns:

Stripped tick list

buildInterval(value)[source]

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)[source]

Change a scale attribute

Parameters:

Returns:

Calculated interval

testAttribute(attribute)[source]

Parameters:

attribute (int) – Attribute to be tested

Returns:

True, if attribute is enabled

setAttributes(attributes)[source]

Change the scale attribute

Parameters:

attributes – Set scale attributes

attributes()[source]

Returns:

Scale attributes

setReference(r)[source]

Specify a reference point

Parameters:

r (float) – new reference value

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

reference()[source]

Returns:

the reference value

setBase(base)[source]

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

base()[source]

Returns:

Base of the scale engine

QwtLinearScaleEngine

class qwt.scale_engine.QwtLinearScaleEngine(base=10)[source]

A scale engine for linear scales

The step size will fit into the pattern f$left{ 1,2,5right} cdot 10^{n}f$, where n is an integer.

autoScale(maxNumSteps, x1, x2, stepSize, relativeMargin=0.0)[source]

Align and divide an interval

Parameters:

Returns:

tuple (x1, x2, stepSize)

divideScale(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)[source]

Calculate a scale division for an interval

Parameters:

Returns:

Calculated scale division

buildTicks(interval, stepSize, maxMinorSteps)[source]

Calculate ticks for an interval

Parameters:

Returns:

Calculated ticks

buildMajorTicks(interval, stepSize)[source]

Calculate major ticks for an interval

Parameters:

Returns:

Calculated ticks

buildMinorTicks(ticks, maxMinorSteps, stepSize)[source]

Calculate minor ticks for an interval

Parameters:

align(interval, stepSize)[source]

Align an interval to a step size

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

Parameters:

Returns:

Aligned interval

QwtLogScaleEngine

class qwt.scale_engine.QwtLogScaleEngine(base=10)[source]

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, relativeMargin=0.0)[source]

Align and divide an interval

Parameters:

Returns:

tuple (x1, x2, stepSize)

divideScale(x1, x2, maxMajorSteps, maxMinorSteps, stepSize=0.0)[source]

Calculate a scale division for an interval

Parameters:

Returns:

Calculated scale division

buildTicks(interval, stepSize, maxMinorSteps)[source]

Calculate ticks for an interval

Parameters:

Returns:

Calculated ticks

buildMajorTicks(interval, stepSize)[source]

Calculate major ticks for an interval

Parameters:

Returns:

Calculated ticks

buildMinorTicks(ticks, maxMinorSteps, stepSize)[source]

Calculate minor ticks for an interval

Parameters:

align(interval, stepSize)[source]

Align an interval to a step size

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

Parameters:

Returns:

Aligned interval

QwtAbstractScaleDraw

class qwt.scale_draw.QwtAbstractScaleDraw[source]

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:

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

extent(font)[source]

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

drawTick(painter, value, len_)[source]

Draw a tick

Parameters:

drawBackbone(painter)[source]

Draws the baseline of the scale

Parameters:

painter (QPainter) – Painter

See also

drawTick(), drawLabel()

drawLabel(painter, value)[source]

Draws the label for a major scale tick

Parameters:

enableComponent(component, enable)[source]

En/Disable a component of the scale

Parameters:

hasComponent(component)[source]

Check if a component is enabled

Parameters:

component (int) – Component type

Returns:

True, when component is enabled

See also

enableComponent()

setScaleDiv(scaleDiv)[source]

Change the scale division

Parameters:

scaleDiv (qwt.scale_div.QwtScaleDiv) – New scale division

setTransformation(transformation)[source]

Change the transformation of the scale

Parameters:

transformation (qwt.transform.QwtTransform) – New scale transformation

scaleMap()[source]

Returns:

Map how to translate between scale and pixel values

scaleDiv()[source]

Returns:

scale division

setPenWidth(width)[source]

Specify the width of the scale pen

Parameters:

width (int) – Pen width

penWidth()[source]

Returns:

Scale pen width

draw(painter, palette)[source]

Draw the scale

Parameters:

setSpacing(spacing)[source]

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

spacing()[source]

Get the spacing

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

Returns:

Spacing

setMinimumExtent(minExtent)[source]

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

minimumExtent()[source]

Get the minimum extent

Returns:

Minimum extent

setTickLength(tick_type, length)[source]

Set the length of the ticks

Parameters:

Warning

the length is limited to [0..1000]

tickLength(tick_type)[source]

Parameters:

tick_type (int) – Tick type

Returns:

Length of the ticks

maxTickLength()[source]

Returns:

Length of the longest tick

Useful for layout calculations

setTickLighterFactor(tick_type, factor)[source]

Set the color lighter factor of the ticks

Parameters:

tickLighterFactor(tick_type)[source]

Parameters:

tick_type (int) – Tick type

Returns:

Color lighter factor of the ticks

label(value)[source]

Convert a value into its representing label

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

Parameters:

value (float) – Value

Returns:

Label string

tickLabel(font, value)[source]

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:

Returns:

Tuple (tick label, text size)

invalidateCache()[source]

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[source]

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:

class QwtScaleDraw

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.

alignment()[source]

Returns:

Alignment of the scale

setAlignment(align)[source]

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

orientation()[source]

Return the orientation

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

Returns:

Orientation of the scale

getBorderDistHint(font)[source]

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:

minLabelDist(font)[source]

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

extent(font)[source]

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

minLength(font)[source]

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

labelPosition(value)[source]

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

drawTick(painter, value, len_)[source]

Draw a tick

Parameters:

drawBackbone(painter)[source]

Draws the baseline of the scale

Parameters:

painter (QPainter) – Painter

See also

drawTick(), drawLabel()

move(*args)[source]

Move the position of the scale

The meaning of the parameter pos depends on the alignment:

move(x, y)[source]

Parameters:

move(pos)[source]

Parameters:

pos (QPointF) – position

See also

pos(), setLength()

pos()[source]

Returns:

Origin of the scale

See also

pos(), setLength()

setLength(length)[source]

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()

length()[source]

Returns:

the length of the backbone

See also

setLength(), pos()

drawLabel(painter, value)[source]

Draws the label for a major scale tick

Parameters:

boundingLabelRect(font, value)[source]

Find the bounding rectangle for the label.

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

Parameters:

Returns:

Bounding rectangle

labelTransformation(pos, size)[source]

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

Parameters:

Returns:

Transformation matrix

labelRect(font, value)[source]

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:

Returns:

Bounding rectangle that is needed to draw a label

labelSize(font, value)[source]

Calculate the size that is needed to draw a label

Parameters:

Returns:

Size that is needed to draw a label

setLabelRotation(rotation)[source]

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.

labelRotation()[source]

Returns:

the label rotation

setLabelAlignment(alignment)[source]

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:

Changing the alignment is often necessary for rotated labels.

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

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 fromQwtAbstractScaleDraw.label().

labelAlignment()[source]

Returns:

the label flags

setLabelAutoSize(state)[source]

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

labelAutoSize()[source]

Returns:

True if automatic size option is enabled for labels

See also

setLabelAutoSize()

maxLabelWidth(font)[source]

Parameters:

font (QFont) – Font

Returns:

the maximum width of a label

maxLabelHeight(font)[source]

Parameters:

font (QFont) – Font

Returns:

the maximum height of a label