lets_plot.element_text

lets_plot.element_text(color=None, family=None, face=None, size=None, angle=None, hjust=None, vjust=None, margin=None, blank=False) dict

Specify how non-data components of the plot are drawn. This theme element draws texts.

Parameters
colorstr

Text color.

familystr

Font family.

facestr

Font face (“plain”, “italic”, “bold”, “bold_italic”).

sizeint

Text size in pt.

anglefloat

Angle to rotate the text (in degrees).

hjustfloat

Horizontal justification (in [0, 1]). 0 - left-justified 1 - right-justified 0.5 - center-justified Can be used with values out of range, but behaviour is not specified.

vjustfloat

Vertical justification (in [0, 1]). 0 - bottom-justified 1 - top-justified 0.5 - middle-justified Can be used with values out of range, but behaviour is not specified.

marginmargin

Margins around the text. See margin() for more details.

blankbool, default=False

If True - draws nothing, and assigns no space.

Returns
dict

Theme element specification.

Examples

1import numpy as np
2from lets_plot import *
3LetsPlot.setup_html()
4np.random.seed(42)
5data = {'x': np.random.normal(size=1000)}
6ggplot(data, aes(x='x')) + geom_histogram() + \
7    theme(axis_text=element_text(color='#bdbdbd'))