
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/plot_9_plotly.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_auto_examples_plot_9_plotly.py>`
        to download the full example code or to run this example in your browser via Binder

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_plot_9_plotly.py:


========================================
Example with the plotly graphing library
========================================

Sphinx-Gallery supports examples made with the
`plotly library <https://plotly.com/python/>`_. Sphinx-Gallery is able to
capture the ``_repr_html_`` of plotly figure objects (see :ref:`capture_repr`).
To display the figure, the last line in your code block should therefore be
the plotly figure object.

In order to use plotly, the ``conf.py`` of the project should include the
following lines to select the appropriate plotly renderer::

    import plotly.io as pio
    pio.renderers.default = 'sphinx_gallery'

**Optional**: the ``sphinx_gallery`` renderer of plotly will not generate png
thumbnails. For png thumbnails, you can use instead the ``sphinx_gallery_png``
renderer, and add ``plotly.io._sg_scraper.plotly_sg_scraper`` to the list of
:ref:`image_scrapers`. The scraper requires you to
`install the orca package <https://plotly.com/python/static-image-export/>`_.

This tutorial gives a few examples of plotly figures, starting with its
high-level API `plotly express <https://plotly.com/python/plotly-express/>`_.

.. GENERATED FROM PYTHON SOURCE LINES 27-37

.. code-block:: python3

    import plotly.express as px
    import numpy as np

    df = px.data.tips()
    fig = px.bar(df, x='sex', y='total_bill', facet_col='day', color='smoker', barmode='group',
                 template='presentation+plotly'
                 )
    fig.update_layout(height=400)
    fig






