Psyplot GUI widgets for modifying label formatoptions

This module contains PyQt widgets that can be used to modify label formatoptions (e.g. title, xlabel, titleprops, etc.) in the psyplot GUI.

Classes:

DictCombo(attrs, fmt_widget[, modulo_style])

A combobox that inserts keys into the formatoption

FontPropertiesWidget(parent, fmto[, artist, ...])

A widget for modifying the font properties or a label

FontSizeWidget(parent, fmto[, artist, base])

A widget for modifying the fontsize of a label

FontWeightWidget(parent, fmto[, artist, base])

A widget for modifying the fontweight of a label

LabelWidget(parent, fmto, project[, properties])

A widget to modify a text label (title, xlabel, etc.)

Functions:

mpl_weight2qt(weight)

Convert a weight from matplotlib definition to a Qt weight

class psy_simple.widgets.texts.DictCombo(attrs, fmt_widget, modulo_style=True)

Bases: QComboBox

A combobox that inserts keys into the formatoption

Methods:

insert_bracketed(s)

insert_modulo(s)

insert_bracketed(s)
insert_modulo(s)
class psy_simple.widgets.texts.FontPropertiesWidget(parent, fmto, artist=None, base=None)

Bases: QWidget

A widget for modifying the font properties or a label

Methods:

artist_to_qfont(artist)

Convert a matplotlib.text.Text artist to a QFont object

choose_color([color])

choose_font([font])

Choose a font for the label through a dialog

load_properties()

modify_size(val)

qfont_to_artist_props(font)

refresh()

Refresh the widgets from the current font

toggle_bold()

toggle_italic()

Attributes:

current_font

The current QFont of the artist

static artist_to_qfont(artist)

Convert a matplotlib.text.Text artist to a QFont object

Parameters:

artist (matplotlib.text.Text) – The text artist, e.g. an axes title

Returns:

The QFont object

Return type:

PyQt5.QtGui.QFont

choose_color(color=None)
choose_font(font=None)

Choose a font for the label through a dialog

current_font = None

The current QFont of the artist

load_properties()
modify_size(val)
static qfont_to_artist_props(font)
refresh()

Refresh the widgets from the current font

toggle_bold()
toggle_italic()
class psy_simple.widgets.texts.FontSizeWidget(parent, fmto, artist=None, base=None)

Bases: QWidget

A widget for modifying the fontsize of a label

class psy_simple.widgets.texts.FontWeightWidget(parent, fmto, artist=None, base=None)

Bases: QWidget

A widget for modifying the fontweight of a label

class psy_simple.widgets.texts.LabelWidget(parent, fmto, project, properties=True)

Bases: QWidget

A widget to modify a text label (title, xlabel, etc.)

This widget contains one combobox for the 'labels' key in the psyplot.rcParams dictionary, and a second combobox for the enhanced attributes of the corresponding formatoption object fmto.

Additionally, it provides buttons to switch to the formatoption options of the corresponding fontsize, fontweight and fontproperties of this label

psy_simple.widgets.texts.mpl_weight2qt(weight)

Convert a weight from matplotlib definition to a Qt weight

Parameters:

weight (int or string) – Either an integer between 1 and 1000 or a string out of weights_mpl2qt

Returns:

One type of the PyQt5.QtGui.QFont.Weight

Return type:

int