lets_plot.plot.core.LayerSpec¶
- class lets_plot.plot.core.LayerSpec(**kwargs)¶
A class of the plot layer object.
Do not use this class explicitly.
Instead, you should construct its objects with functions geom_point(), geom_contour(), geom_boxplot(), geom_text() etc.
- __init__(**kwargs)¶
Initialize self.
- as_dict()¶
Return the dictionary of all properties of the object with as_dict() applied recursively to all subproperties of FeatureSpec type.
- Returns
- dict
Dictionary of properties.
Examples
1from lets_plot import * 2LetsPlot.setup_html() 3p = ggplot({'x': [0], 'y': [0]}) + geom_point(aes('x', 'y')) 4p.as_dict()
{'data': {'x': [0], 'y': [0]}, 'mapping': {}, 'data_meta': {}, 'kind': 'plot', 'scales': [], 'layers': [{'geom': 'point', 'mapping': {'x': 'x', 'y': 'y'}, 'data_meta': {}}], 'metainfo_list': []}
- props()¶
Return the dictionary of all properties of the object in their initial form.
- Returns
- dict
Dictionary of properties.
Examples
1from lets_plot import * 2LetsPlot.setup_html() 3p = ggplot({'x': [0], 'y': [0]}) + geom_point(aes('x', 'y')) 4p.props()
{'data': {'x': [0], 'y': [0]}, 'mapping': <lets_plot.plot.core.FeatureSpec at 0x22af07c3640>, 'data_meta': {}}