.. raw:: html

    <div class="output_subarea output_html rendered_html output_result">
    <div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
            <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>                <div id="23b61d90-f963-4514-9f9d-3000f7010646" class="plotly-graph-div" style="height:400px; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("23b61d90-f963-4514-9f9d-3000f7010646")) {                    Plotly.newPlot(                        "23b61d90-f963-4514-9f9d-3000f7010646",                        [{"alignmentgroup": "True", "hovertemplate": "smoker=No<br>day=Sun<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "No", "marker": {"color": "#636efa"}, "name": "No", "offsetgroup": "No", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": ["Female", "Male", "Male", "Male", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Male", "Female", "Male", "Female", "Male", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Female", "Female", "Male", "Male", "Male", "Female", "Male", "Male", "Male", "Male", "Male"], "xaxis": "x", "y": [16.99, 10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 10.33, 16.29, 16.97, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 38.07, 23.95, 25.71, 17.31, 29.93, 14.07, 13.13, 17.26, 24.55, 19.77, 29.85, 48.17, 25.0, 13.39, 16.49, 21.5, 12.66, 16.21, 13.81, 24.52, 20.76, 31.71, 20.69], "yaxis": "y"}, {"alignmentgroup": "True", "hovertemplate": "smoker=No<br>day=Sat<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "No", "marker": {"color": "#636efa"}, "name": "No", "offsetgroup": "No", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Male", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Male", "Female", "Female", "Male", "Male", "Male", "Female", "Male", "Male", "Male", "Female", "Male", "Male", "Male", "Female", "Male", "Male", "Female", "Female", "Male", "Female", "Male", "Male", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Male"], "xaxis": "x2", "y": [20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 13.37, 12.69, 21.7, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 16.31, 16.93, 18.69, 31.27, 16.04, 26.41, 48.27, 17.59, 20.08, 16.45, 20.23, 12.02, 17.07, 14.73, 10.51, 20.92, 18.24, 14.0, 7.25, 48.33, 20.45, 13.28, 11.61, 10.77, 10.07, 35.83, 29.03, 17.82], "yaxis": "y2"}, {"alignmentgroup": "True", "hovertemplate": "smoker=No<br>day=Thur<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "No", "marker": {"color": "#636efa"}, "name": "No", "offsetgroup": "No", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Male", "Male", "Male", "Female", "Male", "Female", "Male", "Male", "Male", "Male", "Female", "Female", "Female", "Male", "Female", "Male", "Male", "Female", "Female", "Male", "Female", "Female", "Male", "Male", "Female", "Female", "Female", "Female", "Female", "Female", "Female", "Female", "Female", "Male", "Male", "Female", "Female", "Female", "Female", "Female", "Male", "Male", "Male", "Female"], "xaxis": "x3", "y": [27.2, 22.76, 17.29, 16.66, 10.07, 15.98, 34.83, 13.03, 18.28, 24.71, 21.16, 10.65, 12.43, 24.08, 11.69, 13.42, 14.26, 15.95, 12.48, 29.8, 8.52, 14.52, 11.38, 22.82, 19.08, 20.27, 11.17, 12.26, 18.26, 8.51, 10.33, 14.15, 13.16, 17.47, 34.3, 41.19, 27.05, 16.43, 8.35, 18.64, 11.87, 9.78, 7.51, 7.56, 18.78], "yaxis": "y3"}, {"alignmentgroup": "True", "hovertemplate": "smoker=No<br>day=Fri<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "No", "marker": {"color": "#636efa"}, "name": "No", "offsetgroup": "No", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Female", "Male", "Female"], "xaxis": "x4", "y": [22.49, 22.75, 12.46, 15.98], "yaxis": "y4"}, {"alignmentgroup": "True", "hovertemplate": "smoker=Yes<br>day=Sun<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "Yes", "marker": {"color": "#EF553B"}, "name": "Yes", "offsetgroup": "Yes", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": ["Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Female", "Male", "Male"], "xaxis": "x", "y": [17.51, 7.25, 31.85, 16.82, 32.9, 17.89, 14.48, 9.6, 34.63, 34.65, 23.33, 45.35, 23.17, 40.55, 20.9, 30.46, 18.15, 23.1, 15.69], "yaxis": "y"}, {"alignmentgroup": "True", "hovertemplate": "smoker=Yes<br>day=Sat<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "Yes", "marker": {"color": "#EF553B"}, "name": "Yes", "offsetgroup": "Yes", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Female", "Female", "Male", "Female", "Female", "Male", "Male", "Male", "Female", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Female", "Male", "Male", "Female", "Female", "Female", "Male", "Male", "Male", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Female", "Male"], "xaxis": "x2", "y": [38.01, 11.24, 20.29, 13.81, 11.02, 18.29, 3.07, 15.01, 26.86, 25.28, 17.92, 44.3, 22.42, 15.36, 20.49, 25.21, 14.31, 10.59, 10.63, 50.81, 15.81, 26.59, 38.73, 24.27, 12.76, 30.06, 25.89, 13.27, 28.17, 12.9, 28.15, 11.59, 7.74, 30.14, 22.12, 24.01, 15.69, 15.53, 12.6, 32.83, 27.18, 22.67], "yaxis": "y2"}, {"alignmentgroup": "True", "hovertemplate": "smoker=Yes<br>day=Thur<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "Yes", "marker": {"color": "#EF553B"}, "name": "Yes", "offsetgroup": "Yes", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Male", "Male", "Female", "Male", "Male", "Male", "Male", "Female", "Female", "Male", "Male", "Female", "Female", "Female", "Male", "Female"], "xaxis": "x3", "y": [19.44, 32.68, 16.0, 19.81, 28.44, 15.48, 16.58, 10.34, 43.11, 13.0, 13.51, 18.71, 12.74, 13.0, 16.4, 20.53, 16.47], "yaxis": "y3"}, {"alignmentgroup": "True", "hovertemplate": "smoker=Yes<br>day=Fri<br>sex=%{x}<br>total_bill=%{y}<extra></extra>", "legendgroup": "Yes", "marker": {"color": "#EF553B"}, "name": "Yes", "offsetgroup": "Yes", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": ["Male", "Female", "Female", "Male", "Male", "Male", "Male", "Female", "Female", "Male", "Female", "Male", "Male", "Female", "Female"], "xaxis": "x4", "y": [28.97, 5.75, 16.32, 40.17, 27.28, 12.03, 21.01, 11.35, 15.38, 12.16, 13.42, 8.58, 13.42, 16.27, 10.09], "yaxis": "y4"}],                        {"annotations": [{"font": {}, "showarrow": false, "text": "day=Sun", "x": 0.1175, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper"}, {"font": {}, "showarrow": false, "text": "day=Sat", "x": 0.3725, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper"}, {"font": {}, "showarrow": false, "text": "day=Thur", "x": 0.6275, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper"}, {"font": {}, "showarrow": false, "text": "day=Fri", "x": 0.8824999999999998, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper"}], "barmode": "group", "height": 400, "legend": {"title": {"text": "smoker"}, "tracegroupgap": 0}, "margin": {"t": 60}, "template": {"data": {"bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "bar"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "barpolar"}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "choropleth": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "choropleth"}], "contour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "contour"}], "contourcarpet": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "contourcarpet"}], "heatmap": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmap"}], "heatmapgl": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmapgl"}], "histogram": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "histogram"}], "histogram2d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2d"}], "histogram2dcontour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2dcontour"}], "mesh3d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "mesh3d"}], "parcoords": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "parcoords"}], "pie": [{"automargin": true, "type": "pie"}], "scatter": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scatter"}], "scatter3d": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scatter3d"}], "scattercarpet": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattercarpet"}], "scattergeo": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scattergeo"}], "scattergl": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scattergl"}], "scattermapbox": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattermapbox"}], "scatterpolar": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scatterpolar"}], "scatterpolargl": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scatterpolargl"}], "scatterternary": [{"line": {"width": 3}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}, "size": 9}, "type": "scatterternary"}], "surface": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "surface"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "height": 30, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "height": 36, "line": {"color": "white"}}, "type": "table"}]}, "layout": {"annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]], "sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}, "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f", "size": 18}, "geo": {"bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white"}, "hoverlabel": {"align": "left"}, "hovermode": "closest", "mapbox": {"style": "light"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "ternary": {"aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "title": {"x": 0.05}, "xaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}, "yaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}}}, "xaxis": {"anchor": "y", "domain": [0.0, 0.235], "title": {"text": "sex"}}, "xaxis2": {"anchor": "y2", "domain": [0.255, 0.49], "matches": "x", "title": {"text": "sex"}}, "xaxis3": {"anchor": "y3", "domain": [0.51, 0.745], "matches": "x", "title": {"text": "sex"}}, "xaxis4": {"anchor": "y4", "domain": [0.7649999999999999, 0.9999999999999999], "matches": "x", "title": {"text": "sex"}}, "yaxis": {"anchor": "x", "domain": [0.0, 1.0], "title": {"text": "total_bill"}}, "yaxis2": {"anchor": "x2", "domain": [0.0, 1.0], "matches": "y", "showticklabels": false}, "yaxis3": {"anchor": "x3", "domain": [0.0, 1.0], "matches": "y", "showticklabels": false}, "yaxis4": {"anchor": "x4", "domain": [0.0, 1.0], "matches": "y", "showticklabels": false}},                        {"responsive": true}                    )                };                            </script>        </div>
    </div>
    <br />
    <br />

