plotnine.themes.element_text

class plotnine.themes.element_text(family=None, style=None, weight=None, color=None, size=None, ha=None, va=None, rotation=None, linespacing=None, backgroundcolor=None, margin=None, **kwargs)[source]

Theme element: Text

Parameters
familystr

Font family. See matplotlib.text.Text.set_family() for supported values.

stylestr in ['normal', 'italic', 'oblique']

Font style

colorstr | tuple

Text color

weightstr

Should be one of normal, bold, heavy, light, ultrabold or ultralight.

sizefloat

text size

hastr in ['center', 'left', 'right']

Horizontal Alignment.

vastr in ['center' , 'top', 'bottom', 'baseline']

Vertical alignment.

rotationfloat

Rotation angle in the range [0, 360]

linespacingfloat

Line spacing

backgroundcolorstr | tuple

Background color

margindict

Margin around the text. The keys are one of ['t', 'b', 'l', 'r'] and units. The units are one of ['pt', 'lines', 'in']. The units default to pt and the other keys to 0. Not all text themeables support margin parameters and other than the units, only some of the other keys will a.

kwargsdict

Parameters recognised by matplotlib.text.Text

Notes

element_text will accept parameters that conform to the ggplot2 element_text API, but it is preferable the Matplotlib based API described above.