plotly package¶
Plotly’s Python API allows users to programmatically access Plotly’s server resources.
This package is organized as follows:
Subpackages:
plotly: all functionality that requires access to Plotly’s servers
graph_objects: objects for designing figures and visualizing data
matplotlylib: tools to convert matplotlib figures
Modules:
tools: some helpful tools that do not require access to Plotly’s servers
utils: functions that you probably won’t need, but that subpackages use
version: holds the current API version
exceptions: defines our custom exception classes
Subpackages¶
- plotly.colors package
- plotly.data package
- plotly.express package
- plotly.figure_factory package
- plotly.graph_objects package
- plotly.graph_objects package
- Subpackages
- plotly.graph_objects.bar package
- plotly.graph_objects.barpolar package
- plotly.graph_objects.box package
- plotly.graph_objects.candlestick package
- plotly.graph_objects.carpet package
- plotly.graph_objects.choropleth package
- plotly.graph_objects.choroplethmap package
- plotly.graph_objects.choroplethmapbox package
- plotly.graph_objects.cone package
- plotly.graph_objects.contour package
- plotly.graph_objects.contourcarpet package
- plotly.graph_objects.densitymap package
- plotly.graph_objects.densitymapbox package
- plotly.graph_objects.funnel package
- plotly.graph_objects.funnelarea package
- plotly.graph_objects.heatmap package
- plotly.graph_objects.histogram package
- plotly.graph_objects.histogram2d package
- plotly.graph_objects.histogram2dcontour package
- plotly.graph_objects.icicle package
- plotly.graph_objects.image package
- plotly.graph_objects.indicator package
- plotly.graph_objects.isosurface package
- plotly.graph_objects.layout package
- plotly.graph_objects.mesh3d package
- plotly.graph_objects.ohlc package
- plotly.graph_objects.parcats package
- plotly.graph_objects.parcoords package
- plotly.graph_objects.pie package
- plotly.graph_objects.sankey package
- plotly.graph_objects.scatter package
- plotly.graph_objects.scatter3d package
- plotly.graph_objects.scattercarpet package
- plotly.graph_objects.scattergeo package
- plotly.graph_objects.scattergl package
- plotly.graph_objects.scattermap package
- plotly.graph_objects.scattermapbox package
- plotly.graph_objects.scatterpolar package
- plotly.graph_objects.scatterpolargl package
- plotly.graph_objects.scattersmith package
- plotly.graph_objects.scatterternary package
- plotly.graph_objects.splom package
- plotly.graph_objects.streamtube package
- plotly.graph_objects.sunburst package
- plotly.graph_objects.surface package
- plotly.graph_objects.table package
- plotly.graph_objects.treemap package
- plotly.graph_objects.violin package
- plotly.graph_objects.volume package
- plotly.graph_objects.waterfall package
- Submodules
- plotly.graph_objects.graph_objects module
- Subpackages
- plotly.io package
Submodules¶
plotly.animation module¶
-
class
plotly.animation.DurationValidator(plotly_name='duration')¶ Bases:
_plotly_utils.basevalidators.NumberValidator
-
class
plotly.animation.EasingValidator(plotly_name='easing', parent_name='batch_animate', **_)¶ Bases:
_plotly_utils.basevalidators.EnumeratedValidator
plotly.basedatatypes module¶
-
class
plotly.basedatatypes.BaseFigure(data=None, layout_plotly=None, frames=None, skip_invalid=False, **kwargs)¶ Bases:
objectBase class for all figure types (both widget and non-widget)
-
add_hline(y, row='all', col='all', exclude_empty_subplots=True, annotation=None, **kwargs)¶ Add a horizontal line to a plot or subplot that extends infinitely in the x-dimension.
- Parameters
y (float or int) – A number representing the y coordinate of the horizontal line.
exclude_empty_subplots (Boolean) – If True (default) do not place the shape on subplots that have no data plotted on them.
row (None, int or 'all') – Subplot row for shape indexed starting at 1. If ‘all’, addresses all rows in the specified column(s). If both row and col are None, addresses the first subplot if subplots exist, or the only plot. By default is “all”.
col (None, int or 'all') – Subplot column for shape indexed starting at 1. If ‘all’, addresses all rows in the specified column(s). If both row and col are None, addresses the first subplot if subplots exist, or the only plot. By default is “all”.
annotation (dict or plotly.graph_objects.layout.Annotation. If dict(),) – it is interpreted as describing an annotation. The annotation is placed relative to the shape based on annotation_position (see below) unless its x or y value has been specified for the annotation passed here. xref and yref are always the same as for the added shape and cannot be overridden.
annotation_position (a string containing optionally ["top", "bottom"]) – and [“left”, “right”] specifying where the text should be anchored to on the line. Example positions are “bottom left”, “right top”, “right”, “bottom”. If an annotation is added but annotation_position is not specified, this defaults to “top right”.
annotation_* (any parameters to go.layout.Annotation can be passed as) – keywords by prefixing them with “annotation_”. For example, to specify the annotation text “example” you can pass annotation_text=”example” as a keyword argument.
**kwargs – Any named function parameters that can be passed to ‘add_shape’, except for x0, x1, y0, y1 or type.
-
add_hrect(y0, y1, row='all', col='all', exclude_empty_subplots=True, annotation=None, **kwargs)¶ Add a rectangle to a plot or subplot that extends infinitely in the x-dimension.
- Parameters
y0 (float or int) – A number representing the y coordinate of one side of the rectangle.
y1 (float or int) – A number representing the y coordinate of the other side of the rectangle.
exclude_empty_subplots (Boolean) – If True (default) do not place the shape on subplots that have no data plotted on them.
row (None, int or 'all') – Subplot row for shape indexed starting at 1. If ‘all’, addresses all rows in the specified column(s). If both row and col are None, addresses the first subplot if subplots exist, or the only plot. By default is “all”.
col (None, int or 'all') – Subplot column for shape indexed starting at 1. If ‘all’, addresses all rows in the specified column(s). If both row and col are None, addresses the first subplot if subplots exist, or the only plot. By default is “all”.
annotation (dict or plotly.graph_objects.layout.Annotation. If dict(),) – it is interpreted as describing an annotation. The annotation is placed relative to the shape based on annotation_position (see below) unless its x or y value has been specified for the annotation passed here. xref and yref are always the same as for the added shape and cannot be overridden.
annotation_position (a string containing optionally ["inside", "outside"], ["top", "bottom"]) – and [“left”, “right”] specifying where the text should be anchored to on the rectangle. Example positions are “outside top left”, “inside bottom”, “right”, “inside left”, “inside” (“outside” is not supported). If an annotation is added but annotation_position is not specified this defaults to “inside top right”.
annotation_* (any parameters to go.layout.Annotation can be passed as) – keywords by prefixing them with “annotation_”. For example, to specify the annotation text “example” you can pass annotation_text=”example” as a keyword argument.
**kwargs – Any named function parameters that can be passed to ‘add_shape’, except for x0, x1, y0, y1 or type.
-
add_trace(trace, row
-