.. GENERATED FROM PYTHON SOURCE LINES 38-42

In addition to the classical scatter or bar charts, plotly provides a large
variety of traces, such as the sunburst hierarchical trace of the following
example. plotly is an interactive library: click on one of the continents
for a more detailed view of the drill-down.

.. GENERATED FROM PYTHON SOURCE LINES 42-52

.. code-block:: python3


    df = px.data.gapminder().query("year == 2007")
    fig = px.sunburst(df, path=['continent', 'country'], values='pop',
                      color='lifeExp', hover_data=['iso_alpha'],
                      color_continuous_scale='RdBu',
                      color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))
    fig.update_layout(title_text='Life expectancy of countries and continents')
    fig







.. raw:: html

    <div class="output_subarea output_html rendered_html output_result">
    <div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
            <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>                <div id="ce4c15e2-d091-4798-8563-a9e507bd82fc" class="plotly-graph-div" style="height:525px; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("ce4c15e2-d091-4798-8563-a9e507bd82fc")) {                    Plotly.newPlot(                        "ce4c15e2-d091-4798-8563-a9e507bd82fc",                        [{"branchvalues": "total", "customdata": [["AFG", 43.828], ["ALB", 76.423], ["DZA", 72.301], ["AGO", 42.731], ["ARG", 75.32], ["AUS", 81.235], ["AUT", 79.829], ["BHR", 75.635], ["BGD", 64.062], ["BEL", 79.441], ["BEN", 56.728], ["BOL", 65.554], ["BIH", 74.852], ["BWA", 50.728], ["BRA", 72.39], ["BGR", 73.005], ["BFA", 52.295], ["BDI", 49.58], ["KHM", 59.723], ["CMR", 50.43], ["CAN", 80.65300000000002], ["CAF", 44.74100000000001], ["TCD", 50.651], ["CHL", 78.553], ["CHN", 72.961], ["COL", 72.889], ["COM", 65.152], ["COD", 46.46199999999999], ["COG", 55.321999999999996], ["CRI", 78.782], ["CIV", 48.328], ["HRV", 75.748], ["CUB", 78.273], ["CZE", 76.486], ["DNK", 78.332], ["DJI", 54.791000000000004], ["DOM", 72.235], ["ECU", 74.994], ["EGY", 71.33800000000001], ["SLV", 71.878], ["GNQ", 51.57899999999999], ["ERI", 58.03999999999999], ["ETH", 52.946999999999996], ["FIN", 79.313], ["FRA", 80.65699999999998], ["GAB", 56.73500000000001], ["GMB", 59.448], ["DEU", 79.406], ["GHA", 60.02199999999999], ["GRC", 79.483], ["GTM", 70.259], ["GIN", 56.007], ["GNB", 46.388000000000005], ["HTI", 60.916000000000004], ["HND", 70.19800000000001], ["HKG", 82.208], ["HUN", 73.33800000000001], ["ISL", 81.757], ["IND", 64.69800000000001], ["IDN", 70.65], ["IRN", 70.964], ["IRQ", 59.545], ["IRL", 78.885], ["ISR", 80.745], ["ITA", 80.546], ["JAM", 72.567], ["JPN", 82.603], ["JOR", 72.535], ["KEN", 54.11], ["KOR", 67.297], ["KOR", 78.623], ["KWT", 77.58800000000001], ["LBN", 71.993], ["LSO", 42.592], ["LBR", 45.67800000000001], ["LBY", 73.952], ["MDG", 59.443000000000005], ["MWI", 48.303000000000004], ["MYS", 74.241], ["MLI", 54.467], ["MRT", 64.164], ["MUS", 72.801], ["MEX", 76.195], ["MNG", 66.803], ["MNE", 74.543], ["MAR", 71.164], ["MOZ", 42.082], ["MMR", 62.068999999999996], ["NAM", 52.906000000000006], ["NPL", 63.785], ["NLD", 79.762], ["NZL", 80.204], ["NIC", 72.899], ["NER", 56.867], ["NGA", 46.858999999999995], ["NOR", 80.196], ["OMN", 75.64], ["PAK", 65.483], ["PAN", 75.53699999999999], ["PRY", 71.752], ["PER", 71.421], ["PHL", 71.688], ["POL", 75.563], ["PRT", 78.098], ["PRI", 78.74600000000001], ["REU", 76.442], ["ROU", 72.476], ["RWA", 46.242], ["STP", 65.528], ["SAU", 72.777], ["SEN", 63.062], ["SRB", 74.002], ["SLE", 42.568000000000005], ["SGP", 79.972], ["SVK", 74.663], ["SVN", 77.926], ["SOM", 48.159], ["ZAF", 49.339], ["ESP", 80.941], ["LKA", 72.396], ["SDN", 58.556000000000004], ["SWZ", 39.613], ["SWE", 80.884], ["CHE", 81.70100000000001], ["SYR", 74.143], ["TWN", 78.4], ["TZA", 52.516999999999996], ["THA", 70.616], ["TGO", 58.42], ["TTO", 69.819], ["TUN", 73.923], ["TUR", 71.777], ["UGA", 51.542], ["GBR", 79.425], ["USA", 78.242], ["URY", 76.384], ["VEN", 73.747], ["VNM", 74.249], ["PSE", 73.422], ["YEM", 62.698], ["ZMB", 42.38399999999999], ["ZWE", 43.486999999999995], ["(?)", 54.56441057558197], ["(?)", 75.35668222743027], ["(?)", 69.44386304205017], ["(?)", 77.89057081069897], ["(?)", 81.06215400970112]], "domain": {"x": [0.0, 1.0], "y": [0.0, 1.0]}, "hovertemplate": "labels=%{label}<br>pop=%{value}<br>parent=%{parent}<br>id=%{id}<br>iso_alpha=%{customdata[0]}<br>lifeExp=%{color}<extra></extra>", "ids": ["Asia/Afghanistan", "Europe/Albania", "Africa/Algeria", "Africa/Angola", "Americas/Argentina", "Oceania/Australia", "Europe/Austria", "Asia/Bahrain", "Asia/Bangladesh", "Europe/Belgium", "Africa/Benin", "Americas/Bolivia", "Europe/Bosnia and Herzegovina", "Africa/Botswana", "Americas/Brazil", "Europe/Bulgaria", "Africa/Burkina Faso", "Africa/Burundi", "Asia/Cambodia", "Africa/Cameroon", "Americas/Canada", "Africa/Central African Republic", "Africa/Chad", "Americas/Chile", "Asia/China", "Americas/Colombia", "Africa/Comoros", "Africa/Congo, Dem. Rep.", "Africa/Congo, Rep.", "Americas/Costa Rica", "Africa/Cote d'Ivoire", "Europe/Croatia", "Americas/Cuba", "Europe/Czech Republic", "Europe/Denmark", "Africa/Djibouti", "Americas/Dominican Republic", "Americas/Ecuador", "Africa/Egypt", "Americas/El Salvador", "Africa/Equatorial Guinea", "Africa/Eritrea", "Africa/Ethiopia", "Europe/Finland", "Europe/France", "Africa/Gabon", "Africa/Gambia", "Europe/Germany", "Africa/Ghana", "Europe/Greece", "Americas/Guatemala", "Africa/Guinea", "Africa/Guinea-Bissau", "Americas/Haiti", "Americas/Honduras", "Asia/Hong Kong, China", "Europe/Hungary", "Europe/Iceland", "Asia/India", "Asia/Indonesia", "Asia/Iran", "Asia/Iraq", "Europe/Ireland", "Asia/Israel", "Europe/Italy", "Americas/Jamaica", "Asia/Japan", "Asia/Jordan", "Africa/Kenya", "Asia/Korea, Dem. Rep.", "Asia/Korea, Rep.", "Asia/Kuwait", "Asia/Lebanon", "Africa/Lesotho", "Africa/Liberia", "Africa/Libya", "Africa/Madagascar", "Africa/Malawi", "Asia/Malaysia", "Africa/Mali", "Africa/Mauritania", "Africa/Mauritius", "Americas/Mexico", "Asia/Mongolia", "Europe/Montenegro", "Africa/Morocco", "Africa/Mozambique", "Asia/Myanmar", "Africa/Namibia", "Asia/Nepal", "Europe/Netherlands", "Oceania/New Zealand", "Americas/Nicaragua", "Africa/Niger", "Africa/Nigeria", "Europe/Norway", "Asia/Oman", "Asia/Pakistan", "Americas/Panama", "Americas/Paraguay", "Americas/Peru", "Asia/Philippines", "Europe/Poland", "Europe/Portugal", "Americas/Puerto Rico", "Africa/Reunion", "Europe/Romania", "Africa/Rwanda", "Africa/Sao Tome and Principe", "Asia/Saudi Arabia", "Africa/Senegal", "Europe/Serbia", "Africa/Sierra Leone", "Asia/Singapore", "Europe/Slovak Republic", "Europe/Slovenia", "Africa/Somalia", "Africa/South Africa", "Europe/Spain", "Asia/Sri Lanka", "Africa/Sudan", "Africa/Swaziland", "Europe/Sweden", "Europe/Switzerland", "Asia/Syria", "Asia/Taiwan", "Africa/Tanzania", "Asia/Thailand", "Africa/Togo", "Americas/Trinidad and Tobago", "Africa/Tunisia", "Europe/Turkey", "Africa/Uganda", "Europe/United Kingdom", "Americas/United States", "Americas/Uruguay", "Americas/Venezuela", "Asia/Vietnam", "Asia/West Bank and Gaza", "Asia/Yemen, Rep.", "Africa/Zambia", "Africa/Zimbabwe", "Africa", "Americas", "Asia", "Europe", "Oceania"], "labels": ["Afghanistan", "Albania", "Algeria", "Angola", "Argentina", "Australia", "Austria", "Bahrain", "Bangladesh", "Belgium", "Benin", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Dem. Rep.", "Congo, Rep.", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Czech Republic", "Denmark", "Djibouti", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Ethiopia", "Finland", "France", "Gabon", "Gambia", "Germany", "Ghana", "Greece", "Guatemala", "Guinea", "Guinea-Bissau", "Haiti", "Honduras", "Hong Kong, China", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kenya", "Korea, Dem. Rep.", "Korea, Rep.", "Kuwait", "Lebanon", "Lesotho", "Liberia", "Libya", "Madagascar", "Malawi", "Malaysia", "Mali", "Mauritania", "Mauritius", "Mexico", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Puerto Rico", "Reunion", "Romania", "Rwanda", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Sierra Leone", "Singapore", "Slovak Republic", "Slovenia", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tanzania", "Thailand", "Togo", "Trinidad and Tobago", "Tunisia", "Turkey", "Uganda", "United Kingdom", "United States", "Uruguay", "Venezuela", "Vietnam", "West Bank and Gaza", "Yemen, Rep.", "Zambia", "Zimbabwe", "Africa", "Americas", "Asia", "Europe", "Oceania"], "marker": {"coloraxis": "coloraxis", "colors": [43.828, 76.423, 72.301, 42.731, 75.32, 81.235, 79.829, 75.635, 64.062, 79.441, 56.728, 65.554, 74.852, 50.728, 72.39, 73.005, 52.295, 49.58, 59.723, 50.43, 80.65300000000002, 44.74100000000001, 50.651, 78.553, 72.961, 72.889, 65.152, 46.46199999999999, 55.321999999999996, 78.782, 48.328, 75.748, 78.273, 76.486, 78.332, 54.791000000000004, 72.235, 74.994, 71.33800000000001, 71.878, 51.57899999999999, 58.03999999999999, 52.946999999999996, 79.313, 80.65699999999998, 56.73500000000001, 59.448, 79.406, 60.02199999999999, 79.483, 70.259, 56.007, 46.388000000000005, 60.916000000000004, 70.19800000000001, 82.208, 73.33800000000001, 81.757, 64.69800000000001, 70.65, 70.964, 59.545, 78.885, 80.745, 80.546, 72.567, 82.603, 72.535, 54.11, 67.297, 78.623, 77.58800000000001, 71.993, 42.592, 45.67800000000001, 73.952, 59.443000000000005, 48.303000000000004, 74.241, 54.467, 64.164, 72.801, 76.195, 66.803, 74.543, 71.164, 42.082, 62.068999999999996, 52.906000000000006, 63.785, 79.762, 80.204, 72.899, 56.867, 46.858999999999995, 80.196, 75.64, 65.483, 75.53699999999999, 71.752, 71.421, 71.688, 75.563, 78.098, 78.74600000000001, 76.442, 72.476, 46.242, 65.528, 72.777, 63.062, 74.002, 42.568000000000005, 79.972, 74.663, 77.926, 48.159, 49.339, 80.941, 72.396, 58.556000000000004, 39.613, 80.884, 81.70100000000001, 74.143, 78.4, 52.516999999999996, 70.616, 58.42, 69.819, 73.923, 71.777, 51.542, 79.425, 78.242, 76.384, 73.747, 74.249, 73.422, 62.698, 42.38399999999999, 43.486999999999995, 54.56441057558197, 75.35668222743027, 69.44386304205017, 77.89057081069897, 81.06215400970112]}, "name": "", "parents": ["Asia", "Europe", "Africa", "Africa", "Americas", "Oceania", "Europe", "Asia", "Asia", "Europe", "Africa", "Americas", "Europe", "Africa", "Americas", "Europe", "Africa", "Africa", "Asia", "Africa", "Americas", "Africa", "Africa", "Americas", "Asia", "Americas", "Africa", "Africa", "Africa", "Americas", "Africa", "Europe", "Americas", "Europe", "Europe", "Africa", "Americas", "Americas", "Africa", "Americas", "Africa", "Africa", "Africa", "Europe", "Europe", "Africa", "Africa", "Europe", "Africa", "Europe", "Americas", "Africa", "Africa", "Americas", "Americas", "Asia", "Europe", "Europe", "Asia", "Asia", "Asia", "Asia", "Europe", "Asia", "Europe", "Americas", "Asia", "Asia", "Africa", "Asia", "Asia", "Asia", "Asia", "Africa", "Africa", "Africa", "Africa", "Africa", "Asia", "Africa", "Africa", "Africa", "Americas", "Asia", "Europe", "Africa", "Africa", "Asia", "Africa", "Asia", "Europe", "Oceania", "Americas", "Africa", "Africa", "Europe", "Asia", "Asia", "Americas", "Americas", "Americas", "Asia", "Europe", "Europe", "Americas", "Africa", "Europe", "Africa", "Africa", "Asia", "Africa", "Europe", "Africa", "Asia", "Europe", "Europe", "Africa", "Africa", "Europe", "Asia", "Africa", "Africa", "Europe", "Europe", "Asia", "Asia", "Africa", "Asia", "Africa", "Americas", "Africa", "Europe", "Africa", "Europe", "Americas", "Americas", "Americas", "Asia", "Asia", "Asia", "Africa", "Africa", "", "", "", "", ""], "type": "sunburst", "values": [31889923, 3600523, 33333216, 12420476, 40301927, 20434176, 8199783, 708573, 150448339, 10392226, 8078314, 9119152, 4552198, 1639131, 190010647, 7322858, 14326203, 8390505, 14131858, 17696293, 33390141, 4369038, 10238807, 16284741, 1318683096, 44227550, 710960, 64606759, 3800610, 4133884, 18013409, 4493312, 11416987, 10228744, 5468120, 496374, 9319622, 13755680, 80264543, 6939688, 551201, 4906585, 76511887, 5238460, 61083916, 1454867, 1688359, 82400996, 22873338, 10706290, 12572928, 9947814, 1472041, 8502814, 7483763, 6980412, 9956108, 301931, 1110396331, 223547000, 69453570, 27499638, 4109086, 6426679, 58147733, 2780132, 127467972, 6053193, 35610177, 23301725, 49044790, 2505559, 3921278, 2012649, 3193942, 6036914, 19167654, 13327079, 24821286, 12031795, 3270065, 1250882, 108700891, 2874127, 684736, 33757175, 19951656, 47761980, 2055080, 28901790, 16570613, 4115771, 5675356, 12894865, 135031164, 4627926, 3204897, 169270617, 3242173, 6667147, 28674757, 91077287, 38518241, 10642836, 3942491, 798094, 22276056, 8860588, 199579, 27601038, 12267493, 10150265, 6144562, 4553009, 5447502, 2009245, 9118773, 43997828, 40448191, 20378239, 42292929, 1133066, 9031088, 7554661, 19314747, 23174294, 38139640, 65068149, 5701579, 1056608, 10276158, 71158647, 29170398, 60776238, 301139947, 3447496, 26084662, 85262356, 4018332, 22211743, 11746035, 12311143, 929539692, 898871184, 3811953827, 586098529, 24549947]}],                        {"coloraxis": {"cmid": 68.91909251904043, "colorbar": {"title": {"text": "lifeExp"}}, "colorscale": [[0.0, "rgb(103,0,31)"], [0.1, "rgb(178,24,43)"], [0.2, "rgb(214,96,77)"], [0.3, "rgb(244,165,130)"], [0.4, "rgb(253,219,199)"], [0.5, "rgb(247,247,247)"], [0.6, "rgb(209,229,240)"], [0.7, "rgb(146,197,222)"], [0.8, "rgb(67,147,195)"], [0.9, "rgb(33,102,172)"], [1.0, "rgb(5,48,97)"]]}, "legend": {"tracegroupgap": 0}, "margin": {"t": 60}, "template": {"data": {"bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "bar"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}}, "type": "barpolar"}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "choropleth": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "choropleth"}], "contour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "contour"}], "contourcarpet": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "contourcarpet"}], "heatmap": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmap"}], "heatmapgl": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "heatmapgl"}], "histogram": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "histogram"}], "histogram2d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2d"}], "histogram2dcontour": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "histogram2dcontour"}], "mesh3d": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "type": "mesh3d"}], "parcoords": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "parcoords"}], "pie": [{"automargin": true, "type": "pie"}], "scatter": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatter"}], "scatter3d": [{"line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatter3d"}], "scattercarpet": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattercarpet"}], "scattergeo": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattergeo"}], "scattergl": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattergl"}], "scattermapbox": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scattermapbox"}], "scatterpolar": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterpolar"}], "scatterpolargl": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterpolargl"}], "scatterternary": [{"marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "type": "scatterternary"}], "surface": [{"colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "type": "surface"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "line": {"color": "white"}}, "type": "table"}]}, "layout": {"annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]], "sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}, "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f"}, "geo": {"bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white"}, "hoverlabel": {"align": "left"}, "hovermode": "closest", "mapbox": {"style": "light"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white"}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "ternary": {"aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "bgcolor": "#E5ECF6", "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "title": {"x": 0.05}, "xaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}, "yaxis": {"automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "zerolinewidth": 2}}}, "title": {"text": "Life expectancy of countries and continents"}},                        {"responsive": true}                    )                };                            </script>        </div>
    </div>
    <br />
    <br />

