plotly.graph_objects.Figure¶
|
|
|
Show a figure using either the default renderer(s) or the renderer(s) specified by the renderer argument |
|
Add traces to the figure |
|
Perform a property update operation on all traces that satisfy the specified selection criteria |
|
Update the properties of the figure’s layout with a dict and/or with keyword arguments. |
-
class
plotly.graph_objects.Figure(data=None, layout=None, frames=None, skip_invalid=False, **kwargs)¶ -
__init__(data=None, layout=None, frames=None, skip_invalid=False, **kwargs)¶ Create a new :class:Figure instance
- Parameters
data –
The ‘data’ property is a tuple of trace instances that may be specified as:
A list or tuple of trace instances (e.g. [Scatter(…), Bar(…)])
A single trace instance (e.g. Scatter(…), Bar(…), etc.)
A list or tuple of dicts of string/value properties where: - The ‘type’ property specifies the trace type
- One of: [‘area’, ‘bar’, ‘barpolar’, ‘box’,
’candlestick’, ‘carpet’, ‘choropleth’, ‘choroplethmapbox’, ‘cone’, ‘contour’, ‘contourcarpet’, ‘densitymapbox’, ‘funnel’, ‘funnelarea’, ‘heatmap’, ‘heatmapgl’, ‘histogram’, ‘histogram2d’, ‘histogram2dcontour’, ‘image’, ‘indicator’, ‘isosurface’, ‘mesh3d’, ‘ohlc’, ‘parcats’, ‘parcoords’, ‘pie’, ‘pointcloud’, ‘sankey’, ‘scatter’, ‘scatter3d’, ‘scattercarpet’, ‘scattergeo’, ‘scattergl’, ‘scattermapbox’, ‘scatterpolar’, ‘scatterpolargl’, ‘scatterternary’, ‘splom’, ‘streamtube’, ‘sunburst’, ‘surface’, ‘table’, ‘treemap’, ‘violin’, ‘volume’, ‘waterfall’]
All remaining properties are passed to the constructor of the specified trace type
(e.g. [{‘type’: ‘scatter’, …}, {‘type’: ‘bar, …}])
layout –
The ‘layout’ property is an instance of Layout that may be specified as:
An instance of
plotly.graph_objects.LayoutA dict of string/value properties that will be passed to the Layout constructor
Supported dict properties:
- activeshape
:class:`plotly.graph_objects.layout.Activeshape ` instance or dict with compatible properties
- angularaxis
:class:`plotly.graph_objects.layout.AngularAxis ` instance or dict with compatible properties
- annotations
A tuple of
plotly.graph_objects.layout.Annotationinstances or dicts with compatible properties- annotationdefaults
When used in a template (as layout.template.layout.annotationdefaults), sets the default property values to use for elements of layout.annotations
- autosize
Determines whether or not a layout width or height that has been left undefined by the user is initialized on each relayout. Note that, regardless of this attribute, an undefined layout width or height is always initialized on the first call to plot.
- autotypenumbers
Using “strict” a numeric string in trace data is not converted to a number. Using convert types a numeric string in trace data may be treated as a number during automatic axis
typedetection. This is the default value; however it could be overridden for individual axes.- bargap
Sets the gap (in plot fraction) between bars of adjacent location coordinates.
- bargroupgap
Sets the gap (in plot fraction) between bars of the same location coordinate.
- barmode
Determines how bars at the same location coordinate are displayed on the graph. With “stack”, the bars are stacked on top of one another With “relative”, the bars are stacked on top of one another, with negative values below the axis, positive values above With “group”, the bars are plotted next to one another centered around the shared location. With “overlay”, the bars are plotted over one another, you might need to an “opacity” to see multiple bars.
- barnorm
Sets the normalization for bar traces on the graph. With “fraction”, the value of each bar is divided by the sum of all values at that location coordinate. “percent” is the same but multiplied by 100 to show percentages.
- boxgap
Sets the gap (in plot fraction) between boxes of adjacent location coordinates. Has no effect on traces that have “width” set.
- boxgroupgap
Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have “width” set.
- boxmode
Determines how boxes at the same location coordinate are displayed on the graph. If “group”, the boxes are plotted next to one another centered around the shared location. If “overlay”, the boxes are plotted over one another, you might need to set “opacity” to see them multiple boxes. Has no effect on traces that have “width” set.
- calendar
Sets the default calendar system to use for interpreting and displaying dates throughout the plot.
- clickmode
Determines the mode of single click interactions. “event” is the default value and emits the
plotly_clickevent. In addition this mode emits theplotly_selectedevent in drag modes “lasso” and “select”, but with no event data attached (kept for compatibility reasons). The “select” flag enables selecting single data points via click. This mode also supports persistent selections, meaning that pressing Shift while clicking, adds to / subtracts from an existing selection. “select” withhovermode: “x” can be confusing, consider explicitly settinghovermode: “closest” when using this feature. Selection events are sent accordingly as long as “event” flag is set as well. When the “event” flag is missing,plotly_clickandplotly_selectedevents are not fired.- coloraxis
plotly.graph_objects.layout.Coloraxisinstance or dict with compatible properties- colorscale
plotly.graph_objects.layout.Colorscaleinstance or dict with compatible properties- colorway
Sets the default trace colors.
- computed
Placeholder for exporting automargin-impacting values namely
margin.t,margin.b,margin.landmargin.rin “full-json” mode.- datarevision
If provided, a changed value tells
Plotly.reactthat one or more data arrays has changed. This way you can modify arrays in- place rather than making a complete new copy for an incremental change. If NOT provided,Plotly.reactassumes that data arrays are being treated as immutable, thus any data array with a different identity from its predecessor contains new data.- direction
Legacy polar charts are deprecated! Please switch to “polar” subplots. Sets the direction corresponding to positive angles in legacy polar charts.
- dragmode
Determines the mode of drag interactions. “select” and “lasso” apply only to scatter traces with markers or text. “orbit” and “turntable” apply only to 3D scenes.
- editrevision
Controls persistence of user-driven changes in
editable: trueconfiguration, other than trace names and axis titles. Defaults tolayout.uirevision.- extendfunnelareacolors
If
true, the funnelarea slice colors (whether given byfunnelareacolorwayor inherited fromcolorway) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can setfalseto disable. Colors provided in the trace, usingmarker.colors, are never extended.- extendpiecolors
If
true, the pie slice colors (whether given bypiecolorwayor inherited fromcolorway) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can setfalseto disable. Colors provided in the trace, usingmarker.colors, are never extended.- extendsunburstcolors
If
true, the sunburst slice colors (whether given bysunburstcolorwayor inherited fromcolorway) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can setfalseto disable. Colors provided in the trace, usingmarker.colors, are never extended.- extendtreemapcolors
If
true, the treemap slice colors (whether given bytreemapcolorwayor inherited fromcolorway) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can setfalseto disable. Colors provided in the trace, usingmarker.colors, are never extended.- font
Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.
- funnelareacolorway
Sets the default funnelarea slice colors. Defaults to the main
colorwayused for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, seeextendfunnelareacolors.- funnelgap
Sets the gap (in plot fraction) between bars of adjacent location coordinates.
- funnelgroupgap
Sets the gap (in plot fraction) between bars of the same location coordinate.
- funnelmode
Determines how bars at the same location coordinate are displayed on the graph. With “stack”, the bars are stacked on top of one another With “group”, the bars are plotted next to one another centered around the shared location. With “overlay”, the bars are plotted over one another, you might need to an “opacity” to see multiple bars.
- geo
plotly.graph_objects.layout.Geoinstance or dict with compatible properties- grid
plotly.graph_objects.layout.Gridinstance or dict with compatible properties- height
Sets the plot’s height (in px).
- hiddenlabels
hiddenlabels is the funnelarea & pie chart analog of visible:’legendonly’ but it can contain many labels, and can simultaneously hide slices from several pies/funnelarea charts
- hiddenlabelssrc
Sets the source reference on Chart Studio Cloud for hiddenlabels .
- hidesources
Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise).
- hoverdistance
Sets the default distance (in pixels) to look for data to add hover labels (-1 means no cutoff, 0 means no looking for data). This is only a real distance for hovering on point-like objects, like scatter points. For area-like objects (bars, scatter fills, etc) hovering is on inside the area and off outside, but these objects will not supersede hover on point-like objects in case of conflict.
- hoverlabel
plotly.graph_objects.layout.Hoverlabelinstance or dict with compatible properties- hovermode
Determines the mode of hover interactions. If “closest”, a single hoverlabel will appear for the “closest” point within the
hoverdistance. If “x” (or “y”), multiple hoverlabels will appear for multiple points at the “closest” x- (or y-) coordinate within thehoverdistance, with the caveat that no more than one hoverlabel will appear per trace. If x unified (or y unified), a single hoverlabel will appear multiple points at the closest x- (or y-) coordinate within thehoverdistancewith the caveat that no more than one hoverlabel will appear per trace. In this mode, spikelines are enabled by default perpendicular to the specified axis. If false, hover interactions are disabled. Ifclickmodeincludes the “select” flag,hovermodedefaults to “closest”. Ifclickmodelacks the “select” flag, it defaults to “x” or “y” (depending on the trace’sorientationvalue) for plots based on cartesian coordinates. For anything else the default value is “closest”.- images
A tuple of
plotly.graph_objects.layout.Imageinstances or dicts with compatible properties- imagedefaults
When used in a template (as layout.template.layout.imagedefaults), sets the default property values to use for elements of layout.images
- legend
plotly.graph_objects.layout.Legendinstance or dict with compatible properties- mapbox
plotly.graph_objects.layout.Mapboxinstance or dict with compatible properties- margin
plotly.graph_objects.layout.Margininstance or dict with compatible properties- meta
Assigns extra meta information that can be used in various
textattributes. Attributes such as the graph, axis and colorbartitle.text, annotationtexttrace.namein legend items,rangeselector,updatemenusandsliderslabeltext all supportmeta. One can accessmetafields using template strings:%{meta[i]}whereiis the index of themetaitem in question.metacan also be an object for example{key: value}which can be accessed %{meta[key]}.- metasrc
Sets the source reference on Chart Studio Cloud for meta .
- modebar
plotly.graph_objects.layout.Modebarinstance or dict with compatible properties- newshape
plotly.graph_objects.layout.Newshapeinstance or dict with compatible properties- orientation
Legacy polar charts are deprecated! Please switch to “polar” subplots. Rotates the entire polar by the given angle in legacy polar charts.
- paper_bgcolor
Sets the background color of the paper where the graph is drawn.
- piecolorway
Sets the default pie slice colors. Defaults to the main
colorwayused for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, seeextendpiecolors.- plot_bgcolor
Sets the background color of the plotting area in-between x and y axes.
- polar
plotly.graph_objects.layout.Polarinstance or dict with compatible properties- radialaxis
plotly.graph_objects.layout.RadialAxisinstance or dict with compatible properties- scene
plotly.graph_objects.layout.Sceneinstance or dict with compatible properties- selectdirection
When
dragmodeis set to “select”, this limits the selection of the drag to horizontal, vertical or diagonal. “h” only allows horizontal selection, “v” only vertical, “d” only diagonal and “any” sets no limit.- selectionrevision
Controls persistence of user-driven changes in selected points from all traces.
- separators
Sets the decimal and thousand separators. For example, *. * puts a ‘.’ before decimals and a space between thousands. In English locales, dflt is “.,” but other locales may alter this default.
- shapes
A tuple of
plotly.graph_objects.layout.Shapeinstances or dicts with compatible properties- shapedefaults
When used in a template (as layout.template.layout.shapedefaults), sets the default property values to use for elements of layout.shapes
- showlegend
Determines whether or not a legend is drawn. Default is
trueif there is a trace to show and any of these: a) Two or more traces would by default be shown in the legend. b) One pie trace is shown in the legend. c) One trace is explicitly given withshowlegend: true.- sliders
A tuple of
plotly.graph_objects.layout.Sliderinstances or dicts with compatible properties- sliderdefaults
When used in a template (as layout.template.layout.sliderdefaults), sets the default property values to use for elements of layout.sliders
- spikedistance
Sets the default distance (in pixels) to look for data to draw spikelines to (-1 means no cutoff, 0 means no looking for data). As with hoverdistance, distance does not apply to area- like objects. In addition, some objects can be hovered on but will not generate spikelines, such as scatter fills.
- sunburstcolorway
Sets the default sunburst slice colors. Defaults to the main
colorwayused for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, seeextendsunburstcolors.- template
Default attributes to be applied to the plot. This should be a dict with format:
{'layout': layoutTemplate, 'data': {trace_type: [traceTemplate, ...], ...}}wherelayoutTemplateis a dict matching the structure offigure.layoutandtraceTemplateis a dict matching the structure of the trace with typetrace_type(e.g. ‘scatter’). Alternatively, this may be specified as an instance of plotly.graph_objects.layout.Template. Trace templates are applied cyclically to traces of each type. Container arrays (egannotations) have special handling: An object ending indefaults(egannotationdefaults) is applied to each array item. But if an item has atemplateitemnamekey we look in the template array for an item with matchingnameand apply that instead. If no matchingnameis found we mark the item invisible. Any named template item not referenced is appended to the end of the array, so this can be used to add a watermark annotation or a logo image, for example. To omit one of these items on the plot, make an item with matchingtemplateitemnameandvisible: false.- ternary
plotly.graph_objects.layout.Ternaryinstance or dict with compatible properties- title
plotly.graph_objects.layout.Titleinstance or dict with compatible properties- titlefont
Deprecated: Please use layout.title.font instead. Sets the title font. Note that the title’s font used to be customized by the now deprecated
titlefontattribute.- transition
Sets transition options used during Plotly.react updates.
- treemapcolorway
Sets the default treemap slice colors. Defaults to the main
colorwayused for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, seeextendtreemapcolors.- uirevision
Used to allow user interactions with the plot to persist after
Plotly.reactcalls that are unaware of these interactions. Ifuirevisionis omitted, or if it is given and it changed from the previousPlotly.reactcall, the exact new figure is used. Ifuirevisionis truthy and did NOT change, any attribute that has been affected by user interactions and did not receive a different value in the new figure will keep the interaction value.layout.uirevisionattribute serves as the default foruirevisionattributes in various sub-containers. For finer control you can set these sub-attributes directly. For example, if your app separately controls the data on the x and y axes you might setxaxis.uirevision=*time*andyaxis.uirevision=*cost*. Then if only the y data is changed, you can updateyaxis.uirevision=*quantity*and the y axis range will reset but the x axis range will retain any user-driven zoom.- uniformtext
:class:`plotly.graph_objects.layout.Uniformtext ` instance or dict with compatible properties
- updatemenus
A tuple of
plotly.graph_objects.layout.Updatemenuinstances or dicts with compatible properties- updatemenudefaults
When used in a template (as layout.template.layout.updatemenudefaults), sets the default property values to use for elements of layout.updatemenus
- violingap
Sets the gap (in plot fraction) between violins of adjacent location coordinates. Has no effect on traces that have “width” set.
- violingroupgap
Sets the gap (in plot fraction) between violins of the same location coordinate. Has no effect on traces that have “width” set.
- violinmode
Determines how violins at the same location coordinate are displayed on the graph. If “group”, the violins are plotted next to one another centered around the shared location. If “overlay”, the violins are plotted over one another, you might need to set “opacity” to see them multiple violins. Has no effect on traces that have “width” set.
- waterfallgap
Sets the gap (in plot fraction) between bars of adjacent location coordinates.
- waterfallgroupgap
Sets the gap (in plot fraction) between bars of the same location coordinate.
- waterfallmode
Determines how bars at the same location coordinate are displayed on the graph. With “group”, the bars are plotted next to one another centered around the shared location. With “overlay”, the bars are plotted over one another, you might need to an “opacity” to see multiple bars.
- width
Sets the plot’s width (in px).
- xaxis
plotly.graph_objects.layout.XAxisinstance or dict with compatible properties- yaxis
plotly.graph_objects.layout.YAxisinstance or dict with compatible properties
frames –
The ‘frames’ property is a tuple of instances of Frame that may be specified as:
A list or tuple of instances of plotly.graph_objects.Frame
A list or tuple of dicts of string/value properties that will be passed to the Frame constructor
Supported dict properties:
- baseframe
The name of the frame into which this frame’s properties are merged before applying. This is used to unify properties and avoid needing to specify the same values for the same properties in multiple frames.
- data
A list of traces this frame modifies. The format is identical to the normal trace definition.
- group
An identifier that specifies the group to which the frame belongs, used by animate to select a subset of frames.
- layout
Layout properties which this frame modifies. The format is identical to the normal layout definition.
- name
A label by which to identify the frame
- traces
A list of trace indices that identify the respective traces in the data attribute
skip_invalid (bool) – If True, invalid properties in the figure specification will be skipped silently. If False (default) invalid properties in the figure specification will result in a ValueError
- Raises
ValueError – if a property in the specification of data, layout, or frames is invalid AND skip_invalid is False
-
-
class
plotly.graph_objects.Figure(data=None, layout=None, frames=None, skip_invalid=False, **kwargs)¶ -
add_annotation(arg=None, align=None, arrowcolor=None, arrowhead=None, arrowside=None, arrowsize=None, arrowwidth=None, ax=None, axref=None, ay=None, ayref=None, bgcolor=None, bordercolor=None, borderpad=None, borderwidth=None, captureevents=None, clicktoshow=None, font=None, height=None, hoverlabel=None, hovertext=None, name=None, opacity=None, showarrow=None, standoff=None, startarrowhead=None, startarrowsize=None, startstandoff=None, templateitemname=None, text=None, textangle=None, valign=None, visible=None, width=None, x=None, xanchor=None, xclick=None, xref=None, xshift=None, y=None, yanchor=None, yclick=None, yref=None, yshift=None, row=None, col=None, secondary_y=None, exclude_empty_subplots=None, **kwargs)¶ Create and add a new annotation to the figure’s layout
- Parameters
arg – instance of Annotation or dict with compatible properties
align – Sets the horizontal alignment of the
textwithin the box. Has an effect only iftextspans two or more lines (i.e.textcontains one or more <br> HTML tags) or if an explicit width is set to override the text width.arrowcolor – Sets the color of the annotation arrow.
arrowhead – Sets the end annotation arrow head style.
arrowside – Sets the annotation arrow head position.
arrowsize – Sets the size of the end annotation arrow head, relative to
arrowwidth. A value of 1 (default) gives a head about 3x as wide as the line.arrowwidth – Sets the width (in px) of annotation arrow line.
ax – Sets the x component of the arrow tail about the arrow head. If
axrefispixel, a positive (negative) component corresponds to an arrow pointing from right to left (left to right). Ifaxrefis notpixeland is exactly the same asxref, this is an absolute value on that axis, likex, specified in the same coordinates asxref.axref – Indicates in what coordinates the tail of the annotation (ax,ay) is specified. If set to a ax axis id (e.g. “ax” or “ax2”), the
axposition refers to a ax coordinate. If set to “paper”, theaxposition refers to the distance from the left of the plotting area in normalized coordinates where 0 (1) corresponds to the left (right). If set to a ax axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., ax2 domain refers to the domain of the second ax axis and a ax position of 0.5 refers to the point between the left and the right of the domain of the second ax axis. In order for absolute positioning of the arrow to work, “axref” must be exactly the same as “xref”, otherwise “axref” will revert to “pixel” (explained next). For relative positioning, “axref” can be set to “pixel”, in which case the “ax” value is specified in pixels relative to “x”. Absolute positioning is useful for trendline annotations which should continue to indicate the correct trend when zoomed. Relative positioning is useful for specifying the text offset for an annotated point.ay – Sets the y component of the arrow tail about the arrow head. If
ayrefispixel, a positive (negative) component corresponds to an arrow pointing from bottom to top (top to bottom). Ifayrefis notpixeland is exactly the same asyref, this is an absolute value on that axis, likey, specified in the same coordinates asyref.ayref – Indicates in what coordinates the tail of the annotation (ax,ay) is specified. If set to a ay axis id (e.g. “ay” or “ay2”), the
ayposition refers to a ay coordinate. If set to “paper”, theayposition refers to the distance from the bottom of the plotting area in normalized coordinates where 0 (1) corresponds to the bottom (top). If set to a ay axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., ay2 domain refers to the domain of the second ay axis and a ay position of 0.5 refers to the point between the bottom and the top of the domain of the second ay axis. In order for absolute positioning of the arrow to work, “ayref” must be exactly the same as “yref”, otherwise “ayref” will revert to “pixel” (explained next). For relative positioning, “ayref” can be set to “pixel”, in which case the “ay” value is specified in pixels relative to “y”. Absolute positioning is useful for trendline annotations which should continue to indicate the correct trend when zoomed. Relative positioning is useful for specifying the text offset for an annotated point.bgcolor – Sets the background color of the annotation.
bordercolor – Sets the color of the border enclosing the annotation
text.borderpad – Sets the padding (in px) between the
textand the enclosing border.borderwidth – Sets the width (in px) of the border enclosing the annotation
text.captureevents – Determines whether the annotation text box captures mouse move and click events, or allows those events to pass through to data points in the plot that may be behind the annotation. By default
captureeventsis False unlesshovertextis provided. If you use the eventplotly_clickannotationwithouthovertextyou must explicitly enablecaptureevents.clicktoshow – Makes this annotation respond to clicks on the plot. If you click a data point that exactly matches the
xandyvalues of this annotation, and it is hidden (visible: false), it will appear. In “onoff” mode, you must click the same point again to make it disappear, so if you click multiple points, you can show multiple annotations. In “onout” mode, a click anywhere else in the plot (on another data point or not) will hide this annotation. If you need to show/hide this annotation in response to differentxoryvalues, you can setxclickand/oryclick. This is useful for example to label the side of a bar. To label markers though,standoffis preferred overxclickandyclick.font – Sets the annotation text font.
height – Sets an explicit height for the text box. null (default) lets the text set the box height. Taller text will be clipped.
hoverlabel –
plotly.graph_objects.layout.annotation.Hoverlab elinstance or dict with compatible propertieshovertext – Sets text to appear when hovering over this annotation. If omitted or blank, no hover label will appear.
name – When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with
templateitemnamematching thisnamealongside your modifications (includingvisible: falseorenabled: falseto hide it). Has no effect outside of a template.opacity – Sets the opacity of the annotation (text + arrow).
showarrow – Determines whether or not the annotation is drawn with an arrow. If True,
textis placed near the arrow’s tail. If False,textlines up with thexandyprovided.standoff – Sets a distance, in pixels, to move the end arrowhead away from the position it is pointing at, for example to point at the edge of a marker independent of zoom. Note that this shortens the arrow from the
ax/ayvector, in contrast toxshift/yshiftwhich moves everything by this amount.startarrowhead – Sets the start annotation arrow head style.
startarrowsize – Sets the size of the start annotation arrow head, relative to
arrowwidth. A value of 1 (default) gives a head about 3x as wide as the line.startstandoff – Sets a distance, in pixels, to move the start arrowhead away from the position it is pointing at, for example to point at the edge of a marker independent of zoom. Note that this shortens the arrow from the
ax/ayvector, in contrast toxshift/yshiftwhich moves everything by this amount.templateitemname – Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with
templateitemnamematching itsname, alongside your modifications (includingvisible: falseorenabled: falseto hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it withvisible: true.text – Sets the text associated with this annotation. Plotly uses a subset of HTML tags to do things like newline (<br>), bold (<b></b>), italics (<i></i>), hyperlinks (<a href=’…’></a>). Tags <em>, <sup>, <sub> <span> are also supported.
textangle – Sets the angle at which the
textis drawn with respect to the horizontal.valign – Sets the vertical alignment of the
textwithin the box. Has an effect only if an explicit height is set to override the text height.visible – Determines whether or not this annotation is visible.
width – Sets an explicit width for the text box. null (default) lets the text set the box width. Wider text will be clipped. There is no automatic wrapping; use <br> to start a new line.
x – Sets the annotation’s x position. If the axis
typeis “log”, then you must take the log of your desired range. If the axistypeis “date”, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axistypeis “category”, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.xanchor – Sets the text box’s horizontal position anchor This anchor binds the
xposition to the “left”, “center” or “right” of the annotation. For example, ifxis set to 1,xrefto “paper” andxanchorto “right” then the right-most portion of the annotation lines up with the right-most edge of the plotting area. If “auto”, the anchor is equivalent to “center” for data- referenced annotations or if there is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.xclick – Toggle this annotation when clicking a data point whose
xvalue isxclickrather than the annotation’sxvalue.xref – Sets the annotation’s x coordinate axis. If set to a x axis id (e.g. “x” or “x2”), the
xposition refers to a x coordinate. If set to “paper”, thexposition refers to the distance from the left of the plotting area in normalized coordinates where 0 (1) corresponds to the left (right). If set to a x axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., x2 domain refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis.xshift – Shifts the position of the whole annotation and arrow to the right (positive) or left (negative) by this many pixels.
y – Sets the annotation’s y position. If the axis
typeis “log”, then you must take the log of your desired range. If the axistypeis “date”, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axistypeis “category”, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.yanchor – Sets the text box’s vertical position anchor This anchor binds the
yposition to the “top”, “middle” or “bottom” of the annotation. For example, ifyis set to 1,yrefto “paper” andyanchorto “top” then the top-most portion of the annotation lines up with the top-most edge of the plotting area. If “auto”, the anchor is equivalent to “middle” for data-referenced annotations or if there is an arrow, whereas for paper- referenced with no arrow, the anchor picked corresponds to the closest side.yclick – Toggle this annotation when clicking a data point whose
yvalue isyclickrather than the annotation’syvalue.yref – Sets the annotation’s y coordinate axis. If set to a y axis id (e.g. “y” or “y2”), the
yposition refers to a y coordinate. If set to “paper”, theyposition refers to the distance from the bottom of the plotting area in normalized coordinates where 0 (1) corresponds to the bottom (top). If set to a y axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., y2 domain refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis.yshift – Shifts the position of the whole annotation and arrow up (positive) or down (negative) by this many pixels.
row – Subplot row for annotation. If ‘all’, addresses all rows in the specified column(s).
col – Subplot column for annotation. If ‘all’, addresses all columns in the specified row(s).
secondary_y – Whether to add annotation to secondary y-axis
exclude_empty_subplots – If True, annotation will not be added to subplots without traces.
- Returns
- Return type
-
add_area(customdata=None, customdatasrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, ids=None, idssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, opacity=None, r=None, rsrc=None, showlegend=None, stream=None, t=None, tsrc=None, uid=None, uirevision=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Area trace
- Parameters
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.area.Hoverlabelinstance or dict with compatible propertiesids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.area.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
r – Area traces are deprecated! Please switch to the “barpolar” trace type. Sets the radial coordinates for legacy polar chart only.
rsrc – Sets the source reference on Chart Studio Cloud for r .
showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.area.Streaminstance or dict with compatible propertiest – Area traces are deprecated! Please switch to the “barpolar” trace type. Sets the angular coordinates for legacy polar chart only.
tsrc – Sets the source reference on Chart Studio Cloud for t .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_bar(alignmentgroup=None, base=None, basesrc=None, cliponaxis=None, constraintext=None, customdata=None, customdatasrc=None, dx=None, dy=None, error_x=None, error_y=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, insidetextanchor=None, insidetextfont=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, offset=None, offsetgroup=None, offsetsrc=None, opacity=None, orientation=None, outsidetextfont=None, r=None, rsrc=None, selected=None, selectedpoints=None, showlegend=None, stream=None, t=None, text=None, textangle=None, textfont=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, tsrc=None, uid=None, uirevision=None, unselected=None, visible=None, width=None, widthsrc=None, x=None, x0=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, y=None, y0=None, yaxis=None, ycalendar=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Bar trace
The data visualized by the span of the bars is set in
yiforientationis set th “v” (the default) and the labels are set inx. By settingorientationto “h”, the roles are interchanged.- Parameters
alignmentgroup – Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
base – Sets where the bar base is drawn (in position axis units). In “stack” or “relative” barmode, traces that set “base” will be excluded and drawn in “overlay” mode instead.
basesrc – Sets the source reference on Chart Studio Cloud for base .
cliponaxis – Determines whether the text nodes are clipped about the subplot axes. To show the text nodes above axis lines and tick labels, make sure to set
xaxis.layerandyaxis.layerto below traces.constraintext – Constrain the size of text inside or outside a bar to be no larger than the bar itself.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.error_x –
plotly.graph_objects.bar.ErrorXinstance or dict with compatible propertieserror_y –
plotly.graph_objects.bar.ErrorYinstance or dict with compatible propertieshoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.bar.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablesvalueandlabel. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
insidetextanchor – Determines if texts are kept at center or start/end points in
textposition“inside” mode.insidetextfont – Sets the font used for
textlying inside the bar.legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.bar.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
offset – Shifts the position where the bar is drawn (in position axis units). In “group” barmode, traces that set “offset” will be excluded and drawn in “overlay” mode instead.
offsetgroup – Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
offsetsrc – Sets the source reference on Chart Studio Cloud for offset .
opacity – Sets the opacity of the trace.
orientation – Sets the orientation of the bars. With “v” (“h”), the value of the each bar spans along the vertical (horizontal).
outsidetextfont – Sets the font used for
textlying outside the bar.r – r coordinates in scatter traces are deprecated!Please switch to the “scatterpolar” trace type.Sets the radial coordinatesfor legacy polar chart only.
rsrc – Sets the source reference on Chart Studio Cloud for r .
selected –
plotly.graph_objects.bar.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.bar.Streaminstance or dict with compatible propertiest – t coordinates in scatter traces are deprecated!Please switch to the “scatterpolar” trace type.Sets the angular coordinatesfor legacy polar chart only.
text – Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textangle – Sets the angle of the tick labels with respect to the bar. For example, a
tickangleof -90 draws the tick labels vertically. With “auto” the texts may automatically be rotated to fit with the maximum size in bars.textfont – Sets the font used for
text.textposition – Specifies the location of the
text. “inside” positionstextinside, next to the bar end (rotated and scaled if needed). “outside” positionstextoutside, next to the bar end (scaled if needed), unless there is another bar stacked on this one, then the text gets pushed inside. “auto” tries to positiontextinside the bar, but if the bar is too small and no bar is stacked on this one the text is moved outside.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablesvalueandlabel.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
tsrc – Sets the source reference on Chart Studio Cloud for t .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.bar.Unselectedinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
width – Sets the bar width (in position axis units).
widthsrc – Sets the source reference on Chart Studio Cloud for width .
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ycalendar – Sets the calendar system to use with
ydate data.yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_barpolar(base=None, basesrc=None, customdata=None, customdatasrc=None, dr=None, dtheta=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, offset=None, offsetsrc=None, opacity=None, r=None, r0=None, rsrc=None, selected=None, selectedpoints=None, showlegend=None, stream=None, subplot=None, text=None, textsrc=None, theta=None, theta0=None, thetasrc=None, thetaunit=None, uid=None, uirevision=None, unselected=None, visible=None, width=None, widthsrc=None, row=None, col=None, **kwargs)¶ Add a new Barpolar trace
The data visualized by the radial span of the bars is set in
r- Parameters
base – Sets where the bar base is drawn (in radial axis units). In “stack” barmode, traces that set “base” will be excluded and drawn in “overlay” mode instead.
basesrc – Sets the source reference on Chart Studio Cloud for base .
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dr – Sets the r coordinate step.
dtheta – Sets the theta coordinate step. By default, the
dthetastep equals the subplot’s period divided by the length of thercoordinates.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.barpolar.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.barpolar.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
offset – Shifts the angular position where the bar is drawn (in “thetatunit” units).
offsetsrc – Sets the source reference on Chart Studio Cloud for offset .
opacity – Sets the opacity of the trace.
r – Sets the radial coordinates
r0 – Alternate to
r. Builds a linear space of r coordinates. Use withdrwherer0is the starting coordinate anddrthe step.rsrc – Sets the source reference on Chart Studio Cloud for r .
selected –
plotly.graph_objects.barpolar.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.barpolar.Streaminstance or dict with compatible propertiessubplot – Sets a reference between this trace’s data coordinates and a polar subplot. If “polar” (the default value), the data refer to
layout.polar. If “polar2”, the data refer tolayout.polar2, and so on.text – Sets hover text elements associated with each bar. If a single string, the same string appears over all bars. If an array of string, the items are mapped in order to the this trace’s coordinates.
textsrc – Sets the source reference on Chart Studio Cloud for text .
theta – Sets the angular coordinates
theta0 – Alternate to
theta. Builds a linear space of theta coordinates. Use withdthetawheretheta0is the starting coordinate anddthetathe step.thetasrc – Sets the source reference on Chart Studio Cloud for theta .
thetaunit – Sets the unit of input “theta” values. Has an effect only when on “linear” angular axes.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.barpolar.Unselectedinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
width – Sets the bar angular width (in “thetaunit” units).
widthsrc – Sets the source reference on Chart Studio Cloud for width .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_box(alignmentgroup=None, boxmean=None, boxpoints=None, customdata=None, customdatasrc=None, dx=None, dy=None, fillcolor=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hoveron=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, jitter=None, legendgroup=None, line=None, lowerfence=None, lowerfencesrc=None, marker=None, mean=None, meansrc=None, median=None, mediansrc=None, meta=None, metasrc=None, name=None, notched=None, notchspan=None, notchspansrc=None, notchwidth=None, offsetgroup=None, opacity=None, orientation=None, pointpos=None, q1=None, q1src=None, q3=None, q3src=None, quartilemethod=None, sd=None, sdsrc=None, selected=None, selectedpoints=None, showlegend=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, unselected=None, upperfence=None, upperfencesrc=None, visible=None, whiskerwidth=None, width=None, x=None, x0=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, y=None, y0=None, yaxis=None, ycalendar=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Box trace
Each box spans from quartile 1 (Q1) to quartile 3 (Q3). The second quartile (Q2, i.e. the median) is marked by a line inside the box. The fences grow outward from the boxes’ edges, by default they span +/- 1.5 times the interquartile range (IQR: Q3-Q1), The sample mean and standard deviation as well as notches and the sample, outlier and suspected outliers points can be optionally added to the box plot. The values and positions corresponding to each boxes can be input using two signatures. The first signature expects users to supply the sample values in the
ydata array for vertical boxes (xfor horizontal boxes). By supplying anx(y) array, one box per distinctx(y) value is drawn If nox(y) list is provided, a single box is drawn. In this case, the box is positioned with the tracenameor withx0(y0) if provided. The second signature expects users to supply the boxes corresponding Q1, median and Q3 statistics in theq1,medianandq3data arrays respectively. Other box features relying on statistics namelylowerfence,upperfence,notchspancan be set directly by the users. To have plotly compute them or to show sample points besides the boxes, users can set theydata array for vertical boxes (xfor horizontal boxes) to a 2D array with the outer length corresponding to the number of boxes in the traces and the inner length corresponding the sample size.- Parameters
alignmentgroup – Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
boxmean – If True, the mean of the box(es)’ underlying distribution is drawn as a dashed line inside the box(es). If “sd” the standard deviation is also drawn. Defaults to True when
meanis set. Defaults to “sd” whensdis set Otherwise defaults to False.boxpoints – If “outliers”, only the sample points lying outside the whiskers are shown If “suspectedoutliers”, the outlier points are shown and points either less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1 are highlighted (see
outliercolor) If “all”, all sample points are shown If False, only the box(es) are shown with no sample points Defaults to “suspectedoutliers” whenmarker.outliercolorormarker.line.outliercoloris set. Defaults to “all” under the q1/median/q3 signature. Otherwise defaults to “outliers”.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step for multi-box traces set using q1/median/q3.
dy – Sets the y coordinate step for multi-box traces set using q1/median/q3.
fillcolor – Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.box.Hoverlabelinstance or dict with compatible propertieshoveron – Do the hover effects highlight individual boxes or sample points or both?
hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
jitter – Sets the amount of jitter in the sample points drawn. If 0, the sample points align along the distribution axis. If 1, the sample points are drawn in a random jitter of width equal to the width of the box(es).
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.box.Lineinstance or dict with compatible propertieslowerfence – Sets the lower fence values. There should be as many items as the number of boxes desired. This attribute has effect only under the q1/median/q3 signature. If
lowerfenceis not provided but a sample (inyorx) is set, we compute the lower as the last sample point below 1.5 times the IQR.lowerfencesrc – Sets the source reference on Chart Studio Cloud for lowerfence .
marker –
plotly.graph_objects.box.Markerinstance or dict with compatible propertiesmean – Sets the mean values. There should be as many items as the number of boxes desired. This attribute has effect only under the q1/median/q3 signature. If
meanis not provided but a sample (inyorx) is set, we compute the mean for each box using the sample values.meansrc – Sets the source reference on Chart Studio Cloud for mean .
median – Sets the median values. There should be as many items as the number of boxes desired.
mediansrc – Sets the source reference on Chart Studio Cloud for median .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover. For box traces, the name will also be used for the position coordinate, if
xandx0(yandy0if horizontal) are missing and the position axis is categoricalnotched – Determines whether or not notches are drawn. Notches displays a confidence interval around the median. We compute the confidence interval as median +/- 1.57 * IQR / sqrt(N), where IQR is the interquartile range and N is the sample size. If two boxes’ notches do not overlap there is 95% confidence their medians differ. See https://sites.google.com/site/davidsstatistics/home /notched-box-plots for more info. Defaults to False unless
notchwidthornotchspanis set.notchspan – Sets the notch span from the boxes’
medianvalues. There should be as many items as the number of boxes desired. This attribute has effect only under the q1/median/q3 signature. Ifnotchspanis not provided but a sample (inyorx) is set, we compute it as 1.57 * IQR / sqrt(N), where N is the sample size.notchspansrc – Sets the source reference on Chart Studio Cloud for notchspan .
notchwidth – Sets the width of the notches relative to the box’ width. For example, with 0, the notches are as wide as the box(es).
offsetgroup – Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
opacity – Sets the opacity of the trace.
orientation – Sets the orientation of the box(es). If “v” (“h”), the distribution is visualized along the vertical (horizontal).
pointpos – Sets the position of the sample points in relation to the box(es). If 0, the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes
q1 – Sets the Quartile 1 values. There should be as many items as the number of boxes desired.
q1src – Sets the source reference on Chart Studio Cloud for q1 .
q3 – Sets the Quartile 3 values. There should be as many items as the number of boxes desired.
q3src – Sets the source reference on Chart Studio Cloud for q3 .
quartilemethod – Sets the method used to compute the sample’s Q1 and Q3 quartiles. The “linear” method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publication s/jse/v14n3/langford.html). The “exclusive” method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The “inclusive” method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half.
sd – Sets the standard deviation values. There should be as many items as the number of boxes desired. This attribute has effect only under the q1/median/q3 signature. If
sdis not provided but a sample (inyorx) is set, we compute the standard deviation for each box using the sample values.sdsrc – Sets the source reference on Chart Studio Cloud for sd .
selected –
plotly.graph_objects.box.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.box.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each sample value. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.box.Unselectedinstance or dict with compatible propertiesupperfence – Sets the upper fence values. There should be as many items as the number of boxes desired. This attribute has effect only under the q1/median/q3 signature. If
upperfenceis not provided but a sample (inyorx) is set, we compute the lower as the last sample point above 1.5 times the IQR.upperfencesrc – Sets the source reference on Chart Studio Cloud for upperfence .
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
whiskerwidth – Sets the width of the whiskers relative to the box’ width. For example, with 1, the whiskers are as wide as the box(es).
width – Sets the width of the box in data coordinate If 0 (default value) the width is automatically selected based on the positions of other box traces in the same subplot.
x – Sets the x sample data or coordinates. See overview for more info.
x0 – Sets the x coordinate for single-box traces or the starting coordinate for multi-box traces set using q1/median/q3. See overview for more info.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y sample data or coordinates. See overview for more info.
y0 – Sets the y coordinate for single-box traces or the starting coordinate for multi-box traces set using q1/median/q3. See overview for more info.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ycalendar – Sets the calendar system to use with
ydate data.yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_candlestick(close=None, closesrc=None, customdata=None, customdatasrc=None, decreasing=None, high=None, highsrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, increasing=None, legendgroup=None, line=None, low=None, lowsrc=None, meta=None, metasrc=None, name=None, opacity=None, open=None, opensrc=None, selectedpoints=None, showlegend=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, visible=None, whiskerwidth=None, x=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, yaxis=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Candlestick trace
The candlestick is a style of financial chart describing open, high, low and close for a given
xcoordinate (most likely time). The boxes represent the spread between theopenandclosevalues and the lines represent the spread between thelowandhighvalues Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing candles are drawn in green whereas decreasing are drawn in red.- Parameters
close – Sets the close values.
closesrc – Sets the source reference on Chart Studio Cloud for close .
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
decreasing –
plotly.graph_objects.candlestick.Decreasinginstance or dict with compatible propertieshigh – Sets the high values.
highsrc – Sets the source reference on Chart Studio Cloud for high .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.candlestick.Hoverlabelinstance or dict with compatible propertieshovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
increasing –
plotly.graph_objects.candlestick.Increasinginstance or dict with compatible propertieslegendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.candlestick.Lineinstance or dict with compatible propertieslow – Sets the low values.
lowsrc – Sets the source reference on Chart Studio Cloud for low .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
open – Sets the open values.
opensrc – Sets the source reference on Chart Studio Cloud for open .
selectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.candlestick.Streaminstance or dict with compatible propertiestext – Sets hover text elements associated with each sample point. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to this trace’s sample points.
textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
whiskerwidth – Sets the width of the whiskers relative to the box’ width. For example, with 1, the whiskers are as wide as the box(es).
x – Sets the x coordinates. If absent, linear coordinate will be generated.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_carpet(a=None, a0=None, aaxis=None, asrc=None, b=None, b0=None, baxis=None, bsrc=None, carpet=None, cheaterslope=None, color=None, customdata=None, customdatasrc=None, da=None, db=None, font=None, ids=None, idssrc=None, meta=None, metasrc=None, name=None, opacity=None, stream=None, uid=None, uirevision=None, visible=None, x=None, xaxis=None, xsrc=None, y=None, yaxis=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Carpet trace
The data describing carpet axis layout is set in
yand (optionally) alsox. If onlyyis present,xthe plot is interpreted as a cheater plot and is filled in using theyvalues.xandymay either be 2D arrays matching with each dimension matching that ofaandb, or they may be 1D arrays with total length equal to that ofaandb.- Parameters
a – An array containing values of the first parameter value
a0 – Alternate to
a. Builds a linear space of a coordinates. Use withdawherea0is the starting coordinate anddathe step.aaxis –
plotly.graph_objects.carpet.Aaxisinstance or dict with compatible propertiesasrc – Sets the source reference on Chart Studio Cloud for a .
b – A two dimensional array of y coordinates at each carpet point.
b0 – Alternate to
b. Builds a linear space of a coordinates. Use withdbwhereb0is the starting coordinate anddbthe step.baxis –
plotly.graph_objects.carpet.Baxisinstance or dict with compatible propertiesbsrc – Sets the source reference on Chart Studio Cloud for b .
carpet – An identifier for this carpet, so that
scattercarpetandcontourcarpettraces can specify a carpet plot on which they liecheaterslope – The shift applied to each successive row of data in creating a cheater plot. Only used if
xis been omitted.color – Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
da – Sets the a coordinate step. See
a0for more info.db – Sets the b coordinate step. See
b0for more info.font – The default font used for axis & tick labels on this carpet
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
stream –
plotly.graph_objects.carpet.Streaminstance or dict with compatible propertiesuid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – A two dimensional array of x coordinates at each carpet point. If omitted, the plot is a cheater plot and the xaxis is hidden by default.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – A two dimensional array of y coordinates at each carpet point.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_choropleth(autocolorscale=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, featureidkey=None, geo=None, geojson=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, locationmode=None, locations=None, locationssrc=None, marker=None, meta=None, metasrc=None, name=None, reversescale=None, selected=None, selectedpoints=None, showlegend=None, showscale=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, unselected=None, visible=None, z=None, zauto=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Choropleth trace
The data that describes the choropleth value-to-color mapping is set in
z. The geographic locations corresponding to each value inzare set inlocations.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.choropleth.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
featureidkey – Sets the key in GeoJSON features which is used as id to match the items included in the
locationsarray. Only has an effect whengeojsonis set. Support nested property, for example “properties.name”.geo – Sets a reference between this trace’s geospatial coordinates and a geographic map. If “geo” (the default value), the geospatial coordinates refer to
layout.geo. If “geo2”, the geospatial coordinates refer tolayout.geo2, and so on.geojson – Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type “FeatureCollection” or “Feature” with geometries of type “Polygon” or “MultiPolygon”.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.choropleth.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
locationmode – Determines the set of locations used to match entries in
locationsto regions on the map. Values “ISO-3”, “USA-states”, country names correspond to features on the base map and value “geojson-id” corresponds to features from a custom GeoJSON linked to thegeojsonattribute.locations – Sets the coordinates via location IDs or names. See
locationmodefor more info.locationssrc – Sets the source reference on Chart Studio Cloud for locations .
marker –
plotly.graph_objects.choropleth.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.selected –
plotly.graph_objects.choropleth.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.choropleth.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each location.
textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.choropleth.Unselectedinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
z – Sets the color values.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_choroplethmapbox(autocolorscale=None, below=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, featureidkey=None, geojson=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, locations=None, locationssrc=None, marker=None, meta=None, metasrc=None, name=None, reversescale=None, selected=None, selectedpoints=None, showlegend=None, showscale=None, stream=None, subplot=None, text=None, textsrc=None, uid=None, uirevision=None, unselected=None, visible=None, z=None, zauto=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Choroplethmapbox trace
GeoJSON features to be filled are set in
geojsonThe data that describes the choropleth value-to-color mapping is set inlocationsandz.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.below – Determines if the choropleth polygons will be inserted before the layer with the specified ID. By default, choroplethmapbox traces are placed above the water layers. If set to ‘’, the layer will be inserted above every existing layer.
coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.choroplethmapbox.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
featureidkey – Sets the key in GeoJSON features which is used as id to match the items included in the
locationsarray. Support nested property, for example “properties.name”.geojson – Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type “FeatureCollection” or “Feature” with geometries of type “Polygon” or “MultiPolygon”.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.choroplethmapbox.Hoverlabe linstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablepropertiesAnything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
locations – Sets which features found in “geojson” to plot using their feature
idfield.locationssrc – Sets the source reference on Chart Studio Cloud for locations .
marker –
plotly.graph_objects.choroplethmapbox.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.selected –
plotly.graph_objects.choroplethmapbox.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.choroplethmapbox.Streaminstance or dict with compatible propertiessubplot – Sets a reference between this trace’s data coordinates and a mapbox subplot. If “mapbox” (the default value), the data refer to
layout.mapbox. If “mapbox2”, the data refer tolayout.mapbox2, and so on.text – Sets the text elements associated with each location.
textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.choroplethmapbox.Unselecte dinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
z – Sets the color values.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_cone(anchor=None, autocolorscale=None, cauto=None, cmax=None, cmid=None, cmin=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, lighting=None, lightposition=None, meta=None, metasrc=None, name=None, opacity=None, reversescale=None, scene=None, showlegend=None, showscale=None, sizemode=None, sizeref=None, stream=None, text=None, textsrc=None, u=None, uid=None, uirevision=None, usrc=None, v=None, visible=None, vsrc=None, w=None, wsrc=None, x=None, xsrc=None, y=None, ysrc=None, z=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Cone trace
Use cone traces to visualize vector fields. Specify a vector field using 6 1D arrays, 3 position arrays
x,yandzand 3 vector component arraysu,v,w. The cones are drawn exactly at the positions given byx,yandz.- Parameters
anchor – Sets the cones’ anchor with respect to their x/y/z positions. Note that “cm” denote the cone’s center of mass which corresponds to 1/4 from the tail to tip.
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.cauto – Determines whether or not the color domain is computed with respect to the input data (here u/v/w norm) or the bounds set in
cminandcmaxDefaults tofalsewhencminandcmaxare set by the user.cmax – Sets the upper bound of the color domain. Value should have the same units as u/v/w norm and if set,
cminmust be set as well.cmid – Sets the mid-point of the color domain by scaling
cminand/orcmaxto be equidistant to this point. Value should have the same units as u/v/w norm. Has no effect whencautoisfalse.cmin – Sets the lower bound of the color domain. Value should have the same units as u/v/w norm and if set,
cmaxmust be set as well.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.cone.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`cmin` andcmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.cone.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablenormAnything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
lighting –
plotly.graph_objects.cone.Lightinginstance or dict with compatible propertieslightposition –
plotly.graph_objects.cone.Lightpositioninstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the surface. Please note that in the case of using high
opacityvalues for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change.reversescale – Reverses the color mapping if true. If true,
cminwill correspond to the last color in the array andcmaxwill correspond to the first color.scene – Sets a reference between this trace’s 3D coordinate system and a 3D scene. If “scene” (the default value), the (x,y,z) coordinates refer to
layout.scene. If “scene2”, the (x,y,z) coordinates refer tolayout.scene2, and so on.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
sizemode – Determines whether
sizerefis set as a “scaled” (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as “absolute” value (in the same units as the vector field).sizeref – Adjusts the cone size scaling. The size of the cones is determined by their u/v/w norm multiplied a factor and
sizeref. This factor (computed internally) corresponds to the minimum “time” to travel across two successive x/y/z positions at the average velocity of those two successive positions. All cones in a given trace use the same factor. Withsizemodeset to “scaled”,sizerefis unitless, its default value is 0.5 Withsizemodeset to “absolute”,sizerefhas the same units as the u/v/w vector field, its the default value is half the sample’s maximum vector norm.stream –
plotly.graph_objects.cone.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with the cones. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textsrc – Sets the source reference on Chart Studio Cloud for text .
u – Sets the x components of the vector field.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.usrc – Sets the source reference on Chart Studio Cloud for u .
v – Sets the y components of the vector field.
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
vsrc – Sets the source reference on Chart Studio Cloud for v .
w – Sets the z components of the vector field.
wsrc – Sets the source reference on Chart Studio Cloud for w .
x – Sets the x coordinates of the vector field and of the displayed cones.
xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y coordinates of the vector field and of the displayed cones.
ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the z coordinates of the vector field and of the displayed cones.
zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_contour(autocolorscale=None, autocontour=None, coloraxis=None, colorbar=None, colorscale=None, connectgaps=None, contours=None, customdata=None, customdatasrc=None, dx=None, dy=None, fillcolor=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hoverongaps=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, line=None, meta=None, metasrc=None, name=None, ncontours=None, opacity=None, reversescale=None, showlegend=None, showscale=None, stream=None, text=None, textsrc=None, transpose=None, uid=None, uirevision=None, visible=None, x=None, x0=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, xtype=None, y=None, y0=None, yaxis=None, ycalendar=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, ytype=None, z=None, zauto=None, zhoverformat=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Contour trace
The data from which contour lines are computed is set in
z. Data inzmust be a 2D list of numbers. Say thatzhas N rows and M columns, then by default, these N rows correspond to N y coordinates (set inyor auto-generated) and the M columns correspond to M x coordinates (set inxor auto- generated). By settingtransposeto True, the above behavior is flipped.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.autocontour – Determines whether or not the contour level attributes are picked by an algorithm. If True, the number of contour levels can be set in
ncontours. If False, set the contour level attributes incontours.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.contour.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.connectgaps – Determines whether or not gaps (i.e. {nan} or missing values) in the
zdata are filled in. It is defaulted to true ifzis a one dimensional array otherwise it is defaulted to false.contours –
plotly.graph_objects.contour.Contoursinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.fillcolor – Sets the fill color if
contours.typeis “constraint”. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.contour.Hoverlabelinstance or dict with compatible propertieshoverongaps – Determines whether or not gaps (i.e. {nan} or missing values) in the
zdata have hover labels associated with them.hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.contour.Lineinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
ncontours – Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of
ncontours. Has an effect only ifautocontouris True or ifcontours.sizeis missing.opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.contour.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each z value.
textsrc – Sets the source reference on Chart Studio Cloud for text .
transpose – Transposes the z data.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
xtype – If “array”, the heatmap’s x coordinates are given by “x” (the default behavior when
xis provided). If “scaled”, the heatmap’s x coordinates are given by “x0” and “dx” (the default behavior whenxis not provided).y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ycalendar – Sets the calendar system to use with
ydate data.yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
ytype – If “array”, the heatmap’s y coordinates are given by “y” (the default behavior when
yis provided) If “scaled”, the heatmap’s y coordinates are given by “y0” and “dy” (the default behavior whenyis not provided)z – Sets the z data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zhoverformat – Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. See: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format
zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_contourcarpet(a=None, a0=None, asrc=None, atype=None, autocolorscale=None, autocontour=None, b=None, b0=None, bsrc=None, btype=None, carpet=None, coloraxis=None, colorbar=None, colorscale=None, contours=None, customdata=None, customdatasrc=None, da=None, db=None, fillcolor=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, line=None, meta=None, metasrc=None, name=None, ncontours=None, opacity=None, reversescale=None, showlegend=None, showscale=None, stream=None, text=None, textsrc=None, transpose=None, uid=None, uirevision=None, visible=None, xaxis=None, yaxis=None, z=None, zauto=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Contourcarpet trace
Plots contours on either the first carpet axis or the carpet axis with a matching
carpetattribute. Datazis interpreted as matching that of the corresponding carpet axis.- Parameters
a – Sets the x coordinates.
a0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.asrc – Sets the source reference on Chart Studio Cloud for a .
atype – If “array”, the heatmap’s x coordinates are given by “x” (the default behavior when
xis provided). If “scaled”, the heatmap’s x coordinates are given by “x0” and “dx” (the default behavior whenxis not provided).autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.autocontour – Determines whether or not the contour level attributes are picked by an algorithm. If True, the number of contour levels can be set in
ncontours. If False, set the contour level attributes incontours.b – Sets the y coordinates.
b0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.bsrc – Sets the source reference on Chart Studio Cloud for b .
btype – If “array”, the heatmap’s y coordinates are given by “y” (the default behavior when
yis provided) If “scaled”, the heatmap’s y coordinates are given by “y0” and “dy” (the default behavior whenyis not provided)carpet – The
carpetof the carpet axes on which this contour trace liescoloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.contourcarpet.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.contours –
plotly.graph_objects.contourcarpet.Contoursinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
da – Sets the x coordinate step. See
x0for more info.db – Sets the y coordinate step. See
y0for more info.fillcolor – Sets the fill color if
contours.typeis “constraint”. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.contourcarpet.Lineinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
ncontours – Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of
ncontours. Has an effect only ifautocontouris True or ifcontours.sizeis missing.opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.contourcarpet.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each z value.
textsrc – Sets the source reference on Chart Studio Cloud for text .
transpose – Transposes the z data.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.z – Sets the z data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_densitymapbox(autocolorscale=None, below=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, lat=None, latsrc=None, legendgroup=None, lon=None, lonsrc=None, meta=None, metasrc=None, name=None, opacity=None, radius=None, radiussrc=None, reversescale=None, showlegend=None, showscale=None, stream=None, subplot=None, text=None, textsrc=None, uid=None, uirevision=None, visible=None, z=None, zauto=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Densitymapbox trace
Draws a bivariate kernel density estimation with a Gaussian kernel from
lonandlatcoordinates and optionalzvalues using a colorscale.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.below – Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to ‘’, the layer will be inserted above every existing layer.
coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.densitymapbox.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.densitymapbox.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (lon,lat) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
lat – Sets the latitude coordinates (in degrees North).
latsrc – Sets the source reference on Chart Studio Cloud for lat .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
lon – Sets the longitude coordinates (in degrees East).
lonsrc – Sets the source reference on Chart Studio Cloud for lon .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
radius – Sets the radius of influence of one
lon/latpoint in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed.radiussrc – Sets the source reference on Chart Studio Cloud for radius .
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.densitymapbox.Streaminstance or dict with compatible propertiessubplot – Sets a reference between this trace’s data coordinates and a mapbox subplot. If “mapbox” (the default value), the data refer to
layout.mapbox. If “mapbox2”, the data refer tolayout.mapbox2, and so on.text – Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (lon,lat) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
z – Sets the points’ weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_funnel(alignmentgroup=None, cliponaxis=None, connector=None, constraintext=None, customdata=None, customdatasrc=None, dx=None, dy=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, insidetextanchor=None, insidetextfont=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, offset=None, offsetgroup=None, opacity=None, orientation=None, outsidetextfont=None, selectedpoints=None, showlegend=None, stream=None, text=None, textangle=None, textfont=None, textinfo=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, uid=None, uirevision=None, visible=None, width=None, x=None, x0=None, xaxis=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, y=None, y0=None, yaxis=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Funnel trace
Visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a “drop-off” representation wherein each item appears in each stage it traversed. See also the “funnelarea” trace type for a different approach to visualizing funnel data.
- Parameters
alignmentgroup – Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
cliponaxis – Determines whether the text nodes are clipped about the subplot axes. To show the text nodes above axis lines and tick labels, make sure to set
xaxis.layerandyaxis.layerto below traces.connector –
plotly.graph_objects.funnel.Connectorinstance or dict with compatible propertiesconstraintext – Constrain the size of text inside or outside a bar to be no larger than the bar itself.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.funnel.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablespercentInitial,percentPreviousandpercentTotal. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
insidetextanchor – Determines if texts are kept at center or start/end points in
textposition“inside” mode.insidetextfont – Sets the font used for
textlying inside the bar.legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.funnel.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
offset – Shifts the position where the bar is drawn (in position axis units). In “group” barmode, traces that set “offset” will be excluded and drawn in “overlay” mode instead.
offsetgroup – Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
opacity – Sets the opacity of the trace.
orientation – Sets the orientation of the funnels. With “v” (“h”), the value of the each bar spans along the vertical (horizontal). By default funnels are tend to be oriented horizontally; unless only “y” array is presented or orientation is set to “v”. Also regarding graphs including only ‘horizontal’ funnels, “autorange” on the “y-axis” are set to “reversed”.
outsidetextfont – Sets the font used for
textlying outside the bar.selectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.funnel.Streaminstance or dict with compatible propertiestext – Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textangle – Sets the angle of the tick labels with respect to the bar. For example, a
tickangleof -90 draws the tick labels vertically. With “auto” the texts may automatically be rotated to fit with the maximum size in bars.textfont – Sets the font used for
text.textinfo – Determines which trace information appear on the graph. In the case of having multiple funnels, percentages & totals are computed separately (per trace).
textposition – Specifies the location of the
text. “inside” positionstextinside, next to the bar end (rotated and scaled if needed). “outside” positionstextoutside, next to the bar end (scaled if needed), unless there is another bar stacked on this one, then the text gets pushed inside. “auto” tries to positiontextinside the bar, but if the bar is too small and no bar is stacked on this one the text is moved outside.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablespercentInitial,percentPrevious,percentTotal,labelandvalue.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
width – Sets the bar width (in position axis units).
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_funnelarea(aspectratio=None, baseratio=None, customdata=None, customdatasrc=None, dlabel=None, domain=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, insidetextfont=None, label0=None, labels=None, labelssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, opacity=None, scalegroup=None, showlegend=None, stream=None, text=None, textfont=None, textinfo=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, title=None, uid=None, uirevision=None, values=None, valuessrc=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Funnelarea trace
Visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a “pie” trace, wherein each item appears in a single stage. See also the “funnel” trace type for a different approach to visualizing funnel data.
- Parameters
aspectratio – Sets the ratio between height and width
baseratio – Sets the ratio between bottom length and maximum top length.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dlabel – Sets the label step. See
label0for more info.domain –
plotly.graph_objects.funnelarea.Domaininstance or dict with compatible propertieshoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.funnelarea.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variableslabel,color,value,textandpercent. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each sector. If a single string, the same string appears for all data points. If an array of string, the items are mapped in order of this trace’s sectors. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
insidetextfont – Sets the font used for
textinfolying inside the sector.label0 – Alternate to
labels. Builds a numeric set of labels. Use withdlabelwherelabel0is the starting label anddlabelthe step.labels – Sets the sector labels. If
labelsentries are duplicated, we sum associatedvaluesor simply count occurrences ifvaluesis not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label.labelssrc – Sets the source reference on Chart Studio Cloud for labels .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.funnelarea.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
scalegroup – If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.
showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.funnelarea.Streaminstance or dict with compatible propertiestext – Sets text elements associated with each sector. If trace
textinfocontains a “text” flag, these elements will be seen on the chart. If tracehoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textfont – Sets the font used for
textinfo.textinfo – Determines which trace information appear on the graph.
textposition – Specifies the location of the
textinfo.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variableslabel,color,value,textandpercent.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
title –
plotly.graph_objects.funnelarea.Titleinstance or dict with compatible propertiesuid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.values – Sets the values of the sectors. If omitted, we count occurrences of each label.
valuessrc – Sets the source reference on Chart Studio Cloud for values .
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_heatmap(autocolorscale=None, coloraxis=None, colorbar=None, colorscale=None, connectgaps=None, customdata=None, customdatasrc=None, dx=None, dy=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hoverongaps=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, meta=None, metasrc=None, name=None, opacity=None, reversescale=None, showlegend=None, showscale=None, stream=None, text=None, textsrc=None, transpose=None, uid=None, uirevision=None, visible=None, x=None, x0=None, xaxis=None, xcalendar=None, xgap=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, xtype=None, y=None, y0=None, yaxis=None, ycalendar=None, ygap=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, ytype=None, z=None, zauto=None, zhoverformat=None, zmax=None, zmid=None, zmin=None, zsmooth=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Heatmap trace
The data that describes the heatmap value-to-color mapping is set in
z. Data inzcan either be a 2D list of values (ragged or not) or a 1D array of values. In the case wherezis a 2D list, say thatzhas N rows and M columns. Then, by default, the resulting heatmap will have N partitions along the y axis and M partitions along the x axis. In other words, the i-th row/ j-th column cell inzis mapped to the i-th partition of the y axis (starting from the bottom of the plot) and the j-th partition of the x-axis (starting from the left of the plot). This behavior can be flipped by usingtranspose. Moreover,x(y) can be provided with M or M+1 (N or N+1) elements. If M (N), then the coordinates correspond to the center of the heatmap cells and the cells have equal width. If M+1 (N+1), then the coordinates correspond to the edges of the heatmap cells. In the case wherezis a 1D list, the x and y coordinates must be provided inxandyrespectively to form data triplets.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.heatmap.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.connectgaps – Determines whether or not gaps (i.e. {nan} or missing values) in the
zdata are filled in. It is defaulted to true ifzis a one dimensional array andzsmoothis not false; otherwise it is defaulted to false.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.heatmap.Hoverlabelinstance or dict with compatible propertieshoverongaps – Determines whether or not gaps (i.e. {nan} or missing values) in the
zdata have hover labels associated with them.hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.heatmap.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each z value.
textsrc – Sets the source reference on Chart Studio Cloud for text .
transpose – Transposes the z data.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xgap – Sets the horizontal gap (in pixels) between bricks.
xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
xtype – If “array”, the heatmap’s x coordinates are given by “x” (the default behavior when
xis provided). If “scaled”, the heatmap’s x coordinates are given by “x0” and “dx” (the default behavior whenxis not provided).y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ycalendar – Sets the calendar system to use with
ydate data.ygap – Sets the vertical gap (in pixels) between bricks.
yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
ytype – If “array”, the heatmap’s y coordinates are given by “y” (the default behavior when
yis provided) If “scaled”, the heatmap’s y coordinates are given by “y0” and “dy” (the default behavior whenyis not provided)z – Sets the z data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zhoverformat – Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. See: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format
zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsmooth – Picks a smoothing algorithm use to smooth
zdata.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_heatmapgl(autocolorscale=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, dx=None, dy=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, ids=None, idssrc=None, meta=None, metasrc=None, name=None, opacity=None, reversescale=None, showscale=None, stream=None, text=None, textsrc=None, transpose=None, uid=None, uirevision=None, visible=None, x=None, x0=None, xaxis=None, xsrc=None, xtype=None, y=None, y0=None, yaxis=None, ysrc=None, ytype=None, z=None, zauto=None, zmax=None, zmid=None, zmin=None, zsmooth=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Heatmapgl trace
WebGL version of the heatmap trace type.
- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.heatmapgl.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.heatmapgl.Hoverlabelinstance or dict with compatible propertiesids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.heatmapgl.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each z value.
textsrc – Sets the source reference on Chart Studio Cloud for text .
transpose – Transposes the z data.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xsrc – Sets the source reference on Chart Studio Cloud for x .
xtype – If “array”, the heatmap’s x coordinates are given by “x” (the default behavior when
xis provided). If “scaled”, the heatmap’s x coordinates are given by “x0” and “dx” (the default behavior whenxis not provided).y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ysrc – Sets the source reference on Chart Studio Cloud for y .
ytype – If “array”, the heatmap’s y coordinates are given by “y” (the default behavior when
yis provided) If “scaled”, the heatmap’s y coordinates are given by “y0” and “dy” (the default behavior whenyis not provided)z – Sets the z data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsmooth – Picks a smoothing algorithm use to smooth
zdata.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_histogram(alignmentgroup=None, autobinx=None, autobiny=None, bingroup=None, cumulative=None, customdata=None, customdatasrc=None, error_x=None, error_y=None, histfunc=None, histnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, nbinsx=None, nbinsy=None, offsetgroup=None, opacity=None, orientation=None, selected=None, selectedpoints=None, showlegend=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, unselected=None, visible=None, x=None, xaxis=None, xbins=None, xcalendar=None, xsrc=None, y=None, yaxis=None, ybins=None, ycalendar=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Histogram trace
The sample data from which statistics are computed is set in
xfor vertically spanning histograms and inyfor horizontally spanning histograms. Binning options are setxbinsandybinsrespectively if no aggregation data is provided.- Parameters
alignmentgroup – Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
autobinx – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinxis not needed. However, we acceptautobinx: trueorfalseand will updatexbinsaccordingly before deletingautobinxfrom the trace.autobiny – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinyis not needed. However, we acceptautobiny: trueorfalseand will updateybinsaccordingly before deletingautobinyfrom the trace.bingroup – Set a group of histogram traces which will have compatible bin settings. Note that traces on the same subplot and with the same “orientation” under
barmode“stack”, “relative” and “group” are forced into the same bingroup, Usingbingroup, traces underbarmode“overlay” and on different axes (of the same axis type) can have compatible bin settings. Note that histogram and histogram2d* trace can share the samebingroupcumulative –
plotly.graph_objects.histogram.Cumulativeinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
error_x –
plotly.graph_objects.histogram.ErrorXinstance or dict with compatible propertieserror_y –
plotly.graph_objects.histogram.ErrorYinstance or dict with compatible propertieshistfunc – Specifies the binning function used for this histogram trace. If “count”, the histogram values are computed by counting the number of values lying inside each bin. If “sum”, “avg”, “min”, “max”, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.
histnorm – Specifies the type of normalization used for this histogram trace. If “”, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If “percent” / “probability”, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If “density”, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If probability density, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.histogram.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablebinNumberAnything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.histogram.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
nbinsx – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
xbins.sizeis provided.nbinsy – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
ybins.sizeis provided.offsetgroup – Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
opacity – Sets the opacity of the trace.
orientation – Sets the orientation of the bars. With “v” (“h”), the value of the each bar spans along the vertical (horizontal).
selected –
plotly.graph_objects.histogram.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.histogram.Streaminstance or dict with compatible propertiestext – Sets hover text elements associated with each bar. If a single string, the same string appears over all bars. If an array of string, the items are mapped in order to the this trace’s coordinates.
textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.histogram.Unselectedinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the sample data to be binned on the x axis.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xbins –
plotly.graph_objects.histogram.XBinsinstance or dict with compatible propertiesxcalendar – Sets the calendar system to use with
xdate data.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the sample data to be binned on the y axis.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ybins –
plotly.graph_objects.histogram.YBinsinstance or dict with compatible propertiesycalendar – Sets the calendar system to use with
ydate data.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_histogram2d(autobinx=None, autobiny=None, autocolorscale=None, bingroup=None, coloraxis=None, colorbar=None, colorscale=None, customdata=None, customdatasrc=None, histfunc=None, histnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, ids=None, idssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, nbinsx=None, nbinsy=None, opacity=None, reversescale=None, showlegend=None, showscale=None, stream=None, uid=None, uirevision=None, visible=None, x=None, xaxis=None, xbingroup=None, xbins=None, xcalendar=None, xgap=None, xsrc=None, y=None, yaxis=None, ybingroup=None, ybins=None, ycalendar=None, ygap=None, ysrc=None, z=None, zauto=None, zhoverformat=None, zmax=None, zmid=None, zmin=None, zsmooth=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Histogram2d trace
The sample data from which statistics are computed is set in
xandy(wherexandyrepresent marginal distributions, binning is set inxbinsandybinsin this case) orz(wherezrepresent the 2D distribution and binning set, binning is set byxandyin this case). The resulting distribution is visualized as a heatmap.- Parameters
autobinx – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinxis not needed. However, we acceptautobinx: trueorfalseand will updatexbinsaccordingly before deletingautobinxfrom the trace.autobiny – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinyis not needed. However, we acceptautobiny: trueorfalseand will updateybinsaccordingly before deletingautobinyfrom the trace.autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.bingroup – Set the
xbingroupandybingroupdefault prefix For example, setting abingroupof 1 on two histogram2d traces will make them their x-bins and y-bins match separately.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.histogram2d.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
histfunc – Specifies the binning function used for this histogram trace. If “count”, the histogram values are computed by counting the number of values lying inside each bin. If “sum”, “avg”, “min”, “max”, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.
histnorm – Specifies the type of normalization used for this histogram trace. If “”, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If “percent” / “probability”, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If “density”, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If probability density, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.histogram2d.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablezAnything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.histogram2d.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
nbinsx – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
xbins.sizeis provided.nbinsy – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
ybins.sizeis provided.opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.histogram2d.Streaminstance or dict with compatible propertiesuid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the sample data to be binned on the x axis.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xbingroup – Set a group of histogram traces which will have compatible x-bin settings. Using
xbingroup, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible x-bin settings. Note that the samexbingroupvalue can be used to set (1D) histogrambingroupxbins –
plotly.graph_objects.histogram2d.XBinsinstance or dict with compatible propertiesxcalendar – Sets the calendar system to use with
xdate data.xgap – Sets the horizontal gap (in pixels) between bricks.
xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the sample data to be binned on the y axis.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ybingroup – Set a group of histogram traces which will have compatible y-bin settings. Using
ybingroup, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible y-bin settings. Note that the sameybingroupvalue can be used to set (1D) histogrambingroupybins –
plotly.graph_objects.histogram2d.YBinsinstance or dict with compatible propertiesycalendar – Sets the calendar system to use with
ydate data.ygap – Sets the vertical gap (in pixels) between bricks.
ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the aggregation data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zhoverformat – Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. See: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format
zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsmooth – Picks a smoothing algorithm use to smooth
zdata.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_histogram2dcontour(autobinx=None, autobiny=None, autocolorscale=None, autocontour=None, bingroup=None, coloraxis=None, colorbar=None, colorscale=None, contours=None, customdata=None, customdatasrc=None, histfunc=None, histnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, ids=None, idssrc=None, legendgroup=None, line=None, marker=None, meta=None, metasrc=None, name=None, nbinsx=None, nbinsy=None, ncontours=None, opacity=None, reversescale=None, showlegend=None, showscale=None, stream=None, uid=None, uirevision=None, visible=None, x=None, xaxis=None, xbingroup=None, xbins=None, xcalendar=None, xsrc=None, y=None, yaxis=None, ybingroup=None, ybins=None, ycalendar=None, ysrc=None, z=None, zauto=None, zhoverformat=None, zmax=None, zmid=None, zmin=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Histogram2dContour trace
The sample data from which statistics are computed is set in
xandy(wherexandyrepresent marginal distributions, binning is set inxbinsandybinsin this case) orz(wherezrepresent the 2D distribution and binning set, binning is set byxandyin this case). The resulting distribution is visualized as a contour plot.- Parameters
autobinx – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinxis not needed. However, we acceptautobinx: trueorfalseand will updatexbinsaccordingly before deletingautobinxfrom the trace.autobiny – Obsolete: since v1.42 each bin attribute is auto- determined separately and
autobinyis not needed. However, we acceptautobiny: trueorfalseand will updateybinsaccordingly before deletingautobinyfrom the trace.autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.autocontour – Determines whether or not the contour level attributes are picked by an algorithm. If True, the number of contour levels can be set in
ncontours. If False, set the contour level attributes incontours.bingroup – Set the
xbingroupandybingroupdefault prefix For example, setting abingroupof 1 on two histogram2d traces will make them their x-bins and y-bins match separately.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.histogram2dcontour.ColorBa rinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`zmin` andzmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.contours –
plotly.graph_objects.histogram2dcontour.Contour sinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
histfunc – Specifies the binning function used for this histogram trace. If “count”, the histogram values are computed by counting the number of values lying inside each bin. If “sum”, “avg”, “min”, “max”, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.
histnorm – Specifies the type of normalization used for this histogram trace. If “”, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If “percent” / “probability”, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If “density”, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If probability density, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.histogram2dcontour.Hoverla belinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablezAnything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.histogram2dcontour.Lineinstance or dict with compatible propertiesmarker –
plotly.graph_objects.histogram2dcontour.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
nbinsx – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
xbins.sizeis provided.nbinsy – Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if
ybins.sizeis provided.ncontours – Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of
ncontours. Has an effect only ifautocontouris True or ifcontours.sizeis missing.opacity – Sets the opacity of the trace.
reversescale – Reverses the color mapping if true. If true,
zminwill correspond to the last color in the array andzmaxwill correspond to the first color.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.histogram2dcontour.Streaminstance or dict with compatible propertiesuid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the sample data to be binned on the x axis.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xbingroup – Set a group of histogram traces which will have compatible x-bin settings. Using
xbingroup, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible x-bin settings. Note that the samexbingroupvalue can be used to set (1D) histogrambingroupxbins –
plotly.graph_objects.histogram2dcontour.XBinsinstance or dict with compatible propertiesxcalendar – Sets the calendar system to use with
xdate data.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the sample data to be binned on the y axis.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ybingroup – Set a group of histogram traces which will have compatible y-bin settings. Using
ybingroup, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible y-bin settings. Note that the sameybingroupvalue can be used to set (1D) histogrambingroupybins –
plotly.graph_objects.histogram2dcontour.YBinsinstance or dict with compatible propertiesycalendar – Sets the calendar system to use with
ydate data.ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the aggregation data.
zauto – Determines whether or not the color domain is computed with respect to the input data (here in
z) or the bounds set inzminandzmaxDefaults tofalsewhenzminandzmaxare set by the user.zhoverformat – Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. See: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format
zmax – Sets the upper bound of the color domain. Value should have the same units as in
zand if set,zminmust be set as well.zmid – Sets the mid-point of the color domain by scaling
zminand/orzmaxto be equidistant to this point. Value should have the same units as inz. Has no effect whenzautoisfalse.zmin – Sets the lower bound of the color domain. Value should have the same units as in
zand if set,zmaxmust be set as well.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_hline(y, row='all', col='all', exclude_empty_subplots=True, **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, **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_image(colormodel=None, customdata=None, customdatasrc=None, dx=None, dy=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, meta=None, metasrc=None, name=None, opacity=None, source=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, visible=None, x0=None, xaxis=None, y0=None, yaxis=None, z=None, zmax=None, zmin=None, zsrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Image trace
Display an image, i.e. data on a 2D regular raster. By default, when an image is displayed in a subplot, its y axis will be reversed (ie.
autorange: 'reversed'), constrained to the domain (ie.constrain: 'domain') and it will have the same scale as its x axis (ie.scaleanchor: 'x,) in order for pixels to be rendered as squares.- Parameters
colormodel – Color model used to map the numerical color components described in
zinto colors. Ifsourceis specified, this attribute will be set torgba256otherwise it defaults torgb.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Set the pixel’s horizontal size.
dy – Set the pixel’s vertical size
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.image.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablesz,colorandcolormodel. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
source – Specifies the data URI of the image to be visualized. The URI consists of “data:image/[<media subtype>][;base64],<data>”
stream –
plotly.graph_objects.image.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with each z value.
textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x0 – Set the image’s x position.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.y0 – Set the image’s y position.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.z – A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color.
zmax – Array defining the higher bound for each color component. Note that the default value will depend on the colormodel. For the
rgbcolormodel, it is [255, 255, 255]. For thergbacolormodel, it is [255, 255, 255, 1]. For thergba256colormodel, it is [255, 255, 255, 255]. For thehslcolormodel, it is [360, 100, 100]. For thehslacolormodel, it is [360, 100, 100, 1].zmin – Array defining the lower bound for each color component. Note that the default value will depend on the colormodel. For the
rgbcolormodel, it is [0, 0, 0]. For thergbacolormodel, it is [0, 0, 0, 0]. For thergba256colormodel, it is [0, 0, 0, 0]. For thehslcolormodel, it is [0, 0, 0]. For thehslacolormodel, it is [0, 0, 0, 0].zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_indicator(align=None, customdata=None, customdatasrc=None, delta=None, domain=None, gauge=None, ids=None, idssrc=None, meta=None, metasrc=None, mode=None, name=None, number=None, stream=None, title=None, uid=None, uirevision=None, value=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Indicator trace
An indicator is used to visualize a single
valuealong with some contextual information such asstepsor athreshold, using a combination of three visual elements: a number, a delta, and/or a gauge. Deltas are taken with respect to areference. Gauges can be either angular or bullet (aka linear) gauges.- Parameters
align – Sets the horizontal alignment of the
textwithin the box. Note that this attribute has no effect if an angular gauge is displayed: in this case, it is always centeredcustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
delta –
plotly.graph_objects.indicator.Deltainstance or dict with compatible propertiesdomain –
plotly.graph_objects.indicator.Domaininstance or dict with compatible propertiesgauge – The gauge of the Indicator plot.
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
mode – Determines how the value is displayed on the graph.
numberdisplays the value numerically in text.deltadisplays the difference to a reference value in text. Finally,gaugedisplays the value graphically on an axis.name – Sets the trace name. The trace name appear as the legend item and on hover.
number –
plotly.graph_objects.indicator.Numberinstance or dict with compatible propertiesstream –
plotly.graph_objects.indicator.Streaminstance or dict with compatible propertiestitle –
plotly.graph_objects.indicator.Titleinstance or dict with compatible propertiesuid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.value – Sets the number to be displayed.
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_isosurface(autocolorscale=None, caps=None, cauto=None, cmax=None, cmid=None, cmin=None, coloraxis=None, colorbar=None, colorscale=None, contour=None, customdata=None, customdatasrc=None, flatshading=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, isomax=None, isomin=None, legendgroup=None, lighting=None, lightposition=None, meta=None, metasrc=None, name=None, opacity=None, reversescale=None, scene=None, showlegend=None, showscale=None, slices=None, spaceframe=None, stream=None, surface=None, text=None, textsrc=None, uid=None, uirevision=None, value=None, valuesrc=None, visible=None, x=None, xsrc=None, y=None, ysrc=None, z=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Isosurface trace
Draws isosurfaces between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the
value,x,yandzof every vertex of a uniform or non- uniform 3-D grid. Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace.- Parameters
autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.caps –
plotly.graph_objects.isosurface.Capsinstance or dict with compatible propertiescauto – Determines whether or not the color domain is computed with respect to the input data (here
value) or the bounds set incminandcmaxDefaults tofalsewhencminandcmaxare set by the user.cmax – Sets the upper bound of the color domain. Value should have the same units as
valueand if set,cminmust be set as well.cmid – Sets the mid-point of the color domain by scaling
cminand/orcmaxto be equidistant to this point. Value should have the same units asvalue. Has no effect whencautoisfalse.cmin – Sets the lower bound of the color domain. Value should have the same units as
valueand if set,cmaxmust be set as well.coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.isosurface.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`cmin` andcmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.contour –
plotly.graph_objects.isosurface.Contourinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
flatshading – Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low- poly look via flat reflections.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.isosurface.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
isomax – Sets the maximum boundary for iso-surface plot.
isomin – Sets the minimum boundary for iso-surface plot.
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
lighting –
plotly.graph_objects.isosurface.Lightinginstance or dict with compatible propertieslightposition –
plotly.graph_objects.isosurface.Lightpositioninstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the surface. Please note that in the case of using high
opacityvalues for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change.reversescale – Reverses the color mapping if true. If true,
cminwill correspond to the last color in the array andcmaxwill correspond to the first color.scene – Sets a reference between this trace’s 3D coordinate system and a 3D scene. If “scene” (the default value), the (x,y,z) coordinates refer to
layout.scene. If “scene2”, the (x,y,z) coordinates refer tolayout.scene2, and so on.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
slices –
plotly.graph_objects.isosurface.Slicesinstance or dict with compatible propertiesspaceframe –
plotly.graph_objects.isosurface.Spaceframeinstance or dict with compatible propertiesstream –
plotly.graph_objects.isosurface.Streaminstance or dict with compatible propertiessurface –
plotly.graph_objects.isosurface.Surfaceinstance or dict with compatible propertiestext – Sets the text elements associated with the vertices. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.value – Sets the 4th dimension (value) of the vertices.
valuesrc – Sets the source reference on Chart Studio Cloud for value .
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the X coordinates of the vertices on X axis.
xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the Y coordinates of the vertices on Y axis.
ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the Z coordinates of the vertices on Z axis.
zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_layout_image(arg=None, layer=None, name=None, opacity=None, sizex=None, sizey=None, sizing=None, source=None, templateitemname=None, visible=None, x=None, xanchor=None, xref=None, y=None, yanchor=None, yref=None, row=None, col=None, secondary_y=None, exclude_empty_subplots=None, **kwargs)¶ Create and add a new image to the figure’s layout
- Parameters
arg – instance of Image or dict with compatible properties
layer – Specifies whether images are drawn below or above traces. When
xrefandyrefare both set topaper, image is drawn below the entire plot area.name – When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with
templateitemnamematching thisnamealongside your modifications (includingvisible: falseorenabled: falseto hide it). Has no effect outside of a template.opacity – Sets the opacity of the image.
sizex – Sets the image container size horizontally. The image will be sized based on the
positionvalue. Whenxrefis set topaper, units are sized relative to the plot width. Whenxrefends with ` domain`, units are sized relative to the axis width.sizey – Sets the image container size vertically. The image will be sized based on the
positionvalue. Whenyrefis set topaper, units are sized relative to the plot height. Whenyrefends with ` domain`, units are sized relative to the axis height.sizing – Specifies which dimension of the image to constrain.
source – Specifies the URL of the image to be used. The URL must be accessible from the domain where the plot code is run, and can be either relative or absolute.
templateitemname – Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with
templateitemnamematching itsname, alongside your modifications (includingvisible: falseorenabled: falseto hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it withvisible: true.visible – Determines whether or not this image is visible.
x – Sets the image’s x position. When
xrefis set topaper, units are sized relative to the plot height. Seexreffor more infoxanchor – Sets the anchor for the x position
xref – Sets the images’s x coordinate axis. If set to a x axis id (e.g. “x” or “x2”), the
xposition refers to a x coordinate. If set to “paper”, thexposition refers to the distance from the left of the plotting area in normalized coordinates where 0 (1) corresponds to the left (right). If set to a x axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., x2 domain refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis.y – Sets the image’s y position. When
yrefis set topaper, units are sized relative to the plot height. Seeyreffor more infoyanchor – Sets the anchor for the y position.
yref – Sets the images’s y coordinate axis. If set to a y axis id (e.g. “y” or “y2”), the
yposition refers to a y coordinate. If set to “paper”, theyposition refers to the distance from the bottom of the plotting area in normalized coordinates where 0 (1) corresponds to the bottom (top). If set to a y axis ID followed by “domain” (separated by a space), the position behaves like for “paper”, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., y2 domain refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis.row – Subplot row for image. If ‘all’, addresses all rows in the specified column(s).
col – Subplot column for image. If ‘all’, addresses all columns in the specified row(s).
secondary_y – Whether to add image to secondary y-axis
exclude_empty_subplots – If True, image will not be added to subplots without traces.
- Returns
- Return type
-
add_mesh3d(alphahull=None, autocolorscale=None, cauto=None, cmax=None, cmid=None, cmin=None, color=None, coloraxis=None, colorbar=None, colorscale=None, contour=None, customdata=None, customdatasrc=None, delaunayaxis=None, facecolor=None, facecolorsrc=None, flatshading=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, i=None, ids=None, idssrc=None, intensity=None, intensitymode=None, intensitysrc=None, isrc=None, j=None, jsrc=None, k=None, ksrc=None, legendgroup=None, lighting=None, lightposition=None, meta=None, metasrc=None, name=None, opacity=None, reversescale=None, scene=None, showlegend=None, showscale=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, vertexcolor=None, vertexcolorsrc=None, visible=None, x=None, xcalendar=None, xsrc=None, y=None, ycalendar=None, ysrc=None, z=None, zcalendar=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Mesh3d trace
Draws sets of triangles with coordinates given by three 1-dimensional arrays in
x,y,zand (1) a sets ofi,j,kindices (2) Delaunay triangulation or (3) the Alpha- shape algorithm or (4) the Convex-hull algorithm- Parameters
alphahull – Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the
x,yandzarrays, if thei,j,karrays are not supplied. For general use ofmesh3dit is preferred thati,j,kare supplied. If “-1”, Delaunay triangulation is used, which is mainly suitable if the mesh is a single, more or less layer surface that is perpendicular todelaunayaxis. In case thedelaunayaxisintersects the mesh surface at more than one point it will result triangles that are very long in the dimension ofdelaunayaxis. If “>0”, the alpha-shape algorithm is used. In this case, the positivealphahullvalue signals the use of the alpha-shape algorithm, _and_ its value acts as the parameter for the mesh fitting. If 0, the convex-hull algorithm is used. It is suitable for convex bodies or if the intention is to enclose thex,yandzpoint set into a convex hull.autocolorscale – Determines whether the colorscale is a default palette (
autocolorscale: true) or the palette determined bycolorscale. In casecolorscaleis unspecified orautocolorscaleis true, the default palette will be chosen according to whether numbers in thecolorarray are all positive, all negative or mixed.cauto – Determines whether or not the color domain is computed with respect to the input data (here
intensity) or the bounds set incminandcmaxDefaults tofalsewhencminandcmaxare set by the user.cmax – Sets the upper bound of the color domain. Value should have the same units as
intensityand if set,cminmust be set as well.cmid – Sets the mid-point of the color domain by scaling
cminand/orcmaxto be equidistant to this point. Value should have the same units asintensity. Has no effect whencautoisfalse.cmin – Sets the lower bound of the color domain. Value should have the same units as
intensityand if set,cmaxmust be set as well.color – Sets the color of the whole mesh
coloraxis – Sets a reference to a shared color axis. References to these shared color axes are “coloraxis”, “coloraxis2”, “coloraxis3”, etc. Settings for these shared color axes are set in the layout, under
layout.coloraxis,layout.coloraxis2, etc. Note that multiple color scales can be linked to the same color axis.colorbar –
plotly.graph_objects.mesh3d.ColorBarinstance or dict with compatible propertiescolorscale – Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use`cmin` andcmax. Alternatively,colorscalemay be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrR d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H ot,Blackbody,Earth,Electric,Viridis,Cividis.contour –
plotly.graph_objects.mesh3d.Contourinstance or dict with compatible propertiescustomdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
delaunayaxis – Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the Delaunay triangulation. It has an effect if
i,j,kare not provided andalphahullis set to indicate Delaunay triangulation.facecolor – Sets the color of each face Overrides “color” and “vertexcolor”.
facecolorsrc – Sets the source reference on Chart Studio Cloud for facecolor .
flatshading – Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low- poly look via flat reflections.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.mesh3d.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
i – A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the “first” vertex of a triangle. For example,
{i[m], j[m], k[m]}together represent face m (triangle m) in the mesh, wherei[m] = npoints to the triplet{x[n], y[n], z[n]}in the vertex arrays. Therefore, each element inirepresents a point in space, which is the first vertex of a triangle.ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
intensity – Sets the intensity values for vertices or cells as defined by
intensitymode. It can be used for plotting fields on meshes.intensitymode – Determines the source of
intensityvalues.intensitysrc – Sets the source reference on Chart Studio Cloud for intensity .
isrc – Sets the source reference on Chart Studio Cloud for i .
j – A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the “second” vertex of a triangle. For example,
{i[m], j[m], k[m]}together represent face m (triangle m) in the mesh, wherej[m] = npoints to the triplet{x[n], y[n], z[n]}in the vertex arrays. Therefore, each element injrepresents a point in space, which is the second vertex of a triangle.jsrc – Sets the source reference on Chart Studio Cloud for j .
k – A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the “third” vertex of a triangle. For example,
{i[m], j[m], k[m]}together represent face m (triangle m) in the mesh, wherek[m] = npoints to the triplet{x[n], y[n], z[n]}in the vertex arrays. Therefore, each element inkrepresents a point in space, which is the third vertex of a triangle.ksrc – Sets the source reference on Chart Studio Cloud for k .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
lighting –
plotly.graph_objects.mesh3d.Lightinginstance or dict with compatible propertieslightposition –
plotly.graph_objects.mesh3d.Lightpositioninstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the surface. Please note that in the case of using high
opacityvalues for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change.reversescale – Reverses the color mapping if true. If true,
cminwill correspond to the last color in the array andcmaxwill correspond to the first color.scene – Sets a reference between this trace’s 3D coordinate system and a 3D scene. If “scene” (the default value), the (x,y,z) coordinates refer to
layout.scene. If “scene2”, the (x,y,z) coordinates refer tolayout.scene2, and so on.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
showscale – Determines whether or not a colorbar is displayed for this trace.
stream –
plotly.graph_objects.mesh3d.Streaminstance or dict with compatible propertiestext – Sets the text elements associated with the vertices. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.vertexcolor – Sets the color of each vertex Overrides “color”. While Red, green and blue colors are in the range of 0 and 255; in the case of having vertex color data in RGBA format, the alpha color should be normalized to be between 0 and 1.
vertexcolorsrc – Sets the source reference on Chart Studio Cloud for vertexcolor .
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the X coordinates of the vertices. The nth element of vectors
x,yandzjointly represent the X, Y and Z coordinates of the nth vertex.xcalendar – Sets the calendar system to use with
xdate data.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the Y coordinates of the vertices. The nth element of vectors
x,yandzjointly represent the X, Y and Z coordinates of the nth vertex.ycalendar – Sets the calendar system to use with
ydate data.ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the Z coordinates of the vertices. The nth element of vectors
x,yandzjointly represent the X, Y and Z coordinates of the nth vertex.zcalendar – Sets the calendar system to use with
zdate data.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_ohlc(close=None, closesrc=None, customdata=None, customdatasrc=None, decreasing=None, high=None, highsrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, increasing=None, legendgroup=None, line=None, low=None, lowsrc=None, meta=None, metasrc=None, name=None, opacity=None, open=None, opensrc=None, selectedpoints=None, showlegend=None, stream=None, text=None, textsrc=None, tickwidth=None, uid=None, uirevision=None, visible=None, x=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, yaxis=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Ohlc trace
The ohlc (short for Open-High-Low-Close) is a style of financial chart describing open, high, low and close for a given
xcoordinate (most likely time). The tip of the lines represent thelowandhighvalues and the horizontal segments represent theopenandclosevalues. Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing items are drawn in green whereas decreasing are drawn in red.- Parameters
close – Sets the close values.
closesrc – Sets the source reference on Chart Studio Cloud for close .
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
decreasing –
plotly.graph_objects.ohlc.Decreasinginstance or dict with compatible propertieshigh – Sets the high values.
highsrc – Sets the source reference on Chart Studio Cloud for high .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.ohlc.Hoverlabelinstance or dict with compatible propertieshovertext – Same as
text.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
increasing –
plotly.graph_objects.ohlc.Increasinginstance or dict with compatible propertieslegendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.ohlc.Lineinstance or dict with compatible propertieslow – Sets the low values.
lowsrc – Sets the source reference on Chart Studio Cloud for low .
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
open – Sets the open values.
opensrc – Sets the source reference on Chart Studio Cloud for open .
selectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.ohlc.Streaminstance or dict with compatible propertiestext – Sets hover text elements associated with each sample point. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to this trace’s sample points.
textsrc – Sets the source reference on Chart Studio Cloud for text .
tickwidth – Sets the width of the open/close tick marks relative to the “x” minimal interval.
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates. If absent, linear coordinate will be generated.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_parcats(arrangement=None, bundlecolors=None, counts=None, countssrc=None, dimensions=None, dimensiondefaults=None, domain=None, hoverinfo=None, hoveron=None, hovertemplate=None, labelfont=None, line=None, meta=None, metasrc=None, name=None, sortpaths=None, stream=None, tickfont=None, uid=None, uirevision=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Parcats trace
Parallel categories diagram for multidimensional categorical data.
- Parameters
arrangement – Sets the drag interaction mode for categories and dimensions. If
perpendicular, the categories can only move along a line perpendicular to the paths. Iffreeform, the categories can freely move on the plane. Iffixed, the categories and dimensions are stationary.bundlecolors – Sort paths so that like colors are bundled together within each category.
counts – The number of observations represented by each state. Defaults to 1 so that each state represents one observation
countssrc – Sets the source reference on Chart Studio Cloud for counts .
dimensions – The dimensions (variables) of the parallel categories diagram.
dimensiondefaults – When used in a template (as layout.template.data.parcats.dimensiondefaults), sets the default property values to use for elements of parcats.dimensions
domain –
plotly.graph_objects.parcats.Domaininstance or dict with compatible propertieshoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoveron – Sets the hover interaction mode for the parcats diagram. If
category, hover interaction take place per category. Ifcolor, hover interactions take place per color per category. Ifdimension, hover interactions take place across all categories per dimension.hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variablescount,probability,category,categorycount,colorcountandbandcolorcount. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.labelfont – Sets the font for the
dimensionlabels.line –
plotly.graph_objects.parcats.Lineinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
sortpaths – Sets the path sorting algorithm. If
forward, sort paths based on dimension categories from left to right. Ifbackward, sort paths based on dimensions categories from right to left.stream –
plotly.graph_objects.parcats.Streaminstance or dict with compatible propertiestickfont – Sets the font for the
categorylabels.uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_parcoords(customdata=None, customdatasrc=None, dimensions=None, dimensiondefaults=None, domain=None, ids=None, idssrc=None, labelangle=None, labelfont=None, labelside=None, line=None, meta=None, metasrc=None, name=None, rangefont=None, stream=None, tickfont=None, uid=None, uirevision=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Parcoords trace
Parallel coordinates for multidimensional exploratory data analysis. The samples are specified in
dimensions. The colors are set inline.color.- Parameters
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dimensions – The dimensions (variables) of the parallel coordinates chart. 2..60 dimensions are supported.
dimensiondefaults – When used in a template (as layout.template.data.parcoords.dimensiondefaults), sets the default property values to use for elements of parcoords.dimensions
domain –
plotly.graph_objects.parcoords.Domaininstance or dict with compatible propertiesids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
labelangle – Sets the angle of the labels with respect to the horizontal. For example, a
tickangleof -90 draws the labels vertically. Tilted labels with “labelangle” may be positioned better inside margins whenlabelpositionis set to “bottom”.labelfont – Sets the font for the
dimensionlabels.labelside – Specifies the location of the
label. “top” positions labels above, next to the title “bottom” positions labels below the graph Tilted labels with “labelangle” may be positioned better inside margins whenlabelpositionis set to “bottom”.line –
plotly.graph_objects.parcoords.Lineinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
rangefont – Sets the font for the
dimensionrange values.stream –
plotly.graph_objects.parcoords.Streaminstance or dict with compatible propertiestickfont – Sets the font for the
dimensiontick values.uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_pie(automargin=None, customdata=None, customdatasrc=None, direction=None, dlabel=None, domain=None, hole=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, insidetextfont=None, insidetextorientation=None, label0=None, labels=None, labelssrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, opacity=None, outsidetextfont=None, pull=None, pullsrc=None, rotation=None, scalegroup=None, showlegend=None, sort=None, stream=None, text=None, textfont=None, textinfo=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, title=None, titlefont=None, titleposition=None, uid=None, uirevision=None, values=None, valuessrc=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Pie trace
A data visualized by the sectors of the pie is set in
values. The sector labels are set inlabels. The sector colors are set inmarker.colors- Parameters
automargin – Determines whether outside text labels can push the margins.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
direction – Specifies the direction at which succeeding sectors follow one another.
dlabel – Sets the label step. See
label0for more info.domain –
plotly.graph_objects.pie.Domaininstance or dict with compatible propertieshole – Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.pie.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variableslabel,color,value,percentandtext. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each sector. If a single string, the same string appears for all data points. If an array of string, the items are mapped in order of this trace’s sectors. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
insidetextfont – Sets the font used for
textinfolying inside the sector.insidetextorientation – Controls the orientation of the text inside chart sectors. When set to “auto”, text may be oriented in any direction in order to be as big as possible in the middle of a sector. The “horizontal” option orients text to be parallel with the bottom of the chart, and may make text smaller in order to achieve that goal. The “radial” option orients text along the radius of the sector. The “tangential” option orients text perpendicular to the radius of the sector.
label0 – Alternate to
labels. Builds a numeric set of labels. Use withdlabelwherelabel0is the starting label anddlabelthe step.labels – Sets the sector labels. If
labelsentries are duplicated, we sum associatedvaluesor simply count occurrences ifvaluesis not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label.labelssrc – Sets the source reference on Chart Studio Cloud for labels .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.pie.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
outsidetextfont – Sets the font used for
textinfolying outside the sector.pull – Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices.
pullsrc – Sets the source reference on Chart Studio Cloud for pull .
rotation – Instead of the first slice starting at 12 o’clock, rotate to some other angle.
scalegroup – If there are multiple pie charts that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.
showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
sort – Determines whether or not the sectors are reordered from largest to smallest.
stream –
plotly.graph_objects.pie.Streaminstance or dict with compatible propertiestext – Sets text elements associated with each sector. If trace
textinfocontains a “text” flag, these elements will be seen on the chart. If tracehoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textfont – Sets the font used for
textinfo.textinfo – Determines which trace information appear on the graph.
textposition – Specifies the location of the
textinfo.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available. variableslabel,color,value,percentandtext.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
title –
plotly.graph_objects.pie.Titleinstance or dict with compatible propertiestitlefont – Deprecated: Please use pie.title.font instead. Sets the font used for
title. Note that the title’s font used to be set by the now deprecatedtitlefontattribute.titleposition – Deprecated: Please use pie.title.position instead. Specifies the location of the
title. Note that the title’s position used to be set by the now deprecatedtitlepositionattribute.uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.values – Sets the values of the sectors. If omitted, we count occurrences of each label.
valuessrc – Sets the source reference on Chart Studio Cloud for values .
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_pointcloud(customdata=None, customdatasrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, ids=None, idssrc=None, indices=None, indicessrc=None, legendgroup=None, marker=None, meta=None, metasrc=None, name=None, opacity=None, showlegend=None, stream=None, text=None, textsrc=None, uid=None, uirevision=None, visible=None, x=None, xaxis=None, xbounds=None, xboundssrc=None, xsrc=None, xy=None, xysrc=None, y=None, yaxis=None, ybounds=None, yboundssrc=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Pointcloud trace
The data visualized as a point cloud set in
xandyusing the WebGl plotting engine.- Parameters
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.pointcloud.Hoverlabelinstance or dict with compatible propertiesids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
indices – A sequential value, 0..n, supply it to avoid creating this array inside plotting. If specified, it must be a typed
Int32Arrayarray. Its length must be equal to or greater than the number of points. For the best performance and memory use, create one largeindicestyped array that is guaranteed to be at least as long as the largest number of points during use, and reuse it on eachPlotly.restyle()call.indicessrc – Sets the source reference on Chart Studio Cloud for indices .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
marker –
plotly.graph_objects.pointcloud.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.pointcloud.Streaminstance or dict with compatible propertiestext – Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textsrc – Sets the source reference on Chart Studio Cloud for text .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xbounds – Specify
xboundsin the shape of[xMin, xMax] to avoid looping through the `xytyped array. Use it in conjunction withxyandyboundsfor the performance benefits.xboundssrc – Sets the source reference on Chart Studio Cloud for xbounds .
xsrc – Sets the source reference on Chart Studio Cloud for x .
xy – Faster alternative to specifying
xandyseparately. If supplied, it must be a typedFloat32Arrayarray that represents points such thatxy[i * 2] = x[i]andxy[i * 2 + 1] = y[i]xysrc – Sets the source reference on Chart Studio Cloud for xy .
y – Sets the y coordinates.
yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ybounds – Specify
yboundsin the shape of[yMin, yMax] to avoid looping through the `xytyped array. Use it in conjunction withxyandxboundsfor the performance benefits.yboundssrc – Sets the source reference on Chart Studio Cloud for ybounds .
ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_sankey(arrangement=None, customdata=None, customdatasrc=None, domain=None, hoverinfo=None, hoverlabel=None, ids=None, idssrc=None, link=None, meta=None, metasrc=None, name=None, node=None, orientation=None, selectedpoints=None, stream=None, textfont=None, uid=None, uirevision=None, valueformat=None, valuesuffix=None, visible=None, row=None, col=None, **kwargs)¶ Add a new Sankey trace
Sankey plots for network flow data analysis. The nodes are specified in
nodesand the links between sources and targets inlinks. The colors are set innodes[i].colorandlinks[i].color, otherwise defaults are used.- Parameters
arrangement – If value is
snap(the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified vianodepad. If value isperpendicular, the nodes can only move along a line perpendicular to the flow. If value isfreeform, the nodes can freely move on the plane. If value isfixed, the nodes are stationary.customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
domain –
plotly.graph_objects.sankey.Domaininstance or dict with compatible propertieshoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired. Note that this attribute is superseded bynode.hoverinfoandnode.hoverinfofor nodes and links respectively.hoverlabel –
plotly.graph_objects.sankey.Hoverlabelinstance or dict with compatible propertiesids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
link – The links of the Sankey plot.
meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
name – Sets the trace name. The trace name appear as the legend item and on hover.
node – The nodes of the Sankey plot.
orientation – Sets the orientation of the Sankey diagram.
selectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.stream –
plotly.graph_objects.sankey.Streaminstance or dict with compatible propertiestextfont – Sets the font for node labels
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.valueformat – Sets the value formatting rule using d3 formatting mini-language which is similar to those of Python. See https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format
valuesuffix – Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value.
visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_scatter(cliponaxis=None, connectgaps=None, customdata=None, customdatasrc=None, dx=None, dy=None, error_x=None, error_y=None, fill=None, fillcolor=None, groupnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hoveron=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, line=None, marker=None, meta=None, metasrc=None, mode=None, name=None, opacity=None, orientation=None, r=None, rsrc=None, selected=None, selectedpoints=None, showlegend=None, stackgaps=None, stackgroup=None, stream=None, t=None, text=None, textfont=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, tsrc=None, uid=None, uirevision=None, unselected=None, visible=None, x=None, x0=None, xaxis=None, xcalendar=None, xperiod=None, xperiod0=None, xperiodalignment=None, xsrc=None, y=None, y0=None, yaxis=None, ycalendar=None, yperiod=None, yperiod0=None, yperiodalignment=None, ysrc=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Scatter trace
The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts. The data visualized as scatter point or lines is set in
xandy. Text (appearing either on the chart or on hover only) is viatext. Bubble charts are achieved by settingmarker.sizeand/ormarker.colorto numerical arrays.- Parameters
cliponaxis – Determines whether or not markers and text nodes are clipped about the subplot axes. To show markers and text nodes above axis lines and tick labels, make sure to set
xaxis.layerandyaxis.layerto below traces.connectgaps – Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
dx – Sets the x coordinate step. See
x0for more info.dy – Sets the y coordinate step. See
y0for more info.error_x –
plotly.graph_objects.scatter.ErrorXinstance or dict with compatible propertieserror_y –
plotly.graph_objects.scatter.ErrorYinstance or dict with compatible propertiesfill – Sets the area to fill with a solid color. Defaults to “none” unless this trace is stacked, then it gets “tonexty” (“tonextx”) if
orientationis “v” (“h”) Use withfillcolorif not “none”. “tozerox” and “tozeroy” fill to x=0 and y=0 respectively. “tonextx” and “tonexty” fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like “tozerox” and “tozeroy”. “toself” connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. “tonext” fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like “toself” if there is no trace before it. “tonext” should not be used if one trace does not enclose the other. Traces in astackgroupwill only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.fillcolor – Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
groupnorm – Only relevant when
stackgroupis used, and only the firstgroupnormfound in thestackgroupwill be used - including ifvisibleis “legendonly” but not if it isfalse. Sets the normalization for the sum of thisstackgroup. With “fraction”, the value of each trace at each location is divided by the sum of all trace values at that location. “percent” is the same but multiplied by 100 to show percentages. If there are multiple subplots, or multiple `stackgroup`s on one subplot, each will be normalized within its own set.hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.scatter.Hoverlabelinstance or dict with compatible propertieshoveron – Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is “toself” or “tonext” and there are no markers or text, then the default is “fills”, otherwise it is “points”.
hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.scatter.Lineinstance or dict with compatible propertiesmarker –
plotly.graph_objects.scatter.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
mode – Determines the drawing mode for this scatter trace. If the provided
modeincludes “text” then thetextelements appear at the coordinates. Otherwise, thetextelements appear on hover. If there are less than 20 points and the trace is not stacked then the default is “lines+markers”. Otherwise, “lines”.name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
orientation – Only relevant when
stackgroupis used, and only the firstorientationfound in thestackgroupwill be used - including ifvisibleis “legendonly” but not if it isfalse. Sets the stacking direction. With “v” (“h”), the y (x) values of subsequent traces are added. Also affects the default value offill.r – r coordinates in scatter traces are deprecated!Please switch to the “scatterpolar” trace type.Sets the radial coordinatesfor legacy polar chart only.
rsrc – Sets the source reference on Chart Studio Cloud for r .
selected –
plotly.graph_objects.scatter.Selectedinstance or dict with compatible propertiesselectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the
unselectedare turned on for all points, whereas, any other non-array values means no selection all where theselectedandunselectedstyles have no effect.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stackgaps – Only relevant when
stackgroupis used, and only the firststackgapsfound in thestackgroupwill be used - including ifvisibleis “legendonly” but not if it isfalse. Determines how we handle locations at which other traces in this group have data but this one does not. With infer zero we insert a zero at these locations. With “interpolate” we linearly interpolate between existing values, and extrapolate a constant beyond the existing values.stackgroup – Set several scatter traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if
orientationis “h”). If blank or omitted this trace will not be stacked. Stacking also turnsfillon by default, using “tonexty” (“tonextx”) iforientationis “h” (“v”) and sets the defaultmodeto “lines” irrespective of point count. You can only stack on a numeric (linear or log) axis. Traces in astackgroupwill only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.stream –
plotly.graph_objects.scatter.Streaminstance or dict with compatible propertiest – t coordinates in scatter traces are deprecated!Please switch to the “scatterpolar” trace type.Sets the angular coordinatesfor legacy polar chart only.
text – Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textfont – Sets the text font.
textposition – Sets the positions of the
textelements with respects to the (x,y) coordinates.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
tsrc – Sets the source reference on Chart Studio Cloud for t .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.unselected –
plotly.graph_objects.scatter.Unselectedinstance or dict with compatible propertiesvisible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
x0 – Alternate to
x. Builds a linear space of x coordinates. Use withdxwherex0is the starting coordinate anddxthe step.xaxis – Sets a reference between this trace’s x coordinates and a 2D cartesian x axis. If “x” (the default value), the x coordinates refer to
layout.xaxis. If “x2”, the x coordinates refer tolayout.xaxis2, and so on.xcalendar – Sets the calendar system to use with
xdate data.xperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the x axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.xperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the x0 axis. Whenx0periodis round number of weeks, thex0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.xperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the x axis.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y coordinates.
y0 – Alternate to
y. Builds a linear space of y coordinates. Use withdywherey0is the starting coordinate anddythe step.yaxis – Sets a reference between this trace’s y coordinates and a 2D cartesian y axis. If “y” (the default value), the y coordinates refer to
layout.yaxis. If “y2”, the y coordinates refer tolayout.yaxis2, and so on.ycalendar – Sets the calendar system to use with
ydate data.yperiod – Only relevant when the axis
typeis “date”. Sets the period positioning in milliseconds or “M<n>” on the y axis. Special values in the form of “M<n>” could be used to declare the number of months. In this casenmust be a positive integer.yperiod0 – Only relevant when the axis
typeis “date”. Sets the base for period positioning in milliseconds or date string on the y0 axis. Wheny0periodis round number of weeks, they0period0by default would be on a Sunday i.e. 2000-01-02, otherwise it would be at 2000-01-01.yperiodalignment – Only relevant when the axis
typeis “date”. Sets the alignment of data points on the y axis.ysrc – Sets the source reference on Chart Studio Cloud for y .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).secondary_y (boolean or None (default None)) –
If True, associate this trace with the secondary y-axis of the subplot at the specified row and col. Only valid if all of the following conditions are satisfied:
The figure was created using
plotly.subplots.make_subplots.The row and col arguments are not None
The subplot at the specified row and col has type xy (which is the default) and secondary_y True. These properties are specified in the specs argument to make_subplots. See the make_subplots docstring for more info.
- Returns
- Return type
-
add_scatter3d(connectgaps=None, customdata=None, customdatasrc=None, error_x=None, error_y=None, error_z=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, line=None, marker=None, meta=None, metasrc=None, mode=None, name=None, opacity=None, projection=None, scene=None, showlegend=None, stream=None, surfaceaxis=None, surfacecolor=None, text=None, textfont=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, uid=None, uirevision=None, visible=None, x=None, xcalendar=None, xsrc=None, y=None, ycalendar=None, ysrc=None, z=None, zcalendar=None, zsrc=None, row=None, col=None, **kwargs)¶ Add a new Scatter3d trace
The data visualized as scatter point or lines in 3D dimension is set in
x,y,z. Text (appearing either on the chart or on hover only) is viatext. Bubble charts are achieved by settingmarker.sizeand/ormarker.colorProjections are achieved viaprojection. Surface fills are achieved viasurfaceaxis.- Parameters
connectgaps – Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
error_x –
plotly.graph_objects.scatter3d.ErrorXinstance or dict with compatible propertieserror_y –
plotly.graph_objects.scatter3d.ErrorYinstance or dict with compatible propertieserror_z –
plotly.graph_objects.scatter3d.ErrorZinstance or dict with compatible propertieshoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.scatter3d.Hoverlabelinstance or dict with compatible propertieshovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y,z) coordinates. To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.scatter3d.Lineinstance or dict with compatible propertiesmarker –
plotly.graph_objects.scatter3d.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
mode – Determines the drawing mode for this scatter trace. If the provided
modeincludes “text” then thetextelements appear at the coordinates. Otherwise, thetextelements appear on hover. If there are less than 20 points and the trace is not stacked then the default is “lines+markers”. Otherwise, “lines”.name – Sets the trace name. The trace name appear as the legend item and on hover.
opacity – Sets the opacity of the trace.
projection –
plotly.graph_objects.scatter3d.Projectioninstance or dict with compatible propertiesscene – Sets a reference between this trace’s 3D coordinate system and a 3D scene. If “scene” (the default value), the (x,y,z) coordinates refer to
layout.scene. If “scene2”, the (x,y,z) coordinates refer tolayout.scene2, and so on.showlegend – Determines whether or not an item corresponding to this trace is shown in the legend.
stream –
plotly.graph_objects.scatter3d.Streaminstance or dict with compatible propertiessurfaceaxis – If “-1”, the scatter points are not fill with a surface If 0, 1, 2, the scatter points are filled with a Delaunay surface about the x, y, z respectively.
surfacecolor – Sets the surface fill color.
text – Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace’s (x,y,z) coordinates. If trace
hoverinfocontains a “text” flag and “hovertext” is not set, these elements will be seen in the hover labels.textfont –
plotly.graph_objects.scatter3d.Textfontinstance or dict with compatible propertiestextposition – Sets the positions of the
textelements with respects to the (x,y) coordinates.textpositionsrc – Sets the source reference on Chart Studio Cloud for textposition .
textsrc – Sets the source reference on Chart Studio Cloud for text .
texttemplate – Template string used for rendering the information text that appear on points. Note that this will override
textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true) are available.texttemplatesrc – Sets the source reference on Chart Studio Cloud for texttemplate .
uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
uirevision – Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title. Defaults tolayout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
x – Sets the x coordinates.
xcalendar – Sets the calendar system to use with
xdate data.xsrc – Sets the source reference on Chart Studio Cloud for x .
y – Sets the y coordinates.
ycalendar – Sets the calendar system to use with
ydate data.ysrc – Sets the source reference on Chart Studio Cloud for y .
z – Sets the z coordinates.
zcalendar – Sets the calendar system to use with
zdate data.zsrc – Sets the source reference on Chart Studio Cloud for z .
row ('all', int or None (default)) – Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all rows in the specified column(s).col ('all', int or None (default)) – Subplot col index (starting from 1) for the trace to be added. Only valid if figure was created using
plotly.tools.make_subplots.If ‘all’, addresses all columns in the specified row(s).
- Returns
- Return type
-
add_scattercarpet(a=None, asrc=None, b=None, bsrc=None, carpet=None, connectgaps=None, customdata=None, customdatasrc=None, fill=None, fillcolor=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hoveron=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, line=None, marker=None, meta=None, metasrc=None, mode=None, name=None, opacity=None, selected=None, selectedpoints=None, showlegend=None, stream=None, text=None, textfont=None, textposition=None, textpositionsrc=None, textsrc=None, texttemplate=None, texttemplatesrc=None, uid=None, uirevision=None, unselected=None, visible=None, xaxis=None, yaxis=None, row=None, col=None, secondary_y=None, **kwargs)¶ Add a new Scattercarpet trace
Plots a scatter trace on either the first carpet axis or the carpet axis with a matching
carpetattribute.- Parameters
a – Sets the a-axis coordinates.
asrc – Sets the source reference on Chart Studio Cloud for a .
b – Sets the b-axis coordinates.
bsrc – Sets the source reference on Chart Studio Cloud for b .
carpet – An identifier for this carpet, so that
scattercarpetandcontourcarpettraces can specify a carpet plot on which they lieconnectgaps – Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.
customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
customdatasrc – Sets the source reference on Chart Studio Cloud for customdata .
fill – Sets the area to fill with a solid color. Use with
fillcolorif not “none”. scatterternary has a subset of the options available to scatter. “toself” connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. “tonext” fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like “toself” if there is no trace before it. “tonext” should not be used if one trace does not enclose the other.fillcolor – Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
hoverinfo – Determines which trace information appear on hover. If
noneorskipare set, no information is displayed upon hovering. But, ifnoneis set, click and hover events are still fired.hoverinfosrc – Sets the source reference on Chart Studio Cloud for hoverinfo .
hoverlabel –
plotly.graph_objects.scattercarpet.Hoverlabelinstance or dict with compatible propertieshoveron – Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is “toself” or “tonext” and there are no markers or text, then the default is “fills”, otherwise it is “points”.
hovertemplate – Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time- format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time-format#locale_format for details on the date formatting syntax. The variables available inhovertemplateare the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true) are available. Anything contained in tag<extra>is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag<extra></extra>.hovertemplatesrc – Sets the source reference on Chart Studio Cloud for hovertemplate .
hovertext – Sets hover text elements associated with each (a,b) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the the data points in (a,b). To be seen, trace
hoverinfomust contain a “text” flag.hovertextsrc – Sets the source reference on Chart Studio Cloud for hovertext .
ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
idssrc – Sets the source reference on Chart Studio Cloud for ids .
legendgroup – Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
line –
plotly.graph_objects.scattercarpet.Lineinstance or dict with compatible propertiesmarker –
plotly.graph_objects.scattercarpet.Markerinstance or dict with compatible propertiesmeta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index.metasrc – Sets the source reference on Chart Studio Cloud for meta .
mode – Determines the drawing mode for this scatter trace. If the provided
modeincludes “text” then the <code class="docu
-
