facet.simulation.viz.SimulationDrawer#
- class facet.simulation.viz.SimulationDrawer(style=None, histogram=True)[source]#
Draws the result of a univariate simulation, represented by a
UnivariateSimulationResult
object.- Bases:
- Metaclasses:
- Parameters:
style (
Union
[SimulationStyle
,str
,None
]) – the style to be used for drawing; either as aDrawingStyle
instance, or as the name of a named style supported by this drawer type; if not specified, the default style will be used as returned byget_default_style()
histogram (
bool
) – ifTrue
, plot the histogram of observed values for the feature being simulated; ifFalse
, do not plot the histogram (default:True
).
Method summary
Draw the simulation chart.
Get the default style for this drawer.
Get all style classes available for this drawer type.
Attribute summary
The
DrawingStyle
used by this drawer.if
True
, plot the histogram of observed values for the feature being simulated; ifFalse
, do not plot the histogramDefinitions
- _draw(result)[source]#
Core drawing method invoked my method
draw()
.Must be implemented by subclasses of
Drawer
.- Parameters:
data – the data to be rendered
- Return type:
- draw(data, *, title=None)[source]#
Draw the simulation chart.
- Parameters:
data (
UnivariateSimulationResult
[Any
]) – the univariate simulation to drawtitle (
Optional
[str
]) – the title of the chart (optional, defaults to the name of the simulated feature)
- Return type:
- classmethod get_default_style()[source]#
Get the default style for this drawer.
- Return type:
- Returns:
the default style for this drawer
- classmethod get_named_styles()#
- classmethod get_style(name)#
- classmethod get_style_classes()[source]#
Get all style classes available for this drawer type.
- Return type:
- Returns:
an iterable of style classes
- get_style_kwargs(data)#
-
histogram:
bool
# if
True
, plot the histogram of observed values for the feature being simulated; ifFalse
, do not plot the histogram
-
style:
SimulationStyle
# The
DrawingStyle
used by this drawer.