{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"#### New to Plotly?\n",
"Plotly's Python library is free and open source! [Get started](https://plotly.com/python/getting-started/) by downloading the client and [reading the primer](https://plotly.com/python/getting-started/).\n",
"
You can set up Plotly to work in [online](https://plotly.com/python/getting-started/#initialization-for-online-plotting) or [offline](https://plotly.com/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plotly.com/python/getting-started/#start-plotting-online).\n",
"
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Version Check\n",
"Plotly's python package is updated frequently. Run `pip install plotly --upgrade` to use the latest version."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'3.6.0'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import plotly\n",
"plotly.__version__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### NYC Flights Database"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import datetime\n",
"import numpy as np\n",
"import pandas as pd\n",
"import plotly.graph_objs as go\n",
"import plotly.plotly as py\n",
"\n",
"from ipywidgets import widgets"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We'll be making an application to take a look at delays from all flights out of NYC in the year 2013."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(\n",
" 'https://raw.githubusercontent.com/yankev/testing/master/datasets/nycflights.csv')\n",
"df = df.drop(df.columns[[0]], axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
| \n", " | year | \n", "month | \n", "day | \n", "dep_time | \n", "dep_delay | \n", "arr_time | \n", "arr_delay | \n", "carrier | \n", "tailnum | \n", "flight | \n", "origin | \n", "dest | \n", "air_time | \n", "distance | \n", "hour | \n", "minute | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 294791 | \n", "2013 | \n", "8 | \n", "16 | \n", "1306.0 | \n", "-4.0 | \n", "1555.0 | \n", "19.0 | \n", "FL | \n", "N607AT | \n", "348 | \n", "LGA | \n", "ATL | \n", "124.0 | \n", "762 | \n", "13.0 | \n", "6.0 | \n", "
| 314484 | \n", "2013 | \n", "9 | \n", "6 | \n", "1801.0 | \n", "12.0 | \n", "2024.0 | \n", "-28.0 | \n", "UA | \n", "N555UA | \n", "731 | \n", "JFK | \n", "LAX | \n", "299.0 | \n", "2475 | \n", "18.0 | \n", "1.0 | \n", "
| 250440 | \n", "2013 | \n", "6 | \n", "30 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "EV | \n", "N716EV | \n", "5599 | \n", "LGA | \n", "CHS | \n", "NaN | \n", "641 | \n", "NaN | \n", "NaN | \n", "
\n"
],
"text/plain": [
"
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Reference"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on class FigureWidget in module plotly.graph_objs._figurewidget:\n",
"\n",
"class FigureWidget(plotly.basewidget.BaseFigureWidget)\n",
" | FigureWidget(*args, **kwargs)\n",
" | \n",
" | Base class for FigureWidget. The FigureWidget class is code-generated as a\n",
" | subclass\n",
" | \n",
" | Method resolution order:\n",
" | FigureWidget\n",
" | plotly.basewidget.BaseFigureWidget\n",
" | plotly.basedatatypes.BaseFigure\n",
" | ipywidgets.widgets.domwidget.DOMWidget\n",
" | ipywidgets.widgets.widget.Widget\n",
" | ipywidgets.widgets.widget.LoggingHasTraits\n",
" | traitlets.traitlets.HasTraits\n",
" | traitlets.traitlets.HasDescriptors\n",
" | builtins.object\n",
" | \n",
" | Methods defined here:\n",
" | \n",
" | __init__(self, data=None, layout=None, frames=None, skip_invalid=False)\n",
" | Create a new FigureWidget instance\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | data\n",
" | The 'data' property is a tuple of trace instances\n",
" | that may be specified as:\n",
" | - A list or tuple of trace instances\n",
" | (e.g. [Scatter(...), Bar(...)])\n",
" | - A list or tuple of dicts of string/value properties where:\n",
" | - The 'type' property specifies the trace type\n",
" | One of: ['area', 'bar', 'barpolar', 'box',\n",
" | 'candlestick', 'carpet', 'choropleth', 'cone',\n",
" | 'contour', 'contourcarpet', 'heatmap',\n",
" | 'heatmapgl', 'histogram', 'histogram2d',\n",
" | 'histogram2dcontour', 'isosurface', 'mesh3d',\n",
" | 'ohlc', 'parcats', 'parcoords', 'pie',\n",
" | 'pointcloud', 'sankey', 'scatter',\n",
" | 'scatter3d', 'scattercarpet', 'scattergeo',\n",
" | 'scattergl', 'scattermapbox', 'scatterpolar',\n",
" | 'scatterpolargl', 'scatterternary', 'splom',\n",
" | 'streamtube', 'surface', 'table', 'violin']\n",
" | \n",
" | - All remaining properties are passed to the constructor of\n",
" | the specified trace type\n",
" | \n",
" | (e.g. [{'type': 'scatter', ...}, {'type': 'bar, ...}])\n",
" | \n",
" | layout\n",
" | The 'layout' property is an instance of Layout\n",
" | that may be specified as:\n",
" | - An instance of plotly.graph_objs.Layout\n",
" | - A dict of string/value properties that will be passed\n",
" | to the Layout constructor\n",
" | \n",
" | Supported dict properties:\n",
" | \n",
" | angularaxis\n",
" | plotly.graph_objs.layout.AngularAxis instance\n",
" | or dict with compatible properties\n",
" | annotations\n",
" | plotly.graph_objs.layout.Annotation instance or\n",
" | dict with compatible properties\n",
" | annotationdefaults\n",
" | When used in a template (as\n",
" | layout.template.layout.annotationdefaults),\n",
" | sets the default property values to use for\n",
" | elements of layout.annotations\n",
" | autosize\n",
" | Determines whether or not a layout width or\n",
" | height that has been left undefined by the user\n",
" | is initialized on each relayout. Note that,\n",
" | regardless of this attribute, an undefined\n",
" | layout width or height is always initialized on\n",
" | the first call to plot.\n",
" | bargap\n",
" | Sets the gap (in plot fraction) between bars of\n",
" | adjacent location coordinates.\n",
" | bargroupgap\n",
" | Sets the gap (in plot fraction) between bars of\n",
" | the same location coordinate.\n",
" | barmode\n",
" | Determines how bars at the same location\n",
" | coordinate are displayed on the graph. With\n",
" | \"stack\", the bars are stacked on top of one\n",
" | another With \"relative\", the bars are stacked\n",
" | on top of one another, with negative values\n",
" | below the axis, positive values above With\n",
" | \"group\", the bars are plotted next to one\n",
" | another centered around the shared location.\n",
" | With \"overlay\", the bars are plotted over one\n",
" | another, you might need to an \"opacity\" to see\n",
" | multiple bars.\n",
" | barnorm\n",
" | Sets the normalization for bar traces on the\n",
" | graph. With \"fraction\", the value of each bar\n",
" | is divided by the sum of all values at that\n",
" | location coordinate. \"percent\" is the same but\n",
" | multiplied by 100 to show percentages.\n",
" | boxgap\n",
" | Sets the gap (in plot fraction) between boxes\n",
" | of adjacent location coordinates. Has no effect\n",
" | on traces that have \"width\" set.\n",
" | boxgroupgap\n",
" | Sets the gap (in plot fraction) between boxes\n",
" | of the same location coordinate. Has no effect\n",
" | on traces that have \"width\" set.\n",
" | boxmode\n",
" | Determines how boxes at the same location\n",
" | coordinate are displayed on the graph. If\n",
" | \"group\", the boxes are plotted next to one\n",
" | another centered around the shared location. If\n",
" | \"overlay\", the boxes are plotted over one\n",
" | another, you might need to set \"opacity\" to see\n",
" | them multiple boxes. Has no effect on traces\n",
" | that have \"width\" set.\n",
" | calendar\n",
" | Sets the default calendar system to use for\n",
" | interpreting and displaying dates throughout\n",
" | the plot.\n",
" | clickmode\n",
" | Determines the mode of single click\n",
" | interactions. \"event\" is the default value and\n",
" | emits the `plotly_click` event. In addition\n",
" | this mode emits the `plotly_selected` event in\n",
" | drag modes \"lasso\" and \"select\", but with no\n",
" | event data attached (kept for compatibility\n",
" | reasons). The \"select\" flag enables selecting\n",
" | single data points via click. This mode also\n",
" | supports persistent selections, meaning that\n",
" | pressing Shift while clicking, adds to /\n",
" | subtracts from an existing selection. \"select\"\n",
" | with `hovermode`: \"x\" can be confusing,\n",
" | consider explicitly setting `hovermode`:\n",
" | \"closest\" when using this feature. Selection\n",
" | events are sent accordingly as long as \"event\"\n",
" | flag is set as well. When the \"event\" flag is\n",
" | missing, `plotly_click` and `plotly_selected`\n",
" | events are not fired.\n",
" | colorscale\n",
" | plotly.graph_objs.layout.Colorscale instance or\n",
" | dict with compatible properties\n",
" | colorway\n",
" | Sets the default trace colors.\n",
" | datarevision\n",
" | If provided, a changed value tells\n",
" | `Plotly.react` that one or more data arrays has\n",
" | changed. This way you can modify arrays in-\n",
" | place rather than making a complete new copy\n",
" | for an incremental change. If NOT provided,\n",
" | `Plotly.react` assumes that data arrays are\n",
" | being treated as immutable, thus any data array\n",
" | with a different identity from its predecessor\n",
" | contains new data.\n",
" | direction\n",
" | Legacy polar charts are deprecated! Please\n",
" | switch to \"polar\" subplots. Sets the direction\n",
" | corresponding to positive angles in legacy\n",
" | polar charts.\n",
" | dragmode\n",
" | Determines the mode of drag interactions.\n",
" | \"select\" and \"lasso\" apply only to scatter\n",
" | traces with markers or text. \"orbit\" and\n",
" | \"turntable\" apply only to 3D scenes.\n",
" | editrevision\n",
" | Controls persistence of user-driven changes in\n",
" | `editable: true` configuration, other than\n",
" | trace names and axis titles. Defaults to\n",
" | `layout.uirevision`.\n",
" | extendpiecolors\n",
" | If `true`, the pie slice colors (whether given\n",
" | by `piecolorway` or inherited from `colorway`)\n",
" | will be extended to three times its original\n",
" | length by first repeating every color 20%\n",
" | lighter then each color 20% darker. This is\n",
" | intended to reduce the likelihood of reusing\n",
" | the same color when you have many slices, but\n",
" | you can set `false` to disable. Colors provided\n",
" | in the trace, using `marker.colors`, are never\n",
" | extended.\n",
" | font\n",
" | Sets the global font. Note that fonts used in\n",
" | traces and other layout components inherit from\n",
" | the global font.\n",
" | geo\n",
" | plotly.graph_objs.layout.Geo instance or dict\n",
" | with compatible properties\n",
" | grid\n",
" | plotly.graph_objs.layout.Grid instance or dict\n",
" | with compatible properties\n",
" | height\n",
" | Sets the plot's height (in px).\n",
" | hiddenlabels\n",
" | \n",
" | hiddenlabelssrc\n",
" | Sets the source reference on plot.ly for\n",
" | hiddenlabels .\n",
" | hidesources\n",
" | Determines whether or not a text link citing\n",
" | the data source is placed at the bottom-right\n",
" | cored of the figure. Has only an effect only on\n",
" | graphs that have been generated via forked\n",
" | graphs from the plotly service (at\n",
" | https://plotly.com or on-premise).\n",
" | hoverdistance\n",
" | Sets the default distance (in pixels) to look\n",
" | for data to add hover labels (-1 means no\n",
" | cutoff, 0 means no looking for data). This is\n",
" | only a real distance for hovering on point-like\n",
" | objects, like scatter points. For area-like\n",
" | objects (bars, scatter fills, etc) hovering is\n",
" | on inside the area and off outside, but these\n",
" | objects will not supersede hover on point-like\n",
" | objects in case of conflict.\n",
" | hoverlabel\n",
" | plotly.graph_objs.layout.Hoverlabel instance or\n",
" | dict with compatible properties\n",
" | hovermode\n",
" | Determines the mode of hover interactions. If\n",
" | `clickmode` includes the \"select\" flag,\n",
" | `hovermode` defaults to \"closest\". If\n",
" | `clickmode` lacks the \"select\" flag, it\n",
" | defaults to \"x\" or \"y\" (depending on the\n",
" | trace's `orientation` value) for plots based on\n",
" | cartesian coordinates. For anything else the\n",
" | default value is \"closest\".\n",
" | images\n",
" | plotly.graph_objs.layout.Image instance or dict\n",
" | with compatible properties\n",
" | imagedefaults\n",
" | When used in a template (as\n",
" | layout.template.layout.imagedefaults), sets the\n",
" | default property values to use for elements of\n",
" | layout.images\n",
" | legend\n",
" | plotly.graph_objs.layout.Legend instance or\n",
" | dict with compatible properties\n",
" | mapbox\n",
" | plotly.graph_objs.layout.Mapbox instance or\n",
" | dict with compatible properties\n",
" | margin\n",
" | plotly.graph_objs.layout.Margin instance or\n",
" | dict with compatible properties\n",
" | meta\n",
" | Assigns extra meta information that can be used\n",
" | in various `text` attributes. Attributes such\n",
" | as the graph, axis and colorbar `title.text`\n",
" | and annotation `text` support `meta`. One can\n",
" | access `meta` fields using template strings:\n",
" | `%{meta[i]}` where `i` is the index of the\n",
" | `meta` item in question.\n",
" | metasrc\n",
" | Sets the source reference on plot.ly for meta\n",
" | .\n",
" | modebar\n",
" | plotly.graph_objs.layout.Modebar instance or\n",
" | dict with compatible properties\n",
" | orientation\n",
" | Legacy polar charts are deprecated! Please\n",
" | switch to \"polar\" subplots. Rotates the entire\n",
" | polar by the given angle in legacy polar\n",
" | charts.\n",
" | paper_bgcolor\n",
" | Sets the color of paper where the graph is\n",
" | drawn.\n",
" | piecolorway\n",
" | Sets the default pie slice colors. Defaults to\n",
" | the main `colorway` used for trace colors. If\n",
" | you specify a new list here it can still be\n",
" | extended with lighter and darker colors, see\n",
" | `extendpiecolors`.\n",
" | plot_bgcolor\n",
" | Sets the color of plotting area in-between x\n",
" | and y axes.\n",
" | polar\n",
" | plotly.graph_objs.layout.Polar instance or dict\n",
" | with compatible properties\n",
" | radialaxis\n",
" | plotly.graph_objs.layout.RadialAxis instance or\n",
" | dict with compatible properties\n",
" | scene\n",
" | plotly.graph_objs.layout.Scene instance or dict\n",
" | with compatible properties\n",
" | selectdirection\n",
" | When \"dragmode\" is set to \"select\", this limits\n",
" | the selection of the drag to horizontal,\n",
" | vertical or diagonal. \"h\" only allows\n",
" | horizontal selection, \"v\" only vertical, \"d\"\n",
" | only diagonal and \"any\" sets no limit.\n",
" | selectionrevision\n",
" | Controls persistence of user-driven changes in\n",
" | selected points from all traces.\n",
" | separators\n",
" | Sets the decimal and thousand separators. For\n",
" | example, *. * puts a '.' before decimals and a\n",
" | space between thousands. In English locales,\n",
" | dflt is \".,\" but other locales may alter this\n",
" | default.\n",
" | shapes\n",
" | plotly.graph_objs.layout.Shape instance or dict\n",
" | with compatible properties\n",
" | shapedefaults\n",
" | When used in a template (as\n",
" | layout.template.layout.shapedefaults), sets the\n",
" | default property values to use for elements of\n",
" | layout.shapes\n",
" | showlegend\n",
" | Determines whether or not a legend is drawn.\n",
" | Default is `true` if there is a trace to show\n",
" | and any of these: a) Two or more traces would\n",
" | by default be shown in the legend. b) One pie\n",
" | trace is shown in the legend. c) One trace is\n",
" | explicitly given with `showlegend: true`.\n",
" | sliders\n",
" | plotly.graph_objs.layout.Slider instance or\n",
" | dict with compatible properties\n",
" | sliderdefaults\n",
" | When used in a template (as\n",
" | layout.template.layout.sliderdefaults), sets\n",
" | the default property values to use for elements\n",
" | of layout.sliders\n",
" | spikedistance\n",
" | Sets the default distance (in pixels) to look\n",
" | for data to draw spikelines to (-1 means no\n",
" | cutoff, 0 means no looking for data). As with\n",
" | hoverdistance, distance does not apply to area-\n",
" | like objects. In addition, some objects can be\n",
" | hovered on but will not generate spikelines,\n",
" | such as scatter fills.\n",
" | template\n",
" | Default attributes to be applied to the plot.\n",
" | This should be a dict with format: `{'layout':\n",
" | layoutTemplate, 'data': {trace_type:\n",
" | [traceTemplate, ...], ...}}` where\n",
" | `layoutTemplate` is a dict matching the\n",
" | structure of `figure.layout` and\n",
" | `traceTemplate` is a dict matching the\n",
" | structure of the trace with type `trace_type`\n",
" | (e.g. 'scatter'). Alternatively, this may be\n",
" | specified as an instance of\n",
" | plotly.graph_objs.layout.Template. Trace\n",
" | templates are applied cyclically to traces of\n",
" | each type. Container arrays (eg `annotations`)\n",
" | have special handling: An object ending in\n",
" | `defaults` (eg `annotationdefaults`) is applied\n",
" | to each array item. But if an item has a\n",
" | `templateitemname` key we look in the template\n",
" | array for an item with matching `name` and\n",
" | apply that instead. If no matching `name` is\n",
" | found we mark the item invisible. Any named\n",
" | template item not referenced is appended to the\n",
" | end of the array, so this can be used to add a\n",
" | watermark annotation or a logo image, for\n",
" | example. To omit one of these items on the\n",
" | plot, make an item with matching\n",
" | `templateitemname` and `visible: false`.\n",
" | ternary\n",
" | plotly.graph_objs.layout.Ternary instance or\n",
" | dict with compatible properties\n",
" | title\n",
" | plotly.graph_objs.layout.Title instance or dict\n",
" | with compatible properties\n",
" | titlefont\n",
" | Deprecated: Please use layout.title.font\n",
" | instead. Sets the title font. Note that the\n",
" | title's font used to be customized by the now\n",
" | deprecated `titlefont` attribute.\n",
" | transition\n",
" | Sets transition options used during\n",
" | Plotly.react updates.\n",
" | uirevision\n",
" | Used to allow user interactions with the plot\n",
" | to persist after `Plotly.react` calls that are\n",
" | unaware of these interactions. If `uirevision`\n",
" | is omitted, or if it is given and it changed\n",
" | from the previous `Plotly.react` call, the\n",
" | exact new figure is used. If `uirevision` is\n",
" | truthy and did NOT change, any attribute that\n",
" | has been affected by user interactions and did\n",
" | not receive a different value in the new figure\n",
" | will keep the interaction value.\n",
" | `layout.uirevision` attribute serves as the\n",
" | default for `uirevision` attributes in various\n",
" | sub-containers. For finer control you can set\n",
" | these sub-attributes directly. For example, if\n",
" | your app separately controls the data on the x\n",
" | and y axes you might set\n",
" | `xaxis.uirevision=*time*` and\n",
" | `yaxis.uirevision=*cost*`. Then if only the y\n",
" | data is changed, you can update\n",
" | `yaxis.uirevision=*quantity*` and the y axis\n",
" | range will reset but the x axis range will\n",
" | retain any user-driven zoom.\n",
" | updatemenus\n",
" | plotly.graph_objs.layout.Updatemenu instance or\n",
" | dict with compatible properties\n",
" | updatemenudefaults\n",
" | When used in a template (as\n",
" | layout.template.layout.updatemenudefaults),\n",
" | sets the default property values to use for\n",
" | elements of layout.updatemenus\n",
" | violingap\n",
" | Sets the gap (in plot fraction) between violins\n",
" | of adjacent location coordinates. Has no effect\n",
" | on traces that have \"width\" set.\n",
" | violingroupgap\n",
" | Sets the gap (in plot fraction) between violins\n",
" | of the same location coordinate. Has no effect\n",
" | on traces that have \"width\" set.\n",
" | violinmode\n",
" | Determines how violins at the same location\n",
" | coordinate are displayed on the graph. If\n",
" | \"group\", the violins are plotted next to one\n",
" | another centered around the shared location. If\n",
" | \"overlay\", the violins are plotted over one\n",
" | another, you might need to set \"opacity\" to see\n",
" | them multiple violins. Has no effect on traces\n",
" | that have \"width\" set.\n",
" | width\n",
" | Sets the plot's width (in px).\n",
" | xaxis\n",
" | plotly.graph_objs.layout.XAxis instance or dict\n",
" | with compatible properties\n",
" | yaxis\n",
" | plotly.graph_objs.layout.YAxis instance or dict\n",
" | with compatible properties\n",
" | \n",
" | frames\n",
" | The 'frames' property is a tuple of instances of\n",
" | Frame that may be specified as:\n",
" | - A list or tuple of instances of plotly.graph_objs.Frame\n",
" | - A list or tuple of dicts of string/value properties that\n",
" | will be passed to the Frame constructor\n",
" | \n",
" | Supported dict properties:\n",
" | \n",
" | baseframe\n",
" | The name of the frame into which this frame's\n",
" | properties are merged before applying. This is\n",
" | used to unify properties and avoid needing to\n",
" | specify the same values for the same properties\n",
" | in multiple frames.\n",
" | data\n",
" | A list of traces this frame modifies. The\n",
" | format is identical to the normal trace\n",
" | definition.\n",
" | group\n",
" | An identifier that specifies the group to which\n",
" | the frame belongs, used by animate to select a\n",
" | subset of frames.\n",
" | layout\n",
" | Layout properties which this frame modifies.\n",
" | The format is identical to the normal layout\n",
" | definition.\n",
" | name\n",
" | A label by which to identify the frame\n",
" | traces\n",
" | A list of trace indices that identify the\n",
" | respective traces in the data attribute\n",
" | \n",
" | skip_invalid: bool\n",
" | If True, invalid properties in the figure specification will be\n",
" | skipped silently. If False (default) invalid properties in the\n",
" | figure specification will result in a ValueError\n",
" | \n",
" | Raises\n",
" | ------\n",
" | ValueError\n",
" | if a property in the specification of data, layout, or frames\n",
" | is invalid AND skip_invalid is False\n",
" | \n",
" | add_area(self, customdata=None, customdatasrc=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, ids=None, idssrc=None, legendgroup=None, marker=None, name=None, opacity=None, r=None, rsrc=None, selectedpoints=None, showlegend=None, stream=None, t=None, tsrc=None, uid=None, uirevision=None, visible=None, row=None, col=None, **kwargs)\n",
" | Add a new Area trace\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | customdata\n",
" | Assigns extra data each datum. This may be useful when\n",
" | listening to hover, click and selection events. Note\n",
" | that, \"scatter\" traces also appends customdata items in\n",
" | the markers DOM elements\n",
" | customdatasrc\n",
" | Sets the source reference on plot.ly for customdata .\n",
" | hoverinfo\n",
" | Determines which trace information appear on hover. If\n",
" | `none` or `skip` are set, no information is displayed\n",
" | upon hovering. But, if `none` is set, click and hover\n",
" | events are still fired.\n",
" | hoverinfosrc\n",
" | Sets the source reference on plot.ly for hoverinfo .\n",
" | hoverlabel\n",
" | plotly.graph_objs.area.Hoverlabel instance or dict with\n",
" | compatible properties\n",
" | ids\n",
" | Assigns id labels to each datum. These ids for object\n",
" | constancy of data points during animation. Should be an\n",
" | array of strings, not numbers or any other type.\n",
" | idssrc\n",
" | Sets the source reference on plot.ly for ids .\n",
" | legendgroup\n",
" | Sets the legend group for this trace. Traces part of\n",
" | the same legend group hide/show at the same time when\n",
" | toggling legend items.\n",
" | marker\n",
" | plotly.graph_objs.area.Marker instance or dict with\n",
" | compatible properties\n",
" | name\n",
" | Sets the trace name. The trace name appear as the\n",
" | legend item and on hover.\n",
" | opacity\n",
" | Sets the opacity of the trace.\n",
" | r\n",
" | Area traces are deprecated! Please switch to the\n",
" | \"barpolar\" trace type. Sets the radial coordinates for\n",
" | legacy polar chart only.\n",
" | rsrc\n",
" | Sets the source reference on plot.ly for r .\n",
" | selectedpoints\n",
" | Array containing integer indices of selected points.\n",
" | Has an effect only for traces that support selections.\n",
" | Note that an empty array means an empty selection where\n",
" | the `unselected` are turned on for all points, whereas,\n",
" | any other non-array values means no selection all where\n",
" | the `selected` and `unselected` styles have no effect.\n",
" | showlegend\n",
" | Determines whether or not an item corresponding to this\n",
" | trace is shown in the legend.\n",
" | stream\n",
" | plotly.graph_objs.area.Stream instance or dict with\n",
" | compatible properties\n",
" | t\n",
" | Area traces are deprecated! Please switch to the\n",
" | \"barpolar\" trace type. Sets the angular coordinates for\n",
" | legacy polar chart only.\n",
" | tsrc\n",
" | Sets the source reference on plot.ly for t .\n",
" | uid\n",
" | Assign an id to this trace, Use this to provide object\n",
" | constancy between traces during animations and\n",
" | transitions.\n",
" | uirevision\n",
" | Controls persistence of some user-driven changes to the\n",
" | trace: `constraintrange` in `parcoords` traces, as well\n",
" | as some `editable: true` modifications such as `name`\n",
" | and `colorbar.title`. Defaults to `layout.uirevision`.\n",
" | Note that other user-driven trace attribute changes are\n",
" | controlled by `layout` attributes: `trace.visible` is\n",
" | controlled by `layout.legend.uirevision`,\n",
" | `selectedpoints` is controlled by\n",
" | `layout.selectionrevision`, and `colorbar.(x|y)`\n",
" | (accessible with `config: {editable: true}`) is\n",
" | controlled by `layout.editrevision`. Trace changes are\n",
" | tracked by `uid`, which only falls back on trace index\n",
" | if no `uid` is provided. So if your app can add/remove\n",
" | traces before the end of the `data` array, such that\n",
" | the same trace has a different index, you can still\n",
" | preserve user-driven changes if you give each trace a\n",
" | `uid` that stays with it as it moves.\n",
" | visible\n",
" | Determines whether or not this trace is visible. If\n",
" | \"legendonly\", the trace is not drawn, but can appear as\n",
" | a legend item (provided that the legend itself is\n",
" | visible).\n",
" | row : int or None (default)\n",
" | Subplot row index (starting from 1) for the trace to be\n",
" | added. Only valid if figure was created using\n",
" | `plotly.tools.make_subplots`\n",
" | col : int or None (default)\n",
" | Subplot col index (starting from 1) for the trace to be\n",
" | added. Only valid if figure was created using\n",
" | `plotly.tools.make_subplots`\n",
" | \n",
" | Returns\n",
" | -------\n",
" | Area\n",
" | \n",
" | add_bar(self, 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, insidetextfont=None, legendgroup=None, marker=None, name=None, offset=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, textfont=None, textposition=None, textpositionsrc=None, textsrc=None, tsrc=None, uid=None, uirevision=None, unselected=None, visible=None, width=None, widthsrc=None, x=None, x0=None, xaxis=None, xcalendar=None, xsrc=None, y=None, y0=None, yaxis=None, ycalendar=None, ysrc=None, row=None, col=None, **kwargs)\n",
" | Add a new Bar trace\n",
" | \n",
" | The data visualized by the span of the bars is set in `y` if\n",
" | `orientation` is set th \"v\" (the default) and the labels are\n",
" | set in `x`. By setting `orientation` to \"h\", the roles are\n",
" | interchanged.\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | base\n",
" | Sets where the bar base is drawn (in position axis\n",
" | units). In \"stack\" or \"relative\" barmode, traces that\n",
" | set \"base\" will be excluded and drawn in \"overlay\" mode\n",
" | instead.\n",
" | basesrc\n",
" | Sets the source reference on plot.ly for base .\n",
" | cliponaxis\n",
" | Determines whether the text nodes are clipped about the\n",
" | subplot axes. To show the text nodes above axis lines\n",
" | and tick labels, make sure to set `xaxis.layer` and\n",
" | `yaxis.layer` to *below traces*.\n",
" | constraintext\n",
" | Constrain the size of text inside or outside a bar to\n",
" | be no larger than the bar itself.\n",
" | customdata\n",
" | Assigns extra data each datum. This may be useful when\n",
" | listening to hover, click and selection events. Note\n",
" | that, \"scatter\" traces also appends customdata items in\n",
" | the markers DOM elements\n",
" | customdatasrc\n",
" | Sets the source reference on plot.ly for customdata .\n",
" | dx\n",
" | Sets the x coordinate step. See `x0` for more info.\n",
" | dy\n",
" | Sets the y coordinate step. See `y0` for more info.\n",
" | error_x\n",
" | plotly.graph_objs.bar.ErrorX instance or dict with\n",
" | compatible properties\n",
" | error_y\n",
" | plotly.graph_objs.bar.ErrorY instance or dict with\n",
" | compatible properties\n",
" | hoverinfo\n",
" | Determines which trace information appear on hover. If\n",
" | `none` or `skip` are set, no information is displayed\n",
" | upon hovering. But, if `none` is set, click and hover\n",
" | events are still fired.\n",
" | hoverinfosrc\n",
" | Sets the source reference on plot.ly for hoverinfo .\n",
" | hoverlabel\n",
" | plotly.graph_objs.bar.Hoverlabel instance or dict with\n",
" | compatible properties\n",
" | hovertemplate\n",
" | Template string used for rendering the information that\n",
" | appear on hover box. Note that this will override\n",
" | `hoverinfo`. Variables are inserted using %{variable},\n",
" | for example \"y: %{y}\". Numbers are formatted using\n",
" | d3-format's syntax %{variable:d3-format}, for example\n",
" | \"Price: %{y:$.2f}\". See https://github.com/d3/d3-format\n",
" | /blob/master/README.md#locale_format for details on the\n",
" | formatting syntax. The variables available in\n",
" | `hovertemplate` are the ones emitted as event data\n",
" | described at this link\n",
" | https://plotly.com/javascript/plotlyjs-events/#event-data.\n",
" | Additionally, every attributes that can be specified\n",
" | per-point (the ones that are `arrayOk: true`) are\n",
" | available. Anything contained in tag `