.. GENERATED FROM PYTHON SOURCE LINES 53-56

While plotly express is often the high-level entry point of the plotly
library, complex figures mixing different types of traces can be made
with the low-level ``graph_objects`` imperative API.

.. GENERATED FROM PYTHON SOURCE LINES 56-66

.. code-block:: python3


    from plotly.subplots import make_subplots
    import plotly.graph_objects as go
    fig = make_subplots(rows=1, cols=2, specs=[[{}, {'type':'domain'}]])
    fig.add_trace(go.Bar(x=[2018, 2019, 2020], y=[3, 2, 5], showlegend=False), 1, 1)
    fig.add_trace(go.Pie(labels=['A', 'B', 'C'], values=[1, 3, 6]), 1, 2)
    fig.update_layout(height=400, template='presentation', yaxis_title_text='revenue')
    fig

    # sphinx_gallery_thumbnail_path = '_static/plotly_logo.png'





.. raw:: html

    <div class="output_subarea output_html rendered_html output_result">
    <div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
            <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>                <div id="a1d0a8a8-172c-4766-82f8-1de1a00cd685" class="plotly-graph-div" style="height:400px; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("a1d0a8a8-172c-4766-82f8-1de1a00cd685")) {                    Plotly.newPlot(                        "a1d0a8a8-172c-4766-82f8-1de1a00cd685",                        [{"showlegend": false, "type": "bar", "x": [2018, 2019, 2020], "xaxis": "x", "y": [3, 2, 5], "yaxis": "y"}, {"domain": {"x": [0.55, 1.0], "y": [0.0, 1.0]}, "labels": ["A", "B", "C"], "type": "pie", "values": [1, 3, 6]}],                        {"height": 400, "template": {"data": {"pie": [{"automargin": true, "type": "pie"}], "scatter": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scatter"}], "scatter3d": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scatter3d"}], "scattergeo": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scattergeo"}], "scattergl": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scattergl"}], "scatterpolar": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scatterpolar"}], "scatterpolargl": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scatterpolargl"}], "scatterternary": [{"line": {"width": 3}, "marker": {"size": 9}, "type": "scatterternary"}], "table": [{"cells": {"height": 30}, "header": {"height": 36}, "type": "table"}]}, "layout": {"font": {"size": 18}, "xaxis": {"title": {"standoff": 15}}, "yaxis": {"title": {"standoff": 15}}}}, "xaxis": {"anchor": "y", "domain": [0.0, 0.45]}, "yaxis": {"anchor": "x", "domain": [0.0, 1.0], "title": {"text": "revenue"}}},                        {"responsive": true}                    )                };                            </script>        </div>
    </div>
    <br />
    <br />

**Estimated memory usage:**  21 MB


.. _sphx_glr_download_auto_examples_plot_9_plotly.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example


  .. container:: binder-badge

    .. image:: images/binder_badge_logo.svg
      :target: https://mybinder.org/v2/gh/sphinx-gallery/sphinx-gallery.github.io/master?urlpath=lab/tree/notebooks/auto_examples/plot_9_plotly.ipynb
      :alt: Launch binder
      :width: 150 px


  .. container:: sphx-glr-download sphx-glr-download-python

     :download:`Download Python source code: plot_9_plotly.py <plot_9_plotly.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: plot_9_plotly.ipynb <plot_9_plotly.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
