From edabbee3d1c3327843a17ef5228665095e1e3d87 Mon Sep 17 00:00:00 2001 From: plotlydocbot Date: Tue, 3 Mar 2026 17:17:04 +0000 Subject: [PATCH 1/5] build of https://github.com/plotly/plotly.py/commit/4cfec3dee7c9337aa84a9844486fa021a8eb1e55 --- 2D-Histogram.ipynb | 453 +++++ 2d-histogram-contour.ipynb | 401 ++++ 3d-axes.ipynb | 395 ++++ 3d-bubble-charts.ipynb | 309 +++ 3d-camera-controls.ipynb | 452 +++++ 3d-isosurface-plots.ipynb | 375 ++++ 3d-line-plots.ipynb | 191 ++ 3d-mesh.ipynb | 309 +++ 3d-scatter-plots.ipynb | 262 +++ 3d-subplots.ipynb | 143 ++ 3d-surface-plots.ipynb | 329 ++++ 3d-volume.ipynb | 379 ++++ LaTeX.ipynb | 125 ++ animations.ipynb | 528 +++++ annotated-heatmap.ipynb | 409 ++++ axes.ipynb | 1690 ++++++++++++++++ bar-charts.ipynb | 1416 ++++++++++++++ bio-alignment-chart.ipynb | 125 ++ bio-clustergram.ipynb | 191 ++ bio-manhattanplot.ipynb | 150 ++ bio-volcano-plot.ipynb | 149 ++ box-plots.ipynb | 811 ++++++++ bubble-charts.ipynb | 350 ++++ bubble-maps.ipynb | 300 +++ builtin-colorscales.ipynb | 257 +++ bullet-charts.ipynb | 267 +++ candlestick-charts.ipynb | 285 +++ carpet-contour.ipynb | 374 ++++ carpet-plot.ipynb | 323 +++ carpet-scatter.ipynb | 281 +++ categorical-axes.ipynb | 400 ++++ choropleth-maps.ipynb | 608 ++++++ click-events.ipynb | 156 ++ colorscales.ipynb | 1071 ++++++++++ cone-plot.ipynb | 267 +++ configuration-options.ipynb | 576 ++++++ continuous-error-bars.ipynb | 177 ++ contour-plots.ipynb | 553 ++++++ county-choropleth.ipynb | 437 +++++ creating-and-updating-figures.ipynb | 1089 +++++++++++ custom-buttons.ipynb | 570 ++++++ dash.ipynb | 78 + dendrogram.ipynb | 269 +++ density-heatmaps.ipynb | 192 ++ discrete-color.ipynb | 488 +++++ distplot.ipynb | 509 +++++ dot-plots.ipynb | 259 +++ dropdowns.ipynb | 650 +++++++ dumbbell-plots.ipynb | 264 +++ ecdf-plots.ipynb | 379 ++++ error-bars.ipynb | 354 ++++ facet-plots.ipynb | 438 +++++ figure-factories.ipynb | 100 + figure-factory-subplots.ipynb | 320 +++ figure-factory-table.ipynb | 437 +++++ figure-introspection.ipynb | 376 ++++ figure-labels.ipynb | 454 +++++ figure-structure.ipynb | 311 +++ figurewidget-app.ipynb | 299 +++ figurewidget.ipynb | 272 +++ filled-area-plots.ipynb | 450 +++++ filled-area-tile-maps.ipynb | 249 +++ funnel-charts.ipynb | 386 ++++ gantt.ipynb | 300 +++ gauge-charts.ipynb | 192 ++ getting-started.ipynb | 348 ++++ graph-objects.ipynb | 162 ++ graphing-multiple-chart-types.ipynb | 353 ++++ heatmaps.ipynb | 486 +++++ hexbin-mapbox.ipynb | 272 +++ histograms.ipynb | 896 +++++++++ horizontal-bar-charts.ipynb | 592 ++++++ horizontal-vertical-shapes.ipynb | 327 ++++ hover-text-and-formatting.ipynb | 895 +++++++++ icicle-charts.ipynb | 832 ++++++++ images.ipynb | 514 +++++ imshow.ipynb | 854 ++++++++ indicator.ipynb | 375 ++++ interactive-html-export.ipynb | 212 ++ ipython-vs-python.ipynb | 137 ++ jupyter-lab-tools.ipynb | 114 ++ legend.ipynb | 1276 ++++++++++++ line-and-scatter.ipynb | 1044 ++++++++++ line-charts.ipynb | 764 ++++++++ linear-fits.ipynb | 414 ++++ lines-on-maps.ipynb | 448 +++++ lines-on-tile-maps.ipynb | 263 +++ location-mode.ipynb | 590 ++++++ log-plot.ipynb | 263 +++ map-configuration.ipynb | 401 ++++ map-subplots-and-small-multiples.ipynb | 219 +++ marginal-plots.ipynb | 237 +++ marker-style.ipynb | 799 ++++++++ migrate-to-maplibre.ipynb | 117 ++ mixed-subplots.ipynb | 184 ++ ml-knn.ipynb | 470 +++++ ml-pca.ipynb | 417 ++++ ml-regression.ipynb | 781 ++++++++ ml-roc-pr.ipynb | 430 ++++ ml-tsne-umap-projections.ipynb | 290 +++ ml_apps.ipynb | 78 + multiple-axes.ipynb | 581 ++++++ ne_50m_rivers_lake_centerlines (1).zip | Bin 0 -> 457951 bytes ne_50m_rivers_lake_centerlines.zip | Bin 0 -> 457951 bytes network-graphs.ipynb | 285 +++ ohlc-charts.ipynb | 270 +++ orca-management.ipynb | 453 +++++ pandas-backend.ipynb | 349 ++++ parallel-categories-diagram.ipynb | 416 ++++ parallel-coordinates-plot.ipynb | 337 ++++ pattern-hatching-texture.ipynb | 351 ++++ peak-finding.ipynb | 221 +++ performance.ipynb | 433 +++++ pie-charts.ipynb | 597 ++++++ plot-data-from-csv.ipynb | 191 ++ plotly-express.ipynb | 995 ++++++++++ polar-chart.ipynb | 626 ++++++ px-arguments.ipynb | 517 +++++ quiver-plots.ipynb | 152 ++ radar-chart.ipynb | 221 +++ random-walk.ipynb | 248 +++ range-slider.ipynb | 429 ++++ .../plotly/datasets/master/mesh_dataset.txt | 100 + renderers.ipynb | 472 +++++ sankey-diagram.ipynb | 490 +++++ scatter-plots-on-maps.ipynb | 353 ++++ selections.ipynb | 472 +++++ setting-graph-size.ipynb | 339 ++++ shapes.ipynb | 1724 +++++++++++++++++ sliders.ipynb | 178 ++ smith-charts.ipynb | 174 ++ smoothing.ipynb | 258 +++ splom.ipynb | 496 +++++ static-image-export.ipynb | 452 +++++ static-image-generation-migration.ipynb | 124 ++ streamline-plots.ipynb | 178 ++ streamtube-plot.ipynb | 220 +++ strip-charts.ipynb | 129 ++ styling-plotly-express.ipynb | 279 +++ subplots.ipynb | 926 +++++++++ sunburst-charts.ipynb | 636 ++++++ supported-colors.ipynb | 204 ++ table-subplots.ipynb | 160 ++ table.ipynb | 384 ++++ templates.ipynb | 708 +++++++ ternary-contour.ipynb | 265 +++ ternary-plots.ipynb | 205 ++ ternary-scatter-contour.ipynb | 229 +++ text-and-annotations.ipynb | 1292 ++++++++++++ tick-formatting.ipynb | 377 ++++ tile-county-choropleth.ipynb | 424 ++++ tile-map-layers.ipynb | 496 +++++ tile-scatter-maps.ipynb | 562 ++++++ time-series.ipynb | 769 ++++++++ tree-plots.ipynb | 234 +++ treemaps.ipynb | 695 +++++++ trisurf.ipynb | 206 ++ troubleshooting.ipynb | 141 ++ v4-migration.ipynb | 441 +++++ v6-changes.ipynb | 193 ++ violin.ipynb | 479 +++++ waterfall-charts.ipynb | 221 +++ wide-form.ipynb | 605 ++++++ wind-rose-charts.ipynb | 158 ++ 164 files changed, 67933 insertions(+) create mode 100644 2D-Histogram.ipynb create mode 100644 2d-histogram-contour.ipynb create mode 100644 3d-axes.ipynb create mode 100644 3d-bubble-charts.ipynb create mode 100644 3d-camera-controls.ipynb create mode 100644 3d-isosurface-plots.ipynb create mode 100644 3d-line-plots.ipynb create mode 100644 3d-mesh.ipynb create mode 100644 3d-scatter-plots.ipynb create mode 100644 3d-subplots.ipynb create mode 100644 3d-surface-plots.ipynb create mode 100644 3d-volume.ipynb create mode 100644 LaTeX.ipynb create mode 100644 animations.ipynb create mode 100644 annotated-heatmap.ipynb create mode 100644 axes.ipynb create mode 100644 bar-charts.ipynb create mode 100644 bio-alignment-chart.ipynb create mode 100644 bio-clustergram.ipynb create mode 100644 bio-manhattanplot.ipynb create mode 100644 bio-volcano-plot.ipynb create mode 100644 box-plots.ipynb create mode 100644 bubble-charts.ipynb create mode 100644 bubble-maps.ipynb create mode 100644 builtin-colorscales.ipynb create mode 100644 bullet-charts.ipynb create mode 100644 candlestick-charts.ipynb create mode 100644 carpet-contour.ipynb create mode 100644 carpet-plot.ipynb create mode 100644 carpet-scatter.ipynb create mode 100644 categorical-axes.ipynb create mode 100644 choropleth-maps.ipynb create mode 100644 click-events.ipynb create mode 100644 colorscales.ipynb create mode 100644 cone-plot.ipynb create mode 100644 configuration-options.ipynb create mode 100644 continuous-error-bars.ipynb create mode 100644 contour-plots.ipynb create mode 100644 county-choropleth.ipynb create mode 100644 creating-and-updating-figures.ipynb create mode 100644 custom-buttons.ipynb create mode 100644 dash.ipynb create mode 100644 dendrogram.ipynb create mode 100644 density-heatmaps.ipynb create mode 100644 discrete-color.ipynb create mode 100644 distplot.ipynb create mode 100644 dot-plots.ipynb create mode 100644 dropdowns.ipynb create mode 100644 dumbbell-plots.ipynb create mode 100644 ecdf-plots.ipynb create mode 100644 error-bars.ipynb create mode 100644 facet-plots.ipynb create mode 100644 figure-factories.ipynb create mode 100644 figure-factory-subplots.ipynb create mode 100644 figure-factory-table.ipynb create mode 100644 figure-introspection.ipynb create mode 100644 figure-labels.ipynb create mode 100644 figure-structure.ipynb create mode 100644 figurewidget-app.ipynb create mode 100644 figurewidget.ipynb create mode 100644 filled-area-plots.ipynb create mode 100644 filled-area-tile-maps.ipynb create mode 100644 funnel-charts.ipynb create mode 100644 gantt.ipynb create mode 100644 gauge-charts.ipynb create mode 100644 getting-started.ipynb create mode 100644 graph-objects.ipynb create mode 100644 graphing-multiple-chart-types.ipynb create mode 100644 heatmaps.ipynb create mode 100644 hexbin-mapbox.ipynb create mode 100644 histograms.ipynb create mode 100644 horizontal-bar-charts.ipynb create mode 100644 horizontal-vertical-shapes.ipynb create mode 100644 hover-text-and-formatting.ipynb create mode 100644 icicle-charts.ipynb create mode 100644 images.ipynb create mode 100644 imshow.ipynb create mode 100644 indicator.ipynb create mode 100644 interactive-html-export.ipynb create mode 100644 ipython-vs-python.ipynb create mode 100644 jupyter-lab-tools.ipynb create mode 100644 legend.ipynb create mode 100644 line-and-scatter.ipynb create mode 100644 line-charts.ipynb create mode 100644 linear-fits.ipynb create mode 100644 lines-on-maps.ipynb create mode 100644 lines-on-tile-maps.ipynb create mode 100644 location-mode.ipynb create mode 100644 log-plot.ipynb create mode 100644 map-configuration.ipynb create mode 100644 map-subplots-and-small-multiples.ipynb create mode 100644 marginal-plots.ipynb create mode 100644 marker-style.ipynb create mode 100644 migrate-to-maplibre.ipynb create mode 100644 mixed-subplots.ipynb create mode 100644 ml-knn.ipynb create mode 100644 ml-pca.ipynb create mode 100644 ml-regression.ipynb create mode 100644 ml-roc-pr.ipynb create mode 100644 ml-tsne-umap-projections.ipynb create mode 100644 ml_apps.ipynb create mode 100644 multiple-axes.ipynb create mode 100644 ne_50m_rivers_lake_centerlines (1).zip create mode 100644 ne_50m_rivers_lake_centerlines.zip create mode 100644 network-graphs.ipynb create mode 100644 ohlc-charts.ipynb create mode 100644 orca-management.ipynb create mode 100644 pandas-backend.ipynb create mode 100644 parallel-categories-diagram.ipynb create mode 100644 parallel-coordinates-plot.ipynb create mode 100644 pattern-hatching-texture.ipynb create mode 100644 peak-finding.ipynb create mode 100644 performance.ipynb create mode 100644 pie-charts.ipynb create mode 100644 plot-data-from-csv.ipynb create mode 100644 plotly-express.ipynb create mode 100644 polar-chart.ipynb create mode 100644 px-arguments.ipynb create mode 100644 quiver-plots.ipynb create mode 100644 radar-chart.ipynb create mode 100644 random-walk.ipynb create mode 100644 range-slider.ipynb create mode 100644 raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt create mode 100644 renderers.ipynb create mode 100644 sankey-diagram.ipynb create mode 100644 scatter-plots-on-maps.ipynb create mode 100644 selections.ipynb create mode 100644 setting-graph-size.ipynb create mode 100644 shapes.ipynb create mode 100644 sliders.ipynb create mode 100644 smith-charts.ipynb create mode 100644 smoothing.ipynb create mode 100644 splom.ipynb create mode 100644 static-image-export.ipynb create mode 100644 static-image-generation-migration.ipynb create mode 100644 streamline-plots.ipynb create mode 100644 streamtube-plot.ipynb create mode 100644 strip-charts.ipynb create mode 100644 styling-plotly-express.ipynb create mode 100644 subplots.ipynb create mode 100644 sunburst-charts.ipynb create mode 100644 supported-colors.ipynb create mode 100644 table-subplots.ipynb create mode 100644 table.ipynb create mode 100644 templates.ipynb create mode 100644 ternary-contour.ipynb create mode 100644 ternary-plots.ipynb create mode 100644 ternary-scatter-contour.ipynb create mode 100644 text-and-annotations.ipynb create mode 100644 tick-formatting.ipynb create mode 100644 tile-county-choropleth.ipynb create mode 100644 tile-map-layers.ipynb create mode 100644 tile-scatter-maps.ipynb create mode 100644 time-series.ipynb create mode 100644 tree-plots.ipynb create mode 100644 treemaps.ipynb create mode 100644 trisurf.ipynb create mode 100644 troubleshooting.ipynb create mode 100644 v4-migration.ipynb create mode 100644 v6-changes.ipynb create mode 100644 violin.ipynb create mode 100644 waterfall-charts.ipynb create mode 100644 wide-form.ipynb create mode 100644 wind-rose-charts.ipynb diff --git a/2D-Histogram.ipynb b/2D-Histogram.ipynb new file mode 100644 index 000000000..cdcdedf1a --- /dev/null +++ b/2D-Histogram.ipynb @@ -0,0 +1,453 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "01dceb6e", + "metadata": {}, + "source": [ + "## 2D Histograms or Density Heatmaps\n", + "\n", + "A 2D histogram, also known as a density heatmap, is the 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [heatmap](/python/heatmaps/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the color of the tile representing the bin. This kind of visualization (and the related [2D histogram contour, or density contour](https://plotly.com/python/2d-histogram-contour/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns. For data sets of more than a few thousand points, a better approach than the ones listed here would be to [use Plotly with Datashader](/python/datashader/) to precompute the aggregations before displaying the data with Plotly.\n", + "\n", + "## Density Heatmaps with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/). The Plotly Express function `density_heatmap()` can be used to produce density heatmaps." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d97e993", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_heatmap(df, x=\"total_bill\", y=\"tip\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "910366c9", + "metadata": {}, + "source": [ + "The number of bins can be controlled with `nbinsx` and `nbinsy` and the [color scale](/python/colorscales/) with `color_continuous_scale`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cce16ab2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_heatmap(df, x=\"total_bill\", y=\"tip\", nbinsx=20, nbinsy=20, color_continuous_scale=\"Viridis\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3b17138", + "metadata": {}, + "source": [ + "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "67b949c3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_heatmap(df, x=\"total_bill\", y=\"tip\", marginal_x=\"histogram\", marginal_y=\"histogram\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b3f10b2e", + "metadata": {}, + "source": [ + "Density heatmaps can also be [faceted](/python/facet-plots/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89108f32", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_heatmap(df, x=\"total_bill\", y=\"tip\", facet_row=\"sex\", facet_col=\"smoker\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9be862a0", + "metadata": {}, + "source": [ + "### Displaying Text\n", + "\n", + "*New in v5.5*\n", + "\n", + "You can add the `z` values as text using the `text_auto` argument. Setting it to `True` will display the values on the bars, and setting it to a `d3-format` formatting string will control the output format." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f015060b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_heatmap(df, x=\"total_bill\", y=\"tip\", text_auto=True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "24efb450", + "metadata": {}, + "source": [ + "### Other aggregation functions than `count`\n", + "\n", + "By passing in a `z` value and a `histfunc`, density heatmaps can perform basic aggregation operations. Here we show average Sepal Length grouped by Petal Length and Petal Width for the Iris dataset." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c9ba9116", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "\n", + "fig = px.density_heatmap(df, x=\"petal_length\", y=\"petal_width\", z=\"sepal_length\", histfunc=\"avg\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "23bc9473", + "metadata": {}, + "source": [ + "### 2D Histograms with Graph Objects\n", + "\n", + "To build this kind of figure using [graph objects](/python/graph-objects/) without using Plotly Express, we can use the `go.Histogram2d` class." + ] + }, + { + "cell_type": "markdown", + "id": "826868e8", + "metadata": {}, + "source": [ + "### 2D Histogram of a Bivariate Normal Distribution ###" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3149fb4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "x = np.random.randn(500)\n", + "y = np.random.randn(500)+1\n", + "\n", + "fig = go.Figure(go.Histogram2d(\n", + " x=x,\n", + " y=y\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "87b282dc", + "metadata": {}, + "source": [ + "### 2D Histogram Binning and Styling Options ###" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fca0188c", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "x = np.random.randn(500)\n", + "y = np.random.randn(500)+1\n", + "\n", + "fig = go.Figure(go.Histogram2d(x=x, y=y, histnorm='probability',\n", + " autobinx=False,\n", + " xbins=dict(start=-3, end=3, size=0.1),\n", + " autobiny=False,\n", + " ybins=dict(start=-2.5, end=4, size=0.1),\n", + " colorscale=[[0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'], [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'], [1, 'rgb(217,30,30)']]\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "491606f4", + "metadata": {}, + "source": [ + "### Sharing bin settings between 2D Histograms\n", + "This example shows how to use [bingroup](https://plotly.com/python/reference/histogram/#histogram-bingroup) attribute to have a compatible bin settings for both histograms. To define `start`, `end` and `size` value of x-axis and y-axis separately, set [ybins](https://plotly.com/python/reference/histogram2dcontour/#histogram2dcontour-ybins) and `xbins`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b2dbe0a5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(2,2)\n", + "fig.add_trace(go.Histogram2d(\n", + " x = [ 1, 2, 2, 3, 4 ],\n", + " y = [ 1, 2, 2, 3, 4 ],\n", + " coloraxis = \"coloraxis\",\n", + " xbins = {'start':1, 'size':1}), 1,1)\n", + "fig.add_trace(go.Histogram2d(\n", + " x = [ 4, 5, 5, 5, 6 ],\n", + " y = [ 4, 5, 5, 5, 6 ],\n", + " coloraxis = \"coloraxis\",\n", + " ybins = {'start': 3, 'size': 1}),1,2)\n", + "fig.add_trace(go.Histogram2d(\n", + " x = [ 1, 2, 2, 3, 4 ],\n", + " y = [ 1, 2, 2, 3, 4 ],\n", + " bingroup = 1,\n", + " coloraxis = \"coloraxis\",\n", + " xbins = {'start':1, 'size':1}), 2,1)\n", + "fig.add_trace(go.Histogram2d(\n", + " x = [ 4, 5, 5, 5, 6 ],\n", + " y = [ 4, 5, 5, 5, 6 ],\n", + " bingroup = 1,\n", + " coloraxis = \"coloraxis\",\n", + " ybins = {'start': 3, 'size': 1}),2,2)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7a322e08", + "metadata": {}, + "source": [ + "### 2D Histogram Overlaid with a Scatter Chart ###" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d2342ee", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "x0 = np.random.randn(100)/5. + 0.5 # 5. enforces float division\n", + "y0 = np.random.randn(100)/5. + 0.5\n", + "x1 = np.random.rand(50)\n", + "y1 = np.random.rand(50) + 1.0\n", + "\n", + "x = np.concatenate([x0, x1])\n", + "y = np.concatenate([y0, y1])\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=x0,\n", + " y=y0,\n", + " mode='markers',\n", + " showlegend=False,\n", + " marker=dict(\n", + " symbol='x',\n", + " opacity=0.7,\n", + " color='white',\n", + " size=8,\n", + " line=dict(width=1),\n", + " )\n", + "))\n", + "fig.add_trace(go.Scatter(\n", + " x=x1,\n", + " y=y1,\n", + " mode='markers',\n", + " showlegend=False,\n", + " marker=dict(\n", + " symbol='circle',\n", + " opacity=0.7,\n", + " color='white',\n", + " size=8,\n", + " line=dict(width=1),\n", + " )\n", + "))\n", + "fig.add_trace(go.Histogram2d(\n", + " x=x,\n", + " y=y,\n", + " colorscale='YlGnBu',\n", + " zmax=10,\n", + " nbinsx=14,\n", + " nbinsy=14,\n", + " zauto=False,\n", + "))\n", + "\n", + "fig.update_layout(\n", + " xaxis=dict( ticks='', showgrid=False, zeroline=False, nticks=20 ),\n", + " yaxis=dict( ticks='', showgrid=False, zeroline=False, nticks=20 ),\n", + " autosize=False,\n", + " height=550,\n", + " width=550,\n", + " hovermode='closest',\n", + "\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "60b1861f", + "metadata": {}, + "source": [ + "### Text on 2D Histogram Points\n", + "\n", + "In this example we add text to 2D Histogram points. We use the values from the `z` attribute for the text." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ac655123", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.tips()\n", + "\n", + "fig = go.Figure(go.Histogram2d(\n", + " x=df.total_bill,\n", + " y=df.tip,\n", + " texttemplate= \"%{z}\"\n", + " ))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cee4594b", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/histogram2d/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "423b7747", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.11" + }, + "plotly": { + "description": "How to make 2D Histograms in Python with Plotly.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "2D Histograms", + "order": 5, + "page_type": "u-guide", + "permalink": "python/2D-Histogram/", + "redirect_from": [ + "python/2d-histograms/" + ], + "thumbnail": "thumbnail/histogram2d.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/2d-histogram-contour.ipynb b/2d-histogram-contour.ipynb new file mode 100644 index 000000000..12d9cb855 --- /dev/null +++ b/2d-histogram-contour.ipynb @@ -0,0 +1,401 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "578f43ab", + "metadata": {}, + "source": [ + "## 2D Histogram Contours or Density Contours\n", + "\n", + "A 2D histogram contour plot, also known as a density contour plot, is a 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [contour plot](/python/contour-plots/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the value to be used to compute contours. This kind of visualization (and the related [2D histogram, or density heatmap](/python/2D-Histogram/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns.\n", + "\n", + "## Density Contours with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/). The Plotly Express function `density_contour()` can be used to produce density contours." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cad8cce1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_contour(df, x=\"total_bill\", y=\"tip\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9d5f416d", + "metadata": {}, + "source": [ + "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a32e159", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_contour(df, x=\"total_bill\", y=\"tip\", marginal_x=\"histogram\", marginal_y=\"histogram\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a741522a", + "metadata": {}, + "source": [ + "Density contours can also be [faceted](/python/facet-plots/) and [discretely colored](/python/discrete-color/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63f77a30", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_contour(df, x=\"total_bill\", y=\"tip\", facet_col=\"sex\", color=\"smoker\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8c470fb9", + "metadata": {}, + "source": [ + "Plotly Express density contours can be [continuously-colored](/python/colorscales/) and labeled:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bc5c58c0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "\n", + "fig = px.density_contour(df, x=\"total_bill\", y=\"tip\")\n", + "fig.update_traces(contours_coloring=\"fill\", contours_showlabels = True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "abbff28b", + "metadata": {}, + "source": [ + "### Other aggregation functions than `count`\n", + "\n", + "By passing in a `z` value and a `histfunc`, density contours can perform basic aggregation operations. Here we show average Sepal Length grouped by Petal Length and Petal Width for the Iris dataset." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f53f2c7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "\n", + "fig = px.density_contour(df, x=\"petal_length\", y=\"petal_width\", z=\"sepal_length\", histfunc=\"avg\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6b5b9513", + "metadata": {}, + "source": [ + "### 2D Histograms with Graph Objects\n", + "\n", + "To build this kind of figure with [graph objects](/python/graph-objects/) without using Plotly Express, we can use the `go.Histogram2d` class.\n", + "\n", + "#### Basic 2D Histogram Contour" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1009f306", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "x = np.random.uniform(-1, 1, size=500)\n", + "y = np.random.uniform(-1, 1, size=500)\n", + "\n", + "fig = go.Figure(go.Histogram2dContour(\n", + " x = x,\n", + " y = y\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d42837b7", + "metadata": {}, + "source": [ + "#### 2D Histogram Contour Colorscale" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c95c2b1f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "x = np.random.uniform(-1, 1, size=500)\n", + "y = np.random.uniform(-1, 1, size=500)\n", + "\n", + "fig = go.Figure(go.Histogram2dContour(\n", + " x = x,\n", + " y = y,\n", + " colorscale = 'Blues'\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6760ee76", + "metadata": {}, + "source": [ + "#### 2D Histogram Contour Styled" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bdd50930", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "x = np.random.uniform(-1, 1, size=500)\n", + "y = np.random.uniform(-1, 1, size=500)\n", + "\n", + "fig = go.Figure(go.Histogram2dContour(\n", + " x = x,\n", + " y = y,\n", + " colorscale = 'Jet',\n", + " contours = dict(\n", + " showlabels = True,\n", + " labelfont = dict(\n", + " family = 'Raleway',\n", + " color = 'white'\n", + " )\n", + " ),\n", + " hoverlabel = dict(\n", + " bgcolor = 'white',\n", + " bordercolor = 'black',\n", + " font = dict(\n", + " family = 'Raleway',\n", + " color = 'black'\n", + " )\n", + " )\n", + "\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "63441d20", + "metadata": {}, + "source": [ + "#### 2D Histogram Contour Subplot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e75241f8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "t = np.linspace(-1, 1.2, 2000)\n", + "x = (t**3) + (0.3 * np.random.randn(2000))\n", + "y = (t**6) + (0.3 * np.random.randn(2000))\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Histogram2dContour(\n", + " x = x,\n", + " y = y,\n", + " colorscale = 'Blues',\n", + " reversescale = True,\n", + " xaxis = 'x',\n", + " yaxis = 'y'\n", + " ))\n", + "fig.add_trace(go.Scatter(\n", + " x = x,\n", + " y = y,\n", + " xaxis = 'x',\n", + " yaxis = 'y',\n", + " mode = 'markers',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,0.3)',\n", + " size = 3\n", + " )\n", + " ))\n", + "fig.add_trace(go.Histogram(\n", + " y = y,\n", + " xaxis = 'x2',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,1)'\n", + " )\n", + " ))\n", + "fig.add_trace(go.Histogram(\n", + " x = x,\n", + " yaxis = 'y2',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,1)'\n", + " )\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " autosize = False,\n", + " xaxis = dict(\n", + " zeroline = False,\n", + " domain = [0,0.85],\n", + " showgrid = False\n", + " ),\n", + " yaxis = dict(\n", + " zeroline = False,\n", + " domain = [0,0.85],\n", + " showgrid = False\n", + " ),\n", + " xaxis2 = dict(\n", + " zeroline = False,\n", + " domain = [0.85,1],\n", + " showgrid = False\n", + " ),\n", + " yaxis2 = dict(\n", + " zeroline = False,\n", + " domain = [0.85,1],\n", + " showgrid = False\n", + " ),\n", + " height = 600,\n", + " width = 600,\n", + " bargap = 0,\n", + " hovermode = 'closest',\n", + " showlegend = False\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "da0aa3b2", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/histogram2dcontour/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "89ae25db", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + }, + "plotly": { + "description": "How to make 2D Histogram Contour plots in Python with Plotly.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "2D Histogram Contour", + "order": 11, + "page_type": "u-guide", + "permalink": "python/2d-histogram-contour/", + "redirect_from": "python/2d-density-plots/", + "thumbnail": "thumbnail/hist2dcontour.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-axes.ipynb b/3d-axes.ipynb new file mode 100644 index 000000000..ba56c0d28 --- /dev/null +++ b/3d-axes.ipynb @@ -0,0 +1,395 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "9bb9f26e", + "metadata": {}, + "source": [ + "### Range of axes\n", + "\n", + "3D figures have an attribute in `layout` called `scene`, which contains\n", + "attributes such as `xaxis`, `yaxis` and `zaxis` parameters, in order to\n", + "set the range, title, ticks, color etc. of the axes.\n", + "\n", + "For creating 3D charts, see [this page](https://plotly.com/python/3d-charts/).\n", + "\n", + "Set `range` on an axis to manually configure a range for that axis. If you don't set `range`, it's automatically calculated. In this example, we set a `range` on `xaxis`, `yaxis`, and `zaxis`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9601dfdf", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "N = 70\n", + "\n", + "fig = go.Figure(data=[go.Mesh3d(x=(70*np.random.randn(N)),\n", + " y=(55*np.random.randn(N)),\n", + " z=(40*np.random.randn(N)),\n", + " opacity=0.5,\n", + " color='rgba(244,22,100,0.6)'\n", + " )])\n", + "\n", + "fig.update_layout(\n", + " scene = dict(\n", + " xaxis = dict(nticks=4, range=[-100,100],),\n", + " yaxis = dict(nticks=4, range=[-50,100],),\n", + " zaxis = dict(nticks=4, range=[-100,100],),),\n", + " width=700,\n", + " margin=dict(r=20, l=10, b=10, t=10))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "402ced08", + "metadata": {}, + "source": [ + "### Setting only a Lower or Upper Bound for Range\n", + "\n", + "*New in 5.17*\n", + "\n", + "You can also set just a lower or upper bound for `range`. In this case, autorange is used for the other bound. In this example, we apply autorange to the lower bound of the `yaxis` and the upper bound of `zaxis` by setting them to `None`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f3c9ba69", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "N = 70\n", + "\n", + "fig = go.Figure(data=[go.Mesh3d(x=(70*np.random.randn(N)),\n", + " y=(55*np.random.randn(N)),\n", + " z=(40*np.random.randn(N)),\n", + " opacity=0.5,\n", + " color='rgba(244,22,100,0.6)'\n", + " )])\n", + "\n", + "fig.update_layout(\n", + " scene = dict(\n", + " xaxis = dict(nticks=4, range=[-100,100],),\n", + " yaxis = dict(nticks=4, range=[None, 100],),\n", + " zaxis = dict(nticks=4, range=[-100, None],),),\n", + " width=700,\n", + " margin=dict(r=20, l=10, b=10, t=10))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "13da267c", + "metadata": {}, + "source": [ + "### Fixed Ratio Axes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "33444419", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import numpy as np\n", + "\n", + "N = 50\n", + "\n", + "fig = make_subplots(rows=2, cols=2,\n", + " specs=[[{'is_3d': True}, {'is_3d': True}],\n", + " [{'is_3d': True}, {'is_3d': True}]],\n", + " print_grid=False)\n", + "for i in [1,2]:\n", + " for j in [1,2]:\n", + " fig.add_trace(\n", + " go.Mesh3d(\n", + " x=(60*np.random.randn(N)),\n", + " y=(25*np.random.randn(N)),\n", + " z=(40*np.random.randn(N)),\n", + " opacity=0.5,\n", + " ),\n", + " row=i, col=j)\n", + "\n", + "fig.update_layout(width=700, margin=dict(r=10, l=10, b=10, t=10))\n", + "# fix the ratio in the top left subplot to be a cube\n", + "fig.update_layout(scene_aspectmode='cube')\n", + "# manually force the z-axis to appear twice as big as the other two\n", + "fig.update_layout(scene2_aspectmode='manual',\n", + " scene2_aspectratio=dict(x=1, y=1, z=2))\n", + "# draw axes in proportion to the proportion of their ranges\n", + "fig.update_layout(scene3_aspectmode='data')\n", + "# automatically produce something that is well proportioned using 'data' as the default\n", + "fig.update_layout(scene4_aspectmode='auto')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e3d50957", + "metadata": {}, + "source": [ + "### Set Axes Title" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "54023603", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Define random surface\n", + "N = 50\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Mesh3d(x=(60*np.random.randn(N)),\n", + " y=(25*np.random.randn(N)),\n", + " z=(40*np.random.randn(N)),\n", + " opacity=0.5,\n", + " color='yellow'\n", + " ))\n", + "fig.add_trace(go.Mesh3d(x=(70*np.random.randn(N)),\n", + " y=(55*np.random.randn(N)),\n", + " z=(30*np.random.randn(N)),\n", + " opacity=0.5,\n", + " color='pink'\n", + " ))\n", + "\n", + "fig.update_layout(scene = dict(\n", + " xaxis=dict(\n", + " title=dict(\n", + " text='X AXIS TITLE'\n", + " )\n", + " ),\n", + " yaxis=dict(\n", + " title=dict(\n", + " text='Y AXIS TITLE'\n", + " )\n", + " ),\n", + " zaxis=dict(\n", + " title=dict(\n", + " text='Z AXIS TITLE'\n", + " )\n", + " ),\n", + " ),\n", + " width=700,\n", + " margin=dict(r=20, b=10, l=10, t=10))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "510af730", + "metadata": {}, + "source": [ + "### Ticks Formatting" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b7421e50", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Define random surface\n", + "N = 50\n", + "fig = go.Figure(data=[go.Mesh3d(x=(60*np.random.randn(N)),\n", + " y=(25*np.random.randn(N)),\n", + " z=(40*np.random.randn(N)),\n", + " opacity=0.5,\n", + " color='rgba(100,22,200,0.5)'\n", + " )])\n", + "\n", + "# Different types of customized ticks\n", + "fig.update_layout(scene = dict(\n", + " xaxis = dict(\n", + " ticktext= ['TICKS','MESH','PLOTLY','PYTHON'],\n", + " tickvals= [0,50,75,-50]),\n", + " yaxis = dict(\n", + " nticks=5, tickfont=dict(\n", + " color='green',\n", + " size=12,\n", + " family='Old Standard TT, serif',),\n", + " ticksuffix='#'),\n", + " zaxis = dict(\n", + " nticks=4, ticks='outside',\n", + " tick0=0, tickwidth=4),),\n", + " width=700,\n", + " margin=dict(r=10, l=10, b=10, t=10)\n", + " )\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0fbc434a", + "metadata": {}, + "source": [ + "### Background and Grid Color" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ed2160b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "N = 50\n", + "fig = go.Figure(data=[go.Mesh3d(x=(30*np.random.randn(N)),\n", + " y=(25*np.random.randn(N)),\n", + " z=(30*np.random.randn(N)),\n", + " opacity=0.5,)])\n", + "\n", + "\n", + "# xaxis.backgroundcolor is used to set background color\n", + "fig.update_layout(scene = dict(\n", + " xaxis = dict(\n", + " backgroundcolor=\"rgb(200, 200, 230)\",\n", + " gridcolor=\"white\",\n", + " showbackground=True,\n", + " zerolinecolor=\"white\",),\n", + " yaxis = dict(\n", + " backgroundcolor=\"rgb(230, 200,230)\",\n", + " gridcolor=\"white\",\n", + " showbackground=True,\n", + " zerolinecolor=\"white\"),\n", + " zaxis = dict(\n", + " backgroundcolor=\"rgb(230, 230,200)\",\n", + " gridcolor=\"white\",\n", + " showbackground=True,\n", + " zerolinecolor=\"white\",),),\n", + " width=700,\n", + " margin=dict(\n", + " r=10, l=10,\n", + " b=10, t=10)\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e6fd06eb", + "metadata": {}, + "source": [ + "### Disabling tooltip spikes\n", + "\n", + "By default, guidelines originating from the tooltip point are drawn. It is possible to disable this behaviour with the `showspikes` parameter. In this example we only keep the `z` spikes (projection of the tooltip on the `x-y` plane). Hover on the data to show this behaviour." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74e4dc08", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "N = 50\n", + "fig = go.Figure(data=[go.Mesh3d(x=(30*np.random.randn(N)),\n", + " y=(25*np.random.randn(N)),\n", + " z=(30*np.random.randn(N)),\n", + " opacity=0.5,)])\n", + "fig.update_layout(scene=dict(xaxis_showspikes=False,\n", + " yaxis_showspikes=False))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4a0f8e32", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + }, + "plotly": { + "description": "How to format axes of 3d plots in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Axes", + "order": 1, + "page_type": "example_index", + "permalink": "python/3d-axes/", + "thumbnail": "thumbnail/3d-axes.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-bubble-charts.ipynb b/3d-bubble-charts.ipynb new file mode 100644 index 000000000..2eda41c5e --- /dev/null +++ b/3d-bubble-charts.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "8dbf6dc6", + "metadata": {}, + "source": [ + "### 3d Bubble chart with Plotly Express" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d4693501", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "df = px.data.gapminder()\n", + "fig = px.scatter_3d(df, x='year', y='continent', z='pop', size='gdpPercap', color='lifeExp',\n", + " hover_data=['country'])\n", + "fig.update_layout(scene_zaxis_type=\"log\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0536c5f1", + "metadata": {}, + "source": [ + "#### Simple Bubble Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "447699fd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "# Get Data: this ex will only use part of it (i.e. rows 750-1500)\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv')\n", + "\n", + "start, end = 750, 1500\n", + "\n", + "fig = go.Figure(data=go.Scatter3d(\n", + " x=df['year'][start:end],\n", + " y=df['continent'][start:end],\n", + " z=df['pop'][start:end],\n", + " text=df['country'][start:end],\n", + " mode='markers',\n", + " marker=dict(\n", + " sizemode='diameter',\n", + " sizeref=750,\n", + " size=df['gdpPercap'][start:end],\n", + " color = df['lifeExp'][start:end],\n", + " colorscale = 'Viridis',\n", + " colorbar_title = 'Life
Expectancy',\n", + " line_color='rgb(140, 140, 170)'\n", + " )\n", + "))\n", + "\n", + "\n", + "fig.update_layout(height=800, width=800,\n", + " title=dict(text='Examining Population and Life Expectancy Over Time'))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4c3b019c", + "metadata": {}, + "source": [ + "#### Bubble Chart Sized by a Variable\n", + "\n", + "Plot planets' distance from sun, density, and gravity with bubble size based on planet size" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2452fd38", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Pluto']\n", + "planet_colors = ['rgb(135, 135, 125)', 'rgb(210, 50, 0)', 'rgb(50, 90, 255)',\n", + " 'rgb(178, 0, 0)', 'rgb(235, 235, 210)', 'rgb(235, 205, 130)',\n", + " 'rgb(55, 255, 217)', 'rgb(38, 0, 171)', 'rgb(255, 255, 255)']\n", + "distance_from_sun = [57.9, 108.2, 149.6, 227.9, 778.6, 1433.5, 2872.5, 4495.1, 5906.4]\n", + "density = [5427, 5243, 5514, 3933, 1326, 687, 1271, 1638, 2095]\n", + "gravity = [3.7, 8.9, 9.8, 3.7, 23.1, 9.0, 8.7, 11.0, 0.7]\n", + "planet_diameter = [4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528, 2370]\n", + "\n", + "# Create trace, sizing bubbles by planet diameter\n", + "fig = go.Figure(data=go.Scatter3d(\n", + " x = distance_from_sun,\n", + " y = density,\n", + " z = gravity,\n", + " text = planets,\n", + " mode = 'markers',\n", + " marker = dict(\n", + " sizemode = 'diameter',\n", + " sizeref = 750, # info on sizeref: https://plotly.com/python/reference/scatter/#scatter-marker-sizeref\n", + " size = planet_diameter,\n", + " color = planet_colors,\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(\n", + " width=800,\n", + " height=800,\n", + " title=dict(text=\"Planets!\"),\n", + " scene=dict(\n", + " xaxis=dict(\n", + " title=dict(\n", + " text=\"Distance from Sun\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Density\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " zaxis=dict(\n", + " title=dict(\n", + " text=\"Gravity\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " bgcolor=\"rgb(20, 24, 54)\"\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "df02d827", + "metadata": {}, + "source": [ + "#### Edit the Colorbar\n", + "\n", + "Plot planets' distance from sun, density, and gravity with bubble size based on planet size" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a63efcf", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Pluto']\n", + "temperatures = [167, 464, 15, -20, -65, -110, -140, -195, -200, -225]\n", + "distance_from_sun = [57.9, 108.2, 149.6, 227.9, 778.6, 1433.5, 2872.5, 4495.1, 5906.4]\n", + "density = [5427, 5243, 5514, 3933, 1326, 687, 1271, 1638, 2095]\n", + "gravity = [3.7, 8.9, 9.8, 3.7, 23.1, 9.0, 8.7, 11.0, 0.7]\n", + "planet_diameter = [4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528, 2370]\n", + "\n", + "# Create trace, sizing bubbles by planet diameter\n", + "fig = go.Figure(go.Scatter3d(\n", + " x = distance_from_sun,\n", + " y = density,\n", + " z = gravity,\n", + " text = planets,\n", + " mode = 'markers',\n", + " marker = dict(\n", + " sizemode = 'diameter',\n", + " sizeref = 750, # info on sizeref: https://plotly.com/python/reference/scatter/#scatter-marker-sizeref\n", + " size = planet_diameter,\n", + " color = temperatures,\n", + " colorbar_title = 'Mean
Temperature',\n", + " colorscale=[[0, 'rgb(5, 10, 172)'], [.3, 'rgb(255, 255, 255)'], [1, 'rgb(178, 10, 28)']]\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(\n", + " width=800,\n", + " height=800,\n", + " title=dict(text=\"Planets!\"),\n", + " scene=dict(\n", + " xaxis=dict(\n", + " title=dict(\n", + " text=\"Distance from Sun\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Density\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " zaxis=dict(\n", + " title=dict(\n", + " text=\"Gravity\",\n", + " font=dict(\n", + " color=\"white\"\n", + " )\n", + " )\n", + " ),\n", + " bgcolor=\"rgb(20, 24, 54)\"\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b71dcc6d", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See https://plotly.com/python/reference/scatter3d/ and https://plotly.com/python/reference/scatter/#scatter-marker-sizeref
for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "fbc79fd9", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "How to make 3D Bubble Charts in Python with Plotly. Three examples of 3D Bubble Charts.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Bubble Charts", + "order": 6, + "page_type": "u-guide", + "permalink": "python/3d-bubble-charts/", + "thumbnail": "thumbnail/3dbubble.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-camera-controls.ipynb b/3d-camera-controls.ipynb new file mode 100644 index 000000000..c975a096d --- /dev/null +++ b/3d-camera-controls.ipynb @@ -0,0 +1,452 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "8dab23b0", + "metadata": {}, + "source": [ + "### How camera controls work\n", + "\n", + "The camera position and direction is determined by three vectors: *up*, *center*, *eye*. Their coordinates refer to the 3-d domain, i.e., `(0, 0, 0)` is always the center of the domain, no matter data values.\n", + "The `eye` vector determines the position of the camera. The default is $(x=1.25, y=1.25, z=1.25)$.\n", + "\n", + "The `up` vector determines the `up` direction on the page. The default is $(x=0, y=0, z=1)$, that is, the z-axis points up.\n", + "\n", + "The projection of the `center` point lies at the center of the view. By default it is $(x=0, y=0, z=0)$." + ] + }, + { + "cell_type": "markdown", + "id": "6679256d", + "metadata": {}, + "source": [ + "### Default parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f9654caf", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=40, r=0, l=20, b=20)\n", + ")\n", + "\n", + "name = 'default'\n", + "# Default parameters which are used when `layout.scene.camera` is not provided\n", + "camera = dict(\n", + " up=dict(x=0, y=0, z=1),\n", + " center=dict(x=0, y=0, z=0),\n", + " eye=dict(x=1.25, y=1.25, z=1.25)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "66df7136", + "metadata": {}, + "source": [ + "### Changing the camera position by setting the eye parameter\n", + "\n", + "#### Lower the View Point\n", + "\n", + "by setting `eye.z` to a smaller value." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f91249c2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:2, y:2, z:0.1)'\n", + "camera = dict(\n", + " eye=dict(x=2, y=2, z=0.1)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f1b6042e", + "metadata": {}, + "source": [ + "#### X-Z plane\n", + "\n", + "set `eye.x` and `eye.z` to zero" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8fab17af", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:0., y:2.5, z:0.)'\n", + "camera = dict(\n", + " eye=dict(x=0., y=2.5, z=0.)\n", + ")\n", + "\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6cb5bf8a", + "metadata": {}, + "source": [ + "#### Y-Z plane" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ea1b5cf2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:2.5, y:0., z:0.)'\n", + "camera = dict(\n", + " eye=dict(x=2.5, y=0., z=0.)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3a0193e", + "metadata": {}, + "source": [ + "#### View from Above (X-Y plane)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ddcf0ea4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:0., y:0., z:2.5)'\n", + "camera = dict(\n", + " eye=dict(x=0., y=0., z=2.5)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "51537395", + "metadata": {}, + "source": [ + "#### Zooming In\n", + "... by placing the camera closer to the origin (`eye` with a smaller norm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3999c810", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:0.1, y:0.1, z:1.5)'\n", + "camera = dict(\n", + " eye=dict(x=0.1, y=0.1, z=1.5)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "13e6c1e6", + "metadata": {}, + "source": [ + "### Tilting the camera vertical by setting the up parameter\n", + "\n", + "Tilt camera by changing the `up` vector: here the vertical of the view points in the `x` direction." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e488f245", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "name = 'eye = (x:0., y:2.5, z:0.), point along x'\n", + "camera = dict(\n", + " up=dict(x=1, y=0., z=0),\n", + " eye=dict(x=0., y=2.5, z=0.)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d039ae46", + "metadata": {}, + "source": [ + "Note when `up` does not correspond to the direction of an axis, you also need to set `layout.scene.dragmode='orbit'`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "67f70500", + "metadata": {}, + "outputs": [], + "source": [ + "import math\n", + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=30, r=0, l=20, b=10)\n", + ")\n", + "\n", + "angle = math.pi / 4 # 45 degrees\n", + "\n", + "name = 'vertical is along y+z'\n", + "camera = dict(\n", + " up=dict(x=0, y=math.cos(angle), z=math.sin(angle)),\n", + " eye=dict(x=2, y=0, z=0)\n", + ")\n", + "\n", + "fig.update_layout(scene_camera=camera, scene_dragmode='orbit', title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "397afabe", + "metadata": {}, + "source": [ + "### Changing the focal point by setting center\n", + "\n", + "You can change the focal point (a point which projection lies at the center of the view) by setting the `center` parameter of `camera`. Note how a part of the data is cropped below because the camera is looking up." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "88bcbc55", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=go.Surface(z=z_data, showscale=False))\n", + "fig.update_layout(\n", + " title=dict(text='Mt Bruno Elevation'),\n", + " width=400, height=400,\n", + " margin=dict(t=25, r=0, l=20, b=30)\n", + ")\n", + "\n", + "name = 'looking up'\n", + "camera = dict(\n", + " center=dict(x=0, y=0, z=0.7))\n", + "\n", + "\n", + "fig.update_layout(scene_camera=camera, title=name)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c3f92466", + "metadata": {}, + "source": [ + "#### Reference" + ] + }, + { + "cell_type": "markdown", + "id": "679b2ae7", + "metadata": {}, + "source": [ + "See https://plotly.com/python/reference/layout/scene/#layout-scene-camera for more information and chart attribute options!" + ] + }, + { + "cell_type": "markdown", + "id": "9b62cc45", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to Control the Camera in your 3D Charts in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Camera Controls", + "order": 5, + "permalink": "python/3d-camera-controls/", + "thumbnail": "thumbnail/3d-camera-controls.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-isosurface-plots.ipynb b/3d-isosurface-plots.ipynb new file mode 100644 index 000000000..b279a0cc6 --- /dev/null +++ b/3d-isosurface-plots.ipynb @@ -0,0 +1,375 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d70a3088", + "metadata": {}, + "source": [ + "With ``go.Isosurface``, you can plot [isosurface contours](https://en.wikipedia.org/wiki/Isosurface) of a scalar field ``value``, which is defined on ``x``, ``y`` and ``z`` coordinates.\n", + "\n", + "#### Basic Isosurface\n", + "\n", + "In this first example, we plot the isocontours of values ``isomin=2`` and ``isomax=6``. In addition, portions of the sides of the coordinate domains for which the value is between ``isomin`` and ``isomax`` (named the ``caps``) are colored. Please rotate the figure to visualize both the internal surfaces and the caps surfaces on the sides." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4f6588b5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig= go.Figure(data=go.Isosurface(\n", + " x=[0,0,0,0,1,1,1,1],\n", + " y=[1,0,1,0,1,0,1,0],\n", + " z=[1,1,0,0,1,1,0,0],\n", + " value=[1,2,3,4,5,6,7,8],\n", + " isomin=2,\n", + " isomax=6,\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4c982843", + "metadata": {}, + "source": [ + "### Removing caps when visualizing isosurfaces\n", + "\n", + "For a clearer visualization of internal surfaces, it is possible to remove the caps (color-coded surfaces on the sides of the visualization domain). Caps are visible by default." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eb351d64", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, -5:5:40j]\n", + "\n", + "# ellipsoid\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=10,\n", + " isomax=40,\n", + " caps=dict(x_show=False, y_show=False)\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "772552a3", + "metadata": {}, + "source": [ + "### Modifying the number of isosurfaces" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46f0b4a3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, -5:5:40j]\n", + "\n", + "# ellipsoid\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=10,\n", + " isomax=50,\n", + " surface_count=5, # number of isosurfaces, 2 by default: only min and max\n", + " colorbar_nticks=5, # colorbar ticks correspond to isosurface values\n", + " caps=dict(x_show=False, y_show=False)\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6fae98a7", + "metadata": {}, + "source": [ + "### Changing the opacity of isosurfaces" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f4464107", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, -5:5:40j]\n", + "\n", + "# ellipsoid\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " opacity=0.6,\n", + " isomin=10,\n", + " isomax=50,\n", + " surface_count=3,\n", + " caps=dict(x_show=False, y_show=False)\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2a944190", + "metadata": {}, + "source": [ + "#### Isosurface with Additional Slices\n", + "\n", + "Here we visualize slices parallel to the axes on top of isosurfaces. For a clearer visualization, the `fill` ratio of isosurfaces is decreased below 1 (completely filled)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b5e3a58f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, -5:5:40j]\n", + "\n", + "# ellipsoid\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=5,\n", + " isomax=50,\n", + " surface_fill=0.4,\n", + " caps=dict(x_show=False, y_show=False),\n", + " slices_z=dict(show=True, locations=[-1, -3,]),\n", + " slices_y=dict(show=True, locations=[0]),\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2161d6f0", + "metadata": {}, + "source": [ + "#### Multiple Isosurfaces with Caps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9c0b8806", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, 0:5:20j]\n", + "\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=30,\n", + " isomax=50,\n", + " surface=dict(count=3, fill=0.7, pattern='odd'),\n", + " caps=dict(x_show=True, y_show=True),\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a83f2c34", + "metadata": {}, + "source": [ + "### Changing the default colorscale of isosurfaces" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b752e396", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, -5:5:40j]\n", + "\n", + "# ellipsoid\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " colorscale='BlueRed',\n", + " isomin=10,\n", + " isomax=50,\n", + " surface_count=3,\n", + " caps=dict(x_show=False, y_show=False)\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d115cf10", + "metadata": {}, + "source": [ + "### Customizing the layout and appearance of isosurface plots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d0caa95a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-5:5:40j, -5:5:40j, 0:5:20j]\n", + "\n", + "values = X * X * 0.5 + Y * Y + Z * Z * 2\n", + "\n", + "fig = go.Figure(data=go.Isosurface(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=30,\n", + " isomax=50,\n", + " surface=dict(count=3, fill=0.7, pattern='odd'),\n", + " showscale=False, # remove colorbar\n", + " caps=dict(x_show=True, y_show=True),\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " margin=dict(t=0, l=0, b=0), # tight layout\n", + " scene_camera_eye=dict(x=1.86, y=0.61, z=0.98))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8d4102d3", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/isosurface/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "46cfcb6c", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make 3D Isosurface Plots in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Isosurface Plots", + "order": 10, + "page_type": "u-guide", + "permalink": "python/3d-isosurface-plots/", + "redirect_from": "python/isosurfaces-with-marching-cubes/", + "thumbnail": "thumbnail/isosurface.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-line-plots.ipynb b/3d-line-plots.ipynb new file mode 100644 index 000000000..efde7da4b --- /dev/null +++ b/3d-line-plots.ipynb @@ -0,0 +1,191 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1b2b8f2b", + "metadata": {}, + "source": [ + "### 3D Line plot with Plotly Express" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ed3005d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"country=='Brazil'\")\n", + "fig = px.line_3d(df, x=\"gdpPercap\", y=\"pop\", z=\"year\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d2db2cb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"continent=='Europe'\")\n", + "fig = px.line_3d(df, x=\"gdpPercap\", y=\"pop\", z=\"year\", color='country')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "83289632", + "metadata": {}, + "source": [ + "#### 3D Line Plot of Brownian Motion\n", + "\n", + "Here we represent a trajectory in 3D." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5959800e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "rs = np.random.RandomState()\n", + "rs.seed(0)\n", + "\n", + "def brownian_motion(T = 1, N = 100, mu = 0.1, sigma = 0.01, S0 = 20):\n", + " dt = float(T)/N\n", + " t = np.linspace(0, T, N)\n", + " W = rs.standard_normal(size = N)\n", + " W = np.cumsum(W)*np.sqrt(dt) # standard brownian motion\n", + " X = (mu-0.5*sigma**2)*t + sigma*W\n", + " S = S0*np.exp(X) # geometric brownian motion\n", + " return S\n", + "\n", + "dates = pd.date_range('2012-01-01', '2013-02-22')\n", + "T = (dates.max()-dates.min()).days / 365\n", + "N = dates.size\n", + "start_price = 100\n", + "y = brownian_motion(T, N, sigma=0.1, S0=start_price)\n", + "z = brownian_motion(T, N, sigma=0.1, S0=start_price)\n", + "\n", + "fig = go.Figure(data=go.Scatter3d(\n", + " x=dates, y=y, z=z,\n", + " marker=dict(\n", + " size=4,\n", + " color=z,\n", + " colorscale='Viridis',\n", + " ),\n", + " line=dict(\n", + " color='darkblue',\n", + " width=2\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(\n", + " width=800,\n", + " height=700,\n", + " autosize=False,\n", + " scene=dict(\n", + " camera=dict(\n", + " up=dict(\n", + " x=0,\n", + " y=0,\n", + " z=1\n", + " ),\n", + " eye=dict(\n", + " x=0,\n", + " y=1.0707,\n", + " z=1,\n", + " )\n", + " ),\n", + " aspectratio = dict( x=1, y=1, z=0.7 ),\n", + " aspectmode = 'manual'\n", + " ),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "cb632b43", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.(line_3d)`](https://plotly.com/python-api-reference/generated/plotly.express.line_3d) or https://plotly.com/python/reference/scatter3d/#scatter3d-marker-line for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "63b7b008", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make 3D Line Plots", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Line Plots", + "order": 7, + "page_type": "u-guide", + "permalink": "python/3d-line-plots/", + "thumbnail": "thumbnail/3d-line.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-mesh.ipynb b/3d-mesh.ipynb new file mode 100644 index 000000000..13023226c --- /dev/null +++ b/3d-mesh.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "51798fe8", + "metadata": {}, + "source": [ + "### Simple 3D Mesh example ###\n", + "\n", + "`go.Mesh3d` draws a 3D set of triangles with vertices given by `x`, `y` and `z`. If only coordinates are given, an algorithm such as [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used to draw the triangles. Otherwise the triangles can be given using the `i`, `j` and `k` parameters (see examples below)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8906b45f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Download data set from plotly repo\n", + "pts = np.loadtxt(np.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt'))\n", + "x, y, z = pts.T\n", + "\n", + "fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z, color='lightpink', opacity=0.50)])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "aa481809", + "metadata": {}, + "source": [ + "### 3D Mesh example with Alphahull" + ] + }, + { + "cell_type": "markdown", + "id": "75f0cd52", + "metadata": {}, + "source": [ + "The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0dbab7a8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "pts = np.loadtxt(np.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt'))\n", + "x, y, z = pts.T\n", + "\n", + "fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z,\n", + " alphahull=5,\n", + " opacity=0.4,\n", + " color='cyan')])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "19972ae1", + "metadata": {}, + "source": [ + "### 3D Mesh in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5212c7d1", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + '3d-mesh', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "c472884c", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "3ab8f99e", + "metadata": {}, + "source": [ + "### Mesh Tetrahedron\n", + "\n", + "In this example we use the `i`, `j` and `k` parameters to specify manually the geometry of the triangles of the mesh." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c39ebebb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[\n", + " go.Mesh3d(\n", + " x=[0, 1, 2, 0],\n", + " y=[0, 0, 1, 2],\n", + " z=[0, 2, 0, 1],\n", + " colorbar=dict(title=dict(text='z')),\n", + " colorscale=[[0, 'gold'],\n", + " [0.5, 'mediumturquoise'],\n", + " [1, 'magenta']],\n", + " # Intensity of each vertex, which will be interpolated and color-coded\n", + " intensity=[0, 0.33, 0.66, 1],\n", + " # i, j and k give the vertices of triangles\n", + " # here we represent the 4 triangles of the tetrahedron surface\n", + " i=[0, 0, 0, 1],\n", + " j=[1, 2, 3, 2],\n", + " k=[2, 3, 1, 3],\n", + " name='y',\n", + " showscale=True\n", + " )\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "caa62d5f", + "metadata": {}, + "source": [ + "### Mesh Cube" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "40b3600a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "fig = go.Figure(data=[\n", + " go.Mesh3d(\n", + " # 8 vertices of a cube\n", + " x=[0, 0, 1, 1, 0, 0, 1, 1],\n", + " y=[0, 1, 1, 0, 0, 1, 1, 0],\n", + " z=[0, 0, 0, 0, 1, 1, 1, 1],\n", + " colorbar=dict(title=dict(text='z')),\n", + " colorscale=[[0, 'gold'],\n", + " [0.5, 'mediumturquoise'],\n", + " [1, 'magenta']],\n", + " # Intensity of each vertex, which will be interpolated and color-coded\n", + " intensity = np.linspace(0, 1, 8, endpoint=True),\n", + " # i, j and k give the vertices of triangles\n", + " i = [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],\n", + " j = [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],\n", + " k = [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],\n", + " name='y',\n", + " showscale=True\n", + " )\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f0ce0c12", + "metadata": {}, + "source": [ + "### Intensity values defined on vertices or cells\n", + "\n", + "The `intensitymode` attribute of `go.Mesh3d` can be set to `vertex` (default mode, in which case intensity values are interpolated between values defined on vertices), or to `cell` (value of the whole cell, no interpolation). Note that the `intensity` parameter should have the same length as the number of vertices or cells, depending on the `intensitymode`.\n", + "\n", + "Whereas the previous example used the default `intensitymode='vertex'`, we plot here the same mesh with `intensitymode='cell'`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "303e9046", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "fig = go.Figure(data=[\n", + " go.Mesh3d(\n", + " # 8 vertices of a cube\n", + " x=[0, 0, 1, 1, 0, 0, 1, 1],\n", + " y=[0, 1, 1, 0, 0, 1, 1, 0],\n", + " z=[0, 0, 0, 0, 1, 1, 1, 1],\n", + " colorbar=dict(title=dict(text='z')),\n", + " colorscale=[[0, 'gold'],\n", + " [0.5, 'mediumturquoise'],\n", + " [1, 'magenta']],\n", + " # Intensity of each vertex, which will be interpolated and color-coded\n", + " intensity = np.linspace(0, 1, 12, endpoint=True),\n", + " intensitymode='cell',\n", + " # i, j and k give the vertices of triangles\n", + " i = [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],\n", + " j = [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],\n", + " k = [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],\n", + " name='y',\n", + " showscale=True\n", + " )\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8f132268", + "metadata": {}, + "source": [ + "## Reference\n", + "See https://plotly.com/python/reference/mesh3d/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "c6e2cb1a", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to make 3D Mesh Plots", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Mesh Plots", + "order": 9, + "page_type": "u-guide", + "permalink": "python/3d-mesh/", + "thumbnail": "thumbnail/3d-mesh.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-scatter-plots.ipynb b/3d-scatter-plots.ipynb new file mode 100644 index 000000000..8696c1142 --- /dev/null +++ b/3d-scatter-plots.ipynb @@ -0,0 +1,262 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ebb4c1a0", + "metadata": {}, + "source": [ + "## 3D scatter plot with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "Like the [2D scatter plot](https://plotly.com/python/line-and-scatter/) `px.scatter`, the 3D function `px.scatter_3d` plots individual data in three-dimensional space." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a8cf608", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',\n", + " color='species')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a8525f48", + "metadata": {}, + "source": [ + "A 4th dimension of the data can be represented thanks to the color of the markers. Also, values from the `species` column are used below to assign symbols to markers." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d9c50203", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',\n", + " color='petal_length', symbol='species')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5cdbbc96", + "metadata": {}, + "source": [ + "#### Style 3d scatter plot\n", + "\n", + "It is possible to customize the style of the figure through the parameters of `px.scatter_3d` for some options, or by updating the traces or the layout of the figure through `fig.update`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "252bb271", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',\n", + " color='petal_length', size='petal_length', size_max=18,\n", + " symbol='species', opacity=0.7)\n", + "\n", + "# tight layout\n", + "fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7061709b", + "metadata": {}, + "source": [ + "#### 3d scatter plots in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1053d390", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + '3d-scatter-plots', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "8261a38a", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "cafef261", + "metadata": {}, + "source": [ + "### 3D Scatter Plot with go.Scatter3d\n", + "\n", + "#### Basic 3D Scatter Plot\n", + "\n", + "If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Scatter3D` class from `plotly.graph_objects`](/python/graph-objects/).\n", + "Like the [2D scatter plot](https://plotly.com/python/line-and-scatter/) `go.Scatter`, `go.Scatter3d` plots individual data in three-dimensional space." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "51a057cc", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Helix equation\n", + "t = np.linspace(0, 10, 50)\n", + "x, y, z = np.cos(t), np.sin(t), t\n", + "\n", + "fig = go.Figure(data=[go.Scatter3d(x=x, y=y, z=z,\n", + " mode='markers')])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e334c9d1", + "metadata": {}, + "source": [ + "#### 3D Scatter Plot with Colorscaling and Marker Styling" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "993fbad0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Helix equation\n", + "t = np.linspace(0, 20, 100)\n", + "x, y, z = np.cos(t), np.sin(t), t\n", + "\n", + "fig = go.Figure(data=[go.Scatter3d(\n", + " x=x,\n", + " y=y,\n", + " z=z,\n", + " mode='markers',\n", + " marker=dict(\n", + " size=12,\n", + " color=z, # set color to an array/list of desired values\n", + " colorscale='Viridis', # choose a colorscale\n", + " opacity=0.8\n", + " )\n", + ")])\n", + "\n", + "# tight layout\n", + "fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c1897dd4", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.scatter_3d()`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_3d) or https://plotly.com/python/reference/scatter3d/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "b1872dd0", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to make 3D scatter plots in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Scatter Plots", + "order": 2, + "page_type": "example_index", + "permalink": "python/3d-scatter-plots/", + "thumbnail": "thumbnail/3d-scatter.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-subplots.ipynb b/3d-subplots.ipynb new file mode 100644 index 000000000..ec7e8733a --- /dev/null +++ b/3d-subplots.ipynb @@ -0,0 +1,143 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "762e5b43", + "metadata": {}, + "source": [ + "#### 3D Surface Subplots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c760e8e4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "import numpy as np\n", + "\n", + "# Initialize figure with 4 3D subplots\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " specs=[[{'type': 'surface'}, {'type': 'surface'}],\n", + " [{'type': 'surface'}, {'type': 'surface'}]])\n", + "\n", + "# Generate data\n", + "x = np.linspace(-5, 80, 10)\n", + "y = np.linspace(-5, 60, 10)\n", + "xGrid, yGrid = np.meshgrid(y, x)\n", + "z = xGrid ** 3 + yGrid ** 3\n", + "\n", + "# adding surfaces to subplots.\n", + "fig.add_trace(\n", + " go.Surface(x=x, y=y, z=z, colorscale='Viridis', showscale=False),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(\n", + " go.Surface(x=x, y=y, z=z, colorscale='RdBu', showscale=False),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(\n", + " go.Surface(x=x, y=y, z=z, colorscale='YlOrRd', showscale=False),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(\n", + " go.Surface(x=x, y=y, z=z, colorscale='YlGnBu', showscale=False),\n", + " row=2, col=2)\n", + "\n", + "fig.update_layout(\n", + " title_text='3D subplots with different colorscales',\n", + " height=800,\n", + " width=800\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6b32dff8", + "metadata": {}, + "source": [ + "#### Reference" + ] + }, + { + "cell_type": "markdown", + "id": "0078256c", + "metadata": {}, + "source": [ + "See https://plotly.com/python/subplots/ for more information regarding subplots!" + ] + }, + { + "cell_type": "markdown", + "id": "726ae258", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "3D Subplots in Plotly", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Subplots", + "order": 4, + "page_type": "example_index", + "permalink": "python/3d-subplots/", + "thumbnail": "thumbnail/3d-subplots.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-surface-plots.ipynb b/3d-surface-plots.ipynb new file mode 100644 index 000000000..bd0777ee0 --- /dev/null +++ b/3d-surface-plots.ipynb @@ -0,0 +1,329 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e38136c2", + "metadata": {}, + "source": [ + "#### Topographical 3D Surface Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "db247622", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=[go.Surface(z=z_data.values)])\n", + "\n", + "fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,\n", + " width=500, height=500,\n", + " margin=dict(l=65, r=50, b=65, t=90))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4e38bf3d", + "metadata": {}, + "source": [ + "### Passing x and y data to 3D Surface Plot\n", + "\n", + "If you do not specify `x` and `y` coordinates, integer indices are used for the `x` and `y` axis. You can also pass `x` and `y` values to `go.Surface`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "982ac4a7", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "import numpy as np\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "z = z_data.values\n", + "sh_0, sh_1 = z.shape\n", + "x, y = np.linspace(0, 1, sh_0), np.linspace(0, 1, sh_1)\n", + "fig = go.Figure(data=[go.Surface(z=z, x=x, y=y)])\n", + "fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,\n", + " width=500, height=500,\n", + " margin=dict(l=65, r=50, b=65, t=90))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fd9e7ab7", + "metadata": {}, + "source": [ + "#### Surface Plot With Contours" + ] + }, + { + "cell_type": "markdown", + "id": "3b06a814", + "metadata": {}, + "source": [ + "Display and customize contour data for each axis using the `contours` attribute ([reference](https://plotly.com/python/reference/surface/#surface-contours))." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ce6232db", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "# Read data from a csv\n", + "z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')\n", + "\n", + "fig = go.Figure(data=[go.Surface(z=z_data.values)])\n", + "fig.update_traces(contours_z=dict(show=True, usecolormap=True,\n", + " highlightcolor=\"limegreen\", project_z=True))\n", + "fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,\n", + " scene_camera_eye=dict(x=1.87, y=0.88, z=-0.64),\n", + " width=500, height=500,\n", + " margin=dict(l=65, r=50, b=65, t=90)\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ea1eec22", + "metadata": {}, + "source": [ + "#### Configure Surface Contour Levels\n", + "This example shows how to slice the surface graph on the desired position for each of x, y and z axis. [contours.x.start](https://plotly.com/python/reference/surface/#surface-contours-x-start) sets the starting contour level value, `end` sets the end of it, and `size` sets the step between each contour level." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "adfbb06f", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Surface(\n", + " contours = {\n", + " \"x\": {\"show\": True, \"start\": 1.5, \"end\": 2, \"size\": 0.04, \"color\":\"white\"},\n", + " \"z\": {\"show\": True, \"start\": 0.5, \"end\": 0.8, \"size\": 0.05}\n", + " },\n", + " x = [1,2,3,4,5],\n", + " y = [1,2,3,4,5],\n", + " z = [\n", + " [0, 1, 0, 1, 0],\n", + " [1, 0, 1, 0, 1],\n", + " [0, 1, 0, 1, 0],\n", + " [1, 0, 1, 0, 1],\n", + " [0, 1, 0, 1, 0]\n", + " ]))\n", + "fig.update_layout(\n", + " scene = {\n", + " \"xaxis\": {\"nticks\": 20},\n", + " \"zaxis\": {\"nticks\": 4},\n", + " 'camera_eye': {\"x\": 0, \"y\": -1, \"z\": 0.5},\n", + " \"aspectratio\": {\"x\": 1, \"y\": 1, \"z\": 0.2}\n", + " })\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c37c1ab0", + "metadata": {}, + "source": [ + "#### Multiple 3D Surface Plots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4fc5914d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "z1 = np.array([\n", + " [8.83,8.89,8.81,8.87,8.9,8.87],\n", + " [8.89,8.94,8.85,8.94,8.96,8.92],\n", + " [8.84,8.9,8.82,8.92,8.93,8.91],\n", + " [8.79,8.85,8.79,8.9,8.94,8.92],\n", + " [8.79,8.88,8.81,8.9,8.95,8.92],\n", + " [8.8,8.82,8.78,8.91,8.94,8.92],\n", + " [8.75,8.78,8.77,8.91,8.95,8.92],\n", + " [8.8,8.8,8.77,8.91,8.95,8.94],\n", + " [8.74,8.81,8.76,8.93,8.98,8.99],\n", + " [8.89,8.99,8.92,9.1,9.13,9.11],\n", + " [8.97,8.97,8.91,9.09,9.11,9.11],\n", + " [9.04,9.08,9.05,9.25,9.28,9.27],\n", + " [9,9.01,9,9.2,9.23,9.2],\n", + " [8.99,8.99,8.98,9.18,9.2,9.19],\n", + " [8.93,8.97,8.97,9.18,9.2,9.18]\n", + "])\n", + "\n", + "z2 = z1 + 1\n", + "z3 = z1 - 1\n", + "\n", + "fig = go.Figure(data=[\n", + " go.Surface(z=z1),\n", + " go.Surface(z=z2, showscale=False, opacity=0.9),\n", + " go.Surface(z=z3, showscale=False, opacity=0.9)\n", + "\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b943a7ce", + "metadata": {}, + "source": [ + "### Setting the Surface Color\n", + "\n", + "You can use the `surfacecolor` attribute to define the color of the surface of your figure. In this example, the surface color represents the distance from the origin, rather than the default, which is the `z` value." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1882b305", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "# Equation of ring cyclide\n", + "# see https://en.wikipedia.org/wiki/Dupin_cyclide\n", + "import numpy as np\n", + "a, b, d = 1.32, 1., 0.8\n", + "c = a**2 - b**2\n", + "u, v = np.mgrid[0:2*np.pi:100j, 0:2*np.pi:100j]\n", + "x = (d * (c - a * np.cos(u) * np.cos(v)) + b**2 * np.cos(u)) / (a - c * np.cos(u) * np.cos(v))\n", + "y = b * np.sin(u) * (a - d*np.cos(v)) / (a - c * np.cos(u) * np.cos(v))\n", + "z = b * np.sin(v) * (c*np.cos(u) - d) / (a - c * np.cos(u) * np.cos(v))\n", + "\n", + "fig = make_subplots(rows=1, cols=2,\n", + " specs=[[{'is_3d': True}, {'is_3d': True}]],\n", + " subplot_titles=['Color corresponds to z', 'Color corresponds to distance to origin'],\n", + " )\n", + "\n", + "fig.add_trace(go.Surface(x=x, y=y, z=z, colorbar_x=-0.07), 1, 1)\n", + "fig.add_trace(go.Surface(x=x, y=y, z=z, surfacecolor=x**2 + y**2 + z**2), 1, 2)\n", + "fig.update_layout(title_text=\"Ring cyclide\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b7255f31", + "metadata": {}, + "source": [ + "#### Reference" + ] + }, + { + "cell_type": "markdown", + "id": "b3c22655", + "metadata": {}, + "source": [ + "See https://plotly.com/python/reference/surface/ for more information!\n" + ] + }, + { + "cell_type": "markdown", + "id": "540be9eb", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to make 3D-surface plots in Python", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Surface Plots", + "order": 3, + "page_type": "example_index", + "permalink": "python/3d-surface-plots/", + "redirect_from": "python/3d-surface-coloring/", + "thumbnail": "thumbnail/3d-surface.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3d-volume.ipynb b/3d-volume.ipynb new file mode 100644 index 000000000..8a9e295e3 --- /dev/null +++ b/3d-volume.ipynb @@ -0,0 +1,379 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "5158bfb4", + "metadata": {}, + "source": [ + "A volume plot with `go.Volume` shows several partially transparent isosurfaces for volume rendering. The API of `go.Volume` is close to the one of `go.Isosurface`. However, whereas [isosurface plots](/python/3d-isosurface-plots/) show all surfaces with the same opacity, tweaking the `opacityscale` parameter of `go.Volume` results in a depth effect and better volume rendering.\n", + "\n", + "## Simple volume plot with go.Volume\n", + "\n", + "In the three examples below, note that the default colormap is different whether isomin and isomax have the same sign or not." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a412cd65", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "X, Y, Z = np.mgrid[-8:8:40j, -8:8:40j, -8:8:40j]\n", + "values = np.sin(X*Y*Z) / (X*Y*Z)\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=0.1,\n", + " isomax=0.8,\n", + " opacity=0.1, # needs to be small to see through all surfaces\n", + " surface_count=17, # needs to be a large number for good volume rendering\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35a52523", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "X, Y, Z = np.mgrid[-1:1:30j, -1:1:30j, -1:1:30j]\n", + "values = np.sin(np.pi*X) * np.cos(np.pi*Z) * np.sin(np.pi*Y)\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=-0.1,\n", + " isomax=0.8,\n", + " opacity=0.1, # needs to be small to see through all surfaces\n", + " surface_count=21, # needs to be a large number for good volume rendering\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6993ce43", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import plotly.graph_objects as go\n", + "\n", + "# Generate nicely looking random 3D-field\n", + "np.random.seed(0)\n", + "l = 30\n", + "X, Y, Z = np.mgrid[:l, :l, :l]\n", + "vol = np.zeros((l, l, l))\n", + "pts = (l * np.random.rand(3, 15)).astype(int)\n", + "vol[tuple(indices for indices in pts)] = 1\n", + "from scipy import ndimage\n", + "vol = ndimage.gaussian_filter(vol, 4)\n", + "vol /= vol.max()\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(), y=Y.flatten(), z=Z.flatten(),\n", + " value=vol.flatten(),\n", + " isomin=0.2,\n", + " isomax=0.7,\n", + " opacity=0.1,\n", + " surface_count=25,\n", + " ))\n", + "fig.update_layout(scene_xaxis_showticklabels=False,\n", + " scene_yaxis_showticklabels=False,\n", + " scene_zaxis_showticklabels=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9f644a33", + "metadata": {}, + "source": [ + "### Defining the opacity scale of volume plots\n", + "\n", + "In order to see through the volume, the different isosurfaces need to be partially transparent. This transparency is controlled by a global parameter, `opacity`, as well as an opacity scale mapping scalar values to opacity levels. The figure below shows that changing the opacity scale changes a lot the visualization, so that `opacityscale` should be chosen carefully (`uniform` corresponds to a uniform opacity, `min`/`max` maps the minimum/maximum value to a maximal opacity, and `extremes` maps both the minimum and maximum values to maximal opacity, with a dip in between)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "333dad73", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " specs=[[{'type': 'volume'}, {'type': 'volume'}],\n", + " [{'type': 'volume'}, {'type': 'volume'}]])\n", + "\n", + "import numpy as np\n", + "\n", + "X, Y, Z = np.mgrid[-8:8:30j, -8:8:30j, -8:8:30j]\n", + "values = np.sin(X*Y*Z) / (X*Y*Z)\n", + "\n", + "\n", + "fig.add_trace(go.Volume(\n", + " opacityscale=\"uniform\",\n", + " ), row=1, col=1)\n", + "fig.add_trace(go.Volume(\n", + " opacityscale=\"extremes\",\n", + " ), row=1, col=2)\n", + "fig.add_trace(go.Volume(\n", + " opacityscale=\"min\",\n", + " ), row=2, col=1)\n", + "fig.add_trace(go.Volume(\n", + " opacityscale=\"max\",\n", + " ), row=2, col=2)\n", + "fig.update_traces(x=X.flatten(), y=Y.flatten(), z=Z.flatten(), value=values.flatten(),\n", + " isomin=0.15, isomax=0.9, opacity=0.1, surface_count=15)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "463fa282", + "metadata": {}, + "source": [ + "### Defining a custom opacity scale\n", + "\n", + "It is also possible to define a custom opacity scale, mapping scalar values to relative opacity values (between 0 and 1, the maximum opacity is given by the opacity keyword). This is useful to make a range of values completely transparent, as in the example below between -0.2 and 0.2." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "94ac2d65", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "X, Y, Z = np.mgrid[-1:1:30j, -1:1:30j, -1:1:30j]\n", + "values = np.sin(np.pi*X) * np.cos(np.pi*Z) * np.sin(np.pi*Y)\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(),\n", + " y=Y.flatten(),\n", + " z=Z.flatten(),\n", + " value=values.flatten(),\n", + " isomin=-0.5,\n", + " isomax=0.5,\n", + " opacity=0.1, # max opacity\n", + " opacityscale=[[-0.5, 1], [-0.2, 0], [0.2, 0], [0.5, 1]],\n", + " surface_count=21,\n", + " colorscale='RdBu'\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "446ce450", + "metadata": {}, + "source": [ + "### Adding caps to a volume plot\n", + "\n", + "For a clearer visualization of internal surfaces, it is possible to remove the caps (color-coded surfaces on the sides of the visualization domain). Caps are visible by default. Compare below with and without caps." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7e75f6f8", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import plotly.graph_objects as go\n", + "\n", + "\n", + "X, Y, Z = np.mgrid[:1:20j, :1:20j, :1:20j]\n", + "vol = (X - 1)**2 + (Y - 1)**2 + Z**2\n", + "\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(), y=Y.flatten(), z=Z.flatten(),\n", + " value=vol.flatten(),\n", + " isomin=0.2,\n", + " isomax=0.7,\n", + " opacity=0.2,\n", + " surface_count=21,\n", + " caps= dict(x_show=True, y_show=True, z_show=True, x_fill=1), # with caps (default mode)\n", + " ))\n", + "\n", + "# Change camera view for a better view of the sides, XZ plane\n", + "# (see https://plotly.com/python/v3/3d-camera-controls/)\n", + "fig.update_layout(scene_camera = dict(\n", + " up=dict(x=0, y=0, z=1),\n", + " center=dict(x=0, y=0, z=0),\n", + " eye=dict(x=0.1, y=2.5, z=0.1)\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5ff27dc7", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import plotly.graph_objects as go\n", + "\n", + "X, Y, Z = np.mgrid[:1:20j, :1:20j, :1:20j]\n", + "vol = (X - 1)**2 + (Y - 1)**2 + Z**2\n", + "\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(), y=Y.flatten(), z=Z.flatten(),\n", + " value=vol.flatten(),\n", + " isomin=0.2,\n", + " isomax=0.7,\n", + " opacity=0.2,\n", + " surface_count=21,\n", + " caps= dict(x_show=False, y_show=False, z_show=False), # no caps\n", + " ))\n", + "fig.update_layout(scene_camera = dict(\n", + " up=dict(x=0, y=0, z=1),\n", + " center=dict(x=0, y=0, z=0),\n", + " eye=dict(x=0.1, y=2.5, z=0.1)\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e9cd6142", + "metadata": {}, + "source": [ + "### Adding slices to a volume plot\n", + "\n", + "Slices through the volume can be added to the volume plot. In this example the isosurfaces are only partially filled so that the slice is more visible, and the caps were removed for the same purpose." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6518c74c", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import plotly.graph_objects as go\n", + "\n", + "X, Y, Z = np.mgrid[:1:20j, :1:20j, :1:20j]\n", + "vol = (X - 1)**2 + (Y - 1)**2 + Z**2\n", + "\n", + "\n", + "fig = go.Figure(data=go.Volume(\n", + " x=X.flatten(), y=Y.flatten(), z=Z.flatten(),\n", + " value=vol.flatten(),\n", + " isomin=0.2,\n", + " isomax=0.7,\n", + " opacity=0.2,\n", + " surface_count=21,\n", + " slices_z=dict(show=True, locations=[0.4]),\n", + " surface=dict(fill=0.5, pattern='odd'),\n", + " caps= dict(x_show=False, y_show=False, z_show=False), # no caps\n", + " ))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "14b81639", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/volume/ for more information and chart attribute options!\n", + "\n", + "#### See also\n", + "[3D isosurface documentation](/python/3d-isosurface-plots/)" + ] + }, + { + "cell_type": "markdown", + "id": "12010189", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make 3D Volume Plots in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Volume Plots", + "order": 11, + "page_type": "u-guide", + "permalink": "python/3d-volume-plots/", + "thumbnail": "thumbnail/3d-volume-plots.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/LaTeX.ipynb b/LaTeX.ipynb new file mode 100644 index 000000000..451031f3f --- /dev/null +++ b/LaTeX.ipynb @@ -0,0 +1,125 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "5c6dd276", + "metadata": {}, + "source": [ + "#### LaTeX Typesetting\n", + "\n", + "Figure titles, axis labels and annotations all accept LaTeX directives for rendering mathematical formulas and notation, when the entire label is surrounded by dollar signs `$...$`. This rendering is handled by the [MathJax library](https://www.npmjs.com/package/mathjax?activeTab=versions), which must be loaded in the environment where figures are being rendered. MathJax is included by default in Jupyter-like environments. When embedding Plotly figures in other contexts it may be required to ensure that MathJax is separately loaded, for example via a `\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "7775f9ff", + "metadata": {}, + "source": [ + "### WebGL for Scatter Performance\n", + "\n", + "In the examples below we show that it is possible to represent up to around a million points with WebGL-enabled traces.\n", + "For larger datasets, or for a clearer visualization of the density of points,\n", + "it is also possible to use [datashader](/python/datashader/).\n", + "\n", + "### WebGL with Plotly Express\n", + "\n", + "The `render_mode` argument to supported Plotly Express functions (e.g. `scatter` and `scatter_polar`) can be used to enable WebGL rendering.\n", + "\n", + "> **Note** The default `render_mode` is `\"auto\"`, in which case Plotly Express will automatically set `render_mode=\"webgl\"` if the input data is more than 1,000 rows long. In this case, WebGL can be disabled by setting `render_mode=svg`.\n", + "\n", + "Here is an example that creates a 100,000 point scatter plot using Plotly Express with WebGL rendering explicitly enabled." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f3184251", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "np.random.seed(1)\n", + "\n", + "N = 100000\n", + "\n", + "df = pd.DataFrame(dict(x=np.random.randn(N),\n", + " y=np.random.randn(N)))\n", + "\n", + "fig = px.scatter(df, x=\"x\", y=\"y\", render_mode='webgl')\n", + "\n", + "fig.update_traces(marker_line=dict(width=1, color='DarkSlateGray'))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "944c6264", + "metadata": {}, + "source": [ + "#### WebGL with 1,000,000 points with Graph Objects\n", + "\n", + "If Plotly Express does not provide a good starting point for creating a chart, you can use [the more generic `go.Scattergl` class from `plotly.graph_objects`](/python/graph-objects/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8e7ef3eb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "N = 1_000_000\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(\n", + " go.Scattergl(\n", + " x = np.random.randn(N),\n", + " y = np.random.randn(N),\n", + " mode = 'markers',\n", + " marker = dict(\n", + " line = dict(\n", + " width = 1,\n", + " color = 'DarkSlateGrey')\n", + " )\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "69d90f5c", + "metadata": {}, + "source": [ + "See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!\n", + "\n", + "## Datashader\n", + "\n", + "Use [Datashader](https://datashader.org/) to reduce the size of a dataset passed to the browser for rendering by creating a rasterized representation of the dataset. This makes it ideal for working with datasets of tens to hundreds of millions of points.\n", + "\n", + "### Passing Datashader Rasters as a Tile Map Image Layer\n", + "\n", + "The following example shows the spatial distribution of taxi rides in New York City, which are concentrated on major avenues. For more details about tile-based maps, see [the tile map layers tutorial](/python/tile-map-layers)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "76eea6b1", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/uber-rides-data1.csv')\n", + "dff = df.query('Lat < 40.82').query('Lat > 40.70').query('Lon > -74.02').query('Lon < -73.91')\n", + "\n", + "import datashader as ds\n", + "cvs = ds.Canvas(plot_width=1000, plot_height=1000)\n", + "agg = cvs.points(dff, x='Lon', y='Lat')\n", + "# agg is an xarray object, see http://xarray.pydata.org/en/stable/ for more details\n", + "coords_lat, coords_lon = agg.coords['Lat'].values, agg.coords['Lon'].values\n", + "# Corners of the image\n", + "coordinates = [[coords_lon[0], coords_lat[0]],\n", + " [coords_lon[-1], coords_lat[0]],\n", + " [coords_lon[-1], coords_lat[-1]],\n", + " [coords_lon[0], coords_lat[-1]]]\n", + "\n", + "from colorcet import fire\n", + "import datashader.transfer_functions as tf\n", + "img = tf.shade(agg, cmap=fire)[::-1].to_pil()\n", + "\n", + "import plotly.express as px\n", + "# Trick to create rapidly a figure with map axes\n", + "fig = px.scatter_map(dff[:1], lat='Lat', lon='Lon', zoom=12)\n", + "# Add the datashader image as a tile map layer image\n", + "fig.update_layout(\n", + " map_style=\"carto-darkmatter\",\n", + " map_layers=[{\"sourcetype\": \"image\", \"source\": img, \"coordinates\": coordinates}],\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "27f10a1f", + "metadata": {}, + "source": [ + "### Exploring Correlations of a Large Dataset\n", + "\n", + "Here we explore the flight delay dataset from https://www.kaggle.com/usdot/flight-delays. In order to get a visual impression of the correlation between features, we generate a datashader rasterized array which we plot using a `Heatmap` trace. It creates a much clearer visualization than a scatter plot of (even a fraction of) the data points, as shown below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d0852f9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "import numpy as np\n", + "import datashader as ds\n", + "df = pd.read_parquet('https://raw.githubusercontent.com/plotly/datasets/master/2015_flights.parquet')\n", + "fig = go.Figure(go.Scattergl(x=df['SCHEDULED_DEPARTURE'][::200],\n", + " y=df['DEPARTURE_DELAY'][::200],\n", + " mode='markers')\n", + ")\n", + "fig.update_layout(title_text='A busy plot')\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "84593954", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "import numpy as np\n", + "import datashader as ds\n", + "df = pd.read_parquet('https://raw.githubusercontent.com/plotly/datasets/master/2015_flights.parquet')\n", + "\n", + "cvs = ds.Canvas(plot_width=100, plot_height=100)\n", + "agg = cvs.points(df, 'SCHEDULED_DEPARTURE', 'DEPARTURE_DELAY')\n", + "zero_mask = agg.values == 0\n", + "agg.values = np.log10(agg.values, where=np.logical_not(zero_mask))\n", + "agg.values[zero_mask] = np.nan\n", + "fig = px.imshow(agg, origin='lower', labels={'color':'Log10(count)'})\n", + "fig.update_traces(hoverongaps=False)\n", + "fig.update_layout(coloraxis_colorbar=dict(title='Count', tickprefix='1.e'))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ba1af18f", + "metadata": {}, + "source": [ + "Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.\n" + ] + }, + { + "cell_type": "markdown", + "id": "d7db8a27", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "Recommendations for increased speed, improved interactivity, and the ability to plot even more data!", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "High Performance Visualization", + "order": 14, + "permalink": "python/performance/", + "redirect_from": [ + "python/webgl-vs-svg/", + "python/datashader/" + ], + "thumbnail": "thumbnail/webgl.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/pie-charts.ipynb b/pie-charts.ipynb new file mode 100644 index 000000000..218b926c7 --- /dev/null +++ b/pie-charts.ipynb @@ -0,0 +1,597 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d86097be", + "metadata": {}, + "source": [ + "A pie chart is a circular statistical chart, which is divided into sectors to illustrate numerical proportion.\n", + "\n", + "If you're looking instead for a multilevel hierarchical pie-like chart, go to the\n", + "[Sunburst tutorial](/python/sunburst-charts/).\n", + "\n", + "### Pie chart with plotly express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "In `px.pie`, data visualized by the sectors of the pie is set in `values`. The sector labels are set in `names`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1c7cfa9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"year == 2007\").query(\"continent == 'Europe'\")\n", + "df.loc[df['pop'] < 2.e6, 'country'] = 'Other countries' # Represent only large countries\n", + "fig = px.pie(df, values='pop', names='country', title='Population of European continent')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d07e432d", + "metadata": {}, + "source": [ + "### Pie chart with repeated labels\n", + "\n", + "Lines of the dataframe with the same value for `names` are grouped together in the same sector." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1b2fb902", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "# This dataframe has 244 lines, but 4 distinct values for `day`\n", + "df = px.data.tips()\n", + "fig = px.pie(df, values='tip', names='day')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "43d174f1", + "metadata": {}, + "source": [ + "### Pie chart in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5dc2b01e", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'pie-charts', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "768260fa", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "5181ee41", + "metadata": {}, + "source": [ + "### Setting the color of pie sectors with px.pie" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "36353098", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.pie(df, values='tip', names='day', color_discrete_sequence=px.colors.sequential.RdBu)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f651bd9c", + "metadata": {}, + "source": [ + "### Using an explicit mapping for discrete colors\n", + "\n", + "For more information about discrete colors, see the [dedicated page](/python/discrete-color)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bfb9e5a9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.pie(df, values='tip', names='day', color='day',\n", + " color_discrete_map={'Thur':'lightcyan',\n", + " 'Fri':'cyan',\n", + " 'Sat':'royalblue',\n", + " 'Sun':'darkblue'})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d32dedd3", + "metadata": {}, + "source": [ + "### Customizing a pie chart created with px.pie\n", + "\n", + "In the example below, we first create a pie chart with `px,pie`, using some of its options such as `hover_data` (which columns should appear in the hover) or `labels` (renaming column names). For further tuning, we call `fig.update_traces` to set other parameters of the chart (you can also use `fig.update_layout` for changing the layout)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "37f0ee92", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"year == 2007\").query(\"continent == 'Americas'\")\n", + "fig = px.pie(df, values='pop', names='country',\n", + " title='Population of American continent',\n", + " hover_data=['lifeExp'], labels={'lifeExp':'life expectancy'})\n", + "fig.update_traces(textposition='inside', textinfo='percent+label')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f8814869", + "metadata": {}, + "source": [ + "### Basic Pie Chart with go.Pie\n", + "\n", + "If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Pie` class from `plotly.graph_objects`](/python/graph-objects/).\n", + "\n", + "In `go.Pie`, data visualized by the sectors of the pie is set in `values`. The sector labels are set in `labels`. The sector colors are set in `marker.colors`.\n", + "\n", + "If you're looking instead for a multilevel hierarchical pie-like chart, go to the\n", + "[Sunburst tutorial](/python/sunburst-charts/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "913ec0c5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']\n", + "values = [4500, 2500, 1053, 500]\n", + "\n", + "fig = go.Figure(data=[go.Pie(labels=labels, values=values)])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9a9f4e15", + "metadata": {}, + "source": [ + "### Styled Pie Chart\n", + "\n", + "Colors can be given as RGB triplets or hexadecimal strings, or with [CSS color names](https://www.w3schools.com/cssref/css_colors.asp) as below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba307e38", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "colors = ['gold', 'mediumturquoise', 'darkorange', 'lightgreen']\n", + "\n", + "fig = go.Figure(data=[go.Pie(labels=['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen'],\n", + " values=[4500,2500,1053,500])])\n", + "fig.update_traces(hoverinfo='label+percent', textinfo='value', textfont_size=20,\n", + " marker=dict(colors=colors, line=dict(color='#000000', width=2)))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "71a71c72", + "metadata": {}, + "source": [ + "### Controlling text fontsize with uniformtext\n", + "\n", + "If you want all the text labels to have the same size, you can use the `uniformtext` layout parameter. The `minsize` attribute sets the font size, and the `mode` attribute sets what happens for labels which cannot fit with the desired fontsize: either `hide` them or `show` them with overflow. In the example below we also force the text to be inside with `textposition`, otherwise text labels which do not fit are displayed outside of pie sectors." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d3c4ded1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"continent == 'Asia'\")\n", + "fig = px.pie(df, values='pop', names='country')\n", + "fig.update_traces(textposition='inside')\n", + "fig.update_layout(uniformtext_minsize=12, uniformtext_mode='hide')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "99352b35", + "metadata": {}, + "source": [ + "#### Controlling text orientation inside pie sectors\n", + "\n", + "The `insidetextorientation` attribute controls the orientation of text inside sectors. With\n", + "\"auto\" the texts may automatically be rotated to fit with the maximum size inside the slice. Using \"horizontal\" (resp. \"radial\", \"tangential\") forces text to be horizontal (resp. radial or tangential)\n", + "\n", + "For a figure `fig` created with plotly express, use `fig.update_traces(insidetextorientation='...')` to change the text orientation." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9ab4b839", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']\n", + "values = [4500, 2500, 1053, 500]\n", + "\n", + "fig = go.Figure(data=[go.Pie(labels=labels, values=values, textinfo='label+percent',\n", + " insidetextorientation='radial'\n", + " )])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "95a92646", + "metadata": {}, + "source": [ + "### Donut Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "344f0802", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']\n", + "values = [4500, 2500, 1053, 500]\n", + "\n", + "# Use `hole` to create a donut-like pie chart\n", + "fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "11818276", + "metadata": {}, + "source": [ + "### Pulling sectors out from the center\n", + "\n", + "For a \"pulled-out\" or \"exploded\" layout of the pie chart, use the `pull` argument. It can be a scalar for pulling all sectors or an array to pull only some of the sectors." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ff142e9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']\n", + "values = [4500, 2500, 1053, 500]\n", + "\n", + "# pull is given as a fraction of the pie radius\n", + "fig = go.Figure(data=[go.Pie(labels=labels, values=values, pull=[0, 0, 0.2, 0])])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e8c89b72", + "metadata": {}, + "source": [ + "### Pie Charts in subplots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "70cd0a7f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "labels = [\"US\", \"China\", \"European Union\", \"Russian Federation\", \"Brazil\", \"India\",\n", + " \"Rest of World\"]\n", + "\n", + "# Create subplots: use 'domain' type for Pie subplot\n", + "fig = make_subplots(rows=1, cols=2, specs=[[{'type':'domain'}, {'type':'domain'}]])\n", + "fig.add_trace(go.Pie(labels=labels, values=[16, 15, 12, 6, 5, 4, 42], name=\"GHG Emissions\"),\n", + " 1, 1)\n", + "fig.add_trace(go.Pie(labels=labels, values=[27, 11, 25, 8, 1, 3, 25], name=\"CO2 Emissions\"),\n", + " 1, 2)\n", + "\n", + "# Use `hole` to create a donut-like pie chart\n", + "fig.update_traces(hole=.4, hoverinfo=\"label+percent+name\")\n", + "\n", + "fig.update_layout(\n", + " title_text=\"Global Emissions 1990-2011\",\n", + " # Add annotations in the center of the donut pies.\n", + " annotations=[dict(text='GHG', x=sum(fig.get_subplot(1, 1).x) / 2, y=0.5,\n", + " font_size=20, showarrow=False, xanchor=\"center\"),\n", + " dict(text='CO2', x=sum(fig.get_subplot(1, 2).x) / 2, y=0.5,\n", + " font_size=20, showarrow=False, xanchor=\"center\")])\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "175ba776", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "labels = ['1st', '2nd', '3rd', '4th', '5th']\n", + "\n", + "# Define color sets of paintings\n", + "night_colors = ['rgb(56, 75, 126)', 'rgb(18, 36, 37)', 'rgb(34, 53, 101)',\n", + " 'rgb(36, 55, 57)', 'rgb(6, 4, 4)']\n", + "sunflowers_colors = ['rgb(177, 127, 38)', 'rgb(205, 152, 36)', 'rgb(99, 79, 37)',\n", + " 'rgb(129, 180, 179)', 'rgb(124, 103, 37)']\n", + "irises_colors = ['rgb(33, 75, 99)', 'rgb(79, 129, 102)', 'rgb(151, 179, 100)',\n", + " 'rgb(175, 49, 35)', 'rgb(36, 73, 147)']\n", + "cafe_colors = ['rgb(146, 123, 21)', 'rgb(177, 180, 34)', 'rgb(206, 206, 40)',\n", + " 'rgb(175, 51, 21)', 'rgb(35, 36, 21)']\n", + "\n", + "# Create subplots, using 'domain' type for pie charts\n", + "specs = [[{'type':'domain'}, {'type':'domain'}], [{'type':'domain'}, {'type':'domain'}]]\n", + "fig = make_subplots(rows=2, cols=2, specs=specs)\n", + "\n", + "# Define pie charts\n", + "fig.add_trace(go.Pie(labels=labels, values=[38, 27, 18, 10, 7], name='Starry Night',\n", + " marker_colors=night_colors), 1, 1)\n", + "fig.add_trace(go.Pie(labels=labels, values=[28, 26, 21, 15, 10], name='Sunflowers',\n", + " marker_colors=sunflowers_colors), 1, 2)\n", + "fig.add_trace(go.Pie(labels=labels, values=[38, 19, 16, 14, 13], name='Irises',\n", + " marker_colors=irises_colors), 2, 1)\n", + "fig.add_trace(go.Pie(labels=labels, values=[31, 24, 19, 18, 8], name='The Night Café',\n", + " marker_colors=cafe_colors), 2, 2)\n", + "\n", + "# Tune layout and hover info\n", + "fig.update_traces(hoverinfo='label+percent+name', textinfo='none')\n", + "fig.update(layout_title_text='Van Gogh: 5 Most Prominent Colors Shown Proportionally',\n", + " layout_showlegend=False)\n", + "\n", + "fig = go.Figure(fig)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d147adef", + "metadata": {}, + "source": [ + "#### Plot chart with area proportional to total count\n", + "\n", + "Plots in the same `scalegroup` are represented with an area proportional to their total size." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e2935b98", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "labels = [\"Asia\", \"Europe\", \"Africa\", \"Americas\", \"Oceania\"]\n", + "\n", + "fig = make_subplots(1, 2, specs=[[{'type':'domain'}, {'type':'domain'}]],\n", + " subplot_titles=['1980', '2007'])\n", + "fig.add_trace(go.Pie(labels=labels, values=[4, 7, 1, 7, 0.5], scalegroup='one',\n", + " name=\"World GDP 1980\"), 1, 1)\n", + "fig.add_trace(go.Pie(labels=labels, values=[21, 15, 3, 19, 1], scalegroup='one',\n", + " name=\"World GDP 2007\"), 1, 2)\n", + "\n", + "fig.update_layout(title_text='World GDP')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c0bd9a34", + "metadata": {}, + "source": [ + "### Pattern Fills\n", + "\n", + "*New in 5.15*\n", + "\n", + "Pie charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "db237aed", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "labels = [\"Oxygen\", \"Hydrogen\", \"Carbon_Dioxide\", \"Nitrogen\"]\n", + "values = [4500, 2500, 1053, 500]\n", + "colors = [\"gold\", \"mediumturquoise\", \"darkorange\", \"lightgreen\"]\n", + "\n", + "fig = go.Figure(\n", + " data=[\n", + " go.Pie(\n", + " labels=labels,\n", + " values=values,\n", + " textfont_size=20,\n", + " marker=dict(colors=colors, pattern=dict(shape=[\".\", \"x\", \"+\", \"-\"]))\n", + " )\n", + " ]\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e5ee7faf", + "metadata": {}, + "source": [ + "### See Also: Sunburst charts\n", + "\n", + "For multilevel pie charts representing hierarchical data, you can use the `Sunburst` chart. A simple example is given below, for more information see the [tutorial on Sunburst charts](/python/sunburst-charts/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b0affee", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig =go.Figure(go.Sunburst(\n", + " labels=[\"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\" ],\n", + " values=[10, 14, 12, 10, 2, 6, 6, 4, 4],\n", + "))\n", + "fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "829b0b61", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.pie()`](https://plotly.com/python-api-reference/generated/plotly.express.pie) or https://plotly.com/python/reference/pie/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "16abbdb7", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + }, + "plotly": { + "description": "How to make Pie Charts.", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "Pie Charts", + "order": 4, + "page_type": "example_index", + "permalink": "python/pie-charts/", + "thumbnail": "thumbnail/pie-chart.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/plot-data-from-csv.ipynb b/plot-data-from-csv.ipynb new file mode 100644 index 000000000..23dce31f3 --- /dev/null +++ b/plot-data-from-csv.ipynb @@ -0,0 +1,191 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "921138a1", + "metadata": {}, + "source": [ + "CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.\n", + "\n", + "First we import the data and look at it." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c76ccb13", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "f6415633", + "metadata": {}, + "source": [ + "### Plot from CSV with Plotly Express" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ced7e00f", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')\n", + "\n", + "fig = px.line(df, x = 'AAPL_x', y = 'AAPL_y', title='Apple Share Prices over time (2014)')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f2c41636", + "metadata": {}, + "source": [ + "### Plot from CSV in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "62eab90c", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'plot-data-from-csv', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "05747e6a", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "a6bdcd7c", + "metadata": {}, + "source": [ + "### Plot from CSV with `graph_objects`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1dd0ae8f", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.graph_objects as go\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')\n", + "\n", + "fig = go.Figure(go.Scatter(x = df['AAPL_x'], y = df['AAPL_y'],\n", + " name='Share Prices (in USD)'))\n", + "\n", + "fig.update_layout(title=dict(text='Apple Share Prices over time (2014)'),\n", + " plot_bgcolor='rgb(230, 230,230)',\n", + " showlegend=True)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4b70f328", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See https://plotly.com/python/getting-started for more information about Plotly's Python API!\n" + ] + }, + { + "cell_type": "markdown", + "id": "2ba3d1a7", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to create charts from csv files with Plotly and Python", + "display_as": "advanced_opt", + "has_thumbnail": false, + "language": "python", + "layout": "base", + "name": "Plot CSV Data", + "order": 1, + "page_type": "example_index", + "permalink": "python/plot-data-from-csv/", + "thumbnail": "thumbnail/csv.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/plotly-express.ipynb b/plotly-express.ipynb new file mode 100644 index 000000000..20c4443c1 --- /dev/null +++ b/plotly-express.ipynb @@ -0,0 +1,995 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3d89afc9", + "metadata": {}, + "source": [ + "### Overview\n", + "\n", + "The `plotly.express` module (usually imported as `px`) contains functions that can create entire figures at once, and is referred to as Plotly Express or PX. Plotly Express is a built-in part of the `plotly` library, and is the recommended starting point for creating most common figures. Every Plotly Express function uses [graph objects](/python/graph-objects/) internally and returns a `plotly.graph_objects.Figure` instance. Throughout the `plotly` documentation, you will find the Plotly Express way of building figures at the top of any applicable page, followed by a section on how to use graph objects to build similar figures. Any figure created in a single function call with Plotly Express could be created using graph objects alone, but with between 5 and 100 times more code.\n", + "\n", + "Plotly Express provides [more than 30 functions for creating different types of figures](https://plotly.com/python-api-reference/plotly.express.html). The API for these functions was carefully designed to be as consistent and easy to learn as possible, making it easy to switch from a scatter plot to a bar chart to a histogram to a sunburst chart throughout a data exploration session. *Scroll down for a gallery of Plotly Express plots, each made in a single function call.*\n", + "\n", + "Here is a talk from the [SciPy 2021 conference](https://www.scipy2021.scipy.org/) that gives a good introduction to Plotly Express and [Dash](https://dash.plotly.com/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6f540410", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "%%html\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "78202eb6", + "metadata": {}, + "source": [ + "Plotly Express currently includes the following functions:\n", + "\n", + "* **Basics**: [`scatter`](/python/line-and-scatter/), [`line`](/python/line-charts/), [`area`](/python/filled-area-plots/), [`bar`](/python/bar-charts/), [`funnel`](/python/funnel-charts/), [`timeline`](https://plotly.com/python/gantt/)\n", + "* **Part-of-Whole**: [`pie`](/python/pie-charts/), [`sunburst`](/python/sunburst-charts/), [`treemap`](/python/treemaps/), [`icicle`](/python/icicle-charts/), [`funnel_area`](/python/funnel-charts/)\n", + "* **1D Distributions**: [`histogram`](/python/histograms/), [`box`](/python/box-plots/), [`violin`](/python/violin/), [`strip`](/python/strip-charts/), [`ecdf`](/python/ecdf-plots/)\n", + "* **2D Distributions**: [`density_heatmap`](/python/2D-Histogram/), [`density_contour`](/python/2d-histogram-contour/)\n", + "* **Matrix or Image Input**: [`imshow`](/python/imshow/)\n", + "* **3-Dimensional**: [`scatter_3d`](/python/3d-scatter-plots/), [`line_3d`](/python/3d-line-plots/)\n", + "* **Multidimensional**: [`scatter_matrix`](/python/splom/), [`parallel_coordinates`](/python/parallel-coordinates-plot/), [`parallel_categories`](/python/parallel-categories-diagram/)\n", + "* **Tile Maps**: [`scatter_map`](/python/tile-scatter-maps/), [`line_map`](/python/lines-on-tile-maps/), [`choropleth_map`](/python/tile-county-choropleth/), [`density_map`](/python/tile-density-heatmaps/)\n", + "* **Outline Maps**: [`scatter_geo`](/python/scatter-plots-on-maps/), [`line_geo`](/python/lines-on-maps/), [`choropleth`](/python/choropleth-maps/)\n", + "* **Polar Charts**: [`scatter_polar`](/python/polar-chart/), [`line_polar`](/python/polar-chart/), [`bar_polar`](/python/wind-rose-charts/)\n", + "* **Ternary Charts**: [`scatter_ternary`](/python/ternary-plots/), [`line_ternary`](/python/ternary-plots/)\n", + "\n", + "### High-Level Features\n", + "\n", + "The Plotly Express API in general offers the following features:\n", + "\n", + "* **A single entry point into `plotly`**: just `import plotly.express as px` and get access to [all the plotting functions](https://plotly.com/python-api-reference/plotly.express.html), plus [built-in demo datasets under `px.data`](https://plotly.com/python-api-reference/generated/plotly.data.html#module-plotly.data) and [built-in color scales and sequences under `px.color`](https://plotly.com/python-api-reference/generated/plotly.colors.html#module-plotly.colors). Every PX function returns a `plotly.graph_objects.Figure` object, so you can edit it using all the same methods like [`update_layout` and `add_trace`](https://plotly.com/python/creating-and-updating-figures/#updating-figures).\n", + "* **Sensible, Overridable Defaults**: PX functions will infer sensible defaults wherever possible, and will always let you override them.\n", + "* **Flexible Input Formats**: PX functions [accept input in a variety of formats](/python/px-arguments/), from `list`s and `dict`s to [long-form or wide-form `DataFrame`s](/python/wide-form/) to [`numpy` arrays and `xarrays`](/python/imshow/) to [GeoPandas `GeoDataFrames`](/python/maps/).\n", + "* **Automatic Trace and Layout configuration**: PX functions will create one [trace](/python/figure-structure) per animation frame for each unique combination of data values mapped to discrete color, symbol, line-dash, facet-row and/or facet-column. Traces' [`legendgroup` and `showlegend` attributes](https://plotly.com/python/legend/) are set such that only one legend item appears per unique combination of discrete color, symbol and/or line-dash. Traces are automatically linked to a correctly-configured [subplot of the appropriate type](/python/figure-structure).\n", + "* **Automatic Figure Labelling**: PX functions [label axes, legends and colorbars](https://plotly.com/python/figure-labels/) based in the input `DataFrame` or `xarray`, and provide [extra control with the `labels` argument](/python/styling-plotly-express/).\n", + "* **Automatic Hover Labels**: PX functions populate the hover-label using the labels mentioned above, and provide [extra control with the `hover_name` and `hover_data` arguments](/python/hover-text-and-formatting/).\n", + "* **Styling Control**: PX functions [read styling information from the default figure template](/python/styling-plotly-express/), and support commonly-needed [cosmetic controls like `category_orders` and `color_discrete_map`](/python/styling-plotly-express/) to precisely control categorical variables.\n", + "* **Uniform Color Handling**: PX functions automatically switch between [continuous](/python/colorscales/) and [categorical color](/python/discrete-color/) based on the input type.\n", + "* **Faceting**: the 2D-cartesian plotting functions support [row, column and wrapped facetting with `facet_row`, `facet_col` and `facet_col_wrap` arguments](/python/facet-plots/).\n", + "* **Marginal Plots**: the 2D-cartesian plotting functions support [marginal distribution plots](/python/marginal-plots/) with the `marginal`, `marginal_x` and `marginal_y` arguments.\n", + "* **A Pandas backend**: the 2D-cartesian plotting functions are available as [a Pandas plotting backend](/python/pandas-backend/) so you can call them via `df.plot()`.\n", + "* **Trendlines**: `px.scatter` supports [built-in trendlines with accessible model output](/python/linear-fits/).\n", + "* **Animations**: many PX functions support [simple animation support via the `animation_frame` and `animation_group` arguments](/python/animations/).\n", + "* **Automatic WebGL switching**: for sufficiently large scatter plots, PX will automatically [use WebGL for hardware-accelerated rendering](https://plotly.com/python/webgl-vs-svg/)." + ] + }, + { + "cell_type": "markdown", + "id": "1865367b", + "metadata": {}, + "source": [ + "### Plotly Express in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "703c7d43", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'plotly-express', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "7bc93e47", + "metadata": {}, + "source": [ + "### Gallery\n", + "\n", + "The following set of figures is just a sampling of what can be done with Plotly Express.\n", + "\n", + "#### Scatter, Line, Area and Bar Charts\n", + "\n", + "**Read more about [scatter plots](/python/line-and-scatter/) and [discrete color](/python/discrete-color/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e6a527ee", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f518c2bc", + "metadata": {}, + "source": [ + "**Read more about [trendlines](/python/linear-fits/) and [templates](/python/templates/) and [marginal distribution plots](https://plotly.com/python/marginal-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e17b2a23", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", marginal_y=\"violin\",\n", + " marginal_x=\"box\", trendline=\"ols\", template=\"simple_white\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "10748835", + "metadata": {}, + "source": [ + "**Read more about [error bars](/python/error-bars/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16e12d31", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "df[\"e\"] = df[\"sepal_width\"]/100\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", error_x=\"e\", error_y=\"e\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "12d864e9", + "metadata": {}, + "source": [ + "**Read more about [bar charts](/python/bar-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dc1ab9a6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.bar(df, x=\"sex\", y=\"total_bill\", color=\"smoker\", barmode=\"group\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2af0ed3a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.medals_long()\n", + "\n", + "fig = px.bar(df, x=\"medal\", y=\"count\", color=\"nation\",\n", + " pattern_shape=\"nation\", pattern_shape_sequence=[\".\", \"x\", \"+\"])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "07dc14fd", + "metadata": {}, + "source": [ + "**Read more about [facet plots](/python/facet-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "caaea0c7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.bar(df, x=\"sex\", y=\"total_bill\", color=\"smoker\", barmode=\"group\", facet_row=\"time\", facet_col=\"day\",\n", + " category_orders={\"day\": [\"Thur\", \"Fri\", \"Sat\", \"Sun\"], \"time\": [\"Lunch\", \"Dinner\"]})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "280bf57f", + "metadata": {}, + "source": [ + "**Read more about [scatterplot matrices (SPLOMs)](/python/splom/).**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6c88333d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_matrix(df, dimensions=[\"sepal_width\", \"sepal_length\", \"petal_width\", \"petal_length\"], color=\"species\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2b799331", + "metadata": {}, + "source": [ + "**Read more about [parallel coordinates](/python/parallel-coordinates-plot/) and [parallel categories](/python/parallel-categories-diagram/), as well as [continuous color](/python/colorscales/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "350c5c8a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.parallel_coordinates(df, color=\"species_id\", labels={\"species_id\": \"Species\",\n", + " \"sepal_width\": \"Sepal Width\", \"sepal_length\": \"Sepal Length\",\n", + " \"petal_width\": \"Petal Width\", \"petal_length\": \"Petal Length\", },\n", + " color_continuous_scale=px.colors.diverging.Tealrose, color_continuous_midpoint=2)\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e8107412", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.parallel_categories(df, color=\"size\", color_continuous_scale=px.colors.sequential.Inferno)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f7057369", + "metadata": {}, + "source": [ + "**Read more about [hover labels](/python/hover-text-and-formatting/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34af16d1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.scatter(df.query(\"year==2007\"), x=\"gdpPercap\", y=\"lifeExp\", size=\"pop\", color=\"continent\",\n", + " hover_name=\"country\", log_x=True, size_max=60)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "734c5896", + "metadata": {}, + "source": [ + "**Read more about [animations](/python/animations/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "42423d58", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.scatter(df, x=\"gdpPercap\", y=\"lifeExp\", animation_frame=\"year\", animation_group=\"country\",\n", + " size=\"pop\", color=\"continent\", hover_name=\"country\", facet_col=\"continent\",\n", + " log_x=True, size_max=45, range_x=[100,100000], range_y=[25,90])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f74903f3", + "metadata": {}, + "source": [ + "**Read more about [line charts](/python/line-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf981049", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.line(df, x=\"year\", y=\"lifeExp\", color=\"continent\", line_group=\"country\", hover_name=\"country\",\n", + " line_shape=\"spline\", render_mode=\"svg\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e5487137", + "metadata": {}, + "source": [ + "**Read more about [area charts](/python/filled-area-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "95b0e2b9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.area(df, x=\"year\", y=\"pop\", color=\"continent\", line_group=\"country\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c60b7b9e", + "metadata": {}, + "source": [ + "**Read more about [timeline/Gantt charts](/python/gantt/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "59196386", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.DataFrame([\n", + " dict(Task=\"Job A\", Start='2009-01-01', Finish='2009-02-28', Resource=\"Alex\"),\n", + " dict(Task=\"Job B\", Start='2009-03-05', Finish='2009-04-15', Resource=\"Alex\"),\n", + " dict(Task=\"Job C\", Start='2009-02-20', Finish='2009-05-30', Resource=\"Max\")\n", + "])\n", + "\n", + "fig = px.timeline(df, x_start=\"Start\", x_end=\"Finish\", y=\"Resource\", color=\"Resource\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "41ecaa31", + "metadata": {}, + "source": [ + "**Read more about [funnel charts](/python/funnel-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb89bfc", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "data = dict(\n", + " number=[39, 27.4, 20.6, 11, 2],\n", + " stage=[\"Website visit\", \"Downloads\", \"Potential customers\", \"Requested price\", \"Invoice sent\"])\n", + "fig = px.funnel(data, x='number', y='stage')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "416e81ba", + "metadata": {}, + "source": [ + "### Part to Whole Charts\n", + "\n", + "**Read more about [pie charts](/python/pie-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3026809a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"year == 2007\").query(\"continent == 'Europe'\")\n", + "df.loc[df['pop'] < 2.e6, 'country'] = 'Other countries' # Represent only large countries\n", + "fig = px.pie(df, values='pop', names='country', title='Population of European continent')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "243c009b", + "metadata": {}, + "source": [ + "**Read more about [sunburst charts](/python/sunburst-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4736e53d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.sunburst(df, path=['continent', 'country'], values='pop',\n", + " color='lifeExp', hover_data=['iso_alpha'])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b216f0b1", + "metadata": {}, + "source": [ + "**Read more about [treemaps](/python/treemaps/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ccd98a4a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.treemap(df, path=[px.Constant('world'), 'continent', 'country'], values='pop',\n", + " color='lifeExp', hover_data=['iso_alpha'])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ea4df6cb", + "metadata": {}, + "source": [ + "**Read more about [icicle charts](/python/icicle-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "559e62d9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.icicle(df, path=[px.Constant('world'), 'continent', 'country'], values='pop',\n", + " color='lifeExp', hover_data=['iso_alpha'])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4996437f", + "metadata": {}, + "source": [ + "#### Distributions\n", + "\n", + "**Read more about [histograms](/python/histograms/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec313755", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.histogram(df, x=\"total_bill\", y=\"tip\", color=\"sex\", marginal=\"rug\", hover_data=df.columns)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e6bf66dd", + "metadata": {}, + "source": [ + "**Read more about [box plots](/python/box-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f3e18c9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.box(df, x=\"day\", y=\"total_bill\", color=\"smoker\", notched=True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f804ec8b", + "metadata": {}, + "source": [ + "**Read more about [violin plots](/python/violin/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4873876a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"tip\", x=\"smoker\", color=\"sex\", box=True, points=\"all\", hover_data=df.columns)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "851153e1", + "metadata": {}, + "source": [ + "**Read more about [Empirical Cumulative Distribution Function (ECDF) charts](https://plotly.com/python/ecdf-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "167991eb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.ecdf(df, x=\"total_bill\", color=\"sex\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9dff87ed", + "metadata": {}, + "source": [ + "**Read more about [strip charts](https://plotly.com/python/strip-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "af420bb3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.strip(df, x=\"total_bill\", y=\"time\", orientation=\"h\", color=\"smoker\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "91e996a1", + "metadata": {}, + "source": [ + "**Read more about [density contours, also known as 2D histogram contours](/python/2d-histogram-contour/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74c9c7da", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.density_contour(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "852d9db3", + "metadata": {}, + "source": [ + "**Read more about [density heatmaps, also known as 2D histograms](/python/2D-Histogram/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec6aa31c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.density_heatmap(df, x=\"sepal_width\", y=\"sepal_length\", marginal_x=\"rug\", marginal_y=\"histogram\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "15878460", + "metadata": {}, + "source": [ + "### Images and Heatmaps\n", + "\n", + "**Read more about [heatmaps and images](/python/imshow/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f76f1576", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "data=[[1, 25, 30, 50, 1], [20, 1, 60, 80, 30], [30, 60, 1, 5, 20]]\n", + "fig = px.imshow(data,\n", + " labels=dict(x=\"Day of Week\", y=\"Time of Day\", color=\"Productivity\"),\n", + " x=['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n", + " y=['Morning', 'Afternoon', 'Evening']\n", + " )\n", + "fig.update_xaxes(side=\"top\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "229df49c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "from skimage import io\n", + "img = io.imread('https://user-images.githubusercontent.com/72614349/179115668-2630e3e4-3a9f-4c88-9494-3412e606450a.jpg')\n", + "fig = px.imshow(img)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d43a451a", + "metadata": {}, + "source": [ + "#### Tile Maps\n", + "\n", + "**Read more about [tile maps](/python/tile-map-layers/) and [point on tile maps](/python/tile-scatter-maps/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e6f1ede7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.carshare()\n", + "fig = px.scatter_map(df, lat=\"centroid_lat\", lon=\"centroid_lon\", color=\"peak_hour\", size=\"car_hours\",\n", + " color_continuous_scale=px.colors.cyclical.IceFire, size_max=15, zoom=10,\n", + " map_style=\"carto-positron\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c7915ff0", + "metadata": {}, + "source": [ + "**Read more about [tile map GeoJSON choropleths](/python/tile-county-choropleth/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fe13fd4f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.election()\n", + "geojson = px.data.election_geojson()\n", + "\n", + "fig = px.choropleth_map(df, geojson=geojson, color=\"Bergeron\",\n", + " locations=\"district\", featureidkey=\"properties.district\",\n", + " center={\"lat\": 45.5517, \"lon\": -73.7073},\n", + " map_style=\"carto-positron\", zoom=9)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4ec57ac3", + "metadata": {}, + "source": [ + "### Outline Maps\n", + "\n", + "**Read more about [outline symbol maps](/python/scatter-plots-on-maps/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8510fb8b", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.scatter_geo(df, locations=\"iso_alpha\", color=\"continent\", hover_name=\"country\", size=\"pop\",\n", + " animation_frame=\"year\", projection=\"natural earth\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "10609a05", + "metadata": {}, + "source": [ + "**Read more about [choropleth maps](/python/choropleth-maps/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9ac288a7", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder()\n", + "fig = px.choropleth(df, locations=\"iso_alpha\", color=\"lifeExp\", hover_name=\"country\", animation_frame=\"year\", range_color=[20,80])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c271585e", + "metadata": {}, + "source": [ + "#### Polar Coordinates\n", + "\n", + "**Read more about [polar plots](/python/polar-chart/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7232bdaf", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.scatter_polar(df, r=\"frequency\", theta=\"direction\", color=\"strength\", symbol=\"strength\",\n", + " color_discrete_sequence=px.colors.sequential.Plasma_r)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ce837b99", + "metadata": {}, + "source": [ + "**Read more about [radar charts](https://plotly.com/python/radar-chart/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "56a75640", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.line_polar(df, r=\"frequency\", theta=\"direction\", color=\"strength\", line_close=True,\n", + " color_discrete_sequence=px.colors.sequential.Plasma_r)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bea7c362", + "metadata": {}, + "source": [ + "**Read more about [polar bar charts](/python/wind-rose-charts/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fe02224f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.bar_polar(df, r=\"frequency\", theta=\"direction\", color=\"strength\", template=\"plotly_dark\",\n", + " color_discrete_sequence= px.colors.sequential.Plasma_r)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ed27cf24", + "metadata": {}, + "source": [ + "#### 3D Coordinates\n", + "\n", + "**Read more about [3D scatter plots](/python/3d-scatter-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c6f5ccab", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.election()\n", + "fig = px.scatter_3d(df, x=\"Joly\", y=\"Coderre\", z=\"Bergeron\", color=\"winner\", size=\"total\", hover_name=\"district\",\n", + " symbol=\"result\", color_discrete_map = {\"Joly\": \"blue\", \"Bergeron\": \"green\", \"Coderre\":\"red\"})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0a03ec69", + "metadata": {}, + "source": [ + "#### Ternary Coordinates\n", + "\n", + "**Read more about [ternary charts](/python/ternary-plots/).**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b674c6ef", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.election()\n", + "fig = px.scatter_ternary(df, a=\"Joly\", b=\"Coderre\", c=\"Bergeron\", color=\"winner\", size=\"total\", hover_name=\"district\",\n", + " size_max=15, color_discrete_map = {\"Joly\": \"blue\", \"Bergeron\": \"green\", \"Coderre\":\"red\"} )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f6c9fd43", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.0" + }, + "plotly": { + "description": "Plotly Express is a terse, consistent, high-level API for creating figures.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Plotly Express", + "order": 4, + "page_type": "example_index", + "permalink": "python/plotly-express/", + "thumbnail": "thumbnail/plotly-express.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/polar-chart.ipynb b/polar-chart.ipynb new file mode 100644 index 000000000..5895c5183 --- /dev/null +++ b/polar-chart.ipynb @@ -0,0 +1,626 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4c890662", + "metadata": {}, + "source": [ + "## Polar chart with Plotly Express\n", + "\n", + "A polar chart represents data along radial and angular axes. With Plotly Express, it is possible to represent polar data as scatter markers with `px.scatter_polar`, and as lines with `px.line_polar`.\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "For other types of arguments, see the section below using `go.Scatterpolar`.\n", + "\n", + "The radial and angular coordinates are given with the `r` and `theta` arguments of `px.scatter_polar`. In the example below the `theta` data are categorical, but numerical data are possible too and the most common case." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "58a96492", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.scatter_polar(df, r=\"frequency\", theta=\"direction\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "63b40288", + "metadata": {}, + "source": [ + "The \"strength\" column corresponds to strength categories of the wind, and there is a frequency value for each direction and strength. Below we use the strength column to encode the color, symbol and size of the markers." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0ee7e271", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.scatter_polar(df, r=\"frequency\", theta=\"direction\",\n", + " color=\"strength\", symbol=\"strength\", size=\"frequency\",\n", + " color_discrete_sequence=px.colors.sequential.Plasma_r)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ae493b3b", + "metadata": {}, + "source": [ + "For a line polar plot, use `px.line_polar`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ea3f8fdf", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.line_polar(df, r=\"frequency\", theta=\"direction\", color=\"strength\", line_close=True,\n", + " color_discrete_sequence=px.colors.sequential.Plasma_r,\n", + " template=\"plotly_dark\",)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "62511f73", + "metadata": {}, + "source": [ + "See also the [wind rose page](https://plotly.com/python/wind-rose-charts/) for more wind rose visualizations in polar coordinates.\n", + "\n", + "You can plot less than a whole circle with the `range_theta` argument, and also control the `start_angle` and `direction`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d0bc641c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "fig = px.scatter_polar(r=range(0,90,10), theta=range(0,90,10),\n", + " range_theta=[0,90], start_angle=0, direction=\"counterclockwise\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "06e73e71", + "metadata": {}, + "source": [ + "## Polar Scatter Plot with go.Scatterpolar\n", + "\n", + "If Plotly Express does not provide a good starting point, you can use [the more generic `go.Scatterpolar` class from `plotly.graph_objects`](/python/graph-objects/). All the options are documented in the [reference page](https://plotly.com/python/reference/scatterpolar/).\n", + "\n", + "#### Basic Polar Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b915dbe", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=\n", + " go.Scatterpolar(\n", + " r = [0.5,1,2,2.5,3,4],\n", + " theta = [35,70,120,155,205,240],\n", + " mode = 'markers',\n", + " ))\n", + "\n", + "fig.update_layout(showlegend=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c3797d08", + "metadata": {}, + "source": [ + "#### Line Polar Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d1d6b340", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/polar_dataset.csv\")\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = df['x1'],\n", + " theta = df['y'],\n", + " mode = 'lines',\n", + " name = 'Figure 8',\n", + " line_color = 'peru'\n", + " ))\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = df['x2'],\n", + " theta = df['y'],\n", + " mode = 'lines',\n", + " name = 'Cardioid',\n", + " line_color = 'darkviolet'\n", + " ))\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = df['x3'],\n", + " theta = df['y'],\n", + " mode = 'lines',\n", + " name = 'Hypercardioid',\n", + " line_color = 'deepskyblue'\n", + " ))\n", + "\n", + "\n", + "fig.update_layout(\n", + " title = 'Mic Patterns',\n", + " showlegend = False\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "20beedd0", + "metadata": {}, + "source": [ + "#### Polar Bar Chart\n", + "\n", + "a.k.a matplotlib logo in a few lines of code" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2e0498fe", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Barpolar(\n", + " r=[3.5, 1.5, 2.5, 4.5, 4.5, 4, 3],\n", + " theta=[65, 15, 210, 110, 312.5, 180, 270],\n", + " width=[20,15,10,20,15,30,15,],\n", + " marker_color=[\"#E4FF87\", '#709BFF', '#709BFF', '#FFAA70', '#FFAA70', '#FFDF70', '#B6FFB4'],\n", + " marker_line_color=\"black\",\n", + " marker_line_width=2,\n", + " opacity=0.8\n", + "))\n", + "\n", + "fig.update_layout(\n", + " template=None,\n", + " polar = dict(\n", + " radialaxis = dict(range=[0, 5], showticklabels=False, ticks=''),\n", + " angularaxis = dict(showticklabels=False, ticks='')\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8761a57b", + "metadata": {}, + "source": [ + "#### Categorical Polar Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6164f0d1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=2, cols=2, specs=[[{'type': 'polar'}]*2]*2)\n", + "\n", + "fig.add_trace(go.Scatterpolar(\n", + " name = \"angular categories\",\n", + " r = [5, 4, 2, 4, 5],\n", + " theta = [\"a\", \"b\", \"c\", \"d\", \"a\"],\n", + " ), 1, 1)\n", + "fig.add_trace(go.Scatterpolar(\n", + " name = \"radial categories\",\n", + " r = [\"a\", \"b\", \"c\", \"d\", \"b\", \"f\", \"a\"],\n", + " theta = [1, 4, 2, 1.5, 1.5, 6, 5],\n", + " thetaunit = \"radians\",\n", + " ), 1, 2)\n", + "fig.add_trace(go.Scatterpolar(\n", + " name = \"angular categories (w/ categoryarray)\",\n", + " r = [5, 4, 2, 4, 5],\n", + " theta = [\"a\", \"b\", \"c\", \"d\", \"a\"],\n", + " ), 2, 1)\n", + "fig.add_trace(go.Scatterpolar(\n", + " name = \"radial categories (w/ category descending)\",\n", + " r = [\"a\", \"b\", \"c\", \"d\", \"b\", \"f\", \"a\", \"a\"],\n", + " theta = [45, 90, 180, 200, 300, 15, 20, 45],\n", + " ), 2, 2)\n", + "\n", + "fig.update_traces(fill='toself')\n", + "fig.update_layout(\n", + " polar = dict(\n", + " radialaxis_angle = -45,\n", + " angularaxis = dict(\n", + " direction = \"clockwise\",\n", + " period = 6)\n", + " ),\n", + " polar2 = dict(\n", + " radialaxis = dict(\n", + " angle = 180,\n", + " tickangle = -180 # so that tick labels are not upside down\n", + " )\n", + " ),\n", + " polar3 = dict(\n", + " sector = [80, 400],\n", + " radialaxis_angle = -45,\n", + " angularaxis_categoryarray = [\"d\", \"a\", \"c\", \"b\"]\n", + " ),\n", + " polar4 = dict(\n", + " radialaxis_categoryorder = \"category descending\",\n", + " angularaxis = dict(\n", + " thetaunit = \"radians\",\n", + " dtick = 0.3141592653589793\n", + " ))\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0136abb6", + "metadata": {}, + "source": [ + "#### Polar Chart Sector" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f99d775b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=1, cols=2, specs=[[{'type': 'polar'}]*2])\n", + "\n", + "fig.add_trace(go.Scatterpolar(), 1, 1)\n", + "fig.add_trace(go.Scatterpolar(), 1, 2)\n", + "\n", + "# Same data for the two Scatterpolar plots, we will only change the sector in the layout\n", + "fig.update_traces(mode = \"lines+markers\",\n", + " r = [1,2,3,4,5],\n", + " theta = [0,90,180,360,0],\n", + " line_color = \"magenta\",\n", + " marker = dict(\n", + " color = \"royalblue\",\n", + " symbol = \"square\",\n", + " size = 8\n", + " ))\n", + "\n", + "# The sector is [0, 360] by default, we update it for the first plot only\n", + "fig.update_layout(\n", + " showlegend = False,\n", + " polar = dict(# setting parameters for the second plot would be polar2=dict(...)\n", + " sector = [150,210],\n", + " ))\n", + "\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "baac3b4a", + "metadata": {}, + "source": [ + "#### Polar Chart Directions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a9b606ac", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=1, cols=2, specs=[[{'type': 'polar'}, {'type': 'polar'}]])\n", + "\n", + "r = [1,2,3,4,5]\n", + "theta = [0,90,180,360,0]\n", + "\n", + "fig.add_trace(go.Scatterpolar(), 1, 1)\n", + "fig.add_trace(go.Scatterpolar(), 1, 2)\n", + "\n", + "# Same data for the two Scatterpolar plots, we will only change the direction in the layout\n", + "fig.update_traces(r= r, theta=theta,\n", + " mode=\"lines+markers\", line_color='indianred',\n", + " marker=dict(color='lightslategray', size=8, symbol='square'))\n", + "fig.update_layout(\n", + " showlegend = False,\n", + " polar = dict(\n", + " radialaxis_tickfont_size = 8,\n", + " angularaxis = dict(\n", + " tickfont_size=8,\n", + " rotation=90, # start position of angular axis\n", + " direction=\"counterclockwise\"\n", + " )\n", + " ),\n", + " polar2 = dict(\n", + " radialaxis_tickfont_size = 8,\n", + " angularaxis = dict(\n", + " tickfont_size = 8,\n", + " rotation = 90,\n", + " direction = \"clockwise\"\n", + " ),\n", + " ))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2cb72bc2", + "metadata": {}, + "source": [ + "#### Webgl Polar Chart\n", + "\n", + "The `go.Scatterpolargl` trace uses the [WebGL](https://en.wikipedia.org/wiki/WebGL) plotting engine for GPU-accelerated rendering." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "455b1a60", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/hobbs-pearson-trials.csv\")\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_1_r,\n", + " theta = df.trial_1_theta,\n", + " name = \"Trial 1\",\n", + " marker=dict(size=15, color=\"mediumseagreen\")\n", + " ))\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_2_r,\n", + " theta = df.trial_2_theta,\n", + " name = \"Trial 2\",\n", + " marker=dict(size=20, color=\"darkorange\")\n", + " ))\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_3_r,\n", + " theta = df.trial_3_theta,\n", + " name = \"Trial 3\",\n", + " marker=dict(size=12, color=\"mediumpurple\")\n", + " ))\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_4_r,\n", + " theta = df.trial_4_theta,\n", + " name = \"Trial 4\",\n", + " marker=dict(size=22, color = \"magenta\")\n", + " ))\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_5_r,\n", + " theta = df.trial_5_theta,\n", + " name = \"Trial 5\",\n", + " marker=dict(size=19, color = \"limegreen\")\n", + " ))\n", + "fig.add_trace(go.Scatterpolargl(\n", + " r = df.trial_6_r,\n", + " theta = df.trial_6_theta,\n", + " name = \"Trial 6\",\n", + " marker=dict(size=10, color = \"gold\")\n", + " ))\n", + "\n", + "# Common parameters for all traces\n", + "fig.update_traces(mode=\"markers\", marker=dict(line_color='white', opacity=0.7))\n", + "\n", + "fig.update_layout(\n", + " title = \"Hobbs-Pearson Trials\",\n", + " font_size = 15,\n", + " showlegend = False,\n", + " polar = dict(\n", + " bgcolor = \"rgb(223, 223, 223)\",\n", + " angularaxis = dict(\n", + " linewidth = 3,\n", + " showline=True,\n", + " linecolor='black'\n", + " ),\n", + " radialaxis = dict(\n", + " side = \"counterclockwise\",\n", + " showline = True,\n", + " linewidth = 2,\n", + " gridcolor = \"white\",\n", + " gridwidth = 2,\n", + " )\n", + " ),\n", + " paper_bgcolor = \"rgb(223, 223, 223)\"\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a51b0f3b", + "metadata": {}, + "source": [ + "#### Polar Chart Subplots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2c2c9e72", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=2, cols=2, specs=[[{'type': 'polar'}]*2]*2)\n", + "\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = [1, 2, 3],\n", + " theta = [50, 100, 200],\n", + " marker_symbol = \"square\"\n", + " ), 1, 1)\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = [1, 2, 3],\n", + " theta = [1, 2, 3],\n", + " thetaunit = \"radians\"\n", + " ), 1, 1)\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = [\"a\", \"b\", \"c\", \"b\"],\n", + " theta = [\"D\", \"C\", \"B\", \"A\"],\n", + " subplot = \"polar2\"\n", + " ), 1, 2)\n", + "fig.add_trace(go.Scatterpolar(\n", + " r = [50, 300, 900],\n", + " theta = [0, 90, 180],\n", + " subplot = \"polar3\"\n", + " ), 2, 1)\n", + "fig.add_trace(go.Scatterpolar(\n", + " mode = \"lines\",\n", + " r = [3, 3, 4, 3],\n", + " theta = [0, 45, 90, 270],\n", + " fill = \"toself\",\n", + " subplot = \"polar4\"\n", + " ), 2, 2)\n", + "\n", + "\n", + "fig.update_layout(\n", + " polar = dict(\n", + " radialaxis_range = [1, 4],\n", + " angularaxis_thetaunit = \"radians\"\n", + " ),\n", + " polar3 = dict(\n", + " radialaxis = dict(type = \"log\", tickangle = 45),\n", + " sector = [0, 180]\n", + " ),\n", + " polar4 = dict(\n", + " radialaxis = dict(visible = False, range = [0, 6])),\n", + " showlegend = False\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d22e8bd8", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.(scatter_polar)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_polar) or [function reference for `px.(line_polar)`](https://plotly.com/python-api-reference/generated/plotly.express.line_polar) or https://plotly.com/python/reference/scatterpolar/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "1cc599cf", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + }, + "plotly": { + "description": "How to make polar charts in Python with Plotly.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Polar Charts", + "order": 16, + "page_type": "u-guide", + "permalink": "python/polar-chart/", + "thumbnail": "thumbnail/polar.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/px-arguments.ipynb b/px-arguments.ipynb new file mode 100644 index 000000000..6d4d97005 --- /dev/null +++ b/px-arguments.ipynb @@ -0,0 +1,517 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "27ce2452", + "metadata": {}, + "source": [ + "Plotly Express (`px`) is the high-level interface to Plotly and provides functions for generating charts. `px` functions support data provided in a number of different formats (long, wide, and mixed) and as different types of objects, including pandas and Polars dataframes.\n", + "\n", + "## Data for the Examples\n", + "\n", + "The examples on this page use datasets available in the `data` package in `px`. `px.data` contains functions that when called return a dataset as a dataframe. Some of the datasets included in `px.data` are:\n", + "\n", + "- `carshare` - Each row represents the availability of car-sharing services near the centroid of a zone in Montreal over a month-long period.\n", + "- `election` - Each row represents voting results for an electoral district in the 2013 Montreal mayoral election.\n", + "- `iris` - Each row represents a flower.\n", + "\n", + "To access the `iris` dataset, we call its function and assign it to a variable:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "333f9396", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "d1faa3ba", + "metadata": {}, + "source": [ + "By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21b70027", + "metadata": {}, + "outputs": [], + "source": [ + "df = px.data.iris(return_type='polars')\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "fa1a1102", + "metadata": {}, + "source": [ + "## Long, Wide, and Mixed-Form Data\n", + "\n", + "There are three common conventions for storing column-oriented data, usually in a data frame with column names:\n", + "\n", + "* **long-form data** has one row per observation, and one column per variable. This is suitable for storing and displaying multivariate data i.e. with dimension greater than 2. This format is sometimes called \"tidy\".\n", + "* **wide-form data** has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.\n", + "* **mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables. See the [wide-form documentation](/python/wide-form/) for examples of how to use Plotly Express to visualize this kind of data.\n", + "\n", + "Every Plotly Express function can operate on long-form data (other than `px.imshow` which operates only on wide-form input), and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.\n", + "\n", + "By way of example here is the same data, represented in long-form first, and then in wide-form:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b22dadb9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "long_df = px.data.medals_long()\n", + "long_df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41253d80", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "wide_df" + ] + }, + { + "cell_type": "markdown", + "id": "9650255f", + "metadata": {}, + "source": [ + "Plotly Express can produce the same plot from either form:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "199dfc16", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "long_df = px.data.medals_long()\n", + "\n", + "fig = px.bar(long_df, x=\"nation\", y=\"count\", color=\"medal\", title=\"Long-Form Input\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bdf1138c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], title=\"Wide-Form Input\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5fb31255", + "metadata": {}, + "source": [ + "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, or [you can use a data frame with named row- and column-indexes](/python/wide-form/). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c38ff43d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], title=\"Wide-Form Input, relabelled\",\n", + " labels={\"value\": \"count\", \"variable\": \"medal\"})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "027aa52e", + "metadata": {}, + "source": [ + "Many more examples of wide-form and messy data input can be found in our [detailed wide-form support documentation](/python/wide-form/)." + ] + }, + { + "cell_type": "markdown", + "id": "470d3bb8", + "metadata": {}, + "source": [ + "## Dataframe Input\n", + "\n", + "The first argument of every `px` function is `data_frame`. If you provide a dataframe as a `px` function's first argument, you can then specify column names as strings from the dataframe as other arguments.\n", + "\n", + "### Supported DataFrame Types\n", + "\n", + "`px` functions natively support pandas, Polars, and PyArrow dataframes. `px` uses [Narwhals](https://narwhals-dev.github.io/narwhals/) to provide this native dataframe support. Other types of dataframes that are currently supported by Narwhals, for example cuDF and Modin, may also work with `px`.\n", + "\n", + "You can also pass dataframes that are not natively supported, but which support the [dataframe interchange protocol](https://data-apis.org/dataframe-protocol/latest/).\n", + "\n", + "PySpark dataframes are also supported and are converted to pandas dataframes internally by Plotly Express.\n", + "\n", + "#### Additional Dependencies Required\n", + "\n", + "- Plotly Express requires NumPy. You can install it with `pip install numpy` if it's not installed by the dataframe library you are using.\n", + "- To use [trendlines](/python/linear-fits/), you'll also need to have pandas installed.\n", + "- To use PySpark dataframes, you'll need to have pandas installed. To use dataframes that support the dataframe interchange protocol, you'll need to have PyArrow installed.\n", + "\n", + "### Example: Using a Pandas DataFrame with `px.bar`\n", + "\n", + "Here, we create a pandas `DataFrame`, pass it to `px.bar` as its first argument, and then use the `\"sepal_length\"` column for the x-axis and the `\"sepal_width\"` for the y-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35f63ae6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x='sepal_length', y='sepal_width', color='species', size='petal_length')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f44e15c7", + "metadata": {}, + "source": [ + "### Example: Polars DataFrame with `px.bar`\n", + "\n", + "`px` provides native support for dataframe types other than pandas, including Polars:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5cadac58", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris(return_type='polars')\n", + "\n", + "fig = px.scatter(df, x='sepal_length', y='sepal_width', color='species', size='petal_length')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d3783056", + "metadata": {}, + "source": [ + "### Using the Index of a Dataframe\n", + "\n", + "If the dataframe you are using has an index, it is also possible to use that index as an argument. In the following example, the index is used for the hover data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3e8bb0c9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter(df, x=df.sepal_length, y=df.sepal_width, size=df.petal_length,\n", + " hover_data=[df.index])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "16af7a01", + "metadata": {}, + "source": [ + "### Using Columns from Multiple Dataframes\n", + "\n", + "You can also use columns from multiple dataframes in one `px` function, as long as all the dataframe columns you use have the same length. In this example, we pass `df1` as the `data_frame` argument to `px.bar` and then us a column from `df2` for the `y` argument." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63a524af", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df1 = pd.DataFrame(dict(time=[10, 20, 30], sales=[10, 8, 30]))\n", + "df2 = pd.DataFrame(dict(market=[4, 2, 5]))\n", + "fig = px.bar(df1, x=\"time\", y=df2.market, color=\"sales\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "13dacad7", + "metadata": {}, + "source": [ + "### Using labels to pass names\n", + "\n", + "The `labels` argument can be used to override the names used for axis titles, legend entries and hovers." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fce8d998", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = px.data.gapminder()\n", + "gdp = df['pop'] * df['gdpPercap']\n", + "fig = px.bar(df, x='year', y=gdp, color='continent', labels={'y':'gdp'},\n", + " hover_data=['country'],\n", + " title='Evolution of world GDP')\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1d860849", + "metadata": {}, + "outputs": [], + "source": [ + "## Other Input Data" + ] + }, + { + "cell_type": "markdown", + "id": "facaaff1", + "metadata": {}, + "source": [ + "### Input Data as array-like columns: NumPy arrays, lists...\n", + "\n", + "`px` arguments can also be array-like objects such as lists, NumPy arrays, in both long-form or wide-form (for certain functions)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca35c385", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "# List arguments\n", + "fig = px.line(x=[1, 2, 3, 4], y=[3, 5, 4, 8])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9d4fdc58", + "metadata": {}, + "source": [ + "List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[].name = \"name\"`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7beac960", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "# List arguments in wide form\n", + "series1 = [3, 5, 4, 8]\n", + "series2 = [5, 4, 8, 3]\n", + "fig = px.line(x=[1, 2, 3, 4], y=[series1, series2])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "66c139fb", + "metadata": {}, + "source": [ + "### Passing dictionaries or array-likes as the data_frame argument\n", + "\n", + "The `data_frame` argument can also accept a `dict` or `array` in addition to DataFrame objects. Using a dictionary can be a convenient way to pass column names used in axis titles, legend entries and hovers without creating a dataframe." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b7917a91", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "N = 10000\n", + "np.random.seed(0)\n", + "fig = px.density_contour(dict(effect_size=5 + np.random.randn(N),\n", + " waiting_time=np.random.poisson(size=N)),\n", + " x=\"effect_size\", y=\"waiting_time\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "308c0f9c", + "metadata": {}, + "source": [ + "To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.\n", + "\n", + "#### Integer column names\n", + "\n", + "When the `data_frame` argument is a NumPy array, column names are integer corresponding to the columns of the array. In this case, keyword names are used in axis, legend and hovers. This is also the case for a pandas DataFrame with integer column names. Use the `labels` argument to override these names." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "13e13dae", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import plotly.express as px\n", + "\n", + "ar = np.arange(100).reshape((10, 10))\n", + "fig = px.scatter(ar, x=2, y=6, size=1, color=5)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "493aca22", + "metadata": {}, + "source": [ + "### Mixing dataframes and other types\n", + "\n", + "It is possible to mix dataframe columns, NumPy arrays and lists as arguments. Remember that the only column names to be used correspond to columns in the `data_frame` argument, use `labels` to override names displayed in axis titles, legend entries or hovers." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "af02d905", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "df = px.data.gapminder()\n", + "gdp = np.log(df['pop'] * df['gdpPercap']) # NumPy array\n", + "fig = px.bar(df, x='year', y=gdp, color='continent', labels={'y':'log gdp'},\n", + " hover_data=['country'],\n", + " title='Evolution of world GDP')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f4c1d815", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "Input data arguments accepted by Plotly Express functions", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Plotly Express Arguments", + "order": 19, + "page_type": "u-guide", + "permalink": "python/px-arguments/", + "thumbnail": "thumbnail/plotly-express.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/quiver-plots.ipynb b/quiver-plots.ipynb new file mode 100644 index 000000000..3f1b3f034 --- /dev/null +++ b/quiver-plots.ipynb @@ -0,0 +1,152 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3b45f886", + "metadata": {}, + "source": [ + "Quiver plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", + "\n", + "#### Basic Quiver Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f8cb89df", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "import numpy as np\n", + "\n", + "x,y = np.meshgrid(np.arange(0, 2, .2), np.arange(0, 2, .2))\n", + "u = np.cos(x)*y\n", + "v = np.sin(x)*y\n", + "\n", + "fig = ff.create_quiver(x, y, u, v)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "158aba05", + "metadata": {}, + "source": [ + "#### Quiver Plot with Points" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dd9c5a88", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "x,y = np.meshgrid(np.arange(-2, 2, .2),\n", + " np.arange(-2, 2, .25))\n", + "z = x*np.exp(-x**2 - y**2)\n", + "v, u = np.gradient(z, .2, .2)\n", + "\n", + "# Create quiver figure\n", + "fig = ff.create_quiver(x, y, u, v,\n", + " scale=.25,\n", + " arrow_scale=.4,\n", + " name='quiver',\n", + " line_width=1)\n", + "\n", + "# Add points to figure\n", + "fig.add_trace(go.Scatter(x=[-.7, .75], y=[0,0],\n", + " mode='markers',\n", + " marker_size=12,\n", + " name='points'))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "aff0903d", + "metadata": {}, + "source": [ + "#### See also\n", + "\n", + "[Cone plot](/python/cone-plot) for the 3D equivalent of quiver plots.\n", + "\n", + "#### Reference\n", + "\n", + "For more info on `ff.create_quiver()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_quiver.html)" + ] + }, + { + "cell_type": "markdown", + "id": "f7676106", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make a quiver plot in Python. A quiver plot displays velocity vectors a arrows.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Quiver Plots", + "order": 10, + "permalink": "python/quiver-plots/", + "thumbnail": "thumbnail/quiver-plot.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/radar-chart.ipynb b/radar-chart.ipynb new file mode 100644 index 000000000..921884de1 --- /dev/null +++ b/radar-chart.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "5180bfb3", + "metadata": {}, + "source": [ + "A [Radar Chart](https://en.wikipedia.org/wiki/Radar_chart) (also known as a spider plot or star plot) displays multivariate data in the form of a two-dimensional chart of quantitative variables represented on axes originating from the center. The relative position and angle of the axes is typically uninformative. It is equivalent to a [parallel coordinates plot](/python/parallel-coordinates-plot/) with the axes arranged radially.\n", + "\n", + "For a Radar Chart, use a [polar chart](/python/polar-chart/) with categorical angular variables, with `px.line_polar`, or with `go.Scatterpolar`. See [more examples of polar charts](/python/polar-chart/).\n", + "\n", + "#### Radar Chart with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "Use `line_close=True` for closed lines." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5e2be1b0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "df = pd.DataFrame(dict(\n", + " r=[1, 5, 2, 2, 3],\n", + " theta=['processing cost','mechanical properties','chemical stability',\n", + " 'thermal stability', 'device integration']))\n", + "fig = px.line_polar(df, r='r', theta='theta', line_close=True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "64c068a3", + "metadata": {}, + "source": [ + "For a filled line in a Radar Chart, update the figure created with `px.line_polar` with `fig.update_traces`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "943bca16", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "df = pd.DataFrame(dict(\n", + " r=[1, 5, 2, 2, 3],\n", + " theta=['processing cost','mechanical properties','chemical stability',\n", + " 'thermal stability', 'device integration']))\n", + "fig = px.line_polar(df, r='r', theta='theta', line_close=True)\n", + "fig.update_traces(fill='toself')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "414f81df", + "metadata": {}, + "source": [ + "### Basic Radar Chart with go.Scatterpolar" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6f84375f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=go.Scatterpolar(\n", + " r=[1, 5, 2, 2, 3],\n", + " theta=['processing cost','mechanical properties','chemical stability', 'thermal stability',\n", + " 'device integration'],\n", + " fill='toself'\n", + "))\n", + "\n", + "fig.update_layout(\n", + " polar=dict(\n", + " radialaxis=dict(\n", + " visible=True\n", + " ),\n", + " ),\n", + " showlegend=False\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cc4d24b1", + "metadata": {}, + "source": [ + "#### Multiple Trace Radar Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a2dde280", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "categories = ['processing cost','mechanical properties','chemical stability',\n", + " 'thermal stability', 'device integration']\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatterpolar(\n", + " r=[1, 5, 2, 2, 3],\n", + " theta=categories,\n", + " fill='toself',\n", + " name='Product A'\n", + "))\n", + "fig.add_trace(go.Scatterpolar(\n", + " r=[4, 3, 2.5, 1, 2],\n", + " theta=categories,\n", + " fill='toself',\n", + " name='Product B'\n", + "))\n", + "\n", + "fig.update_layout(\n", + " polar=dict(\n", + " radialaxis=dict(\n", + " visible=True,\n", + " range=[0, 5]\n", + " )),\n", + " showlegend=False\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f57087a0", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.(line_polar)`](https://plotly.com/python-api-reference/generated/plotly.express.line_polar) or https://plotly.com/python/reference/scatterpolar/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "dfea1067", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to make radar charts in Python with Plotly.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Radar Charts", + "order": 17, + "page_type": "u-guide", + "permalink": "python/radar-chart/", + "thumbnail": "thumbnail/radar.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/random-walk.ipynb b/random-walk.ipynb new file mode 100644 index 000000000..4e3fe6e73 --- /dev/null +++ b/random-walk.ipynb @@ -0,0 +1,248 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6df27aaf", + "metadata": {}, + "source": [ + "A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\\mathbb{Z}$), two dimensions ($\\mathbb{Z}^2$) or three dimensions ($\\mathbb{Z}^3$) in Cartesian space, where $\\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plotly.com/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.\n", + "\n", + "#### Random Walk in 1D\n", + "\n", + "The jitter in the data points along the x and y axes are meant to illuminate where the points are being drawn and what the tendency of the random walk is." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25592327", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "l = 100\n", + "steps = np.random.choice([-1, 1], size=l) + 0.05 * np.random.randn(l) # l steps\n", + "position = np.cumsum(steps) # integrate the position by summing steps values\n", + "y = 0.05 * np.random.randn(l)\n", + "\n", + "fig = go.Figure(data=go.Scatter(\n", + " x=position,\n", + " y=y,\n", + " mode='markers',\n", + " name='Random Walk in 1D',\n", + " marker=dict(\n", + " color=np.arange(l),\n", + " size=7,\n", + " colorscale='Reds',\n", + " showscale=True,\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(yaxis_range=[-1, 1])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2a649539", + "metadata": {}, + "source": [ + "#### Random Walk in 2D" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8de53287", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "l = 1000\n", + "x_steps = np.random.choice([-1, 1], size=l) + 0.2 * np.random.randn(l) # l steps\n", + "y_steps = np.random.choice([-1, 1], size=l) + 0.2 * np.random.randn(l) # l steps\n", + "x_position = np.cumsum(x_steps) # integrate the position by summing steps values\n", + "y_position = np.cumsum(y_steps) # integrate the position by summing steps values\n", + "\n", + "fig = go.Figure(data=go.Scatter(\n", + " x=x_position,\n", + " y=y_position,\n", + " mode='markers',\n", + " name='Random Walk',\n", + " marker=dict(\n", + " color=np.arange(l),\n", + " size=8,\n", + " colorscale='Greens',\n", + " showscale=True\n", + " )\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "add54cd4", + "metadata": {}, + "source": [ + "#### Random walk and diffusion\n", + "\n", + "In the two following charts we show the link between random walks and diffusion. We compute a large number `N` of random walks representing for examples molecules in a small drop of chemical. While all trajectories start at 0, after some time the spatial distribution of points is a Gaussian distribution. Also, the average distance to the origin grows as $\\sqrt(t)$." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "51fd6a72", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "l = 1000\n", + "N = 10000\n", + "steps = np.random.choice([-1, 1], size=(N, l)) + 0.05 * np.random.standard_normal((N, l)) # l steps\n", + "position = np.cumsum(steps, axis=1) # integrate all positions by summing steps values along time axis\n", + "\n", + "fig = go.Figure(data=go.Histogram(x=position[:, -1])) # positions at final time step\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0060840e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import numpy as np\n", + "\n", + "l = 1000\n", + "N = 10000\n", + "t = np.arange(l)\n", + "steps = np.random.choice([-1, 1], size=(N, l)) + 0.05 * np.random.standard_normal((N, l)) # l steps\n", + "position = np.cumsum(steps, axis=1) # integrate the position by summing steps values\n", + "average_distance = np.std(position, axis=0) # average distance\n", + "\n", + "fig = make_subplots(1, 2)\n", + "fig.add_trace(go.Scatter(x=t, y=average_distance, name='mean distance'), 1, 1)\n", + "fig.add_trace(go.Scatter(x=t, y=average_distance**2, name='mean squared distance'), 1, 2)\n", + "fig.update_xaxes(title_text='$t$')\n", + "fig.update_yaxes(title_text='$l$', col=1)\n", + "fig.update_yaxes(title_text='$l^2$', col=2)\n", + "fig.update_layout(showlegend=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ac32a43a", + "metadata": {}, + "source": [ + "#### Advanced Tip\n", + "\n", + "We can formally think of a 1D random walk as a point jumping along the integer number line. Let $Z_i$ be a random variable that takes on the values +1 and -1. Let this random variable represent the steps we take in the random walk in 1D (where +1 means right and -1 means left). Also, as with the above visualizations, let us assume that the probability of moving left and right is just $\\frac{1}{2}$. Then, consider the sum\n", + "\n", + "$$\n", + "\\begin{align*}\n", + "S_n = \\sum_{i=0}^{n}{Z_i}\n", + "\\end{align*}\n", + "$$\n", + "\n", + "where S_n represents the point that the random walk ends up on after n steps have been taken.\n", + "\n", + "To find the `expected value` of $S_n$, we can compute it directly. Since each $Z_i$ is independent, we have\n", + "\n", + "$$\n", + "\\begin{align*}\n", + "\\mathbb{E}(S_n) = \\sum_{i=0}^{n}{\\mathbb{E}(Z_i)}\n", + "\\end{align*}\n", + "$$\n", + "\n", + "but since $Z_i$ takes on the values +1 and -1 then\n", + "\n", + "$$\n", + "\\begin{align*}\n", + "\\mathbb{E}(Z_i) = 1 \\cdot P(Z_i=1) + -1 \\cdot P(Z_i=-1) = \\frac{1}{2} - \\frac{1}{2} = 0\n", + "\\end{align*}\n", + "$$\n", + "\n", + "Therefore, we expect our random walk to hover around $0$ regardless of how many steps we take in our walk.\n" + ] + }, + { + "cell_type": "markdown", + "id": "4279422a", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "Learn how to use Python to make a Random Walk", + "display_as": "advanced_opt", + "has_thumbnail": false, + "language": "python", + "layout": "base", + "name": "Random Walk", + "order": 2, + "page_type": "example_index", + "permalink": "python/random-walk/", + "thumbnail": "/images/static-image" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/range-slider.ipynb b/range-slider.ipynb new file mode 100644 index 000000000..bb67b82fb --- /dev/null +++ b/range-slider.ipynb @@ -0,0 +1,429 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a71598fd", + "metadata": {}, + "source": [ + "#### Basic Range Slider and Range Selectors" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "344943cd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "# Load data\n", + "df = pd.read_csv(\n", + " \"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv\")\n", + "df.columns = [col.replace(\"AAPL.\", \"\") for col in df.columns]\n", + "\n", + "# Create figure\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(x=list(df.Date), y=list(df.High)))\n", + "\n", + "# Set title\n", + "fig.update_layout(\n", + " title_text=\"Time series with range slider and selectors\"\n", + ")\n", + "\n", + "# Add range slider\n", + "fig.update_layout(\n", + " xaxis=dict(\n", + " rangeselector=dict(\n", + " buttons=list([\n", + " dict(count=1,\n", + " label=\"1m\",\n", + " step=\"month\",\n", + " stepmode=\"backward\"),\n", + " dict(count=6,\n", + " label=\"6m\",\n", + " step=\"month\",\n", + " stepmode=\"backward\"),\n", + " dict(count=1,\n", + " label=\"YTD\",\n", + " step=\"year\",\n", + " stepmode=\"todate\"),\n", + " dict(count=1,\n", + " label=\"1y\",\n", + " step=\"year\",\n", + " stepmode=\"backward\"),\n", + " dict(step=\"all\")\n", + " ])\n", + " ),\n", + " rangeslider=dict(\n", + " visible=True\n", + " ),\n", + " type=\"date\"\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "febd539e", + "metadata": {}, + "source": [ + "#### Range Slider with Vertically Stacked Subplots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4019f284", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "# Create figure\n", + "fig = go.Figure()\n", + "\n", + "# Add traces\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2013-01-15\", \"2013-01-29\", \"2013-02-26\", \"2013-04-19\", \"2013-07-02\",\n", + " \"2013-08-27\",\n", + " \"2013-10-22\", \"2014-01-20\", \"2014-05-05\", \"2014-07-01\", \"2015-02-09\",\n", + " \"2015-04-13\",\n", + " \"2015-05-13\", \"2015-06-08\", \"2015-08-05\", \"2016-02-25\"],\n", + " y=[\"8\", \"3\", \"2\", \"10\", \"5\", \"5\", \"6\", \"8\", \"3\", \"3\", \"7\", \"5\", \"10\", \"10\", \"9\",\n", + " \"14\"],\n", + " name=\"var0\",\n", + " text=[\"8\", \"3\", \"2\", \"10\", \"5\", \"5\", \"6\", \"8\", \"3\", \"3\", \"7\", \"5\", \"10\", \"10\", \"9\",\n", + " \"14\"],\n", + " yaxis=\"y\",\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2015-04-13\", \"2015-05-13\", \"2015-06-08\", \"2015-08-05\", \"2016-02-25\"],\n", + " y=[\"53.0\", \"69.0\", \"89.0\", \"41.0\", \"41.0\"],\n", + " name=\"var1\",\n", + " text=[\"53.0\", \"69.0\", \"89.0\", \"41.0\", \"41.0\"],\n", + " yaxis=\"y2\",\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2013-01-29\", \"2013-02-26\", \"2013-04-19\", \"2013-07-02\", \"2013-08-27\",\n", + " \"2013-10-22\",\n", + " \"2014-01-20\", \"2014-04-09\", \"2014-05-05\", \"2014-07-01\", \"2014-09-30\",\n", + " \"2015-02-09\",\n", + " \"2015-04-13\", \"2015-06-08\", \"2016-02-25\"],\n", + " y=[\"9.6\", \"4.6\", \"2.7\", \"8.3\", \"18\", \"7.3\", \"3\", \"7.5\", \"1.0\", \"0.5\", \"2.8\", \"9.2\",\n", + " \"13\", \"5.8\", \"6.9\"],\n", + " name=\"var2\",\n", + " text=[\"9.6\", \"4.6\", \"2.7\", \"8.3\", \"18\", \"7.3\", \"3\", \"7.5\", \"1.0\", \"0.5\", \"2.8\",\n", + " \"9.2\",\n", + " \"13\", \"5.8\", \"6.9\"],\n", + " yaxis=\"y3\",\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2013-01-29\", \"2013-02-26\", \"2013-04-19\", \"2013-07-02\", \"2013-08-27\",\n", + " \"2013-10-22\",\n", + " \"2014-01-20\", \"2014-04-09\", \"2014-05-05\", \"2014-07-01\", \"2014-09-30\",\n", + " \"2015-02-09\",\n", + " \"2015-04-13\", \"2015-06-08\", \"2016-02-25\"],\n", + " y=[\"6.9\", \"7.5\", \"7.3\", \"7.3\", \"6.9\", \"7.1\", \"8\", \"7.8\", \"7.4\", \"7.9\", \"7.9\", \"7.6\",\n", + " \"7.2\", \"7.2\", \"8.0\"],\n", + " name=\"var3\",\n", + " text=[\"6.9\", \"7.5\", \"7.3\", \"7.3\", \"6.9\", \"7.1\", \"8\", \"7.8\", \"7.4\", \"7.9\", \"7.9\",\n", + " \"7.6\",\n", + " \"7.2\", \"7.2\", \"8.0\"],\n", + " yaxis=\"y4\",\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2013-02-26\", \"2013-07-02\", \"2013-09-26\", \"2013-10-22\", \"2013-12-04\",\n", + " \"2014-01-02\",\n", + " \"2014-01-20\", \"2014-05-05\", \"2014-07-01\", \"2015-02-09\", \"2015-05-05\"],\n", + " y=[\"290\", \"1078\", \"263\", \"407\", \"660\", \"740\", \"33\", \"374\", \"95\", \"734\", \"3000\"],\n", + " name=\"var4\",\n", + " text=[\"290\", \"1078\", \"263\", \"407\", \"660\", \"740\", \"33\", \"374\", \"95\", \"734\", \"3000\"],\n", + " yaxis=\"y5\",\n", + "))\n", + "\n", + "# style all the traces\n", + "fig.update_traces(\n", + " hoverinfo=\"name+x+text\",\n", + " line={\"width\": 0.5},\n", + " marker={\"size\": 8},\n", + " mode=\"lines+markers\",\n", + " showlegend=False\n", + ")\n", + "\n", + "# Add annotations\n", + "fig.update_layout(\n", + " annotations=[\n", + " dict(\n", + " x=\"2013-06-01\",\n", + " y=0,\n", + " arrowcolor=\"rgba(63, 81, 181, 0.2)\",\n", + " arrowsize=0.3,\n", + " ax=0,\n", + " ay=30,\n", + " text=\"state1\",\n", + " xref=\"x\",\n", + " yanchor=\"bottom\",\n", + " yref=\"y\"\n", + " ),\n", + " dict(\n", + " x=\"2014-09-13\",\n", + " y=0,\n", + " arrowcolor=\"rgba(76, 175, 80, 0.1)\",\n", + " arrowsize=0.3,\n", + " ax=0,\n", + " ay=30,\n", + " text=\"state2\",\n", + " xref=\"x\",\n", + " yanchor=\"bottom\",\n", + " yref=\"y\"\n", + " )\n", + " ],\n", + ")\n", + "\n", + "# Add shapes\n", + "fig.update_layout(\n", + " shapes=[\n", + " dict(\n", + " fillcolor=\"rgba(63, 81, 181, 0.2)\",\n", + " line={\"width\": 0},\n", + " type=\"rect\",\n", + " x0=\"2013-01-15\",\n", + " x1=\"2013-10-17\",\n", + " xref=\"x\",\n", + " y0=0,\n", + " y1=0.95,\n", + " yref=\"paper\"\n", + " ),\n", + " dict(\n", + " fillcolor=\"rgba(76, 175, 80, 0.1)\",\n", + " line={\"width\": 0},\n", + " type=\"rect\",\n", + " x0=\"2013-10-22\",\n", + " x1=\"2015-08-05\",\n", + " xref=\"x\",\n", + " y0=0,\n", + " y1=0.95,\n", + " yref=\"paper\"\n", + " )\n", + " ]\n", + ")\n", + "\n", + "# Update axes\n", + "fig.update_layout(\n", + " xaxis=dict(\n", + " autorange=True,\n", + " range=[\"2012-10-31 18:36:37.3129\", \"2016-05-10 05:23:22.6871\"],\n", + " rangeslider=dict(\n", + " autorange=True,\n", + " range=[\"2012-10-31 18:36:37.3129\", \"2016-05-10 05:23:22.6871\"]\n", + " ),\n", + " type=\"date\"\n", + " ),\n", + " yaxis=dict(\n", + " anchor=\"x\",\n", + " autorange=True,\n", + " domain=[0, 0.2],\n", + " linecolor=\"#673ab7\",\n", + " mirror=True,\n", + " range=[-60.0858369099, 28.4406294707],\n", + " showline=True,\n", + " side=\"right\",\n", + " tickfont={\"color\": \"#673ab7\"},\n", + " tickmode=\"auto\",\n", + " ticks=\"\",\n", + " title=dict(\n", + " font=dict(\n", + " color=\"#673ab7\"\n", + " )\n", + " ),\n", + " type=\"linear\",\n", + " zeroline=False\n", + " ),\n", + " yaxis2=dict(\n", + " anchor=\"x\",\n", + " autorange=True,\n", + " domain=[0.2, 0.4],\n", + " linecolor=\"#E91E63\",\n", + " mirror=True,\n", + " range=[29.3787777032, 100.621222297],\n", + " showline=True,\n", + " side=\"right\",\n", + " tickfont={\"color\": \"#E91E63\"},\n", + " tickmode=\"auto\",\n", + " ticks=\"\",\n", + " title=dict(\n", + " font=dict(\n", + " color=\"#E91E63\"\n", + " )\n", + " ),\n", + " type=\"linear\",\n", + " zeroline=False\n", + " ),\n", + " yaxis3=dict(\n", + " anchor=\"x\",\n", + " autorange=True,\n", + " domain=[0.4, 0.6],\n", + " linecolor=\"#795548\",\n", + " mirror=True,\n", + " range=[-3.73690396239, 22.2369039624],\n", + " showline=True,\n", + " side=\"right\",\n", + " tickfont={\"color\": \"#795548\"},\n", + " tickmode=\"auto\",\n", + " ticks=\"\",\n", + " title=dict(\n", + " text=\"mg/L\",\n", + " font=dict(\n", + " color=\"#795548\"\n", + " )\n", + " ),\n", + " type=\"linear\",\n", + " zeroline=False\n", + " ),\n", + " yaxis4=dict(\n", + " anchor=\"x\",\n", + " autorange=True,\n", + " domain=[0.6, 0.8],\n", + " linecolor=\"#607d8b\",\n", + " mirror=True,\n", + " range=[6.63368032236, 8.26631967764],\n", + " showline=True,\n", + " side=\"right\",\n", + " tickfont={\"color\": \"#607d8b\"},\n", + " tickmode=\"auto\",\n", + " ticks=\"\",\n", + " title=dict(\n", + " text=\"mmol/L\",\n", + " font=dict(\n", + " color=\"#607d8b\"\n", + " )\n", + " ),\n", + " type=\"linear\",\n", + " zeroline=False\n", + " ),\n", + " yaxis5=dict(\n", + " anchor=\"x\",\n", + " autorange=True,\n", + " domain=[0.8, 1],\n", + " linecolor=\"#2196F3\",\n", + " mirror=True,\n", + " range=[-685.336803224, 3718.33680322],\n", + " showline=True,\n", + " side=\"right\",\n", + " tickfont={\"color\": \"#2196F3\"},\n", + " tickmode=\"auto\",\n", + " ticks=\"\",\n", + " title=dict(\n", + " text=\"mg/Kg\",\n", + " font=dict(\n", + " color=\"#2196F3\"\n", + " )\n", + " ),\n", + " type=\"linear\",\n", + " zeroline=False\n", + " )\n", + ")\n", + "\n", + "# Update layout\n", + "fig.update_layout(\n", + " dragmode=\"zoom\",\n", + " hovermode=\"x\",\n", + " legend=dict(traceorder=\"reversed\"),\n", + " height=600,\n", + " template=\"plotly_white\",\n", + " margin=dict(\n", + " t=100,\n", + " b=100\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3c42465", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeselector
and https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeslider
for more information and attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "115e2bd4", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + }, + "plotly": { + "description": "Now you can implement range sliders and selectors in your Plotly graphs purely with python!", + "display_as": "controls", + "language": "python", + "layout": "base", + "name": "Range Slider and Selector", + "order": 3, + "page_type": "example_index", + "permalink": "python/range-slider/", + "thumbnail": "thumbnail/sliders.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt b/raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt new file mode 100644 index 000000000..6f5a588bc --- /dev/null +++ b/raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt @@ -0,0 +1,100 @@ +0.689484 -0.014459 0.428751 +0.476483 0.162624 0.449488 +0.586770 0.102149 0.769481 +1.068768 0.678668 1.023915 +1.438060 0.683633 0.752397 +1.483567 0.140479 1.389489 +1.163844 0.125522 1.098527 +1.491083 0.317640 0.760376 +1.970356 0.389628 0.631279 +1.961689 0.144644 0.254462 +1.823355 0.309693 0.151225 +1.868743 0.171245 -0.160235 +1.437345 0.781093 -0.569670 +1.248269 0.429151 -0.795403 +1.108745 0.233132 -0.744953 +1.670774 -0.080785 -0.820339 +1.503391 -0.179939 -0.791839 +1.406028 0.025858 -0.967830 +1.971070 0.309369 -0.651420 +1.853437 0.658340 -0.661080 +1.361601 0.443953 -0.126488 +1.139926 1.295734 0.114152 +1.949556 1.032481 0.417303 +2.323108 0.665570 0.615544 +2.558936 0.227190 0.385185 +2.650508 0.817791 0.186861 +2.431305 1.189158 -0.085800 +2.026224 1.167509 -0.120976 +1.971259 0.499964 -0.035002 +1.168452 0.683057 -0.309909 +1.342775 0.672141 -0.208439 +1.129037 0.183479 -0.485355 +0.871781 0.069470 -0.734185 +0.855148 0.587134 -0.574637 +0.395625 0.606762 -1.004597 +1.051331 0.804046 -1.250838 +1.309558 0.672450 -1.174746 +1.876837 0.506276 -1.376205 +2.620561 0.556901 -1.528117 +2.508878 0.445584 -1.501028 +2.646833 0.160679 -1.605397 +2.448341 -0.003327 -1.875326 +1.610501 0.031129 -2.069439 +1.925691 -0.412504 -2.138976 +1.918400 -0.344678 -2.299420 +1.910517 -0.246417 -2.245133 +2.450736 -0.725501 -2.828320 +2.381144 -1.214003 -2.812268 +2.159600 -1.524586 -2.873087 +2.379856 -1.845657 -2.758474 +2.254824 -1.268736 -3.020816 +2.320000 -1.171255 -3.604322 +1.698536 -1.233225 -3.369023 +1.527831 -1.374688 -3.394583 +1.530377 -1.355630 -3.295790 +1.672040 -1.146433 -3.038195 +1.534793 -1.167195 -3.646896 +1.886021 -0.864813 -3.523450 +2.062097 -0.488551 -3.273344 +2.128729 0.153843 -3.081451 +2.057646 0.302593 -2.701675 +2.155564 0.568636 -2.718267 +2.698137 0.182249 -2.875416 +3.066121 0.562960 -2.909034 +3.925938 0.252966 -3.011479 +4.240422 -0.220912 -2.795740 +3.907132 -0.328587 -2.430246 +3.750647 -0.193345 -2.166711 +2.918651 -0.238123 -2.143549 +2.980647 0.261956 -2.218529 +2.992436 0.081961 -2.173249 +2.710340 -0.490590 -1.838208 +2.693541 -0.259896 -1.613949 +2.361263 -0.187197 -1.208869 +1.897547 -0.032457 -0.792615 +2.345557 0.049672 -1.164745 +2.007566 0.121710 -1.080368 +1.599818 -0.105825 -1.086920 +1.182395 -0.745416 -0.878417 +1.469907 -0.795117 -0.562867 +1.460792 -0.450440 -0.599801 +1.113180 -0.514758 -0.508419 +0.879555 -0.639992 -0.672436 +1.351152 -0.329654 -0.829762 +1.392628 -0.215191 -0.596751 +1.926062 -0.375350 -0.554818 +1.211311 -1.208597 -0.556275 +0.913065 -1.064432 -0.494078 +1.363192 -1.338370 -0.238343 +2.032102 -1.405084 -0.335621 +1.738637 -1.456743 0.028875 +1.249448 -1.299677 0.102270 +0.610179 -1.236958 0.315250 +0.853197 -0.482796 0.164532 +0.794531 -0.346327 -0.462431 +0.635271 -0.689043 -0.492473 +0.545627 -0.840409 -0.344744 +0.137978 -1.164410 -0.537114 +0.552325 -1.242295 -0.476395 +0.417952 -1.794645 -0.288381 diff --git a/renderers.ipynb b/renderers.ipynb new file mode 100644 index 000000000..d3b06e3df --- /dev/null +++ b/renderers.ipynb @@ -0,0 +1,472 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "cd34439d", + "metadata": {}, + "source": [ + "# Displaying Figures\n", + "\n", + "Plotly's Python graphing library, `plotly.py`, gives you a wide range of options for how and where to display your figures.\n", + "\n", + "In general, there are six different approaches you can take in order to display `plotly` figures:\n", + "\n", + " - Using the `renderers` framework in the context of a script or notebook (the main topic of this page)\n", + " - Using [Plotly Studio](https://plotly.com/studio?utm_medium=graphing_libraries&utm_content=python_renderers) to generate charts using natural language\n", + " - Using [Dash](https://dash.plot.ly) in a web app context\n", + " - Using a [`FigureWidget` rather than a `Figure`](https://plotly.com/python/figurewidget/) in an [`ipywidgets` context](https://ipywidgets.readthedocs.io/en/stable/)\n", + " - By [exporting to an HTML file](https://plotly.com/python/interactive-html-export/) and loading that file in a browser immediately or later\n", + " - By [rendering the figure to a static image file using Kaleido](https://plotly.com/python/static-image-export/) such as PNG, JPEG, SVG, PDF or EPS and loading the resulting file in any viewer\n", + "\n", + "Each of the first four approaches is discussed below.\n", + "\n", + "### Displaying Figures Using The `renderers` Framework\n", + "\n", + "The renderers framework is a flexible approach for displaying `plotly.py` figures in a variety of contexts. To display a figure using the renderers framework, you call the `.show()` method on a graph object figure, or pass the figure to the `plotly.io.show` function. With either approach, `plotly.py` will display the figure using the current default renderer(s)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8feec4e0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displayed with fig.show()\"\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "90ddb41f", + "metadata": {}, + "source": [ + "In most situations, you can omit the call to `.show()` and allow the figure to display itself." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c90a9ac8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displaying Itself\"\n", + ")\n", + "fig" + ] + }, + { + "cell_type": "markdown", + "id": "9e5b2147", + "metadata": {}, + "source": [ + "> To be precise, figures will display themselves using the current default renderer when the two following conditions are true. First, the last expression in a cell must evaluate to a figure. Second, `plotly.py` must be running from within an `IPython` kernel.\n", + "\n", + "**In many contexts, an appropriate renderer will be chosen automatically and you will not need to perform any additional configuration.** These contexts include the classic [Jupyter Notebook](https://jupyter.org/), [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), [Visual Studio Code notebooks](https://code.visualstudio.com/docs/python/jupyter-support), [Google Colab](https://colab.research.google.com/notebooks/intro.ipynb), [Kaggle](https://www.kaggle.com/kernels) notebooks, [Azure](https://notebooks.azure.com/) notebooks, and the [Python interactive shell](https://www.python.org/shell/).\n", + "\n", + "Additional contexts are supported by choosing a compatible renderer including [QtConsole](https://qtconsole.readthedocs.io/en/stable/), [Spyder](https://www.spyder-ide.org/), and more.\n", + "\n", + "Next, we will show how to configure the default renderer. After that, we will describe all of the built-in renderers and discuss why you might choose to use each one.\n", + "\n", + "> Note: The `renderers` framework is a generalization of the `plotly.offline.iplot` and `plotly.offline.plot` functions that were the recommended way to display figures prior to `plotly.py` version 4. These functions have been reimplemented using the `renderers` framework and are still supported for backward compatibility, but they will not be discussed here." + ] + }, + { + "cell_type": "markdown", + "id": "59f884e8", + "metadata": {}, + "source": [ + "#### Setting The Default Renderer\n", + "The current and available renderers are configured using the `plotly.io.renderers` configuration object. Display this object to see the current default renderer and the list of all available renderers." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "49a640fd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "pio.renderers" + ] + }, + { + "cell_type": "markdown", + "id": "8c6fb81a", + "metadata": {}, + "source": [ + "The default renderer that you see when you display `pio.renderers` might be different than what is shown here. This is because `plotly.py` attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of an available renderer to the `pio.renderers.default` property. For example, to switch to the `'browser'` renderer, which opens figures in a tab of the default web browser, you would run the following." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4898bf60", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "pio.renderers.default = \"browser\"" + ] + }, + { + "cell_type": "markdown", + "id": "ccb8677f", + "metadata": {}, + "source": [ + "> Note: Default renderers persist for the duration of a single session. For example, if you set a default renderer in an `IPython` kernel, that default won't persist across kernel restarts.\n", + "\n", + "It is also possible to set the default renderer using a system environment variable. At startup, `plotly.py` checks for the existence of an environment variable named `PLOTLY_RENDERER`. If this environment variable is set to the name of an available renderer, this renderer is set as the default.\n", + "\n", + "#### Overriding The Default Renderer\n", + "You can override the default renderer temporarily by passing the name of an available renderer as the `renderer` keyword argument to a figure's `show()` method. For example, to use the `svg` renderer (described later) without changing the default renderer, set `renderer=\"svg\"`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dc401659", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displayed with the 'svg' Renderer\"\n", + ")\n", + "fig.show(renderer=\"svg\")" + ] + }, + { + "cell_type": "markdown", + "id": "c5f8e2bb", + "metadata": {}, + "source": [ + "#### Built-in Renderers\n", + "In this section, we will describe the built-in renderers so that you can choose the one(s) that best suit your needs.\n", + "\n", + "##### Interactive Renderers\n", + "Interactive renderers display figures using the plotly.js JavaScript library and are fully interactive, supporting pan, zoom, hover tooltips, etc.\n", + "\n", + "###### `notebook`\n", + "This renderer is intended for use in the classic [Jupyter Notebook](https://jupyter.org/install.html) (not JupyterLab). The full plotly.js JavaScript library bundle is added to the notebook the first time a figure is rendered, so this renderer will work without an internet connection.\n", + "\n", + "This renderer is a good choice for notebooks that will be exported to HTML files (Either using [nbconvert](https://nbconvert.readthedocs.io/en/latest/) or the \"Download as HTML\" menu action) because the exported HTML files will work without an internet connection.\n", + "\n", + "> Note: Adding the plotly.js bundle to the notebook adds a few megabytes to the notebook size. If you can count on always having an internet connection, you may want to consider using the `notebook_connected` renderer if notebook size is a constraint.\n", + "\n", + "###### `notebook_connected`\n", + "This renderer is the same as `notebook` renderer, except the plotly.js JavaScript library bundle is loaded from an online CDN location. This saves a few megabytes in notebook size, but an internet connection is required in order to display figures that are rendered this way.\n", + "\n", + "This renderer is a good choice for notebooks that will be shared with [nbviewer](https://nbviewer.jupyter.org/) since users must have an active internet connection to access nbviewer in the first place.\n", + "\n", + "###### `kaggle` and `azure`\n", + "These are aliases for `notebook_connected` because this renderer is a good choice for use with [Kaggle Notebooks](https://www.kaggle.com/docs/notebooks) and [Azure Notebooks](https://notebooks.azure.com/).\n", + "\n", + "###### `colab`\n", + "This is a custom renderer for use with [Google Colab](https://colab.research.google.com).\n", + "\n", + "###### `browser`\n", + "This renderer will open a figure in a browser tab using the default web browser. This renderer can only be used when the Python kernel is running locally on the same machine as the web browser, so it is not compatible with Jupyter Hub or online notebook services.\n", + "\n", + "> Implementation Note 1: In this context, the \"default browser\" is the browser that is chosen by the Python [`webbrowser`](https://docs.python.org/3.7/library/webbrowser.html) module.\n", + "\n", + "> Implementation Note 2: The `browser` renderer works by setting up a single use local webserver on a local port. Since the webserver is shut down as soon as the figure is served to the browser, the figure will not be restored if the browser is refreshed.\n", + "\n", + "###### `firefox`, `chrome`, and `chromium`\n", + "These renderers are the same as the `browser` renderer, but they force the use of a particular browser.\n", + "\n", + "###### `iframe` and `iframe_connected`\n", + "These renderers write figures out as standalone HTML files and then display [`iframe`](https://www.w3schools.com/html/html_iframe.asp) elements that reference these HTML files. The `iframe` renderer will include the plotly.js JavaScript bundle in each HTML file that is written, while the `iframe_connected` renderer includes only a reference to an online CDN location from which to load plotly.js. Consequently, the `iframe_connected` renderer outputs files that are smaller than the `iframe` renderer, but it requires an internet connection while the `iframe` renderer can operate offline.\n", + "\n", + "This renderer may be useful when working with notebooks that contain lots of large figures. When using the `notebook` or `notebook_connected` renderer, all of the data for all of the figures in a notebook are stored inline in the notebook itself. If this would result in a prohibitively large notebook size, an `iframe` or `iframe_connected` renderer could be used instead. With the `iframe` renderers, the figure data are stored in the individual HTML files rather than in the notebook itself, resulting in a smaller notebook size.\n", + "\n", + "> Implementation Note: The HTML files written by the `iframe` renderers are stored in a subdirectory named `iframe_figures`. The HTML files are given names based on the execution number of the notebook cell that produced the figure. This means that each time a notebook kernel is restarted, any prior HTML files will be overwritten. This also means that you should not store multiple notebooks using an `iframe` renderer in the same directory, because this could result in figures from one notebook overwriting figures from another notebook." + ] + }, + { + "cell_type": "markdown", + "id": "01c03cb8", + "metadata": {}, + "source": [ + "###### `plotly_mimetype`\n", + "\n", + "The `plotly_mimetype` renderer creates a specification of the figure (called a MIME-type bundle), and requests that the current user interface displays it. User interfaces that support this renderer include [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), [nteract](https://nteract.io/), and the Visual Studio Code [notebook interface](https://code.visualstudio.com/docs/python/jupyter-support).\n", + "\n", + "###### `jupyterlab`, `nteract`, and `vscode`\n", + "These are aliases for `plotly_mimetype` since this renderer is a good choice when working in JupyterLab, nteract, and the Visual Studio Code notebook interface. Note that in VSCode Notebooks, the version of Plotly.js that is used to render is provided by the [vscode-python extension](https://code.visualstudio.com/docs/languages/python) and often trails the latest version by several weeks, so the latest features of `plotly` may not be available in VSCode right away. The situation is similar for Nteract.\n", + "\n", + "##### Static Image Renderers\n", + "A set of renderers is provided for displaying figures as static images. See the [Static Image Export](https://plotly.com/python/static-image-export/) page for more information on getting set up.\n", + "\n", + "###### `png`, `jpeg`, and `svg`\n", + "These renderers display figures as static `.png`, `.jpeg`, and `.svg` files, respectively. These renderers are useful for user interfaces that do not support inline HTML output, but do support inline static images. Examples include the [QtConsole](https://qtconsole.readthedocs.io/en/stable/), [Spyder](https://www.spyder-ide.org/), and the PyCharm [notebook interface](https://www.jetbrains.com/help/pycharm/jupyter-notebook-support.html)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1dedba3c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displayed with the 'png' Renderer\"\n", + ")\n", + "fig.show(renderer=\"png\")" + ] + }, + { + "cell_type": "markdown", + "id": "80c5ee5b", + "metadata": {}, + "source": [ + "###### PDF\n", + "This renderer displays figures as static PDF files. This is especially useful for notebooks that will be exported to PDF files using the LaTeX export capabilities of [`nbconvert`](https://nbconvert.readthedocs.io/en/latest/).\n", + "\n", + "##### Other Miscellaneous Renderers\n", + "\n", + "###### JSON\n", + "In editors that support it (JupyterLab, nteract, and the Visual Studio Code notebook interface), this renderer displays the JSON representation of a figure in a collapsible interactive tree structure. This can be very useful for examining the structure of complex figures.\n", + "\n", + "##### Multiple Renderers\n", + "You can specify that multiple renderers should be used by joining their names on `\"+\"` characters. This is useful when writing code that needs to support multiple contexts. For example, if a notebook specifies a default renderer string of `\"notebook+plotly_mimetype+pdf\"`, then this notebook would be able to run in the classic Jupyter Notebook as well as in JupyterLab, and it would support being exported to PDF using `nbconvert`.\n", + "\n", + "#### Customizing Built-In Renderers\n", + "Most built-in renderers have configuration options to customize their behavior. To view a description of a renderer, including its configuration options, access the renderer object using dictionary-style key lookup on the `plotly.io.renderers` configuration object and then display it. Here is an example of accessing and displaying the `png` renderer." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b4b00bb2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "png_renderer = pio.renderers[\"png\"]\n", + "png_renderer" + ] + }, + { + "cell_type": "markdown", + "id": "f820bb4e", + "metadata": {}, + "source": [ + "From this output, you can see that the `png` renderer supports 3 properties: `width`, `height`, and `scale`. You can customize these properties by assigning new values to them.\n", + "\n", + "Here is an example that customizes the `png` renderer to change the resulting image size, sets the `png` renderer as the default, and then displays a figure." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ad980c5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "png_renderer = pio.renderers[\"png\"]\n", + "png_renderer.width = 500\n", + "png_renderer.height = 500\n", + "\n", + "pio.renderers.default = \"png\"\n", + "\n", + "import plotly.graph_objects as go\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displayed with the 'png' Renderer\"\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c0f731d9", + "metadata": {}, + "source": [ + "You can also override the values of renderer parameters temporarily by passing them as keyword arguments to the `show()` method. For example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "11690457", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(\n", + " data=[go.Bar(y=[2, 1, 3])],\n", + " layout_title_text=\"A Figure Displayed with the 'png' Renderer\"\n", + ")\n", + "fig.show(renderer=\"png\", width=800, height=300)" + ] + }, + { + "cell_type": "markdown", + "id": "3ab444fc", + "metadata": {}, + "source": [ + "### Displaying figures in Plotly Studio\n", + "\n", + "Use [Plotly Studio](https://plotly.com/studio?utm_medium=graphing_libraries&utm_content=python_renderers) to build data apps with Plotly figures using natural language and AI. Describe the charts you want to Plotly Studio, which generates them within a [Dash](https://plotly.com/dash/?utm_medium=graphing_libraries&utm_content=python_renderers) app that you can publish to [Plotly Cloud](https://plotly.com/cloud/?utm_medium=graphing_libraries&utm_content=python_renderers) or [Dash Enterprise](https://plotly.com/dash/?utm_medium=graphing_libraries&utm_content=python_renderers)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "05a30713", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import HTML\n", + "HTML('
')" + ] + }, + { + "cell_type": "markdown", + "id": "b5a78000", + "metadata": {}, + "source": [ + "### Displaying figures in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/?utm_medium=graphing_libraries&utm_content=python_renderers) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/?utm_medium=graphing_libraries&utm_content=python_renderers) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "64a406d9", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'renderers', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "9bfdf266", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "2bd262a0", + "metadata": {}, + "source": [ + "## Displaying Figures Using `ipywidgets`\n", + "Plotly figures can be displayed in [ipywidgets](https://ipywidgets.readthedocs.io/en/stable/) contexts using `plotly.graph_objects.FigureWidget` objects. `FigureWidget` is a figure graph object (just like `plotly.graph_objects.Figure`), so you can add traces to it and update it just like a regular `Figure`. But `FigureWidget` is also an `ipywidgets` object, which means that you can display it alongside other `ipywidgets` to build user interfaces right in the notebook.\n", + "\n", + "See the [Plotly FigureWidget Overview](https://plot.ly/python/figurewidget/) for more information on integrating `plotly.py` figures with `ipywidgets`.\n", + "\n", + "It is important to note that `FigureWidget` does not use the renderers framework discussed above, so you should not use the `plotly.io.show` function on `FigureWidget` objects." + ] + }, + { + "cell_type": "markdown", + "id": "33169703", + "metadata": {}, + "source": [ + "## Performance\n", + "\n", + "No matter the approach chosen to display a figure, [the figure data structure](https://plotly.com/python/figure-structure/) is first (automatically, internally) serialized into a JSON string before being transferred from the Python context to the browser (or [to an HTML file first](https://plotly.com/python/interactive-html-export/) or [to Kaleido for static image export](https://plotly.com/python/static-image-export/)).\n", + "\n", + "*New in v5.0*\n", + "\n", + "The default JSON serialization mechanism can be slow for figures with many data points or with large `numpy` arrays or data frames. **If [the `orjson` package](https://github.com/ijl/orjson) is installed**, `plotly` will use that instead of the built-in `json` package, which can lead to **5-10x** speedups for large figures.\n", + "\n", + "Once a figure is serialized to JSON, it must be rendered by a browser, either immediately in the user's browser, at some later point if the figure is exported to HTML, or immediately in Kaleido's internal headless browser for static image export. Rendering time is generally proportional to the total number of data points in the figure, the number of traces and the number of subplots. In situations where rendering performance is slow, we recommend considering [the use of `plotly` WebGL traces](/python/webgl-vs-svg/) to exploit GPU-accelerated rendering in the browser, or [using the Datashader library to do Python-side rendering](/python/datashader/) before using `px.imshow()` to render the figure.\n" + ] + }, + { + "cell_type": "markdown", + "id": "f08f8870", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.0" + }, + "plotly": { + "description": "Displaying Figures using Plotly's Python graphing library", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Displaying Figures", + "order": 3, + "page_type": "example_index", + "permalink": "python/renderers/", + "redirect_from": "python/offline/", + "thumbnail": "thumbnail/displaying-figures.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/sankey-diagram.ipynb b/sankey-diagram.ipynb new file mode 100644 index 000000000..c691968ab --- /dev/null +++ b/sankey-diagram.ipynb @@ -0,0 +1,490 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e28be07a", + "metadata": {}, + "source": [ + "A [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram) is a flow diagram, in which the width of arrows is proportional to the flow quantity." + ] + }, + { + "cell_type": "markdown", + "id": "747488a3", + "metadata": {}, + "source": [ + "### Basic Sankey Diagram\n", + "Sankey diagrams visualize the contributions to a flow by defining [source](https://plotly.com/python/reference/sankey/#sankey-link-source) to represent the source node, [target](https://plotly.com/python/reference/sankey/#sankey-link-target) for the target node, [value](https://plotly.com/python/reference/sankey/#sankey-link-value) to set the flow volume, and [label](https://plotly.com/python/reference/sankey/#sankey-node-label) that shows the node name." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9c1533d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[go.Sankey(\n", + " node = dict(\n", + " pad = 15,\n", + " thickness = 20,\n", + " line = dict(color = \"black\", width = 0.5),\n", + " label = [\"A1\", \"A2\", \"B1\", \"B2\", \"C1\", \"C2\"],\n", + " color = \"blue\"\n", + " ),\n", + " link = dict(\n", + " source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A1, B1, ...\n", + " target = [2, 3, 3, 4, 4, 5],\n", + " value = [8, 4, 2, 8, 4, 2]\n", + " ))])\n", + "\n", + "fig.update_layout(title_text=\"Basic Sankey Diagram\", font_size=10)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "521c8982", + "metadata": {}, + "source": [ + "### More complex Sankey diagram with colored links" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a3dfa856", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import urllib, json\n", + "\n", + "url = 'https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json'\n", + "response = urllib.request.urlopen(url)\n", + "data = json.loads(response.read())\n", + "\n", + "# override gray link colors with 'source' colors\n", + "opacity = 0.4\n", + "# change 'magenta' to its 'rgba' value to add opacity\n", + "data['data'][0]['node']['color'] = ['rgba(255,0,255, 0.8)' if color == \"magenta\" else color for color in data['data'][0]['node']['color']]\n", + "data['data'][0]['link']['color'] = [data['data'][0]['node']['color'][src].replace(\"0.8\", str(opacity))\n", + " for src in data['data'][0]['link']['source']]\n", + "\n", + "fig = go.Figure(data=[go.Sankey(\n", + " valueformat = \".0f\",\n", + " valuesuffix = \"TWh\",\n", + " # Define nodes\n", + " node = dict(\n", + " pad = 15,\n", + " thickness = 15,\n", + " line = dict(color = \"black\", width = 0.5),\n", + " label = data['data'][0]['node']['label'],\n", + " color = data['data'][0]['node']['color']\n", + " ),\n", + " # Add links\n", + " link = dict(\n", + " source = data['data'][0]['link']['source'],\n", + " target = data['data'][0]['link']['target'],\n", + " value = data['data'][0]['link']['value'],\n", + " label = data['data'][0]['link']['label'],\n", + " color = data['data'][0]['link']['color']\n", + "))])\n", + "\n", + "fig.update_layout(title_text=\"Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock\",\n", + " font_size=10)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7d5f6301", + "metadata": {}, + "source": [ + "### Sankey Diagram in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "de33000c", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'sankey-diagram', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "e5f8f1d0", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "07111ebb", + "metadata": {}, + "source": [ + "### Style Sankey Diagram\n", + "This example also uses [hovermode](https://plotly.com/python/reference/layout/#layout-hovermode) to enable multiple tooltips." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "943cd469", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import urllib, json\n", + "\n", + "url = 'https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json'\n", + "response = urllib.request.urlopen(url)\n", + "data = json.loads(response.read())\n", + "\n", + "fig = go.Figure(data=[go.Sankey(\n", + " valueformat = \".0f\",\n", + " valuesuffix = \"TWh\",\n", + " node = dict(\n", + " pad = 15,\n", + " thickness = 15,\n", + " line = dict(color = \"black\", width = 0.5),\n", + " label = data['data'][0]['node']['label'],\n", + " color = data['data'][0]['node']['color']\n", + " ),\n", + " link = dict(\n", + " source = data['data'][0]['link']['source'],\n", + " target = data['data'][0]['link']['target'],\n", + " value = data['data'][0]['link']['value'],\n", + " label = data['data'][0]['link']['label']\n", + " ))])\n", + "\n", + "fig.update_layout(\n", + " hovermode = 'x',\n", + " title=dict(text=\"Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock\"),\n", + " font=dict(size = 10, color = 'white'),\n", + " plot_bgcolor='black',\n", + " paper_bgcolor='black'\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2f78f4e1", + "metadata": {}, + "source": [ + "### Link Hover Color\n", + "\n", + "*New in 5.19*\n", + "\n", + "Set `link.hovercolor` to change the colors of links on hover. `link.hovercolor` accepts either one color, specified as a string, that will apply to all links, or a list of colors to specify different colors for each link. Here, we use a list to specify a different color for each link:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7cd835ff", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[go.Sankey(\n", + " node = dict(\n", + " pad = 15,\n", + " thickness = 20,\n", + " line = dict(color = \"black\", width = 0.5),\n", + " label = [\"A1\", \"A2\", \"B1\", \"B2\", \"C1\", \"C2\"],\n", + " color = \"blue\"\n", + " ),\n", + " link = dict(\n", + " source = [0, 1, 0, 2, 3, 3],\n", + " target = [2, 3, 3, 4, 4, 5],\n", + " value = [8, 4, 2, 8, 4, 2],\n", + " hovercolor=[\"midnightblue\", \"lightskyblue\", \"gold\", \"mediumturquoise\", \"lightgreen\", \"cyan\"],\n", + " ))])\n", + "\n", + "fig.update_layout(title_text=\"Basic Sankey Diagram\", font_size=10)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ed9f0753", + "metadata": {}, + "source": [ + "### Hovertemplate and customdata of Sankey diagrams\n", + "\n", + "Links and nodes have their own hovertemplate, in which link- or node-specific attributes can be displayed. To add more data to links and nodes, it is possible to use the `customdata` attribute of `link` and `nodes`, as in the following example. For more information about hovertemplate and customdata, please see the [tutorial on hover text](/python/hover-text-and-formatting/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f5463bea", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[go.Sankey(\n", + " node = dict(\n", + " pad = 15,\n", + " thickness = 20,\n", + " line = dict(color = \"black\", width = 0.5),\n", + " label = [\"A1\", \"A2\", \"B1\", \"B2\", \"C1\", \"C2\"],\n", + " customdata = [\"Long name A1\", \"Long name A2\", \"Long name B1\", \"Long name B2\",\n", + " \"Long name C1\", \"Long name C2\"],\n", + " hovertemplate='Node %{customdata} has total value %{value}',\n", + " color = \"blue\"\n", + " ),\n", + " link = dict(\n", + " source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A2, B1, ...\n", + " target = [2, 3, 3, 4, 4, 5],\n", + " value = [8, 4, 2, 8, 4, 2],\n", + " customdata = [\"q\",\"r\",\"s\",\"t\",\"u\",\"v\"],\n", + " hovertemplate='Link from node %{source.customdata}
'+\n", + " 'to node%{target.customdata}
has value %{value}'+\n", + " '
and data %{customdata}',\n", + " ))])\n", + "\n", + "fig.update_layout(title_text=\"Basic Sankey Diagram\", font_size=10)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5cdabd7d", + "metadata": {}, + "source": [ + "### Define Node Position\n", + "\n", + "The following example sets [node.x](https://plotly.com/python/reference/sankey/#sankey-node-x) and `node.y` to place nodes in the specified locations, except in the `snap arrangement` (default behaviour when `node.x` and `node.y` are not defined) to avoid overlapping of the nodes, therefore, an automatic snapping of elements will be set to define the padding between nodes via [nodepad](https://plotly.com/python/reference/sankey/#sankey-node-pad). The other possible arrangements are: 1) perpendicular 2) freeform 3) fixed" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89846c12", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Sankey(\n", + " arrangement = \"snap\",\n", + " node = {\n", + " \"label\": [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\"],\n", + " \"x\": [0.2, 0.1, 0.5, 0.7, 0.3, 0.5],\n", + " \"y\": [0.7, 0.5, 0.2, 0.4, 0.2, 0.3],\n", + " 'pad':10}, # 10 Pixels\n", + " link = {\n", + " \"source\": [0, 0, 1, 2, 5, 4, 3, 5],\n", + " \"target\": [5, 3, 4, 3, 0, 2, 2, 3],\n", + " \"value\": [1, 2, 1, 1, 1, 1, 1, 2]}))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f35fc684", + "metadata": {}, + "source": [ + "### Sankey Diagram with Arrow Links\n", + "\n", + "*New in 5.10*\n", + "\n", + "Create a Sankey diagram with arrow links by setting the `arrowlen` attribute of `link`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3c615e3c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Sankey(\n", + " arrangement='snap',\n", + " node=dict(\n", + " label=['A', 'B', 'C', 'D', 'E', 'F'],\n", + " x=[0.2, 0.1, 0.5, 0.7, 0.3, 0.5],\n", + " y=[0.7, 0.5, 0.2, 0.4, 0.2, 0.3],\n", + " pad=10,\n", + " align=\"right\",\n", + " ),\n", + " link=dict(\n", + " arrowlen=15,\n", + " source=[0, 0, 1, 2, 5, 4, 3, 5],\n", + " target=[5, 3, 4, 3, 0, 2, 2, 3],\n", + " value=[1, 2, 1, 1, 1, 1, 1, 2]\n", + " )\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8fbdf6dd", + "metadata": {}, + "source": [ + "### Node Alignment\n", + "\n", + "*New in 5.19*\n", + "\n", + "You can set the alignment of nodes using `node.align`. Here are two examples with the same `source` and `target`. The first example has nodes aligned \"left\" and the second has nodes aligned \"right\". `node.align` also supports \"center\" and \"justify\". \"justify\" is the default if `node.align` is not set, and is similar to aligning to the \"left\", except that nodes without outgoing links are moved to the right of the figure." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "537b726f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Sankey(\n", + " arrangement='snap',\n", + " node=dict(\n", + " label=[\"0\", \"1\", \"2\", \"3\", \"4\", \"5\"],\n", + " align='left'\n", + "\n", + " ),\n", + " link=dict(\n", + " arrowlen=15,\n", + " source=[0, 1, 4, 2, 1],\n", + " target=[1, 4, 5, 4, 3],\n", + " value=[4, 2, 3, 1, 2]\n", + " )\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "73acfd8a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Sankey(\n", + " arrangement='snap',\n", + " node=dict(\n", + " label=[\"0\", \"1\", \"2\", \"3\", \"4\", \"5\"],\n", + " align=\"right\",\n", + " ),\n", + " link=dict(\n", + " arrowlen=15,\n", + " source=[0, 1, 4, 2, 1],\n", + " target=[1, 4, 5, 4, 3],\n", + " value=[4, 2, 3, 1, 2]\n", + " )\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "585b0782", + "metadata": {}, + "source": [ + "### Reference\n", + "\n", + "See [https://plotly.com/python/reference/sankey](https://plotly.com/python/reference/sankey/) for more information and options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "835ef829", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernel_info": { + "name": "python2" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + }, + "plotly": { + "description": "How to make Sankey Diagrams in Python with Plotly.", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "Sankey Diagram", + "order": 12, + "page_type": "u-guide", + "permalink": "python/sankey-diagram/", + "thumbnail": "thumbnail/sankey.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/scatter-plots-on-maps.ipynb b/scatter-plots-on-maps.ipynb new file mode 100644 index 000000000..7f6e52ec8 --- /dev/null +++ b/scatter-plots-on-maps.ipynb @@ -0,0 +1,353 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "77257459", + "metadata": {}, + "source": [ + "#### Base Map Configuration\n", + "\n", + "Plotly figures made with [Plotly Express](/python/plotly-express/) `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` [graph objects](/python/graph-objects/) have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.\n", + "\n", + "### Geographical Scatter Plot with px.scatter_geo\n", + "\n", + "Here we show the [Plotly Express](/python/plotly-express/) function `px.scatter_geo` for a geographical scatter plot. The `size` argument is used to set the size of markers from a given column of the DataFrame.\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a62c9e8a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.scatter_geo(df, locations=\"iso_alpha\",\n", + " size=\"pop\", # size of markers, \"pop\" is one of the columns of gapminder\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f0f7fa87", + "metadata": {}, + "source": [ + "#### Customize geographical scatter plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c2d7fe18", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.scatter_geo(df, locations=\"iso_alpha\",\n", + " color=\"continent\", # which column to use to set the color of markers\n", + " hover_name=\"country\", # column added to hover information\n", + " size=\"pop\", # size of markers\n", + " projection=\"natural earth\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b1927776", + "metadata": {}, + "source": [ + "### Basic Example with GeoPandas\n", + "\n", + "`px.scatter_geo` can work well with [GeoPandas](https://geopandas.org/) dataframes whose `geometry` is of type `Point`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "01630c21", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import geopandas as gpd\n", + "from geodatasets import get_url\n", + "\n", + "geo_df = gpd.read_file(get_url(\"naturalearth.cities\"))\n", + "\n", + "fig = px.scatter_geo(geo_df,\n", + " lat=geo_df.geometry.y,\n", + " lon=geo_df.geometry.x,\n", + " hover_name=\"name\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fe0c44c1", + "metadata": {}, + "source": [ + "### U.S. Airports Map\n", + "\n", + "Here we show how to use `go.Scattergeo` from `plotly.graph_objects`.\n", + "\n", + "#### Simple U.S. Airports Map" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c00ee75a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv')\n", + "df['text'] = df['airport'] + '' + df['city'] + ', ' + df['state'] + '' + 'Arrivals: ' + df['cnt'].astype(str)\n", + "\n", + "fig = go.Figure(data=go.Scattergeo(\n", + " lon = df['long'],\n", + " lat = df['lat'],\n", + " text = df['text'],\n", + " mode = 'markers',\n", + " marker_color = df['cnt'],\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " title = 'Most trafficked US airports
(Hover for airport names)',\n", + " geo_scope='usa',\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f3581c4b", + "metadata": {}, + "source": [ + "#### Styled U.S. Airports Map" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c42eb9c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv')\n", + "df['text'] = df['airport'] + '' + df['city'] + ', ' + df['state'] + '' + 'Arrivals: ' + df['cnt'].astype(str)\n", + "\n", + "\n", + "fig = go.Figure(data=go.Scattergeo(\n", + " locationmode = 'USA-states',\n", + " lon = df['long'],\n", + " lat = df['lat'],\n", + " text = df['text'],\n", + " mode = 'markers',\n", + " marker = dict(\n", + " size = 8,\n", + " opacity = 0.8,\n", + " reversescale = True,\n", + " autocolorscale = False,\n", + " symbol = 'square',\n", + " line = dict(\n", + " width=1,\n", + " color='rgba(102, 102, 102)'\n", + " ),\n", + " colorscale = 'Blues',\n", + " cmin = 0,\n", + " color = df['cnt'],\n", + " cmax = df['cnt'].max(),\n", + " colorbar=dict(\n", + " title=dict(\n", + " text=\"Incoming flights
February 2011\"\n", + " )\n", + " )\n", + " )))\n", + "\n", + "fig.update_layout(\n", + " title = 'Most trafficked US airports
(Hover for airport names)',\n", + " geo = dict(\n", + " scope='usa',\n", + " projection_type='albers usa',\n", + " showland = True,\n", + " landcolor = \"rgb(250, 250, 250)\",\n", + " subunitcolor = \"rgb(217, 217, 217)\",\n", + " countrycolor = \"rgb(217, 217, 217)\",\n", + " countrywidth = 0.5,\n", + " subunitwidth = 0.5\n", + " ),\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bba81661", + "metadata": {}, + "source": [ + "### North American Precipitation Map" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4564b395", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv')\n", + "\n", + "scl = [0,\"rgb(150,0,90)\"],[0.125,\"rgb(0, 0, 200)\"],[0.25,\"rgb(0, 25, 255)\"],\\\n", + "[0.375,\"rgb(0, 152, 255)\"],[0.5,\"rgb(44, 255, 150)\"],[0.625,\"rgb(151, 255, 0)\"],\\\n", + "[0.75,\"rgb(255, 234, 0)\"],[0.875,\"rgb(255, 111, 0)\"],[1,\"rgb(255, 0, 0)\"]\n", + "\n", + "fig = go.Figure(data=go.Scattergeo(\n", + " lat = df['Lat'],\n", + " lon = df['Lon'],\n", + " text = df['Globvalue'].astype(str) + ' inches',\n", + " marker = dict(\n", + " color = df['Globvalue'],\n", + " colorscale = scl,\n", + " reversescale = True,\n", + " opacity = 0.7,\n", + " size = 2,\n", + " colorbar = dict(\n", + " title = dict(\n", + " side=\"right\"\n", + " ),\n", + " outlinecolor = \"rgba(68, 68, 68, 0)\",\n", + " ticks = \"outside\",\n", + " showticksuffix = \"last\",\n", + " dtick = 0.1\n", + " )\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(\n", + " geo = dict(\n", + " scope = 'north america',\n", + " showland = True,\n", + " landcolor = \"rgb(212, 212, 212)\",\n", + " subunitcolor = \"rgb(255, 255, 255)\",\n", + " countrycolor = \"rgb(255, 255, 255)\",\n", + " showlakes = True,\n", + " lakecolor = \"rgb(255, 255, 255)\",\n", + " showsubunits = True,\n", + " showcountries = True,\n", + " resolution = 50,\n", + " projection = dict(\n", + " type = 'conic conformal',\n", + " rotation_lon = -100\n", + " ),\n", + " lonaxis = dict(\n", + " showgrid = True,\n", + " gridwidth = 0.5,\n", + " range= [ -140.0, -55.0 ],\n", + " dtick = 5\n", + " ),\n", + " lataxis = dict (\n", + " showgrid = True,\n", + " gridwidth = 0.5,\n", + " range= [ 20.0, 60.0 ],\n", + " dtick = 5\n", + " )\n", + " ),\n", + " title=dict(text='US Precipitation 06-30-2015
Source: NOAA'),\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "50e5b8a7", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.(scatter_geo)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_geo) or https://plotly.com/python/reference/scattergeo/ and https://plotly.com/python/reference/layout/geo/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "d9ff11df", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.0" + }, + "plotly": { + "description": "How to make scatter plots on maps in Python. Scatter plots on maps highlight geographic areas and can be colored by value.", + "display_as": "maps", + "language": "python", + "layout": "base", + "name": "Scatter Plots on Maps", + "order": 12, + "page_type": "u-guide", + "permalink": "python/scatter-plots-on-maps/", + "thumbnail": "thumbnail/scatter-plot-on-maps.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/selections.ipynb b/selections.ipynb new file mode 100644 index 000000000..8651de7ec --- /dev/null +++ b/selections.ipynb @@ -0,0 +1,472 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "86d74b6b", + "metadata": {}, + "source": [ + "## Adding Selections to Cartesian Subplots\n", + "\n", + "*New in 5.10*\n", + "\n", + "You can add persistent selections to a rendered figure using the **Box Select** and **Lasso Select** tools in the mode bar.\n", + "To add multiple selections, select **Shift** when making new selections.\n", + "To clear a selection, double-click it. On a subplot you can clear all selections by double-clicking any unselected area of the subplot.\n" + ] + }, + { + "cell_type": "markdown", + "id": "ad6cc0d2", + "metadata": {}, + "source": [ + "You can also add selections to a figure that displays when it renders using `fig.add_selection`.\n", + "Here, we add a rectangular selection with a region between `3.0` and `6.5` on the x axis and between `3.5` and `5.5` on the y axis.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d6712044", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "fig.add_selection(x0=3.0, y0=6.5, x1=3.5, y1=5.5)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3b63073", + "metadata": {}, + "source": [ + "## Selections Using a Custom SVG" + ] + }, + { + "cell_type": "markdown", + "id": "cc3d5dbe", + "metadata": {}, + "source": [ + "In the above example, we added a rectangular selection. You can also render a custom SVG for a selection by defining a `path` that can include single or multiple polygons. Here, we create a selection with a single polygon path \"M2,6.5L4,7.5L4,6Z\".\n", + "\n", + "Please note that multiple polygons e.g. \"M0,0L0,10L10,10,L10,0Z M2,2L2,8L8,8,L8,2Z\" could be used to subtract certain regions from the selection." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "39428f18", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "fig.add_selection(path=\"M2,6.5L4,7.5L4,6Z\")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "944e720c", + "metadata": {}, + "source": [ + "## Styling Selections" + ] + }, + { + "cell_type": "markdown", + "id": "16f81047", + "metadata": {}, + "source": [ + "In the above example, we added a selection to the figure that is displayed when the figure renders.\n", + "`fig.add_selection` accepts additional properties that you can use to style the selection. Here, we add a `color`, `width`, and specify the `dash` type for the selection.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "880a39df", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "fig.add_selection(\n", + " x0=2.5, y0=6.5, x1=3.5, y1=5.5,\n", + " line=dict(\n", + " color=\"Crimson\",\n", + " width=2,\n", + " dash=\"dash\",\n", + " ))\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "ebcaf97d", + "metadata": {}, + "source": [ + "## Styling New Selections\n", + "\n", + "You can style new selections made on the figure by setting properties on `newselection`.\n", + "Try making a new selection on the figure to try it out." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8549e9d5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "\n", + "fig.update_layout(dragmode='select',\n", + " newselection=dict(line=dict(color='blue')))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bc5f5c56", + "metadata": {}, + "source": [ + "## Fill Color for Active Selections\n", + "\n", + "You can style the active selection with `activeselection`. In this example, we set active selections (when created or clicked) to appear with a `fillcolor` of `yellow`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0790bb88", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\")\n", + "fig.add_selection(x0=3.0, y0=6.5, x1=3.5, y1=5.5)\n", + "\n", + "fig.update_layout(dragmode='select',\n", + " activeselection=dict(fillcolor='yellow'))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "25295770", + "metadata": {}, + "source": [ + "## Selections with Time Series\n", + "\n", + "Selections are also supported on time series figures. Here, we add a rectangular selection with a region between the dates `2019-01-01\"` and `\"2019-10-01\"` on the x axis and between `0.95` and `1.15` on the y axis.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8821b89c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks()\n", + "fig = px.line(df, x='date', y=\"GOOG\", markers=True)\n", + "fig.add_selection(x0=\"2019-01-01\", y0=0.95, x1=\"2019-10-01\", y1=1.15)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7d6fd189", + "metadata": {}, + "source": [ + "## Referencing Selections on Multiple Cartesian Subplots" + ] + }, + { + "cell_type": "markdown", + "id": "bdc9f9d1", + "metadata": {}, + "source": [ + "You can add selections to multiple Cartesian subplots by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x` and `y2` and two selections to the the plot with axis ids `x` and `y`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca228977", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "np.random.seed(0)\n", + "t = np.linspace(-1, 1.2, 2000)\n", + "x = (t**3) + (0.3 * np.random.randn(2000))\n", + "y = (t**6) + (0.3 * np.random.randn(2000))\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Histogram2dContour(\n", + " x = x,\n", + " y = y,\n", + " colorscale = 'Blues',\n", + " reversescale = True,\n", + " xaxis = 'x',\n", + " yaxis = 'y'\n", + " ))\n", + "fig.add_trace(go.Scatter(\n", + " x = x,\n", + " y = y,\n", + " xaxis = 'x',\n", + " yaxis = 'y',\n", + " mode = 'markers',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,0.3)',\n", + " size = 3\n", + " )\n", + " ))\n", + "fig.add_trace(go.Histogram(\n", + " y = y,\n", + " xaxis = 'x2',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,1)'\n", + " )\n", + " ))\n", + "fig.add_trace(go.Histogram(\n", + " x = x,\n", + " yaxis = 'y2',\n", + " marker = dict(\n", + " color = 'rgba(0,0,0,1)'\n", + " )\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " autosize = False,\n", + " xaxis = dict(\n", + " zeroline = False,\n", + " domain = [0,0.85],\n", + " showgrid = False\n", + " ),\n", + " yaxis = dict(\n", + " zeroline = False,\n", + " domain = [0,0.85],\n", + " showgrid = False\n", + " ),\n", + " xaxis2 = dict(\n", + " zeroline = False,\n", + " domain = [0.85,1],\n", + " showgrid = False\n", + " ),\n", + " yaxis2 = dict(\n", + " zeroline = False,\n", + " domain = [0.85,1],\n", + " showgrid = False\n", + " ),\n", + " height = 600,\n", + " width = 600,\n", + " bargap = 0,\n", + " hovermode = 'closest',\n", + " showlegend = False,\n", + " selections = [\n", + " dict(\n", + " x0 = 0.5,\n", + " x1 = -0.5,\n", + " xref = \"x\",\n", + " y0 = 190,\n", + " y1= 0,\n", + " yref = \"y2\",\n", + " line = dict(\n", + " color=\"yellow\"\n", + " )\n", + " ),\n", + " dict(\n", + " x0 = -0.2,\n", + " x1 = -1.5,\n", + " xref = \"x\",\n", + " y0 = 2,\n", + " y1= -1,\n", + " yref = \"y\",\n", + " line = dict(\n", + " color=\"yellow\"\n", + " )\n", + " ),\n", + " dict(\n", + " path= \"M0.75,2.39L0.98,3.38L1.46,3.68L1.80,3.35L2.01,2.51L1.67,1.15L1.18,0.50L0.65,0.66L0.54,0.83L0.49,1.56Z\",\n", + " xref= 'x',\n", + " yref = 'y',\n", + " line = dict(\n", + " color='yellow'\n", + " )\n", + " )\n", + " ]\n", + ")\n", + "\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "dc22baeb", + "metadata": {}, + "source": [ + "## Referencing Selections on a Scatterplot Matrix" + ] + }, + { + "cell_type": "markdown", + "id": "c0ae0493", + "metadata": {}, + "source": [ + "You can add selections to a scatterplot matrix by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x2` and `y2` and another on the plot with ids `x3` and `y`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "db2feccf", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter_matrix(df,\n", + " dimensions=[\"sepal_length\", \"sepal_width\", \"petal_length\", \"petal_width\"],\n", + " color=\"species\")\n", + "\n", + "fig.update_layout(\n", + " xaxis = {\"matches\": \"y\"},\n", + " xaxis2 = {\"matches\": \"y2\"},\n", + " xaxis3 = {\"matches\": \"y3\"},\n", + " xaxis4 = {\"matches\": \"y4\"},\n", + " height = 900,\n", + " width = 750,\n", + " dragmode = 'select',\n", + " selections = [\n", + " dict(\n", + " x0 = 3,\n", + " x1 = 4,\n", + " xref = \"x2\",\n", + " y0 = 8,\n", + " y1= 6,\n", + " yref = \"y\"\n", + " ),\n", + " dict(\n", + " x0 = 5,\n", + " x1 = 1,\n", + " xref = \"x3\",\n", + " y0 = 5,\n", + " y1= 4,\n", + " yref = \"y\",\n", + " )\n", + " ]\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e8e74329", + "metadata": {}, + "source": [ + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "7f5ccadf", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.0" + }, + "plotly": { + "description": "How to use selections in Python. Examples of adding and styling selections.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Selections", + "order": 38, + "permalink": "python/selections/", + "thumbnail": "thumbnail/ml_apps.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/setting-graph-size.ipynb b/setting-graph-size.ipynb new file mode 100644 index 000000000..d215e2402 --- /dev/null +++ b/setting-graph-size.ipynb @@ -0,0 +1,339 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "9d07c317", + "metadata": {}, + "source": [ + "### Adjusting Height, Width, & Margins with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b9f66aab", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.scatter(df, x=\"total_bill\", y=\"tip\", facet_col=\"sex\",\n", + " width=800, height=400)\n", + "\n", + "fig.update_layout(\n", + " margin=dict(l=20, r=20, t=20, b=20),\n", + " paper_bgcolor=\"LightSteelBlue\",\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "99316f55", + "metadata": {}, + "source": [ + "### Adjusting graph size with Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8a9950a1", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'setting-graph-size', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "0dfce3dc", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "989a05eb", + "metadata": {}, + "source": [ + "### Adjusting Height, Width, & Margins With Graph Objects\n", + "\n", + "[Graph objects](/python/graph-objects/) are the low-level building blocks of figures which you can use instead of Plotly Express for greater control." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b86cfb19", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 1, 2, 3, 4, 5, 6, 7, 8]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " autosize=False,\n", + " width=500,\n", + " height=500,\n", + " margin=dict(\n", + " l=50,\n", + " r=50,\n", + " b=100,\n", + " t=100,\n", + " pad=4\n", + " ),\n", + " paper_bgcolor=\"LightSteelBlue\",\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f42f5e4b", + "metadata": {}, + "source": [ + "### Automatically Adjust Margins\n", + "\n", + "Set [automargin](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-automargin) to `True` and Plotly will automatically increase the margin size to prevent ticklabels from being cut off or overlapping with axis titles." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "03d2a322", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Bar(\n", + " x=[\"Apples\", \"Oranges\", \"Watermelon\", \"Pears\"],\n", + " y=[3, 2, 1, 4]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " autosize=False,\n", + " width=500,\n", + " height=500,\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Y-axis Title\",\n", + " font=dict(\n", + " size=30\n", + " )\n", + " ),\n", + " ticktext=[\"Very long label\", \"long label\", \"3\", \"label\"],\n", + " tickvals=[1, 2, 3, 4],\n", + " tickmode=\"array\",\n", + " )\n", + ")\n", + "\n", + "fig.update_yaxes(automargin=True)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7492e72e", + "metadata": {}, + "source": [ + "### Automatically Adjust Specific Margins\n", + "\n", + "*New in 5.10*\n", + "\n", + "You can also set `automargin` for specific sides of the figure. Here, we set `automargin` on the `left` and `top` of the figure." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "94d5bada", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Bar(\n", + " x=[\"Apples\", \"Oranges\", \"Watermelon\", \"Pears\"],\n", + " y=[3, 2, 1, 4]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " autosize=False,\n", + " width=500,\n", + " height=500,\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Y-axis Title\",\n", + " font=dict(\n", + " size=30\n", + " )\n", + " ),\n", + " ticktext=[\"Very long label\", \"long label\", \"3\", \"label\"],\n", + " tickvals=[1, 2, 3, 4],\n", + " tickmode=\"array\",\n", + " )\n", + ")\n", + "\n", + "fig.update_yaxes(automargin='left+top')\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9174ea52", + "metadata": {}, + "source": [ + "### Setting a Minimum Plot Size with Automargins\n", + "\n", + "*New in 5.11*\n", + "\n", + "To set a minimum width and height for a plot to be after automargin is applied, use `minreducedwidth` and `minreducedheight`. Here we set both to `250`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ccf46773", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Bar(\n", + " x=[\"Apples\", \"Oranges\", \"Watermelon\", \"Pears\"],\n", + " y=[3, 2, 1, 4]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " autosize=False,\n", + " minreducedwidth=250,\n", + " minreducedheight=250,\n", + " width=450,\n", + " height=450,\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Y-axis Title\",\n", + " font=dict(\n", + " size=30\n", + " )\n", + " ),\n", + " ticktext=[\"Label\", \"Very long label\", \"Other label\", \"Very very long label\"],\n", + " tickvals=[1, 2, 3, 4],\n", + " tickmode=\"array\",\n", + " )\n", + ")\n", + "\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3b7d2be7", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See https://plotly.com/python/reference/layout/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "d5c6476e", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.0" + }, + "plotly": { + "description": "How to manipulate the graph size, margins and background color.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Setting Graph Size", + "order": 11, + "permalink": "python/setting-graph-size/", + "thumbnail": "thumbnail/sizing.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/shapes.ipynb b/shapes.ipynb new file mode 100644 index 000000000..e9f1e5ff1 --- /dev/null +++ b/shapes.ipynb @@ -0,0 +1,1724 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "16efffdf", + "metadata": {}, + "source": [ + "### Adding Lines and Polygons to Figures\n", + "\n", + "As a general rule, there are two ways to add shapes (lines or polygons) to figures:\n", + "1. Trace types in the `scatter` family (e.g. `scatter`, `scatter3d`, `scattergeo` etc) can be drawn with `mode=\"lines\"` and optionally support a `fill=\"self\"` attribute, and so can be used to draw open or closed shapes on figures.\n", + "2. Standalone lines, ellipses and rectangles can be added to figures using `fig.add_shape()`, and they can be positioned absolutely within the figure, or they can be positioned relative to the axes of 2d cartesian subplots i.e. in data coordinates.\n", + "\n", + "*Note:* there are [special methods `add_hline`, `add_vline`, `add_hrect` and `add_vrect` for the common cases of wanting to draw horizontal or vertical lines or rectangles](/python/horizontal-vertical-shapes/) that are fixed to data coordinates in one axis and absolutely positioned in another.\n", + "\n", + "The differences between these two approaches are that:\n", + "* Traces can optionally support hover labels and can appear in legends.\n", + "* Shapes can be positioned absolutely or relative to data coordinates in 2d cartesian subplots only.\n", + "* Traces cannot be positioned absolutely but can be positioned relative to data coordinates in any subplot type.\n", + "* Traces also support [optional text](/python/text-and-annotations/), although there is a [textual equivalent to shapes in text annotations](/python/text-and-annotations/).\n" + ] + }, + { + "cell_type": "markdown", + "id": "4c903e5c", + "metadata": {}, + "source": [ + "### Shape-drawing with Scatter traces\n", + "\n", + "There are two ways to draw filled shapes: scatter traces and [layout.shapes](https://plotly.com/python/reference/layout/shapes/#layout-shapes-items-shape-type) which is mostly useful for the 2d subplots, and defines the shape type to be drawn, and can be rectangle, circle, line, or path (a custom SVG path). You also can use [scatterpolar](https://plotly.com/python/polar-chart/#categorical-polar-chart), scattergeo, [scattermapbox](https://plotly.com/python/filled-area-on-mapbox/#filled-scattermapbox-trace) to draw filled shapes on any kind of subplots. To set an area to be filled with a solid color, you need to define [Scatter.fill=\"toself\"](https://plotly.com/python/reference/scatter/#scatter-fill) that connects the endpoints of the trace into a closed shape. If `mode=line` (default value), then you need to repeat the initial point of a shape at the end of the sequence to have a closed shape." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "151d821f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(x=[0,1,2,0], y=[0,2,0,0], fill=\"toself\"))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "89b68142", + "metadata": {}, + "source": [ + "You can have more shapes either by adding [more traces](https://plotly.com/python/filled-area-plots/) or interrupting the series with `None`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4676ad55", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(x=[0,1,2,0,None,3,3,5,5,3], y=[0,2,0,0,None,0.5,1.5,1.5,0.5,0.5], fill=\"toself\"))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8a4cd8d4", + "metadata": {}, + "source": [ + "#### Shapes in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa153009", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'shapes', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "5a8127ae", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "09dd1b8e", + "metadata": {}, + "source": [ + "#### Vertical and Horizontal Lines Positioned Relative to the Axis Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f83f08fd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[2, 3.5, 6],\n", + " y=[1, 1.5, 1],\n", + " text=[\"Vertical Line\",\n", + " \"Horizontal Dashed Line\",\n", + " \"Diagonal dotted Line\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Set axes ranges\n", + "fig.update_xaxes(range=[0, 7])\n", + "fig.update_yaxes(range=[0, 2.5])\n", + "\n", + "# Add shapes\n", + "fig.add_shape(type=\"line\",\n", + " x0=1, y0=0, x1=1, y1=2,\n", + " line=dict(color=\"RoyalBlue\",width=3)\n", + ")\n", + "fig.add_shape(type=\"line\",\n", + " x0=2, y0=2, x1=5, y1=2,\n", + " line=dict(\n", + " color=\"LightSeaGreen\",\n", + " width=4,\n", + " dash=\"dashdot\",\n", + " )\n", + ")\n", + "fig.add_shape(type=\"line\",\n", + " x0=4, y0=0, x1=6, y1=2,\n", + " line=dict(\n", + " color=\"MediumPurple\",\n", + " width=4,\n", + " dash=\"dot\",\n", + " )\n", + ")\n", + "fig.update_shapes(dict(xref='x', yref='y'))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "93f47be3", + "metadata": {}, + "source": [ + "#### Lines Positioned Relative to the Plot & to the Axis Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3b6cd57b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[2, 6], y=[1, 1],\n", + " text=[\"Line positioned relative to the plot\",\n", + " \"Line positioned relative to the axes\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Set axes ranges\n", + "fig.update_xaxes(range=[0, 8])\n", + "fig.update_yaxes(range=[0, 2])\n", + "\n", + "fig.add_shape(type=\"line\",\n", + " xref=\"x\", yref=\"y\",\n", + " x0=4, y0=0, x1=8, y1=1,\n", + " line=dict(\n", + " color=\"LightSeaGreen\",\n", + " width=3,\n", + " ),\n", + ")\n", + "fig.add_shape(type=\"line\",\n", + " xref=\"paper\", yref=\"paper\",\n", + " x0=0, y0=0, x1=0.5,\n", + " y1=0.5,\n", + " line=dict(\n", + " color=\"DarkOrange\",\n", + " width=3,\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2c3534f2", + "metadata": {}, + "source": [ + "#### Rectangles Positioned Relative to the Axis Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f6c7f0b2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[1.5, 4.5],\n", + " y=[0.75, 0.75],\n", + " text=[\"Unfilled Rectangle\", \"Filled Rectangle\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Set axes properties\n", + "fig.update_xaxes(range=[0, 7], showgrid=False)\n", + "fig.update_yaxes(range=[0, 3.5])\n", + "\n", + "# Add shapes\n", + "fig.add_shape(type=\"rect\",\n", + " x0=1, y0=1, x1=2, y1=3,\n", + " line=dict(color=\"RoyalBlue\"),\n", + ")\n", + "fig.add_shape(type=\"rect\",\n", + " x0=3, y0=1, x1=6, y1=2,\n", + " line=dict(\n", + " color=\"RoyalBlue\",\n", + " width=2,\n", + " ),\n", + " fillcolor=\"LightSkyBlue\",\n", + ")\n", + "fig.update_shapes(dict(xref='x', yref='y'))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6637dfb4", + "metadata": {}, + "source": [ + "#### Rectangle Positioned Relative to the Plot & to the Axis Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c61ddcb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[1.5, 3],\n", + " y=[2.5, 2.5],\n", + " text=[\"Rectangle reference to the plot\",\n", + " \"Rectangle reference to the axes\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Set axes properties\n", + "fig.update_xaxes(range=[0, 4])\n", + "fig.update_yaxes(range=[0, 4])\n", + "\n", + "# Add shapes\n", + "fig.add_shape(type=\"rect\",\n", + " xref=\"x\", yref=\"y\",\n", + " x0=2.5, y0=0,\n", + " x1=3.5, y1=2,\n", + " line=dict(\n", + " color=\"RoyalBlue\",\n", + " width=3,\n", + " ),\n", + " fillcolor=\"LightSkyBlue\",\n", + ")\n", + "fig.add_shape(type=\"rect\",\n", + " xref=\"paper\", yref=\"paper\",\n", + " x0=0.25, y0=0,\n", + " x1=0.5, y1=0.5,\n", + " line=dict(\n", + " color=\"LightSeaGreen\",\n", + " width=3,\n", + " ),\n", + " fillcolor=\"PaleTurquoise\",\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "98db4d57", + "metadata": {}, + "source": [ + "#### A Rectangle Placed Relative to the Axis Position and Length\n", + "\n", + "A shape can be placed relative to an axis's position on the plot by adding the\n", + "string `' domain'` to the axis reference in the `xref` or `yref` attributes for\n", + "shapes.\n", + "The following code places a rectangle that starts at 60% and ends at 70% along\n", + "the x-axis, starting from the left, and starts at 80% and ends at 90% along the\n", + "y-axis, starting from the bottom." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d7ba6fcb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import plotly.express as px\n", + "\n", + "df = px.data.wind()\n", + "fig = px.scatter(df, y=\"frequency\")\n", + "\n", + "fig.update_layout(xaxis=dict(domain=[0, 0.5]), yaxis=dict(domain=[0.25, 0.75]))\n", + "\n", + "# Add a shape whose x and y coordinates refer to the domains of the x and y axes\n", + "fig.add_shape(type=\"rect\",\n", + " xref=\"x domain\", yref=\"y domain\",\n", + " x0=0.6, x1=0.7, y0=0.8, y1=0.9,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8b7f3214", + "metadata": {}, + "source": [ + "#### Highlighting Time Series Regions with Rectangle Shapes\n", + "\n", + "*Note:* there are [special methods `add_hline`, `add_vline`, `add_hrect` and `add_vrect` for the common cases of wanting to draw horizontal or vertical lines or rectangles](/python/horizontal-vertical-shapes/) that are fixed to data coordinates in one axis and absolutely positioned in another.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27259967", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Add scatter trace for line\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2015-02-01\", \"2015-02-02\", \"2015-02-03\", \"2015-02-04\", \"2015-02-05\",\n", + " \"2015-02-06\", \"2015-02-07\", \"2015-02-08\", \"2015-02-09\", \"2015-02-10\",\n", + " \"2015-02-11\", \"2015-02-12\", \"2015-02-13\", \"2015-02-14\", \"2015-02-15\",\n", + " \"2015-02-16\", \"2015-02-17\", \"2015-02-18\", \"2015-02-19\", \"2015-02-20\",\n", + " \"2015-02-21\", \"2015-02-22\", \"2015-02-23\", \"2015-02-24\", \"2015-02-25\",\n", + " \"2015-02-26\", \"2015-02-27\", \"2015-02-28\"],\n", + " y=[-14, -17, -8, -4, -7, -10, -12, -14, -12, -7, -11, -7, -18, -14, -14,\n", + " -16, -13, -7, -8, -14, -8, -3, -9, -9, -4, -13, -9, -6],\n", + " mode=\"lines\",\n", + " name=\"temperature\"\n", + "))\n", + "\n", + "# Add shape regions\n", + "fig.add_vrect(\n", + " x0=\"2015-02-04\", x1=\"2015-02-06\",\n", + " fillcolor=\"LightSalmon\", opacity=0.5,\n", + " layer=\"below\", line_width=0,\n", + "),\n", + "\n", + "fig.add_vrect(\n", + " x0=\"2015-02-20\", x1=\"2015-02-22\",\n", + " fillcolor=\"LightSalmon\", opacity=0.5,\n", + " layer=\"below\", line_width=0,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4baf87df", + "metadata": {}, + "source": [ + "#### Circles Positioned Relative to the Axis Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c960d7fe", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[1.5, 3.5],\n", + " y=[0.75, 2.5],\n", + " text=[\"Unfilled Circle\",\n", + " \"Filled Circle\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Set axes properties\n", + "fig.update_xaxes(range=[0, 4.5], zeroline=False)\n", + "fig.update_yaxes(range=[0, 4.5])\n", + "\n", + "# Add circles\n", + "fig.add_shape(type=\"circle\",\n", + " xref=\"x\", yref=\"y\",\n", + " x0=1, y0=1, x1=3, y1=3,\n", + " line_color=\"LightSeaGreen\",\n", + ")\n", + "fig.add_shape(type=\"circle\",\n", + " xref=\"x\", yref=\"y\",\n", + " fillcolor=\"PaleTurquoise\",\n", + " x0=3, y0=3, x1=4, y1=4,\n", + " line_color=\"LightSeaGreen\",\n", + ")\n", + "\n", + "# Set figure size\n", + "fig.update_layout(width=800, height=800)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "629b3640", + "metadata": {}, + "source": [ + "#### Highlighting Clusters of Scatter Points with Circle Shapes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9446da3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "# Generate data\n", + "x0 = np.random.normal(2, 0.45, 300)\n", + "y0 = np.random.normal(2, 0.45, 300)\n", + "\n", + "x1 = np.random.normal(6, 0.4, 200)\n", + "y1 = np.random.normal(6, 0.4, 200)\n", + "\n", + "# Create figure\n", + "fig = go.Figure()\n", + "\n", + "# Add scatter traces\n", + "fig.add_trace(go.Scatter(x=x0, y=y0, mode=\"markers\"))\n", + "fig.add_trace(go.Scatter(x=x1, y=y1, mode=\"markers\"))\n", + "\n", + "# Add shapes\n", + "fig.add_shape(type=\"circle\",\n", + " xref=\"x\", yref=\"y\",\n", + " x0=min(x0), y0=min(y0),\n", + " x1=max(x0), y1=max(y0),\n", + " opacity=0.2,\n", + " fillcolor=\"blue\",\n", + " line_color=\"blue\",\n", + ")\n", + "\n", + "fig.add_shape(type=\"circle\",\n", + " xref=\"x\", yref=\"y\",\n", + " x0=min(x1), y0=min(y1),\n", + " x1=max(x1), y1=max(y1),\n", + " opacity=0.2,\n", + " fillcolor=\"orange\",\n", + " line_color=\"orange\",\n", + ")\n", + "\n", + "\n", + "# Hide legend\n", + "fig.update_layout(showlegend=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c128a37d", + "metadata": {}, + "source": [ + "#### Venn Diagram with Circle Shapes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3684116e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[1, 1.75, 2.5],\n", + " y=[1, 1, 1],\n", + " text=[\"$A$\", \"$A+B$\", \"$B$\"],\n", + " mode=\"text\",\n", + " textfont=dict(\n", + " color=\"black\",\n", + " size=18,\n", + " family=\"Arail\",\n", + " )\n", + "))\n", + "\n", + "# Update axes properties\n", + "fig.update_xaxes(\n", + " showticklabels=False,\n", + " showgrid=False,\n", + " zeroline=False,\n", + ")\n", + "\n", + "fig.update_yaxes(\n", + " showticklabels=False,\n", + " showgrid=False,\n", + " zeroline=False,\n", + ")\n", + "\n", + "# Add circles\n", + "fig.add_shape(type=\"circle\",\n", + " line_color=\"blue\", fillcolor=\"blue\",\n", + " x0=0, y0=0, x1=2, y1=2\n", + ")\n", + "fig.add_shape(type=\"circle\",\n", + " line_color=\"gray\", fillcolor=\"gray\",\n", + " x0=1.5, y0=0, x1=3.5, y1=2\n", + ")\n", + "fig.update_shapes(opacity=0.3, xref=\"x\", yref=\"y\")\n", + "\n", + "fig.update_layout(\n", + " margin=dict(l=20, r=20, b=100),\n", + " height=600, width=800,\n", + " plot_bgcolor=\"white\"\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c8e03f62", + "metadata": {}, + "source": [ + "#### Adding Shapes to Subplots\n", + "Here we use the different axes (`x1`, `x2`) created by `make_subplots` as reference in order to draw shapes in figure subplots." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "17d65a70", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "# Create Subplots\n", + "fig = make_subplots(rows=2, cols=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[2, 6], y=[1,1]), row=1, col=1)\n", + "fig.add_trace(go.Bar(x=[1,2,3], y=[4,5,6]), row=1, col=2)\n", + "fig.add_trace(go.Scatter(x=[10,20], y=[40,50]), row=2, col=1)\n", + "fig.add_trace(go.Bar(x=[11,13,15], y=[8,11,20]), row=2, col=2)\n", + "\n", + "# Add shapes\n", + "fig.update_layout(\n", + " shapes=[\n", + " dict(type=\"line\", xref=\"x\", yref=\"y\",\n", + " x0=3, y0=0.5, x1=5, y1=0.8, line_width=3),\n", + " dict(type=\"rect\", xref=\"x2\", yref='y2',\n", + " x0=4, y0=2, x1=5, y1=6),\n", + " dict(type=\"rect\", xref=\"x3\", yref=\"y3\",\n", + " x0=10, y0=20, x1=15, y1=30),\n", + " dict(type=\"circle\", xref=\"x4\", yref=\"y4\",\n", + " x0=5, y0=12, x1=10, y1=18)])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3c76d474", + "metadata": {}, + "source": [ + "#### Subplot-Spanning Shapes\n", + "\n", + "*New in 6.6*\n", + "\n", + "You can create shapes that span multiple subplots by passing an array of axis references to `xref` and `yref`. Each element in the array specifies which axis the corresponding coordinate refers to. For example, in the following code, with `xref=[\"x\", \"x2\"]`, `x0` refers to the `x` axis and `x1` refers to the `x2` axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "544a4abe", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=1, cols=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6], mode=\"markers\", marker=dict(size=10)), row=1, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[6, 5, 4], mode=\"markers\", marker=dict(size=10)), row=1, col=2)\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " xref=[\"x\", \"x2\"], # x0 uses the x-axis from subplot 1 (\"x\"), while x1 uses the x-axis from subplot 2 (\"x2\")\n", + " yref=[\"y\", \"y2\"], # y0 uses the y-axis from subplot 1 (\"y\"), while y1 uses the y-axis from subplot 2 (\"y2\")\n", + " x0=2, y0=4.5,\n", + " x1=3, y1=5.5,\n", + " fillcolor=\"rgba(255, 0, 0, 0.2)\",\n", + " line=dict(color=\"red\", width=2),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6e9866de", + "metadata": {}, + "source": [ + "For `path` shapes, the array must have one entry for each coordinate in the path string. Each coordinate in the path maps to the corresponding element in the `xref`/`yref` array, in order." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e8fc2273", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=1, cols=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 2, 3], mode=\"markers\"), row=1, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[3, 2, 1], mode=\"markers\"), row=1, col=2)\n", + "\n", + "# Chevron shape spanning both subplots\n", + "# Path coordinates map to axis refs in order:\n", + "# M 2.5 1.5 -> xref[0]=x, yref[0]=y (start in subplot 1)\n", + "# L 1.5 2 -> xref[1]=x2, yref[1]=y2 (tip in subplot 2)\n", + "# L 2.5 2.5 -> xref[2]=x, yref[2]=y (end in subplot 1)\n", + "\n", + "fig.add_shape(\n", + " type=\"path\",\n", + " path=\"M 2.5 1.5 L 1.5 2 L 2.5 2.5\",\n", + " xref=[\"x\", \"x2\", \"x\"],\n", + " yref=[\"y\", \"y2\", \"y\"],\n", + " line=dict(color=\"purple\", width=3),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0f2e7b78", + "metadata": {}, + "source": [ + "**Note:** When using arrays with `xref` and `yref`, `xsizemode=\"pixel\"` and `ysizemode=\"pixel\"` are not supported." + ] + }, + { + "cell_type": "markdown", + "id": "9eaed57f", + "metadata": { + "lines_to_next_cell": 0 + }, + "source": [ + "#### Adding the Same Shapes to Multiple Subplots\n", + "The same shape can be added to multiple facets by using the `'all'`\n", + "keyword in the `row` and `col` arguments. For example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3aac152", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.scatter(df, x=\"total_bill\", y=\"tip\", facet_row=\"smoker\", facet_col=\"sex\")\n", + "# Adds a rectangle to all facets\n", + "fig.add_shape(\n", + " dict(type=\"rect\", x0=25, x1=35, y0=4, y1=6, line_color=\"purple\"),\n", + " row=\"all\",\n", + " col=\"all\",\n", + ")\n", + "# Adds a line to all the rows of the second column\n", + "fig.add_shape(\n", + " dict(type=\"line\", x0=20, x1=25, y0=5, y1=6, line_color=\"yellow\"), row=\"all\", col=2\n", + ")\n", + "\n", + "# Adds a circle to all the columns of the first row\n", + "fig.add_shape(\n", + " dict(type=\"circle\", x0=10, y0=2, x1=20, y1=7), row=1, col=\"all\", line_color=\"green\"\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ed46706a", + "metadata": {}, + "source": [ + "#### SVG Paths" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d549450", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "# Create scatter trace of text labels\n", + "fig.add_trace(go.Scatter(\n", + " x=[2, 1, 8, 8],\n", + " y=[0.25, 9, 2, 6],\n", + " text=[\"Filled Triangle\",\n", + " \"Filled Polygon\",\n", + " \"Quadratic Bezier Curves\",\n", + " \"Cubic Bezier Curves\"],\n", + " mode=\"text\",\n", + "))\n", + "\n", + "# Update axes properties\n", + "fig.update_xaxes(\n", + " range=[0, 9],\n", + " zeroline=False,\n", + ")\n", + "\n", + "fig.update_yaxes(\n", + " range=[0, 11],\n", + " zeroline=False,\n", + ")\n", + "\n", + "# Add shapes\n", + "fig.update_layout(\n", + " shapes=[\n", + " # Quadratic Bezier Curves\n", + " dict(\n", + " type=\"path\",\n", + " path=\"M 4,4 Q 6,0 8,4\",\n", + " line_color=\"RoyalBlue\",\n", + " ),\n", + " # Cubic Bezier Curves\n", + " dict(\n", + " type=\"path\",\n", + " path=\"M 1,4 C 2,8 6,4 8,8\",\n", + " line_color=\"MediumPurple\",\n", + " ),\n", + " # filled Triangle\n", + " dict(\n", + " type=\"path\",\n", + " path=\" M 1 1 L 1 3 L 4 1 Z\",\n", + " fillcolor=\"LightPink\",\n", + " line_color=\"Crimson\",\n", + " ),\n", + " # filled Polygon\n", + " dict(\n", + " type=\"path\",\n", + " path=\" M 3,7 L2,8 L2,9 L3,10 L4,10 L5,9 L5,8 L4,7 Z\",\n", + " fillcolor=\"PaleTurquoise\",\n", + " line_color=\"LightSeaGreen\",\n", + " ),\n", + " ]\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5daad599", + "metadata": {}, + "source": [ + "#### Shifting Shapes on Categorical Axes\n", + "\n", + "*New in 5.23*\n", + "\n", + "When drawing shapes where `xref` or `yref` reference axes of type category or multicategory, you can shift `x0`, `x1`, `y0`, and `y1` away from the center of the category using `x0shift`, `x1shift`, `y0shift`, and `y1shift` by specifying a value between -1 and 1.\n", + "\n", + "-1 is the center of the previous category, 0 is the center of the referenced category, and 1 is the center of the next category.\n", + "\n", + "In the following example, the `x0` and `x1` values for both shapes reference category values on the x-axis.\n", + "\n", + "In this example, the first shape:\n", + "- Shifts `x0` half way between the center of category \"Germany\" and the center of the previous category by setting `x0shift=-0.5`\n", + "- Shifts `x1`half way between the center of category \"Germany\" and the center of the next category by setting `x1shift=0.5`\n", + "\n", + "The second shape:\n", + "- Shifts `x0` back to the center of the previous category by setting `x0shift=-1`\n", + "- Shifts `x1`forward to the center of the next category by setting `x1shift=1`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "648652d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"continent == 'Europe' and year == 1952\")\n", + "\n", + "fig = go.Figure(\n", + " data=go.Bar(x=df[\"country\"], y=df[\"lifeExp\"], marker_color=\"LightSalmon\"),\n", + " layout=dict(\n", + " shapes=[\n", + " dict(\n", + " type=\"rect\",\n", + " x0=\"Germany\",\n", + " y0=0,\n", + " x1=\"Germany\",\n", + " y1=0.5,\n", + " xref=\"x\",\n", + " yref=\"paper\",\n", + " x0shift=-0.5,\n", + " x1shift=0.5,\n", + " line=dict(color=\"LightGreen\", width=4),\n", + " ),\n", + " dict(\n", + " type=\"rect\",\n", + " x0=\"Spain\",\n", + " y0=0,\n", + " x1=\"Spain\",\n", + " y1=0.5,\n", + " xref=\"x\",\n", + " yref=\"paper\",\n", + " x0shift=-1,\n", + " x1shift=1,\n", + " line=dict(color=\"MediumTurquoise\", width=4),\n", + " ),\n", + " ]\n", + " ),\n", + ")\n", + "\n", + "fig.update_layout(\n", + " title=dict(\n", + " text=\"GDP per Capita in Europe (1972)\"\n", + " ),\n", + " xaxis=dict(\n", + " title=dict(\n", + " text=\"Country\"\n", + " )\n", + " ),\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"GDP per Capita\"\n", + " )\n", + " ),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "c2dd87fc", + "metadata": {}, + "source": [ + "### Drawing shapes with a Mouse on Cartesian plots\n", + "\n", + "_introduced in plotly 4.7_\n", + "\n", + "You can create layout shapes programmatically, but you can also draw shapes manually by setting the `dragmode` to one of the shape-drawing modes: `'drawline'`,`'drawopenpath'`, `'drawclosedpath'`, `'drawcircle'`, or `'drawrect'`. If you need to switch between different shape-drawing or other dragmodes (panning, selecting, etc.), [modebar buttons can be added](/python/configuration-options#add-optional-shapedrawing-buttons-to-modebar) in the `config` to select the dragmode. If you switch to a different dragmode such as pan or zoom, you will need to select the drawing tool in the modebar to go back to shape drawing.\n", + "\n", + "This shape-drawing feature is particularly interesting for annotating graphs, in particular [image traces](/python/imshow) or [layout images](/python/images).\n", + "\n", + "Once you have drawn shapes, you can select and modify an existing shape by clicking on its boundary (note the arrow pointer). Its fillcolor turns to pink to highlight the activated shape and then you can\n", + "- drag and resize it for lines, rectangles and circles/ellipses\n", + "- drag and move individual vertices for closed paths\n", + "- move individual vertices for open paths.\n", + "\n", + "An activated shape is deleted by clicking on the `eraseshape` button.\n", + "\n", + "Drawing or modifying a shape triggers a `relayout` event, which [can be captured by a callback inside a Dash application](https://dash.plotly.com/interactive-graphing)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a1f460e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure()\n", + "text=\"Click and drag here
to draw a rectangle

or select another shape
in the modebar\"\n", + "fig.add_annotation(\n", + " x=0.5,\n", + " y=0.5,\n", + " text=text,\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " showarrow=False,\n", + " font_size=20\n", + ")\n", + "# shape defined programatically\n", + "fig.add_shape(editable=True,\n", + " x0=-1, x1=0, y0=2, y1=3,\n", + " xref='x', yref='y')\n", + "# define dragmode and add modebar buttons\n", + "fig.update_layout(dragmode='drawrect')\n", + "fig.show(config={'modeBarButtonsToAdd':['drawline',\n", + " 'drawopenpath',\n", + " 'drawclosedpath',\n", + " 'drawcircle',\n", + " 'drawrect',\n", + " 'eraseshape'\n", + " ]})" + ] + }, + { + "cell_type": "markdown", + "id": "60b88e93", + "metadata": {}, + "source": [ + "### Style of user-drawn shapes\n", + "\n", + "The layout `newshape` attribute controls the visual appearance of new shapes drawn by the user. `newshape` attributes have the same names as layout shapes.\n", + "\n", + "_Note on shape opacity_: having a new shape's opacity > 0.5 makes it possible to activate a shape by clicking inside the shape (for opacity <= 0.5 you have to click on the border of the shape), but you cannot start a new shape within an existing shape (which is possible for an opacity <= 0.5)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ed5f24d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure()\n", + "text=\"Click and drag
to draw a rectangle

or select another shape
in the modebar\"\n", + "fig.add_annotation(\n", + " x=0.5,\n", + " y=0.5,\n", + " text=text,\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " showarrow=False,\n", + " font_size=20\n", + ")\n", + "# shape defined programatically\n", + "fig.add_shape(line_color='yellow',\n", + " fillcolor='turquoise',\n", + " opacity=0.4,\n", + " editable=True,\n", + " x0=0, x1=1, y0=2, y1=3,\n", + " xref='x', yref='y'\n", + ")\n", + "fig.update_layout(dragmode='drawrect',\n", + " # style of new shapes\n", + " newshape=dict(line_color='yellow',\n", + " fillcolor='turquoise',\n", + " opacity=0.5))\n", + "fig.show(config={'modeBarButtonsToAdd':['drawline',\n", + " 'drawopenpath',\n", + " 'drawclosedpath',\n", + " 'drawcircle',\n", + " 'drawrect',\n", + " 'eraseshape'\n", + " ]})" + ] + }, + { + "cell_type": "markdown", + "id": "27549047", + "metadata": {}, + "source": [ + "### Adding Text Labels to Shapes\n", + "\n", + "*New in 5.14*\n", + "\n", + "Add a text `label` to a shape by adding a `label` property to a shape with `text`. In this example, we add a `rect` and `line` shape and add a text label to both." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c8b0cf6a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='turquoise',\n", + " x0=1,\n", + " y0=1,\n", + " x1=2,\n", + " y1=3,\n", + " label=dict(text=\"Text in rectangle\")\n", + ")\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " x0=3,\n", + " y0=0.5,\n", + " x1=5,\n", + " y1=0.8,\n", + " line_width=3,\n", + " label=dict(text=\"Text above line\")\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "0d8f968a", + "metadata": {}, + "source": [ + "#### Styling Text Labels\n", + "\n", + "Use the `font` property to configure the `color`, `size`, and `family` of the label font.\n", + "In this example, we change the label color of the first rectangle to \"DarkOrange\", set the size of the text above the line to 20, and change the font family and set the font size on the second rectangle." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "04d704a3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='MediumSlateBlue',\n", + " x0=1,\n", + " y0=1,\n", + " x1=2,\n", + " y1=3,\n", + " label=dict(text=\"Text in rectangle\", font=dict(color=\"DarkOrange\")),\n", + ")\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " x0=3,\n", + " y0=0.5,\n", + " x1=5,\n", + " y1=0.8,\n", + " line_width=3,\n", + " label=dict(text=\"Text above line\", font=dict(size=20)),\n", + ")\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='Lavender',\n", + " x0=2.5,\n", + " y0=2.5,\n", + " x1=5,\n", + " y1=3.5,\n", + " label=dict(\n", + " text=\"Text in rectangle 2\", font=dict(family=\"Courier New, monospace\", size=20)\n", + " ),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "3f0c893b", + "metadata": {}, + "source": [ + "#### Setting Label Position\n", + "\n", + "Set a label's position relative to the shape by setting `textposition`. The default position for lines is `middle`. The default position for other shapes is `middle center`.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "60b4c2f6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='Lavender',\n", + " x0=0,\n", + " y0=0,\n", + " x1=1.5,\n", + " y1=1.5,\n", + " label=dict(text=\"Text at middle center\"),\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='Lavender',\n", + " x0=3,\n", + " y0=0,\n", + " x1=4.5,\n", + " y1=1.5,\n", + " label=dict(text=\"Text at top left\", textposition=\"top left\"),\n", + ")\n", + "\n", + "\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " line_color=\"MediumSlateBlue\",\n", + " x0=3,\n", + " y0=2,\n", + " x1=5,\n", + " y1=3,\n", + " line_width=3,\n", + " label=dict(text=\"Text at start\", textposition=\"start\"),\n", + ")\n", + "\n", + "\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " line_color=\"MediumSlateBlue\",\n", + " x0=0,\n", + " y0=2,\n", + " x1=2,\n", + " y1=3,\n", + " line_width=3,\n", + " label=dict(text=\"Text at middle\"),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "ed2183df", + "metadata": {}, + "source": [ + "#### Setting Label Angle\n", + "\n", + "Use `textangle` to rotate a label by setting a value between -180 and 180. The default angle for a label on a line is the angle of the line. The default angle for a label on other shapes is 0. In this example, in the first shape, the label is at 45 degrees, and in the second, the label is at -45 degrees." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ce7fb80a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='LightGreen',\n", + " x0=0,\n", + " y0=0,\n", + " x1=2,\n", + " y1=2,\n", + " label=dict(text=\"Text at 45\", textangle=45),\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor='Gold',\n", + " x0=3,\n", + " y0=0,\n", + " x1=5,\n", + " y1=2,\n", + " label=dict(text=\"Text at -45\", textangle=-45),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "f7924052", + "metadata": {}, + "source": [ + "#### Setting Label Padding\n", + "\n", + "`padding` adds padding between the label and shape. This example shows one line with padding of 30px and another with the default padding, which is 3px." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8a7071a3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " line_color=\"RoyalBlue\",\n", + " x0=3,\n", + " y0=0,\n", + " x1=5,\n", + " y1=3,\n", + " line_width=3,\n", + " label=dict(text=\"Label padding of 30px\", padding=30),\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " line_color=\"RoyalBlue\",\n", + " x0=0,\n", + " y0=0,\n", + " x1=2,\n", + " y1=3,\n", + " line_width=3,\n", + " label=dict(text=\"Default label padding of 3px\"),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "57d44c50", + "metadata": {}, + "source": [ + "#### Setting Label Anchors\n", + "\n", + "`xanchor` sets a label's horizontal positional anchor and `yanchor` sets its vertical position anchor.\n", + "Use `xanchor` to bind the `textposition` to the \"left\", \"center\" or \"right\" of the label text and `yanchor` to bind `textposition` to the \"top\", \"middle\" or \"bottom\" of the label text.\n", + "\n", + "In this example, `yanchor`is set to \"top\", instead of the default of \"bottom\" for lines, meaning the text displays below the line.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e4d2b31a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks(indexed=True)\n", + "fig = px.line(df)\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " x0=\"2018-09-24\",\n", + " y0=0,\n", + " x1=\"2018-12-18\",\n", + " y1=3,\n", + " line_width=0,\n", + " label=dict(text=\"Decline\", textposition=\"top center\", font=dict(size=20)),\n", + " fillcolor=\"green\",\n", + " opacity=0.25,\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " x0=min(df.index),\n", + " y0=1,\n", + " x1=max(df.index),\n", + " y1=1,\n", + " line_width=3,\n", + " line_dash=\"dot\",\n", + " label=dict(\n", + " text=\"Jan 1 2018 Baseline\",\n", + " textposition=\"end\",\n", + " font=dict(size=20, color=\"blue\"),\n", + " yanchor=\"top\",\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d7415bb8", + "metadata": {}, + "source": [ + "#### Variables in Shape Label Text\n", + "\n", + "*New in 5.15*\n", + "\n", + "Use `texttemplate` to add text with variables to shapes. You have access to raw variables (`x0`, `x1`, `y0`, `y1`), which use raw data values from the shape definition, and the following calculated variables:\n", + "\n", + "- `xcenter`: (x0 + x1) / 2\n", + "- `ycenter`: (y0 + y1) / 2\n", + "- `dx`: x1 - x0\n", + "- `dy`: y1 - y0\n", + "- `width`: abs(x1 - x0)\n", + "- `height`: abs(y1 - y0)\n", + "- `length` (for lines only): sqrt(dx^2 + dy^2)\n", + "- `slope`: (y1 - y0) / (x1 - x0)\n", + "\n", + "`texttemplate` supports d3 number and date formatting.\n", + "\n", + "Add a variable with \"%{variable}\". This example adds the raw variables `x0` and `y0` to a rectangle and shows the calculated variables `height`, `slope`, `length`, and `width` on three other shapes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d8a09d48", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor=\"MediumSlateBlue\",\n", + " x0=-0.5,\n", + " y0=-0.5,\n", + " x1=1,\n", + " y1=1,\n", + " label=dict(\n", + " texttemplate=\"x0 is %{x0:.3f}, y0 is %{y0:.3f}\", font=dict(color=\"DarkOrange\")\n", + " ),\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor=\"LightGreen\",\n", + " x0=1,\n", + " y0=1.75,\n", + " x1=2.25,\n", + " y1=3,\n", + " label=dict(texttemplate=\"Height: %{height:.3f}\", font=dict(color=\"DarkOrange\")),\n", + ")\n", + "fig.add_shape(\n", + " type=\"line\",\n", + " x0=3,\n", + " y0=0.5,\n", + " x1=5,\n", + " y1=1.5,\n", + " line_width=3,\n", + " label=dict(\n", + " texttemplate=\"Slope of %{slope:.3f} and length of %{length:.3f}\",\n", + " font=dict(size=20),\n", + " ),\n", + ")\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " fillcolor=\"Lavender\",\n", + " x0=2.5,\n", + " y0=2.5,\n", + " x1=5,\n", + " y1=3.5,\n", + " label=dict(\n", + " texttemplate=\"Width: %{width:.3f}\",\n", + " font=dict(family=\"Courier New, monospace\", size=20),\n", + " ),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "772aeb8a", + "metadata": {}, + "source": [ + "#### Variables in Shape Label Text for New Shapes\n", + "\n", + "*New in 5.15*\n", + "\n", + "You can also use `texttemplate` to add text with variables to new shapes drawn on the graph.\n", + "\n", + "In this example, we enable drawing lines on the figure by adding `drawline` to `modeBarButtonsToAdd` in `config`. We then define a `texttemplate` for shapes that shows the calculated variable `dy`. Select **Draw line** in the modebar to try it out." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cf9f821b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.stocks()\n", + "\n", + "fig = go.Figure(\n", + " data=go.Scatter(\n", + " x=df.date,\n", + " y=df.GOOG,\n", + " ),\n", + " layout=go.Layout(\n", + " yaxis=dict(\n", + " title=dict(\n", + " text=\"Price in USD\"\n", + " )),\n", + " newshape=dict(\n", + " label=dict(texttemplate=\"Change: %{dy:.2f}\")\n", + " ),\n", + " title=dict(text=\"Google Share Price 2018/2019\"),\n", + " ),\n", + ")\n", + "\n", + "\n", + "fig.show(\n", + " config={\n", + " \"modeBarButtonsToAdd\": [\n", + " \"drawline\",\n", + " ]\n", + " }\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "958d24cf", + "metadata": {}, + "source": [ + "#### Shapes in the Legend\n", + "\n", + "*New in 5.16*\n", + "\n", + "You can add a shape to the legend by setting `showlegend=True` on the shape. In this example, we add the second shape to the legend. The name that appears for the shape in the legend is the shape's `name` if it is provided. If no `name` is provided, the shape label's `text` is used. If neither is provided, the legend item appears as \"shape \\\". For example, \"shape 1\"." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c275e250", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks(indexed=True)\n", + "\n", + "fig = px.line(df)\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " x0=\"2018-09-24\",\n", + " y0=0,\n", + " x1=\"2018-12-18\",\n", + " y1=3,\n", + " line_width=0,\n", + " label=dict(text=\"Decline\", textposition=\"top center\", font=dict(size=20)),\n", + " fillcolor=\"green\",\n", + " opacity=0.25,\n", + ")\n", + "\n", + "fig.add_shape(\n", + " showlegend=True,\n", + " type=\"line\",\n", + " x0=min(df.index),\n", + " y0=1,\n", + " x1=max(df.index),\n", + " y1=1,\n", + " line_width=3,\n", + " line_dash=\"dot\",\n", + " label=dict(\n", + " text=\"Jan 1 2018 Baseline\",\n", + " textposition=\"end\",\n", + " font=dict(size=20, color=\"blue\"),\n", + " yanchor=\"top\",\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ee70a74c", + "metadata": {}, + "source": [ + "`newshape` also supports `showlegend`. In this example, each new line drawn on the graph appears in the legend." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a637724e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.stocks()\n", + "\n", + "fig = go.Figure(\n", + " data=go.Scatter(\n", + " x=df.date,\n", + " y=df.AAPL,\n", + " name=\"Apple\"\n", + " ),\n", + " layout=go.Layout(\n", + " yaxis=dict(\n", + " title=dict(text=\"Price in USD\"),\n", + " ),\n", + " newshape=dict(\n", + " showlegend=True,\n", + " label=dict(texttemplate=\"Change: %{dy:.2f}\")\n", + " ),\n", + " title=dict(text=\"Apple Share Price 2018/2019\"),\n", + " ),\n", + ")\n", + "\n", + "\n", + "fig.show(\n", + " config={\n", + " \"modeBarButtonsToAdd\": [\n", + " \"drawline\",\n", + " ]\n", + " }\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "ed12c4a0", + "metadata": {}, + "source": [ + "#### Shape Layer\n", + "\n", + "By default, shapes are drawn above traces. You can also configure them to be drawn between traces and gridlines with `layer=\"between\"` (new in 5.21), or below gridlines with `layer=\"below\"`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35224a48", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks(indexed=True)\n", + "\n", + "fig = px.line(df)\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " x0=\"2018-03-01\",\n", + " y0=0,\n", + " x1=\"2018-08-01\",\n", + " y1=3,\n", + " line_width=0,\n", + " layer=\"above\",\n", + " label=dict(text=\"Above\", textposition=\"top center\", font=dict(size=15)),\n", + " fillcolor=\"LightGreen\",\n", + " opacity=0.80,\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " x0=\"2018-10-01\",\n", + " y0=0,\n", + " x1=\"2019-03-01\",\n", + " y1=3,\n", + " line_width=0,\n", + " layer=\"between\",\n", + " label=dict(text=\"Between\", textposition=\"top center\", font=dict(size=15)),\n", + " fillcolor=\"LightGreen\",\n", + " opacity=0.80,\n", + ")\n", + "\n", + "fig.add_shape(\n", + " type=\"rect\",\n", + " x0=\"2019-05-01\",\n", + " y0=0,\n", + " x1=\"2019-10-01\",\n", + " y1=3,\n", + " line_width=0,\n", + " layer=\"below\",\n", + " label=dict(text=\"Below\", textposition=\"top center\", font=dict(size=15)),\n", + " fillcolor=\"LightGreen\",\n", + " opacity=0.80,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4b59814f", + "metadata": {}, + "source": [ + "### Reference\n", + "See https://plotly.com/python/reference/layout/shapes/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "6692f7f5", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.3" + }, + "plotly": { + "description": "How to make SVG shapes in python. Examples of lines, circle, rectangle, and path.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Shapes", + "order": 25, + "permalink": "python/shapes/", + "thumbnail": "thumbnail/shape.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/sliders.ipynb b/sliders.ipynb new file mode 100644 index 000000000..3d0086100 --- /dev/null +++ b/sliders.ipynb @@ -0,0 +1,178 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "73fcf0f8", + "metadata": {}, + "source": [ + "### Simple Slider Control\n", + "Sliders can be used in Plotly to change the data displayed or style of a plot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "32d9c196", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import numpy as np\n", + "\n", + "# Create figure\n", + "fig = go.Figure()\n", + "\n", + "# Add traces, one for each slider step\n", + "for step in np.arange(0, 5, 0.1):\n", + " fig.add_trace(\n", + " go.Scatter(\n", + " visible=False,\n", + " line=dict(color=\"#00CED1\", width=6),\n", + " name=\"𝜈 = \" + str(step),\n", + " x=np.arange(0, 10, 0.01),\n", + " y=np.sin(step * np.arange(0, 10, 0.01))))\n", + "\n", + "# Make 10th trace visible\n", + "fig.data[10].visible = True\n", + "\n", + "# Create and add slider\n", + "steps = []\n", + "for i in range(len(fig.data)):\n", + " step = dict(\n", + " method=\"update\",\n", + " args=[{\"visible\": [False] * len(fig.data)},\n", + " {\"title\": \"Slider switched to step: \" + str(i)}], # layout attribute\n", + " )\n", + " step[\"args\"][0][\"visible\"][i] = True # Toggle i'th trace to \"visible\"\n", + " steps.append(step)\n", + "\n", + "sliders = [dict(\n", + " active=10,\n", + " currentvalue={\"prefix\": \"Frequency: \"},\n", + " pad={\"t\": 50},\n", + " steps=steps\n", + ")]\n", + "\n", + "fig.update_layout(\n", + " sliders=sliders\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8efe4f6a", + "metadata": {}, + "source": [ + "#### Methods\n", + "The method determines which [plotly.js function](https://plotly.com/javascript/plotlyjs-function-reference/) will be used to update the chart. Plotly can use several [updatemenu](https://plotly.com/python/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-buttons-items-button-method) methods to add the slider:\n", + "- `\"update\"`: modify **data and layout** attributes (as above)\n", + "- `\"restyle\"`: modify **data** attributes\n", + "- `\"relayout\"`: modify **layout** attributes\n", + "- `\"animate\"`: start or pause an animation" + ] + }, + { + "cell_type": "markdown", + "id": "f128f8eb", + "metadata": {}, + "source": [ + "### Sliders in Plotly Express\n", + "Plotly Express provide sliders, but with implicit animation using the `\"animate\"` method described above. The animation play button can be omitted by removing `updatemenus` in the `layout`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5c5aed7c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder()\n", + "fig = px.scatter(df, x=\"gdpPercap\", y=\"lifeExp\", animation_frame=\"year\", animation_group=\"country\",\n", + " size=\"pop\", color=\"continent\", hover_name=\"country\",\n", + " log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])\n", + "\n", + "fig[\"layout\"].pop(\"updatemenus\") # optional, drop animation buttons\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "643944f2", + "metadata": {}, + "source": [ + "#### Reference\n", + "Check out https://plotly.com/python/reference/layout/updatemenus/ for more information!\n" + ] + }, + { + "cell_type": "markdown", + "id": "7e95a9eb", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + }, + "plotly": { + "description": "How to add slider controls to your plots in Python with Plotly.", + "display_as": "controls", + "language": "python", + "layout": "base", + "name": "Sliders", + "order": 1.5, + "page_type": "example_index", + "permalink": "python/sliders/", + "thumbnail": "thumbnail/slider2017.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/smith-charts.ipynb b/smith-charts.ipynb new file mode 100644 index 000000000..27bdd5a3f --- /dev/null +++ b/smith-charts.ipynb @@ -0,0 +1,174 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "228ccc29", + "metadata": {}, + "source": [ + "*New in v5.4*\n", + "\n", + "A [Smith Chart](https://en.wikipedia.org/wiki/Smith_chart) is a specialized chart for visualizing [complex numbers](https://en.wikipedia.org/wiki/Complex_number): numbers with both a real and imaginary part." + ] + }, + { + "cell_type": "markdown", + "id": "20768e91", + "metadata": {}, + "source": [ + "### Smith Charts with Plotly Graph Objects" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca54fb0e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattersmith(imag=[0.5, 1, 2, 3], real=[0.5, 1, 2, 3]))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c0e7edbd", + "metadata": {}, + "source": [ + "### Smith Chart Subplots and Styling" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a65428b0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scattersmith(\n", + " imag=[1],\n", + " real=[1],\n", + " marker_symbol='x',\n", + " marker_size=30,\n", + " marker_color=\"green\",\n", + " subplot=\"smith1\"\n", + "))\n", + "\n", + "fig.add_trace(go.Scattersmith(\n", + " imag=[1],\n", + " real=[1],\n", + " marker_symbol='x',\n", + " marker_size=30,\n", + " marker_color=\"pink\",\n", + " subplot=\"smith2\"\n", + "))\n", + "\n", + "fig.update_layout(\n", + " smith=dict(\n", + " realaxis_gridcolor='red',\n", + " imaginaryaxis_gridcolor='blue',\n", + " domain=dict(x=[0,0.45])\n", + " ),\n", + " smith2=dict(\n", + " realaxis_gridcolor='blue',\n", + " imaginaryaxis_gridcolor='red',\n", + " domain=dict(x=[0.55,1])\n", + " )\n", + ")\n", + "\n", + "fig.update_smiths(bgcolor=\"lightgrey\")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9b0bdb1e", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/scattersmith/ and https://plotly.com/python/reference/layout/smith/ for more information and chart attribute options!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bcec238c", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "0d4f4d43", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.11" + }, + "plotly": { + "description": "How to make Smith Charts with plotly.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Smith Charts", + "order": 20, + "page_type": "u-guide", + "permalink": "python/smith-charts/", + "thumbnail": "thumbnail/contourcarpet.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/smoothing.ipynb b/smoothing.ipynb new file mode 100644 index 000000000..a2d68d3d0 --- /dev/null +++ b/smoothing.ipynb @@ -0,0 +1,258 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e9594d40", + "metadata": {}, + "source": [ + "#### Imports\n", + "\n", + "The tutorial below imports [NumPy](http://www.numpy.org/), [Pandas](https://pandas.pydata.org/docs/user_guide/10min.html), [SciPy](https://www.scipy.org/) and [Plotly](https://plotly.com/python/getting-started/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83d2342a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "import pandas as pd\n", + "import scipy\n", + "\n", + "from scipy import signal" + ] + }, + { + "cell_type": "markdown", + "id": "66e9aca3", + "metadata": {}, + "source": [ + "#### Savitzky-Golay Filter\n", + "\n", + "`Smoothing` is a technique that is used to eliminate noise from a dataset. There are many algorithms and methods to accomplish this but all have the same general purpose of 'roughing out the edges' or 'smoothing' some data.\n", + "\n", + "There is reason to smooth data if there is little to no small-scale structure in the data. The danger to this thinking is that one may skew the representation of the data enough to change its perceived meaning, so for the sake of scientific honesty it is an imperative to at the very minimum explain one's reason's for using a smoothing algorithm to their dataset.\n", + "\n", + "In this example we use the [Savitzky-Golay Filter](https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter), which fits subsequent windows of adjacent data with a low-order polynomial." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "527e0e41", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "import pandas as pd\n", + "import scipy\n", + "\n", + "from scipy import signal\n", + "\n", + "np.random.seed(1)\n", + "\n", + "x = np.linspace(0, 10, 100)\n", + "y = np.sin(x)\n", + "noise = 2 * np.random.random(len(x)) - 1 # uniformly distributed between -1 and 1\n", + "y_noise = y + noise\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=y,\n", + " mode='markers',\n", + " marker=dict(size=2, color='black'),\n", + " name='Sine'\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=y_noise,\n", + " mode='markers',\n", + " marker=dict(\n", + " size=6,\n", + " color='royalblue',\n", + " symbol='circle-open'\n", + " ),\n", + " name='Noisy Sine'\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=signal.savgol_filter(y_noise,\n", + " 53, # window size used for filtering\n", + " 3), # order of fitted polynomial\n", + " mode='markers',\n", + " marker=dict(\n", + " size=6,\n", + " color='mediumpurple',\n", + " symbol='triangle-up'\n", + " ),\n", + " name='Savitzky-Golay'\n", + "))\n", + "\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6e691087", + "metadata": {}, + "source": [ + "#### Triangular Moving Average\n", + "\n", + "Another method for smoothing is a moving average. There are various forms of this, but the idea is to take a window of points in your dataset, compute an average of the points, then shift the window over by one point and repeat. This will generate a bunch of points which will result in the `smoothed` data.\n", + "\n", + "Let us look at the common `Simple Moving Average` first. In the 1D case we have a data set of $N$ points with y-values $y_1, y_2, ..., y_N$. Setting our window size to $n < N$, the new $i^{th}$ y-value after smoothing is computed as:\n", + "\n", + "$$\n", + "\\begin{align*}\n", + "SMA_i = \\frac{y_i + ... + y_{i+n}}{n}\n", + "\\end{align*}\n", + "$$\n", + "\n", + "In the `Triangular Moving Average`, two simple moving averages are computed on top of each other, in order to give more weight to closer (adjacent) points. This means that our $SMA_i$ are computed then a Triangular Moving Average $TMA_i$ is computed as:\n", + "\n", + "$$\n", + "\\begin{align*}\n", + "TMA_i = \\frac{SMA_i + ... + SMA_{i+n}}{n}\n", + "\\end{align*}\n", + "$$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f36850cd", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "def smoothTriangle(data, degree):\n", + " triangle=np.concatenate((np.arange(degree + 1), np.arange(degree)[::-1])) # up then down\n", + " smoothed=[]\n", + "\n", + " for i in range(degree, len(data) - degree * 2):\n", + " point=data[i:i + len(triangle)] * triangle\n", + " smoothed.append(np.sum(point)/np.sum(triangle))\n", + " # Handle boundaries\n", + " smoothed=[smoothed[0]]*int(degree + degree/2) + smoothed\n", + " while len(smoothed) < len(data):\n", + " smoothed.append(smoothed[-1])\n", + " return smoothed\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=y,\n", + " mode='markers',\n", + " marker=dict(\n", + " size=2,\n", + " color='rgb(0, 0, 0)',\n", + " ),\n", + " name='Sine'\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=y_noise,\n", + " mode='markers',\n", + " marker=dict(\n", + " size=6,\n", + " color='#5E88FC',\n", + " symbol='circle-open'\n", + " ),\n", + " name='Noisy Sine'\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=x,\n", + " y=smoothTriangle(y_noise, 10), # setting degree to 10\n", + " mode='markers',\n", + " marker=dict(\n", + " size=6,\n", + " color='#C190F0',\n", + " symbol='triangle-up'\n", + " ),\n", + " name='Moving Triangle - Degree 10'\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d0d1cbcc", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "Learn how to perform smoothing using various methods in Python.", + "display_as": "advanced_opt", + "has_thumbnail": false, + "language": "python", + "layout": "base", + "name": "Smoothing", + "order": 4, + "page_type": "example_index", + "permalink": "python/smoothing/", + "thumbnail": "/images/static-image" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/splom.ipynb b/splom.ipynb new file mode 100644 index 000000000..760644a57 --- /dev/null +++ b/splom.ipynb @@ -0,0 +1,496 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "da50cb85", + "metadata": {}, + "source": [ + "### Scatter matrix with Plotly Express\n", + "\n", + "A scatterplot matrix is a matrix associated to n numerical arrays (data variables), $X_1,X_2,…,X_n$ , of the same length. The cell (i,j) of such a matrix displays the scatter plot of the variable Xi versus Xj.\n", + "\n", + "Here we show the Plotly Express function `px.scatter_matrix` to plot the scatter matrix for the columns of the dataframe. By default, all columns are considered.\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6149395c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_matrix(df)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5d66b0f0", + "metadata": {}, + "source": [ + "Specify the columns to be represented with the `dimensions` argument, and set colors using a column of the dataframe:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca2c03a2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_matrix(df,\n", + " dimensions=[\"sepal_length\", \"sepal_width\", \"petal_length\", \"petal_width\"],\n", + " color=\"species\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2fed135b", + "metadata": {}, + "source": [ + "#### Styled Scatter Matrix with Plotly Express\n", + "\n", + "The scatter matrix plot can be configured thanks to the parameters of `px.scatter_matrix`, but also thanks to `fig.update_traces` for fine tuning (see the next section to learn more about the options)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c601200f", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.scatter_matrix(df,\n", + " dimensions=[\"sepal_length\", \"sepal_width\", \"petal_length\", \"petal_width\"],\n", + " color=\"species\", symbol=\"species\",\n", + " title=\"Scatter matrix of iris data set\",\n", + " labels={col:col.replace('_', ' ') for col in df.columns}) # remove underscore\n", + "fig.update_traces(diagonal_visible=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "dfd90399", + "metadata": {}, + "source": [ + "### Scatter matrix (splom) with go.Splom\n", + "\n", + "If Plotly Express does not provide a good starting point, it is possible to use [the more generic `go.Splom` class from `plotly.graph_objects`](/python/graph-objects/). All its parameters are documented in the reference page https://plotly.com/python/reference/splom/.\n", + "\n", + "The Plotly splom trace implementation for the scatterplot matrix does not require to set $x=Xi$ , and $y=Xj$, for each scatter plot. All arrays, $X_1,X_2,…,X_n$ , are passed once, through a list of dicts called dimensions, i.e. each array/variable represents a dimension.\n", + "\n", + "A trace of type `splom` is defined as follows:\n", + "\n", + "```\n", + "trace=go.Splom(dimensions=[dict(label='string-1',\n", + " values=X1),\n", + " dict(label='string-2',\n", + " values=X2),\n", + " .\n", + " .\n", + " .\n", + " dict(label='string-n',\n", + " values=Xn)],\n", + " ....\n", + " )\n", + "```\n", + "\n", + "The label in each dimension is assigned to the axes titles of the corresponding matrix cell.\n" + ] + }, + { + "cell_type": "markdown", + "id": "13647138", + "metadata": {}, + "source": [ + "#### Splom of the Iris data set" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e0b6b855", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv')\n", + "\n", + "# The Iris dataset contains four data variables, sepal length, sepal width, petal length,\n", + "# petal width, for 150 iris flowers. The flowers are labeled as `Iris-setosa`,\n", + "# `Iris-versicolor`, `Iris-virginica`.\n", + "\n", + "# Define indices corresponding to flower categories, using pandas label encoding\n", + "index_vals = df['class'].astype('category').cat.codes\n", + "\n", + "fig = go.Figure(data=go.Splom(\n", + " dimensions=[dict(label='sepal length',\n", + " values=df['sepal length']),\n", + " dict(label='sepal width',\n", + " values=df['sepal width']),\n", + " dict(label='petal length',\n", + " values=df['petal length']),\n", + " dict(label='petal width',\n", + " values=df['petal width'])],\n", + " text=df['class'],\n", + " marker=dict(color=index_vals,\n", + " showscale=False, # colors encode categorical variables\n", + " line_color='white', line_width=0.5)\n", + " ))\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text='Iris Data set'),\n", + " dragmode='select',\n", + " width=600,\n", + " height=600,\n", + " hovermode='closest',\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0031c308", + "metadata": {}, + "source": [ + "The scatter plots on the principal diagonal can be removed by setting `diagonal_visible=False`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e67b46d5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv')\n", + "index_vals = df['class'].astype('category').cat.codes\n", + "\n", + "fig = go.Figure(data=go.Splom(\n", + " dimensions=[dict(label='sepal length',\n", + " values=df['sepal length']),\n", + " dict(label='sepal width',\n", + " values=df['sepal width']),\n", + " dict(label='petal length',\n", + " values=df['petal length']),\n", + " dict(label='petal width',\n", + " values=df['petal width'])],\n", + " diagonal_visible=False, # remove plots on diagonal\n", + " text=df['class'],\n", + " marker=dict(color=index_vals,\n", + " showscale=False, # colors encode categorical variables\n", + " line_color='white', line_width=0.5)\n", + " ))\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text='Iris Data set'),\n", + " width=600,\n", + " height=600,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bff4df84", + "metadata": {}, + "source": [ + "To plot only the lower/upper half of the splom we switch the default `showlowerhalf=True`/`showupperhalf=True` to `False`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "db0c5847", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv')\n", + "index_vals = df['class'].astype('category').cat.codes\n", + "\n", + "fig = go.Figure(data=go.Splom(\n", + " dimensions=[dict(label='sepal length',\n", + " values=df['sepal length']),\n", + " dict(label='sepal width',\n", + " values=df['sepal width']),\n", + " dict(label='petal length',\n", + " values=df['petal length']),\n", + " dict(label='petal width',\n", + " values=df['petal width'])],\n", + " showupperhalf=False, # remove plots on diagonal\n", + " text=df['class'],\n", + " marker=dict(color=index_vals,\n", + " showscale=False, # colors encode categorical variables\n", + " line_color='white', line_width=0.5)\n", + " ))\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text='Iris Data set'),\n", + " width=600,\n", + " height=600,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c7adf85c", + "metadata": {}, + "source": [ + "Each dict in the list dimensions has a key, visible, set by default on True. We can choose to remove a variable from splom, by setting `visible=False` in its corresponding dimension. In this case the default grid associated to the scatterplot matrix keeps its number of cells, but the cells in the row and column corresponding to the visible false dimension are empty:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2973f98e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv')\n", + "index_vals = df['class'].astype('category').cat.codes\n", + "\n", + "fig = go.Figure(data=go.Splom(\n", + " dimensions=[dict(label='sepal length',\n", + " values=df['sepal length']),\n", + " dict(label='sepal width',\n", + " values=df['sepal width'],\n", + " visible=False),\n", + " dict(label='petal length',\n", + " values=df['petal length']),\n", + " dict(label='petal width',\n", + " values=df['petal width'])],\n", + " text=df['class'],\n", + " marker=dict(color=index_vals,\n", + " showscale=False, # colors encode categorical variables\n", + " line_color='white', line_width=0.5)\n", + " ))\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text='Iris Data set'),\n", + " width=600,\n", + " height=600,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9c42fc3a", + "metadata": {}, + "source": [ + "#### Splom for the diabetes dataset\n", + "\n", + "Diabetes dataset is downloaded from [kaggle](https://www.kaggle.com/uciml/pima-indians-diabetes-database/data). It is used to predict the onset of diabetes based on 8 diagnostic measures. The diabetes file contains the diagnostic measures for 768 patients, that are labeled as non-diabetic (Outcome=0), respectively diabetic (Outcome=1). The splom associated to the 8 variables can illustrate the strength of the relationship between pairs of measures for diabetic/nondiabetic patients." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b567828e", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "dfd = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/diabetes.csv')\n", + "textd = ['non-diabetic' if cl==0 else 'diabetic' for cl in dfd['Outcome']]\n", + "\n", + "fig = go.Figure(data=go.Splom(\n", + " dimensions=[dict(label='Pregnancies', values=dfd['Pregnancies']),\n", + " dict(label='Glucose', values=dfd['Glucose']),\n", + " dict(label='BloodPressure', values=dfd['BloodPressure']),\n", + " dict(label='SkinThickness', values=dfd['SkinThickness']),\n", + " dict(label='Insulin', values=dfd['Insulin']),\n", + " dict(label='BMI', values=dfd['BMI']),\n", + " dict(label='DiabPedigreeFun', values=dfd['DiabetesPedigreeFunction']),\n", + " dict(label='Age', values=dfd['Age'])],\n", + " marker=dict(color=dfd['Outcome'],\n", + " size=5,\n", + " colorscale='Bluered',\n", + " line=dict(width=0.5,\n", + " color='rgb(230,230,230)')),\n", + " text=textd,\n", + " diagonal=dict(visible=False)))\n", + "\n", + "title = \"Scatterplot Matrix (SPLOM) for Diabetes Dataset
Data source:\"+\\\n", + " \" [1]\"\n", + "fig.update_layout(title=title,\n", + " dragmode='select',\n", + " width=1000,\n", + " height=1000,\n", + " hovermode='closest')\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "76a1428f", + "metadata": {}, + "source": [ + "#### Hover Effects\n", + "\n", + "*New in 5.21*\n", + "\n", + "Set `hoversubplots='axis'` with `hovermode` set to `x`, `x unified`, `y`, or `y unified` for hover effects to appear across a column or row. For more on hover effects, see the [Hover Text and Formatting](/python/hover-text-and-formatting/) page." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d3f373c1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\n", + " \"https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv\"\n", + ")\n", + "index_vals = df[\"class\"].astype(\"category\").cat.codes\n", + "\n", + "fig = go.Figure(\n", + " data=go.Splom(\n", + " dimensions=[\n", + " dict(label=\"sepal length\", values=df[\"sepal length\"]),\n", + " dict(label=\"sepal width\", values=df[\"sepal width\"]),\n", + " dict(label=\"petal length\", values=df[\"petal length\"]),\n", + " dict(label=\"petal width\", values=df[\"petal width\"]),\n", + " ],\n", + " showupperhalf=False,\n", + " text=df[\"class\"],\n", + " marker=dict(\n", + " color=index_vals,\n", + " showscale=False,\n", + " line_color=\"white\",\n", + " line_width=0.5,\n", + " ),\n", + " )\n", + ")\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text=\"Iris Data set\"),\n", + " hoversubplots=\"axis\",\n", + " width=600,\n", + " height=600,\n", + " hovermode=\"x\",\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "f4aaa7e6", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.scatter_matrix()`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_matrix) or https://plotly.com/python/reference/splom/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "21ee69c0", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + }, + "plotly": { + "description": "How to make scatterplot matrices or sploms natively in Python with Plotly.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "Scatterplot Matrix", + "order": 6, + "page_type": "u-guide", + "permalink": "python/splom/", + "redirect_from": "python/scatterplot-matrix/", + "thumbnail": "thumbnail/splom_image.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/static-image-export.ipynb b/static-image-export.ipynb new file mode 100644 index 000000000..10e4c057e --- /dev/null +++ b/static-image-export.ipynb @@ -0,0 +1,452 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "e27ca4a0", + "metadata": {}, + "source": [ + "This page demonstrates how to export interactive Plotly figures to static image formats like PNG, JPEG, SVG, and PDF. If you want to export Plotly figures to HTML to retain interactivity, see the [Interactive HTML Export page](/python/interactive-html-export/)" + ] + }, + { + "cell_type": "markdown", + "id": "7a4cdcb8", + "metadata": {}, + "source": [ + "## Install Dependencies\n", + "\n", + "### Kaleido\n", + "\n", + "Static image generation requires [Kaleido](https://github.com/plotly/Kaleido).\n", + "Install Kaleido with pip:\n", + "```\n", + "$ pip install --upgrade kaleido\n", + "```\n", + "or with conda:\n", + "```\n", + "$ conda install -c conda-forge python-kaleido\n", + "```\n", + "\n", + "It's also possible to generate static images using [Orca](https://github.com/plotly/orca), though support for Orca will be removed after September 2025. See the [Orca Management](/python/orca-management/) page for more details.\n", + "\n", + "### Chrome\n", + "\n", + "Kaleido uses Chrome for static image generation. Versions of Kaleido prior to v1 included Chrome as part of the Kaleido package. Kaleido v1 does not include Chrome; instead, it looks for a compatible version of Chrome (or Chromium) already installed on the machine on which it's running.\n", + "\n", + "If you don't have Chrome installed, you can install it directly from Google following the instructions for your operating system.\n", + "\n", + "Plotly also provides a CLI for installing Chrome from the command line.\n", + "\n", + "Run `plotly_get_chrome` to install Chrome.\n", + "\n", + "You can also install Chrome from Python using `plotly.io.get_chrome()`\n", + "\n", + "```python\n", + "import plotly.io as pio\n", + "\n", + "pio.get_chrome()\n", + "```\n", + "\n", + "See the **Additional Information on Browsers with Kaleido** section below for more details on browser compatibility for Kaleido.\n" + ] + }, + { + "cell_type": "markdown", + "id": "3a4890ac", + "metadata": {}, + "source": [ + "## Write Image to a File\n", + "\n", + "Plotly figures have a `write_image` method to write a figure to a file. `write_image` supports PNG, JPEG, WebP, SVG, and PDF formats.\n", + "\n", + "To export a figure using `write_image`, call `write_image` on the figure, and pass as an argument the filename where you want to save the figure. The file format is inferred from the extension:" + ] + }, + { + "cell_type": "markdown", + "id": "7a48247f", + "metadata": {}, + "source": [ + "### Raster Formats\n", + "\n", + "**PNG**\n", + "~~~python\n", + "import plotly.express as px\n", + "data_canada = px.data.gapminder().query(\"country == 'Canada'\")\n", + "fig = px.bar(data_canada, x='year', y='pop')\n", + "fig.write_image(\"fig1.png\")\n", + "~~~\n", + "\n", + "**JPEG**\n", + "\n", + "~~~python\n", + "...\n", + "fig.write_image(\"images/fig1.jpeg\")\n", + "~~~\n", + "\n", + "**WebP**\n", + "\n", + "~~~python\n", + "...\n", + "fig.write_image(\"images/fig1.webp\")\n", + "~~~\n", + "\n", + "### Vector Formats\n", + "\n", + "**SVG**\n", + "~~~python\n", + "...\n", + "fig.write_image(\"images/fig1.svg\")\n", + "~~~\n", + "\n", + "**PDF**\n", + "\n", + "~~~python\n", + "...\n", + "fig.write_image(\"images/fig1.pdf\")\n", + "~~~\n", + "\n", + "---\n", + "\n", + "**EPS** (Kaleido<1.0.0)\n", + "\n", + "Kaleido versions earlier than 1.0.0 also support **EPS** (requires the poppler library). If using Kaleido v1 or later, we recommend PDF or SVG format.\n", + "\n", + "~~~python\n", + "...\n", + "fig.write_image(\"images/fig1.eps\")\n", + "~~~" + ] + }, + { + "cell_type": "markdown", + "id": "85996906", + "metadata": {}, + "source": [ + "**Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image." + ] + }, + { + "cell_type": "markdown", + "id": "53389fa9", + "metadata": {}, + "source": [ + "### Specify a Format\n", + "\n", + "In the earlier example, Plotly inferred the image format from the extension of the filename. You can also specify the format explicitly using the `format` parameter.\n", + "\n", + "~~~python\n", + "import plotly.express as px\n", + "data_canada = px.data.gapminder().query(\"country == 'Canada'\")\n", + "fig = px.bar(data_canada, x='year', y='pop')\n", + "fig.write_image(\"fig1\", format=\"png\")\n", + "~~~\n" + ] + }, + { + "cell_type": "markdown", + "id": "2571e539", + "metadata": {}, + "source": [ + "### Write Multiple Images\n", + "\n", + "*Kaleido v1 and later*\n", + "\n", + "`plotly.io` provides a `write_images` function for writing multiple figures to images. Using `write_images` is faster than calling `fig.write_image` multiple times.\n", + "\n", + "`write_images` takes a list of figure objects or dicts representing figures as its first argument, `fig`. The second argument `file` is a list of paths to export to. These paths can be specified as `str`s or [`pathlib.Path` objects](https://docs.python.org/3/library/pathlib.html).\n", + "\n", + "~~~python\n", + "import plotly.graph_objects as go\n", + "import plotly.express as px\n", + "import plotly.io as pio\n", + "\n", + "\n", + "fig1 = go.Figure(\n", + " data=go.Scatter(x=[1, 2, 3], y=[4, 5, 6], mode='lines+markers'),\n", + " layout=go.Layout(title='Line Chart')\n", + ")\n", + "\n", + "fig2 = go.Figure(\n", + " data=go.Bar(x=['A', 'B', 'C'], y=[10, 5, 15]),\n", + " layout=go.Layout(title='Bar Chart')\n", + ")\n", + "\n", + "fig3 = px.pie(\n", + " values=[30, 20, 10, 40],\n", + " names=['A', 'B', 'C', 'D'],\n", + " title='Pie Chart'\n", + ")\n", + "\n", + "pio.write_images(\n", + " fig=[fig1, fig2, fig3],\n", + " file=['export_images/line_chart.png', 'export_images/bar_chart.png', 'export_images/pie_chart.png']\n", + ")\n", + "~~~\n" + ] + }, + { + "cell_type": "markdown", + "id": "a3b0a5ec", + "metadata": {}, + "source": [ + "## Get Image as Bytes\n", + "\n", + "As well as exporting to a file, Plotly figures also support conversion to a bytes object.\n", + "To convert a figure to a **PNG** bytes object, call the figure's `to_image` method with a `format`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "203c2c5c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "data_canada = px.data.gapminder().query(\"country == 'Canada'\")\n", + "fig = px.bar(data_canada, x='year', y='pop')\n", + "img_bytes = fig.to_image(format=\"png\")" + ] + }, + { + "cell_type": "markdown", + "id": "f11030b5", + "metadata": {}, + "source": [ + "Here's the bytes object displayed using `IPython.display.Image`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ab4f462", + "metadata": {}, + "outputs": [], + "source": [ + "from IPython.display import Image\n", + "Image(img_bytes)" + ] + }, + { + "cell_type": "markdown", + "id": "78ac1c0f", + "metadata": {}, + "source": [ + "## Specify Image Dimensions and Scale\n", + "In addition to the image format, the `to_image` and `write_image` functions provide arguments to specify the image `width` and `height` in logical pixels. They also provide a `scale` parameter that can be used to increase (`scale` > 1) or decrease (`scale` < 1) the physical resolution of the resulting image." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0bace4f7", + "metadata": {}, + "outputs": [], + "source": [ + "img_bytes = fig.to_image(format=\"png\", width=600, height=350, scale=2)\n", + "Image(img_bytes)" + ] + }, + { + "cell_type": "markdown", + "id": "7c703c39", + "metadata": {}, + "source": [ + "## Specify Image Export Engine\n", + "\n", + "> The `engine` parameter, as well as Orca support, is deprecated in Plotly.py 6.2.0 and will be removed after September 2025.\n", + "\n", + "If `kaleido` is installed, it will automatically be used to perform image export. If it is not installed, plotly.py will attempt to use `orca` instead. The `engine` argument to the `to_image` and `write_image` functions can be used to override this default behavior.\n", + "\n", + "Here is an example of specifying `orca` for the image export engine:\n", + "~~~python\n", + "fig.to_image(format=\"png\", engine=\"orca\")\n", + "~~~\n", + "\n", + "And, here is an example of specifying that Kaleido should be used:\n", + "~~~python\n", + "fig.to_image(format=\"png\", engine=\"kaleido\")\n", + "~~~\n" + ] + }, + { + "cell_type": "markdown", + "id": "ab39183b", + "metadata": {}, + "source": [ + "## plotly.io Functions\n", + "\n", + "Previous examples on this page access `write_image` and `to_image` as methods on Plotly Figure objects. This functionality is also available via the `plotly.io` subpackage.\n", + "\n", + "The following example uses the `write_image` function from `plotly.io`. The function takes the figure or a `dict` representing a figure (as shown in the example) as its first argument.\n", + "\n", + "\n", + "~~~python\n", + "import plotly.io as pio\n", + "\n", + "\n", + "fig = dict({\n", + " \"data\": [{\"type\": \"bar\",\n", + " \"x\": [1, 2, 3],\n", + " \"y\": [1, 3, 2]}],\n", + " \"layout\": {\"title\": {\"text\": \"A Figure Specified By Python Dictionary\"}}\n", + "})\n", + "\n", + "pio.write_image(fig, \"fig.png\")\n", + "~~~" + ] + }, + { + "cell_type": "markdown", + "id": "db55ae3a", + "metadata": {}, + "source": [ + "## Image Export Settings (Kaleido)\n", + "\n", + "As well as configuring height, width, and other settings by passing arguments when calling `write_image` and `to_image`, you can also set a single default to be used throughout the duration of the program.\n", + "\n", + "### Available Settings\n", + "\n", + "The following settings are available.\n", + "\n", + "`default_width`: The default pixel width to use on image export.\n", + "\n", + "`default_height`: The default pixel height to use on image export.\n", + "\n", + "`default_scale`: The default image scale factor applied on image export.\n", + "\n", + "`default_format`: The default image format used on export. One of \"png\", \"jpeg\", \"webp\", \"svg\", or \"pdf\". (\"eps\" support is available with Kaleido v0 only)\n", + "\n", + "`mathjax`: Location of the MathJax bundle needed to render LaTeX characters. Defaults to a CDN location. If fully offline export is required, set this to a local MathJax bundle.\n", + "\n", + "`plotlyjs`: Location of the Plotly.js bundle to use. Can be a local file path or URL. By default, Kaleido uses the Plotly.js bundle included with Plotly.py.\n", + "\n", + "`topojson`: Location of the topojson files needed to render choropleth traces. Defaults to a CDN location. If fully offline export is required, set this to a local directory containing the Plotly.js topojson files.\n", + "\n", + "`mapbox_access_token`: The default Mapbox access token (Kaleido v0 only). Mapbox traces are deprecated. See the [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) page for more details.\n", + "\n", + "### Set Defaults\n", + "\n", + "Since Plotly.py 6.1, settings are available on `plotly.io.defaults`\n", + "\n", + "To set the `default_format` to \"jpeg\":\n", + "\n", + "~~~python\n", + "import plotly.io as pio\n", + "pio.defaults.default_format = \"jpeg\"\n", + "~~~\n", + "\n", + "You can also access current defaults. To see the default value for height:\n", + "\n", + "~~~python\n", + "import plotly.io as pio\n", + "pio.defaults.default_height\n", + "~~~\n", + "\n", + "In earlier versions of Plotly.py, these settings are available on `plotly.io.kaleido.scope`. This is deprecated since version 6.2. Use `plotly.io.defaults` instead.\n", + "\n", + "~~~python\n", + "import plotly.io as pio\n", + "# Example using deprecated `plotly.io.kaleido.scope`\n", + "pio.kaleido.scope.default_format = \"jpeg\"\n", + "~~~\n", + "\n", + "### Additional Information on Browsers with Kaleido\n", + "\n", + "When exporting images from Plotly.py, Kaleido will attempt to find a version of [Chrome](https://www.google.com/chrome/index.html) or [Chromium](https://www.chromium.org/getting-involved/download-chromium/) that it can use for the export. It checks in the operating system's PATH for executables with the following names: \"chromium\", \"chromium-browser\", \"chrome\", \"Chrome\", \"google-chrome\" \"google-chrome-stable\", \"Chrome.app\", \"Google Chrome\", \"Google Chrome.app\", and \"Google Chrome for Testing\".\n", + "\n", + "Kaleido will also check the following locations:\n", + "\n", + "**Windows**\n", + "\n", + "- r\"c:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\"\n", + "- f\"c:\\\\Users\\\\{os.environ.get('USER', 'default')}\\\\AppData\\\\\"\n", + "- \"Local\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\"\n", + "\n", + "**Linux\"**\n", + "\n", + "- \"/usr/bin/google-chrome-stable\"\n", + "- \"/usr/bin/google-chrome\"\n", + "- \"/usr/bin/chrome\"\n", + "\n", + "**Mac OS**\n", + "\n", + "- \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\n", + "\n", + "---\n", + "\n", + "Most recent versions of Chrome or Chromium should work with Kaleido. Other Chromium-based browsers may also work, though Kaleido won't discover them automatically. You can set a browser to use by setting the path to search using an environment variable called `BROWSER_PATH`. For example:\n", + "\n", + "```\n", + "BROWSER_PATH=/Applications/Microsoft\\ Edge.app/Contents/MacOS/Microsoft\\ Edge\n", + "```\n" + ] + }, + { + "cell_type": "markdown", + "id": "cbcb1cfd", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.3" + }, + "plotly": { + "description": "Plotly allows you to save static images of your plots. Save the image to your local computer, or embed it inside your Jupyter notebooks as a static image.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Static Image Export", + "order": 6, + "page_type": "u-guide", + "permalink": "python/static-image-export/", + "thumbnail": "thumbnail/static-image-export.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/static-image-generation-migration.ipynb b/static-image-generation-migration.ipynb new file mode 100644 index 000000000..c4aaf772e --- /dev/null +++ b/static-image-generation-migration.ipynb @@ -0,0 +1,124 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4828146d", + "metadata": { + "lines_to_next_cell": 2 + }, + "source": [ + "# Static Image Generation Changes in Plotly.py 6.1\n", + "\n", + "Plotly.py 6.1 introduces support for Kaleido v1, which [improves static image generation](https://plotly.com/blog/kaleido-the-next-generation/) for Plotly figures.\n", + "\n", + "While adding support for Kaleido v1, we are deprecating support for earlier versions of Kaleido and support for [Orca](/python/orca-management/). Support for Orca and earlier versions of Kaleido will be removed after September 2025, and we recommend updating to the latest Kaleido. This page documents how to migrate your Plotly code to Kaleido v1 and outlines the changes in functionality.\n", + "\n", + "To migrate from either Orca or Kaleido v0, first install the latest Kaleido with:\n", + "\n", + "```bash\n", + "pip install --upgrade kaleido\n", + "```\n", + "\n", + "## Chrome\n", + "\n", + "Kaleido uses Chrome for static image generation. Versions of Kaleido prior to v1 included Chrome as part of the Kaleido package. Kaleido v1 does not include Chrome; instead, it looks for a compatible version of Chrome (or Chromium) already installed on the machine on which it's running.\n", + "\n", + "See the [Chrome section](/python/static-image-export#chrome) on the Static Image Export page for more details on Chome and Kaleido.\n", + "\n", + "## Engine Parameter\n", + "\n", + "The `engine` parameter on static image export methods and functions is deprecated in Plotly.py 6.2 and will be removed after September 2025. Once the `engine` parameter is removed, static image generation will use Kaleido v1 if it's installed, or raise an error if it isn't.\n", + "\n", + "You'll need to update your code to remove references to `engine`. For example, `fig.to_image(format=\"png\", engine=\"orca\")` or `fig.to_image(format=\"png\", engine=\"kaleido\")` needs to be updated to `fig.to_image(format=\"png\")`. This change applies to: `fig.to_image`, `fig.write_image`, `plotly.io.to_image`, and `plotly.io.write_image`.\n", + "\n", + "## EPS Format\n", + "\n", + "The `eps` format is no longer supported in Kaleido v1. If your existing code sets `format=\"eps\"`, you'll need to update it to use another format, for example `pdf`.\n", + "\n", + "## Config Settings\n", + "\n", + "Accessing Kaleido defaults and config settings via `plotly.io.kaleido.scope` is now deprecated and will be removed after September 2025. You'll need to update any code that uses `plotly.io.kaleido.scope` to instead use `plotly.io.defaults`. For example, to set the `default_format` to \"jpeg\":\n", + "\n", + "~~~python\n", + "import plotly.io as pio\n", + "pio.defaults.default_format = \"jpeg\"\n", + "# Instead of:\n", + "# pio.kaleido.scope.default_format = \"jpeg\"\n", + "~~~\n", + "\n", + "The `mapbox_access_token` config setting is not available on `plotly.io.defaults` because Mapbox maps are deprecated and will be removed in a future version of Plotly.py. See [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) for more details.\n", + "\n", + "If you are migrating from Orca, the following config settings do not apply to Kaleido: `server_url`, `port`, `timeout`, and `use_xvfb`, but other settings, such as `default_format`, can be accessed via `plotly.io.defaults`.\n", + "\n", + "## Multiple Image Export\n", + "\n", + "Plotly.py 6.1 includes a `write_images` function (`plotly.io.write_images`), which we recommend over `write_image` when exporting more than one figure. Calling `write_images` with a list of figures (or dicts representing figures) to export provides better performance than multiple calls with `write_image`. See the [Write Multiple Images](/python/static-image-export#write-multiple-images) section for more details." + ] + }, + { + "cell_type": "markdown", + "id": "da29043f", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.3" + }, + "plotly": { + "description": "Details about changes to static image generation in Plotly.py 6.1.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Static Image Generation Changes in Plotly.py 6.1", + "order": 40, + "page_type": "u-guide", + "permalink": "python/static-image-generation-changes/", + "thumbnail": "thumbnail/static-image-export.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/streamline-plots.ipynb b/streamline-plots.ipynb new file mode 100644 index 000000000..d9483b7f0 --- /dev/null +++ b/streamline-plots.ipynb @@ -0,0 +1,178 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "865836c4", + "metadata": {}, + "source": [ + "A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to the velocity field. In the case of a stationary velocity field, streamlines coincide with trajectories (see also the [Wikipedia page on streamlines, streaklines and pathlines](https://en.wikipedia.org/wiki/Streamlines,_streaklines,_and_pathlines)).\n", + "\n", + "For the streamline [figure factory](/python/figure-factories/), one needs to provide\n", + "- uniformly spaced ranges of `x` and `y` values (1D)\n", + "- 2-D velocity values `u` and `v` defined on the cross-product (`np.meshgrid(x, y)`) of `x` and `y`.\n", + "\n", + "Velocity values are interpolated when determining the streamlines. Streamlines are initialized on the boundary of the `x-y` domain.\n", + "\n", + "#### Basic Streamline Plot\n", + "\n", + "Streamline plots can be made with a [figure factory](/python/figure-factories/) as detailed in this page." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cca14a2d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "import numpy as np\n", + "\n", + "x = np.linspace(-3, 3, 100)\n", + "y = np.linspace(-3, 3, 100)\n", + "Y, X = np.meshgrid(x, y)\n", + "u = -1 - X**2 + Y\n", + "v = 1 + X - Y**2\n", + "\n", + "# Create streamline figure\n", + "fig = ff.create_streamline(x, y, u, v, arrow_scale=.1)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5a5ddbdf", + "metadata": {}, + "source": [ + "#### Streamline and Source Point Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f1f5032", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import plotly.graph_objects as go\n", + "\n", + "import numpy as np\n", + "\n", + "N = 50\n", + "x_start, x_end = -2.0, 2.0\n", + "y_start, y_end = -1.0, 1.0\n", + "x = np.linspace(x_start, x_end, N)\n", + "y = np.linspace(y_start, y_end, N)\n", + "X, Y = np.meshgrid(x, y)\n", + "source_strength = 5.0\n", + "x_source, y_source = -1.0, 0.0\n", + "\n", + "# Compute the velocity field on the mesh grid\n", + "u = (source_strength/(2*np.pi) *\n", + " (X - x_source)/((X - x_source)**2 + (Y - y_source)**2))\n", + "v = (source_strength/(2*np.pi) *\n", + " (Y - y_source)/((X - x_source)**2 + (Y - y_source)**2))\n", + "\n", + "# Create streamline figure\n", + "fig = ff.create_streamline(x, y, u, v,\n", + " name='streamline')\n", + "\n", + "# Add source point\n", + "fig.add_trace(go.Scatter(x=[x_source], y=[y_source],\n", + " mode='markers',\n", + " marker_size=14,\n", + " name='source point'))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cbab70e2", + "metadata": {}, + "source": [ + "#### See also\n", + "\n", + "For a 3D version of streamlines, use the trace `go.Streamtube` documented [here](/python/streamtube-plot/).\n", + "\n", + "For representing the 2-D vector field as arrows, see the [quiver plot tutorial](/python/quiver-plots/)." + ] + }, + { + "cell_type": "markdown", + "id": "67504c6a", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "For more info on `ff.create_streamline()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_streamline.html)" + ] + }, + { + "cell_type": "markdown", + "id": "e515bc1f", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make a streamline plot in Python. A streamline plot displays vector field data.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Streamline Plots", + "order": 11, + "permalink": "python/streamline-plots/", + "thumbnail": "thumbnail/streamline.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/streamtube-plot.ipynb b/streamtube-plot.ipynb new file mode 100644 index 000000000..67039b6a0 --- /dev/null +++ b/streamtube-plot.ipynb @@ -0,0 +1,220 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "838d93b3", + "metadata": {}, + "source": [ + "### Introduction" + ] + }, + { + "cell_type": "markdown", + "id": "6dc1dfbb", + "metadata": {}, + "source": [ + "In streamtube plots, attributes include `x`, `y`, and `z`, which set the coordinates of the vector field, and `u`, `v`, and `w`, which set the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position." + ] + }, + { + "cell_type": "markdown", + "id": "ca658f14", + "metadata": {}, + "source": [ + "### Basic Streamtube Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1e9af88e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=go.Streamtube(x=[0, 0, 0], y=[0, 1, 2], z=[0, 0, 0],\n", + " u=[0, 0, 0], v=[1, 1, 1], w=[0, 0, 0]))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "50d7da06", + "metadata": {}, + "source": [ + "### Starting Position and Segments\n", + "\n", + "By default, streamlines are initialized in the x-z plane of minimal y value. You can change this behaviour by providing directly the starting points of streamtubes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "964d7b60", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/streamtube-wind.csv').drop(['Unnamed: 0'],axis=1)\n", + "\n", + "fig = go.Figure(data=go.Streamtube(\n", + " x = df['x'],\n", + " y = df['y'],\n", + " z = df['z'],\n", + " u = df['u'],\n", + " v = df['v'],\n", + " w = df['w'],\n", + " starts = dict(\n", + " x = [80] * 16,\n", + " y = [20,30,40,50] * 4,\n", + " z = [0,0,0,0,5,5,5,5,10,10,10,10,15,15,15,15]\n", + " ),\n", + " sizeref = 0.3,\n", + " colorscale = 'Portland',\n", + " showscale = False,\n", + " maxdisplayed = 3000\n", + "))\n", + "\n", + "fig.update_layout(\n", + " scene = dict(\n", + " aspectratio = dict(\n", + " x = 2,\n", + " y = 1,\n", + " z = 0.3\n", + " )\n", + " ),\n", + " margin = dict(\n", + " t = 20,\n", + " b = 20,\n", + " l = 20,\n", + " r = 20\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "20e27609", + "metadata": {}, + "source": [ + "### Tube color and diameter\n", + "\n", + "The color of tubes is determined by their local norm, and the diameter of the field by the local [divergence](https://en.wikipedia.org/wiki/Divergence) of the vector field.\n", + "\n", + "In all cases below the norm is proportional to `z**2` but the direction of the vector is different, resulting in a different divergence field." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "11886288", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import numpy as np\n", + "\n", + "x, y, z = np.mgrid[0:10, 0:10, 0:10]\n", + "x = x.flatten()\n", + "y = y.flatten()\n", + "z = z.flatten()\n", + "\n", + "u = np.zeros_like(x)\n", + "v = np.zeros_like(y)\n", + "w = z**2\n", + "\n", + "fig = make_subplots(rows=1, cols=3, specs=[[{'is_3d': True}, {'is_3d': True}, {'is_3d':True}]])\n", + "\n", + "fig.add_trace(go.Streamtube(x=x, y=y, z=z, u=u, v=v, w=w), 1, 1)\n", + "fig.add_trace(go.Streamtube(x=x, y=y, z=z, u=w, v=v, w=u), 1, 2)\n", + "fig.add_trace(go.Streamtube(x=x, y=y, z=z, u=u, v=w, w=v), 1, 3)\n", + "\n", + "fig.update_layout(scene_camera_eye=dict(x=2, y=2, z=2),\n", + " scene2_camera_eye=dict(x=2, y=2, z=2),\n", + " scene3_camera_eye=dict(x=2, y=2, z=2))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c37bb253", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/streamtube/ for more information and chart attribute options!" + ] + }, + { + "cell_type": "markdown", + "id": "d5b56aa8", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make 3D streamtube plots in Python with Plotly.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "3D Streamtube Plots", + "order": 13, + "page_type": "u-guide", + "permalink": "python/streamtube-plot/", + "thumbnail": "thumbnail/streamtube.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/strip-charts.ipynb b/strip-charts.ipynb new file mode 100644 index 000000000..ad9e57fe7 --- /dev/null +++ b/strip-charts.ipynb @@ -0,0 +1,129 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "dd4c3670", + "metadata": {}, + "source": [ + "### Strip Charts with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "The `px.strip()` function will make strip charts using underlying `box` traces with the box hidden.\n", + "\n", + "See also [box plots](/python/box-plots/) and [violin plots](/python/violin/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d77e439", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.strip(df, x=\"total_bill\", y=\"day\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e0fe640d", + "metadata": {}, + "source": [ + "Strip charts support [faceting](/python/facet-plots/) and [discrete color](/python/discrete-color/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ad13d58", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.strip(df, x=\"total_bill\", y=\"time\", color=\"sex\", facet_col=\"day\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7906c364", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.strip()`](https://plotly.com/python-api-reference/generated/plotly.express.strip) for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "fc3d1b21", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.7" + }, + "plotly": { + "description": "Strip charts are like 1-dimensional jittered scatter plots.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "Strip Charts", + "order": 14, + "page_type": "u-guide", + "permalink": "python/strip-charts/", + "thumbnail": "thumbnail/figure-labels.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/styling-plotly-express.ipynb b/styling-plotly-express.ipynb new file mode 100644 index 000000000..aa90892f7 --- /dev/null +++ b/styling-plotly-express.ipynb @@ -0,0 +1,279 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "b2357351", + "metadata": {}, + "source": [ + "### Styling Figures made with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/). Every Plotly Express function returns [a `plotly.graph_objects.Figure` object](/python/graph-objects/) whose `data` and `layout` has been pre-populated according to the provided arguments.\n", + "\n", + "> You can style and customize figures made with Plotly Express _in all the same ways_ as you can style figures made more manually by explicitly assembling `graph_objects` into a figure.\n", + "\n", + "More specifically, here are the 4 ways you can style and customize figures made with Plotly Express:\n", + "\n", + "1. Control common parameters like width & height, titles, labeling and colors using built-in Plotly Express function arguments\n", + "2. Updating the figure attributes using [update methods or by directly setting attributes](/python/creating-and-updating-figures/)\n", + "3. Using Plotly's [theming/templating mechanism](/python/templates/) via the `template` argument to every Plotly Express function\n", + "4. Setting default values for common parameters using `px.defaults`\n", + "\n", + "### Built-in Plotly Express Styling Arguments\n", + "\n", + "Many common styling options can be set directly in the `px` function call. Every Plotly Express function accepts the following arguments:\n", + "\n", + "- `title` to set the figure title\n", + "- `width` and `height` to set the figure dimensions\n", + "- `template` to [set many styling parameters at once](/python/templates/) (see below for more details)\n", + "- `labels` to override the default axis and legend labels behaviour, which is to use the data frame column name if available, and otherwise to use the label name itself like \"x\", \"y\", \"color\" etc. `labels` accepts a `dict` whose keys are the label to rename and whose values are the desired labels. These labels appear in axis labels, legend and color bar titles, and in hover labels.\n", + "- `category_orders` to override the default category ordering behaviour, which is to use the order in which the data appears in the input. `category_orders` accepts a `dict` whose keys are the column name to reorder and whose values are a `list` of values in the desired order. These orderings apply everywhere categories appear: in legends, on axes, in bar stacks, in the order of facets, in the order of animation frames etc.\n", + "- `hover_data` and `hover_name` to control which attributes appear in the hover label and how they are formatted.\n", + "- [Various color-related attributes](/python/colorscales/) such as `color_continuous_scale`, `color_range`, `color_discrete_sequence` and/or `color_discrete_map` set the colors used in the figure. `color_discrete_map` accepts a dict whose keys are values mapped to `color` and whose values are the desired CSS colors.\n", + "\n", + "To illustrate each of these, here is a simple, default figure made with Plotly Express. Note the default orderings for the x-axis categories and the usage of lowercase & snake_case data frame columns for axis labelling." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f9b3e94b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.histogram(df, x=\"day\", y=\"total_bill\", color=\"sex\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "67a9790e", + "metadata": {}, + "source": [ + "Here is the same figure, restyled by adding some extra parameters to the initial Plotly Express call:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b1daffb8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.histogram(df, x=\"day\", y=\"total_bill\", color=\"sex\",\n", + " title=\"Receipts by Payer Gender and Day of Week\",\n", + " width=600, height=400,\n", + " labels={ # replaces default labels by column name\n", + " \"sex\": \"Payer Gender\", \"day\": \"Day of Week\", \"total_bill\": \"Receipts\"\n", + " },\n", + " category_orders={ # replaces default order by column name\n", + " \"day\": [\"Thur\", \"Fri\", \"Sat\", \"Sun\"], \"sex\": [\"Male\", \"Female\"]\n", + " },\n", + " color_discrete_map={ # replaces default color mapping by value\n", + " \"Male\": \"RebeccaPurple\", \"Female\": \"MediumPurple\"\n", + " },\n", + " template=\"simple_white\"\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1cce6864", + "metadata": {}, + "source": [ + "### Updating or Modifying Figures made with Plotly Express\n", + "\n", + "If none of the built-in Plotly Express arguments allow you to customize the figure the way you need to, you can use [the `update_*` and `add_*` methods](/python/creating-and-updating-figures/) on [the `plotly.graph_objects.Figure` object](/python/graph-objects/) returned by the PX function to make any further modifications to the figure. This approach is the one used throughout the Plotly.py documentation to [customize axes](/python/axes/), control [legends](/python/legend/) and [colorbars](/python/colorscales/), add [shapes](/python/shapes/) and [annotations](/python/text-and-annotations/) etc.\n", + "\n", + "Here is the same figure as above, with some additional customizations to the axes and legend via `.update_yaxes()`, and `.update_layout()`, as well as some annotations added via `.add_shape()` and `.add_annotation()`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "242ecba2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.histogram(df, x=\"day\", y=\"total_bill\", color=\"sex\",\n", + " title=\"Receipts by Payer Gender and Day of Week vs Target\",\n", + " width=600, height=400,\n", + " labels={\"sex\": \"Payer Gender\", \"day\": \"Day of Week\", \"total_bill\": \"Receipts\"},\n", + " category_orders={\"day\": [\"Thur\", \"Fri\", \"Sat\", \"Sun\"], \"sex\": [\"Male\", \"Female\"]},\n", + " color_discrete_map={\"Male\": \"RebeccaPurple\", \"Female\": \"MediumPurple\"},\n", + " template=\"simple_white\"\n", + " )\n", + "\n", + "fig.update_yaxes( # the y-axis is in dollars\n", + " tickprefix=\"$\", showgrid=True\n", + ")\n", + "\n", + "fig.update_layout( # customize font and legend orientation & position\n", + " font_family=\"Rockwell\",\n", + " legend=dict(\n", + " title=None, orientation=\"h\", y=1, yanchor=\"bottom\", x=0.5, xanchor=\"center\"\n", + " )\n", + ")\n", + "\n", + "fig.add_shape( # add a horizontal \"target\" line\n", + " type=\"line\", line_color=\"salmon\", line_width=3, opacity=1, line_dash=\"dot\",\n", + " x0=0, x1=1, xref=\"paper\", y0=950, y1=950, yref=\"y\"\n", + ")\n", + "\n", + "fig.add_annotation( # add a text callout with arrow\n", + " text=\"below target!\", x=\"Fri\", y=400, arrowhead=1, showarrow=True\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "edce425f", + "metadata": {}, + "source": [ + "### How Plotly Express Works with Templates\n", + "\n", + "Plotly has a [theming system based on templates](/python/templates/) and figures created with Plotly Express interact smoothly with this system:\n", + "\n", + "- Plotly Express methods will use the default template if one is set in `plotly.io` (by default, this is set to `plotly`) or in `plotly.express.defaults` (see below)\n", + "- The template in use can always be overridden via the `template` argument to every PX function\n", + "- The default `color_continuous_scale` will be the value of `layout.colorscales.sequential` in the template in use, unless it is overridden via the corresponding function argument or via `plotly.express.defaults` (see below)\n", + "- The default `color_discrete_sequence` will be the value of `layout.colorway` in the template in use, unless it is overridden via the corresponding function argument or via `plotly.express.defaults` (see below)\n", + "\n", + "By way of example, in the following figure, simply setting the `template` argument will automatically change the default continuous color scale, even though we have not specified `color_continuous_scale` directly." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "24cf6102", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "fig = px.density_heatmap(df, x=\"sepal_width\", y=\"sepal_length\", template=\"seaborn\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "504a8cf0", + "metadata": {}, + "source": [ + "### Setting Plotly Express Styling Defaults\n", + "\n", + "Plotly Express supports a simple default-configuration system via the `plotly.express.defaults` singleton object. The values of the properties set on this object are used for the rest of the active session in place of `None` as the default values for any argument to a PX function with a matching name:\n", + "\n", + "- `width` and `height` can be set once globally for all Plotly Express functions\n", + "- `template` can override the setting of `plotly.io.templates.default` for all Plotly Express functions\n", + "- `color_continuous_scale` and `color_discrete_scale` can override the contents of the template in use for all Plotly Express functions that accept these arguments\n", + "- `line_dash_sequence`, `symbol_sequence` and `size_max` can be set once globally for all Plotly Express functions that accept these arguments\n", + "\n", + "To illustrate this \"defaults hierarchy\", in the following example:\n", + "\n", + "- we set the Plotly-wide default template to `simple_white`, but\n", + "- we override the default template for Plotly Express to be `ggplot2`, but\n", + "- we also set the default `color_continuous_scale`, and\n", + "- we set the default `height` and `width` to 400 by 600, but\n", + "- we override the default `width` to 400 via the function argument.\n", + "\n", + "As a result, any figure produced with Plotly Express thereafter uses the `ggplot2` settings for all attributes except for the continuous color scale (visible because `simple_white` doesn't set a plot background, and neither the `simple_white` nor `ggplot2` template uses `Blackbody` as a color scale), and uses the Plotly Express defaults for height but not width (visible because the figure height is the same as the figure width, despite the default)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1fb6c1af", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import plotly.io as pio\n", + "\n", + "pio.templates.default = \"simple_white\"\n", + "\n", + "px.defaults.template = \"ggplot2\"\n", + "px.defaults.color_continuous_scale = px.colors.sequential.Blackbody\n", + "px.defaults.width = 600\n", + "px.defaults.height = 400\n", + "\n", + "df = px.data.iris()\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"sepal_length\", width=400)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8ea841c1", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + }, + "plotly": { + "description": "Figures made with Plotly Express can be customized in all the same ways as figures made with graph objects, as well as with PX-specific function arguments.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Styling Plotly Express Figures", + "order": 30, + "page_type": "u-guide", + "permalink": "python/styling-plotly-express/", + "thumbnail": "thumbnail/plotly-express.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/subplots.ipynb b/subplots.ipynb new file mode 100644 index 000000000..55f87b663 --- /dev/null +++ b/subplots.ipynb @@ -0,0 +1,926 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a4e0e93f", + "metadata": {}, + "source": [ + "### Subplots and Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "Plotly Express does not support arbitrary subplot capabilities, instead it supports [faceting by a given data dimension](/python/facet-plots/), and it also supports [marginal charts to display distribution information](/python/marginal-plots/).\n", + "\n", + "This page documents the usage of the lower-level `plotly.subplots` module and the `make_subplots` function it exposes to construct figures with arbitrary subplots. **Plotly Express faceting uses `make_subplots` internally** so adding traces to Plotly Express facets works just as documented here, with `fig.add_trace(..., row=, col=)`." + ] + }, + { + "cell_type": "markdown", + "id": "43057109", + "metadata": {}, + "source": [ + "#### Simple Subplot\n", + "\n", + "Figures with subplots are created using the `make_subplots` function from the `plotly.subplots` module.\n", + "\n", + "Here is an example of creating a figure that includes two `scatter` traces which are side-by-side since there are 2 columns and 1 row in the subplot layout." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "615afd81", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=1, cols=2)\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),\n", + " row=1, col=1\n", + ")\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(x=[20, 30, 40], y=[50, 60, 70]),\n", + " row=1, col=2\n", + ")\n", + "\n", + "fig.update_layout(height=600, width=800, title_text=\"Side By Side Subplots\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8162790c", + "metadata": {}, + "source": [ + "#### Stacked Subplots\n", + "\n", + "Here is an example of creating a figure with subplots that are stacked on top of each other since there are 3 rows and 1 column in the subplot layout." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b52c83e4", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=3, cols=1)\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[3, 4, 5],\n", + " y=[1000, 1100, 1200],\n", + "), row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[2, 3, 4],\n", + " y=[100, 110, 120],\n", + "), row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[10, 11, 12]\n", + "), row=3, col=1)\n", + "\n", + "\n", + "fig.update_layout(height=600, width=600, title_text=\"Stacked Subplots\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2fd15b01", + "metadata": {}, + "source": [ + "#### Multiple Subplots\n", + "\n", + "Here is an example of creating a 2 x 2 subplot grid and populating each subplot with a single `scatter` trace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eac20c01", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=2, cols=2, start_cell=\"bottom-left\")\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[300, 400, 500], y=[600, 700, 800]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000]),\n", + " row=2, col=2)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "00f413c9", + "metadata": {}, + "source": [ + "#### Multiple Subplots with Titles\n", + "The `subplot_titles` argument to `make_subplots` can be used to position text annotations as titles for each subplot.\n", + "\n", + "Here is an example of adding subplot titles to a 2 x 2 subplot grid of scatter traces." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5b348e1f", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " subplot_titles=(\"Plot 1\", \"Plot 2\", \"Plot 3\", \"Plot 4\"))\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[300, 400, 500], y=[600, 700, 800]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000]),\n", + " row=2, col=2)\n", + "\n", + "fig.update_layout(height=500, width=700,\n", + " title_text=\"Multiple Subplots with Titles\")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "35056acb", + "metadata": {}, + "source": [ + "#### Subplots with Annotations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dce4ab4b", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=1, cols=2)\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(\n", + " x=[1, 2, 3],\n", + " y=[4, 5, 6],\n", + " mode=\"markers+text\",\n", + " text=[\"Text A\", \"Text B\", \"Text C\"],\n", + " textposition=\"bottom center\"\n", + " ),\n", + " row=1, col=1\n", + ")\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(\n", + " x=[20, 30, 40],\n", + " y=[50, 60, 70],\n", + " mode=\"markers+text\",\n", + " text=[\"Text D\", \"Text E\", \"Text F\"],\n", + " textposition=\"bottom center\"\n", + " ),\n", + " row=1, col=2\n", + ")\n", + "\n", + "fig.update_layout(height=600, width=800, title_text=\"Subplots with Annotations\")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "698b2a35", + "metadata": {}, + "source": [ + "#### Customize Subplot Column Widths and Row Heights\n", + "The `column_widths` argument to `make_subplots` can be used to customize the relative widths of the columns in a subplot grid. It should be set to a list of numbers with a length that matches the `cols` argument. These number will be normalized, so that they sum to 1, and used to compute the relative widths of the subplot grid columns. The `row_heights` argument serves the same purpose for controlling the relative heights of rows in the subplot grid.\n", + "\n", + "Here is an example of creating a figure with two scatter traces in side-by-side subplots. The left subplot is set to be wider than the right one." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7f99973c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(rows=1, cols=2, column_widths=[0.7, 0.3])\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]),\n", + " row=1, col=2)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "16afd6c4", + "metadata": {}, + "source": [ + "#### Subplots in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a8f8811e", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'subplots', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "2815c6fa", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "be6f5043", + "metadata": {}, + "source": [ + "#### Customizing Subplot Axes\n", + "After a figure with subplots is created using the `make_subplots` function, its axis properties (title, font, range, grid style, etc.) can be customized using the `update_xaxes` and `update_yaxes` graph object figure methods. By default, these methods apply to all of the x axes or y axes in the figure. The `row` and `col` arguments can be used to control which axes are targeted by the update.\n", + "\n", + "Here is an example that creates a figure with a 2 x 2 subplot grid, populates each subplot with a scatter trace, and then updates the x and y axis titles for each subplot individually." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98e8d51d", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "# Initialize figure with subplots\n", + "fig = make_subplots(\n", + " rows=2, cols=2, subplot_titles=(\"Plot 1\", \"Plot 2\", \"Plot 3\", \"Plot 4\")\n", + ")\n", + "\n", + "# Add traces\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]), row=1, col=1)\n", + "fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]), row=1, col=2)\n", + "fig.add_trace(go.Scatter(x=[300, 400, 500], y=[600, 700, 800]), row=2, col=1)\n", + "fig.add_trace(go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000]), row=2, col=2)\n", + "\n", + "# Update xaxis properties\n", + "fig.update_xaxes(title_text=\"xaxis 1 title\", row=1, col=1)\n", + "fig.update_xaxes(title_text=\"xaxis 2 title\", range=[10, 50], row=1, col=2)\n", + "fig.update_xaxes(title_text=\"xaxis 3 title\", showgrid=False, row=2, col=1)\n", + "fig.update_xaxes(title_text=\"xaxis 4 title\", type=\"log\", row=2, col=2)\n", + "\n", + "# Update yaxis properties\n", + "fig.update_yaxes(title_text=\"yaxis 1 title\", row=1, col=1)\n", + "fig.update_yaxes(title_text=\"yaxis 2 title\", range=[40, 80], row=1, col=2)\n", + "fig.update_yaxes(title_text=\"yaxis 3 title\", showgrid=False, row=2, col=1)\n", + "fig.update_yaxes(title_text=\"yaxis 4 title\", row=2, col=2)\n", + "\n", + "# Update title and height\n", + "fig.update_layout(title_text=\"Customizing Subplot Axes\", height=700)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4be59865", + "metadata": {}, + "source": [ + "#### Subplots with Shared X-Axes\n", + "The `shared_xaxes` argument to `make_subplots` can be used to link the x axes of subplots in the resulting figure. The `vertical_spacing` argument is used to control the vertical spacing between rows in the subplot grid.\n", + "\n", + "Here is an example that creates a figure with 3 vertically stacked subplots with linked x axes. A small vertical spacing value is used to reduce the spacing between subplot rows." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d4d0796f", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=3, cols=1,\n", + " shared_xaxes=True,\n", + " vertical_spacing=0.02)\n", + "\n", + "fig.add_trace(go.Scatter(x=[0, 1, 2], y=[10, 11, 12]),\n", + " row=3, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[2, 3, 4], y=[100, 110, 120]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[3, 4, 5], y=[1000, 1100, 1200]),\n", + " row=1, col=1)\n", + "\n", + "fig.update_layout(height=600, width=600,\n", + " title_text=\"Stacked Subplots with Shared X-Axes\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cf27bce0", + "metadata": {}, + "source": [ + "#### Subplots with Shared Y-Axes\n", + "The `shared_yaxes` argument to `make_subplots` can be used to link the y axes of subplots in the resulting figure.\n", + "\n", + "Here is an example that creates a figure with a 2 x 2 subplot grid, where the y axes of each row are linked.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1e4d07d3", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=2, cols=2, shared_yaxes=True)\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[2, 3, 4]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[20, 30, 40], y=[5, 5, 5]),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(go.Scatter(x=[2, 3, 4], y=[600, 700, 800]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000]),\n", + " row=2, col=2)\n", + "\n", + "fig.update_layout(height=600, width=600,\n", + " title_text=\"Multiple Subplots with Shared Y-Axes\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8c17474d", + "metadata": {}, + "source": [ + "### Subplots with Shared Colorscale\n", + "\n", + "To share colorscale information in multiple subplots, you can use [coloraxis](https://plotly.com/javascript/reference/scatter/#scatter-marker-line-coloraxis)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0f87f8a4", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(rows=1, cols=2, shared_yaxes=True)\n", + "\n", + "fig.add_trace(go.Bar(x=[1, 2, 3], y=[4, 5, 6],\n", + " marker=dict(color=[4, 5, 6], coloraxis=\"coloraxis\")),\n", + " 1, 1)\n", + "\n", + "fig.add_trace(go.Bar(x=[1, 2, 3], y=[2, 3, 5],\n", + " marker=dict(color=[2, 3, 5], coloraxis=\"coloraxis\")),\n", + " 1, 2)\n", + "\n", + "fig.update_layout(coloraxis=dict(colorscale='Bluered_r'), showlegend=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3c9468e", + "metadata": {}, + "source": [ + "#### Custom Sized Subplot with Subplot Titles\n", + "The `specs` argument to `make_subplots` is used to configure per-subplot options. `specs` must be a 2-dimension list with dimensions that match those provided as the `rows` and `cols` arguments. The elements of `specs` may either be `None`, indicating no subplot should be initialized starting with this grid cell, or a dictionary containing subplot options. The `colspan` subplot option specifies the number of grid columns that the subplot starting in the given cell should occupy. If unspecified, `colspan` defaults to 1.\n", + "\n", + "Here is an example that creates a 2 by 2 subplot grid containing 3 subplots. The subplot `specs` element for position (2, 1) has a `colspan` value of 2, causing it to span the full figure width. The subplot `specs` element for position (2, 2) is `None` because no subplot begins at this location in the grid." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "86becd19", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " specs=[[{}, {}],\n", + " [{\"colspan\": 2}, None]],\n", + " subplot_titles=(\"First Subplot\",\"Second Subplot\", \"Third Subplot\"))\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2]),\n", + " row=1, col=2)\n", + "fig.add_trace(go.Scatter(x=[1, 2, 3], y=[2, 1, 2]),\n", + " row=2, col=1)\n", + "\n", + "fig.update_layout(showlegend=False, title_text=\"Specs with Subplot Title\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e53d4553", + "metadata": {}, + "source": [ + "#### Multiple Custom Sized Subplots\n", + "If the `print_grid` argument to `make_subplots` is set to `True`, then a text representation of the subplot grid will be printed.\n", + "\n", + "Here is an example that uses the `rowspan` and `colspan` subplot options to create a custom subplot layout with subplots of mixed sizes. The `print_grid` argument is set to `True` so that the subplot grid is printed to the screen." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b07f00fc", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(\n", + " rows=5, cols=2,\n", + " specs=[[{}, {\"rowspan\": 2}],\n", + " [{}, None],\n", + " [{\"rowspan\": 2, \"colspan\": 2}, None],\n", + " [None, None],\n", + " [{}, {}]],\n", + " print_grid=True)\n", + "\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(1,1)\"), row=1, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(1,2)\"), row=1, col=2)\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(2,1)\"), row=2, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(3,1)\"), row=3, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(5,1)\"), row=5, col=1)\n", + "fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2], name=\"(5,2)\"), row=5, col=2)\n", + "\n", + "fig.update_layout(height=600, width=600, title_text=\"specs examples\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4962c990", + "metadata": {}, + "source": [ + "#### Subplots Types\n", + "By default, the `make_subplots` function assumes that the traces that will be added to all subplots are 2-dimensional cartesian traces (e.g. `scatter`, `bar`, `histogram`, `violin`, etc.). Traces with other subplot types (e.g. `scatterpolar`, `scattergeo`, `parcoords`, etc.) are supported by specifying the `type` subplot option in the `specs` argument to `make_subplots`.\n", + "\n", + "Here are the possible values for the `type` option:\n", + "\n", + " - `\"xy\"`: 2D Cartesian subplot type for scatter, bar, etc. This is the default if no `type` is specified.\n", + " - `\"scene\"`: 3D Cartesian subplot for scatter3d, cone, etc.\n", + " - `\"polar\"`: Polar subplot for scatterpolar, barpolar, etc.\n", + " - `\"ternary\"`: Ternary subplot for scatterternary.\n", + " - `\"mapbox\"`: Mapbox subplot for scattermapbox.\n", + " - `\"domain\"`: Subplot type for traces that are individually positioned. pie, parcoords, parcats, etc.\n", + " - trace type: A trace type name (e.g. `\"bar\"`, `\"scattergeo\"`, `\"carpet\"`, `\"mesh\"`, etc.) which will be used to determine the appropriate subplot type for that trace.\n", + "\n", + "Here is an example that creates and populates a 2 x 2 subplot grid containing 4 different subplot types." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e24f9fd5", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " specs=[[{\"type\": \"xy\"}, {\"type\": \"polar\"}],\n", + " [{\"type\": \"domain\"}, {\"type\": \"scene\"}]],\n", + ")\n", + "\n", + "fig.add_trace(go.Bar(y=[2, 3, 1]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Barpolar(theta=[0, 45, 90], r=[2, 3, 1]),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(go.Pie(values=[2, 3, 1]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter3d(x=[2, 3, 1], y=[0, 0, 0],\n", + " z=[0.5, 1, 2], mode=\"lines\"),\n", + " row=2, col=2)\n", + "\n", + "fig.update_layout(height=700, showlegend=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1a58b7f4", + "metadata": {}, + "source": [ + "As an alternative to providing the name of a subplot type (e.g. `\"xy\"`, `\"polar\"`, `\"domain\"`, `\"scene\"`, etc), the `type` option may also be set to a string containing the name of a trace type (e.g. `\"bar\"`, `\"barpolar\"`, `\"pie\"`, `\"scatter3d\"`, etc.), which will be used to determine the subplot type that is compatible with that trace.\n", + "\n", + "Here is the example above, modified to specify the subplot types using trace type names." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b2928c52", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=2,\n", + " specs=[[{\"type\": \"bar\"}, {\"type\": \"barpolar\"}],\n", + " [{\"type\": \"pie\"}, {\"type\": \"scatter3d\"}]],\n", + ")\n", + "\n", + "fig.add_trace(go.Bar(y=[2, 3, 1]),\n", + " row=1, col=1)\n", + "\n", + "fig.add_trace(go.Barpolar(theta=[0, 45, 90], r=[2, 3, 1]),\n", + " row=1, col=2)\n", + "\n", + "fig.add_trace(go.Pie(values=[2, 3, 1]),\n", + " row=2, col=1)\n", + "\n", + "fig.add_trace(go.Scatter3d(x=[2, 3, 1], y=[0, 0, 0],\n", + " z=[0.5, 1, 2], mode=\"lines\"),\n", + " row=2, col=2)\n", + "\n", + "fig.update_layout(height=700, showlegend=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6853578e", + "metadata": {}, + "source": [ + "#### Side by Side Subplot (low-level API)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a5a8ca15", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "trace1 = go.Scatter(\n", + " x=[1, 2, 3],\n", + " y=[4, 5, 6]\n", + ")\n", + "trace2 = go.Scatter(\n", + " x=[20, 30, 40],\n", + " y=[50, 60, 70],\n", + " xaxis=\"x2\",\n", + " yaxis=\"y2\"\n", + ")\n", + "data = [trace1, trace2]\n", + "layout = go.Layout(\n", + " xaxis=dict(\n", + " domain=[0, 0.7]\n", + " ),\n", + " xaxis2=dict(\n", + " domain=[0.8, 1]\n", + " ),\n", + " yaxis2=dict(\n", + " anchor=\"x2\"\n", + " )\n", + ")\n", + "fig = go.Figure(data=data, layout=layout)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "13b16185", + "metadata": {}, + "source": [ + "#### Subplots with shared axes (low-level API)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "073b59f1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "trace1 = go.Scatter(\n", + " x=[1, 2, 3],\n", + " y=[2, 3, 4]\n", + ")\n", + "trace2 = go.Scatter(\n", + " x=[20, 30, 40],\n", + " y=[5, 5, 5],\n", + " xaxis=\"x2\",\n", + " yaxis=\"y\"\n", + ")\n", + "trace3 = go.Scatter(\n", + " x=[2, 3, 4],\n", + " y=[600, 700, 800],\n", + " xaxis=\"x\",\n", + " yaxis=\"y3\"\n", + ")\n", + "trace4 = go.Scatter(\n", + " x=[4000, 5000, 6000],\n", + " y=[7000, 8000, 9000],\n", + " xaxis=\"x4\",\n", + " yaxis=\"y4\"\n", + ")\n", + "data = [trace1, trace2, trace3, trace4]\n", + "layout = go.Layout(\n", + " xaxis=dict(\n", + " domain=[0, 0.45]\n", + " ),\n", + " yaxis=dict(\n", + " domain=[0, 0.45]\n", + " ),\n", + " xaxis2=dict(\n", + " domain=[0.55, 1]\n", + " ),\n", + " xaxis4=dict(\n", + " domain=[0.55, 1],\n", + " anchor=\"y4\"\n", + " ),\n", + " yaxis3=dict(\n", + " domain=[0.55, 1]\n", + " ),\n", + " yaxis4=dict(\n", + " domain=[0.55, 1],\n", + " anchor=\"x4\"\n", + " )\n", + ")\n", + "fig = go.Figure(data=data, layout=layout)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6bfce533", + "metadata": {}, + "source": [ + "#### Stacked Subplots with a Shared X-Axis (low-level API)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21efdd4f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "trace1 = go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[10, 11, 12]\n", + ")\n", + "trace2 = go.Scatter(\n", + " x=[2, 3, 4],\n", + " y=[100, 110, 120],\n", + " yaxis=\"y2\"\n", + ")\n", + "trace3 = go.Scatter(\n", + " x=[3, 4, 5],\n", + " y=[1000, 1100, 1200],\n", + " yaxis=\"y3\"\n", + ")\n", + "data = [trace1, trace2, trace3]\n", + "layout = go.Layout(\n", + " yaxis=dict(\n", + " domain=[0, 0.33]\n", + " ),\n", + " legend=dict(\n", + " traceorder=\"reversed\"\n", + " ),\n", + " yaxis2=dict(\n", + " domain=[0.33, 0.66]\n", + " ),\n", + " yaxis3=dict(\n", + " domain=[0.66, 1]\n", + " )\n", + ")\n", + "fig = go.Figure(data=data, layout=layout)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8dc2a570", + "metadata": {}, + "source": [ + "#### Setting Subplots on a Figure Directly\n", + "\n", + "_new in 4.13_\n", + "\n", + "Subplots can be added to an already existing figure, provided it doesn't already\n", + "have subplots. `go.Figure.set_subplots` accepts all the same arguments as\n", + "`plotly.subplots.make_subplots`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "08e787d0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure().set_subplots(2, 3, horizontal_spacing=0.1)" + ] + }, + { + "cell_type": "markdown", + "id": "65ee03e1", + "metadata": {}, + "source": [ + "is equivalent to:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cbac6812", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "fig = make_subplots(2, 3, horizontal_spacing=0.1)" + ] + }, + { + "cell_type": "markdown", + "id": "f00b9214", + "metadata": {}, + "source": [ + "#### Reference\n", + "All of the x-axis properties are found here: https://plotly.com/python/reference/layout/xaxis/\n", + "All of the y-axis properties are found here: https://plotly.com/python/reference/layout/yaxis/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "92dbdf0e", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "help(make_subplots)" + ] + }, + { + "cell_type": "markdown", + "id": "92543f02", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "How to make subplots with Plotly's Python graphing library. Examples of stacked, custom-sized, gridded, and annotated subplots.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Subplots", + "order": 17, + "page_type": "u-guide", + "permalink": "python/subplots/", + "redirect_from": "ipython-notebooks/subplots/", + "thumbnail": "thumbnail/subplots.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/sunburst-charts.ipynb b/sunburst-charts.ipynb new file mode 100644 index 000000000..0464a6f1f --- /dev/null +++ b/sunburst-charts.ipynb @@ -0,0 +1,636 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "196fb603", + "metadata": {}, + "source": [ + "Sunburst plots visualize hierarchical data spanning outwards radially from root to leaves. Similar to [Icicle charts](https://plotly.com/python/icicle-charts/) and [Treemaps](https://plotly.com/python/treemaps/), the hierarchy is defined by `labels` (`names` for `px.icicle`) and `parents` attributes. The root starts from the center and children are added to the outer rings.\n", + "\n", + "### Basic Sunburst Plot with plotly.express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "With `px.sunburst`, each row of the DataFrame is represented as a sector of the sunburst." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cf75f6c5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "data = dict(\n", + " character=[\"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parent=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\" ],\n", + " value=[10, 14, 12, 10, 2, 6, 6, 4, 4])\n", + "\n", + "fig = px.sunburst(\n", + " data,\n", + " names='character',\n", + " parents='parent',\n", + " values='value',\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7203e916", + "metadata": {}, + "source": [ + "### Sunburst of a rectangular DataFrame with plotly.express\n", + "\n", + "Hierarchical data are often stored as a rectangular dataframe, with different columns corresponding to different levels of the hierarchy. `px.sunburst` can take a `path` parameter corresponding to a list of columns. Note that `id` and `parent` should not be provided if `path` is given." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "05444715", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.sunburst(df, path=['day', 'time', 'sex'], values='total_bill')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "78488496", + "metadata": {}, + "source": [ + "### Sunburst of a rectangular DataFrame with continuous color argument in px.sunburst\n", + "\n", + "If a `color` argument is passed, the color of a node is computed as the average of the color values of its children, weighted by their values." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f922afa9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.sunburst(df, path=['continent', 'country'], values='pop',\n", + " color='lifeExp', hover_data=['iso_alpha'],\n", + " color_continuous_scale='RdBu',\n", + " color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ecbca661", + "metadata": {}, + "source": [ + "### Sunburst of a rectangular DataFrame with discrete color argument in px.sunburst\n", + "\n", + "When the argument of `color` corresponds to non-numerical data, discrete colors are used. If a sector has the same value of the `color` column for all its children, then the corresponding color is used, otherwise the first color of the discrete color sequence is used." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dd913f50", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.sunburst(df, path=['sex', 'day', 'time'], values='total_bill', color='day')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5d6e6fe3", + "metadata": {}, + "source": [ + "In the example below the color of `Saturday` and `Sunday` sectors is the same as `Dinner` because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f1b6de2e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.sunburst(df, path=['sex', 'day', 'time'], values='total_bill', color='time')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3563e60", + "metadata": {}, + "source": [ + "### Using an explicit mapping for discrete colors\n", + "\n", + "For more information about discrete colors, see the [dedicated page](/python/discrete-color)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cb804273", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.sunburst(df, path=['sex', 'day', 'time'], values='total_bill', color='time',\n", + " color_discrete_map={'(?)':'black', 'Lunch':'gold', 'Dinner':'darkblue'})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9b0b3221", + "metadata": {}, + "source": [ + "### Rectangular data with missing values\n", + "\n", + "If the dataset is not fully rectangular, missing values should be supplied as `None`. Note that the parents of `None` entries must be a leaf, i.e. it cannot have other children than `None` (otherwise a `ValueError` is raised)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6892af1a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "vendors = [\"A\", \"B\", \"C\", \"D\", None, \"E\", \"F\", \"G\", \"H\", None]\n", + "sectors = [\"Tech\", \"Tech\", \"Finance\", \"Finance\", \"Other\",\n", + " \"Tech\", \"Tech\", \"Finance\", \"Finance\", \"Other\"]\n", + "regions = [\"North\", \"North\", \"North\", \"North\", \"North\",\n", + " \"South\", \"South\", \"South\", \"South\", \"South\"]\n", + "sales = [1, 3, 2, 4, 1, 2, 2, 1, 4, 1]\n", + "df = pd.DataFrame(\n", + " dict(vendors=vendors, sectors=sectors, regions=regions, sales=sales)\n", + ")\n", + "print(df)\n", + "fig = px.sunburst(df, path=['regions', 'sectors', 'vendors'], values='sales')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d11d45b7", + "metadata": {}, + "source": [ + "### Basic Sunburst Plot with go.Sunburst\n", + "\n", + "If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Sunburst` class from `plotly.graph_objects`](/python/graph-objects/).\n", + "\n", + "Main arguments:\n", + "\n", + "1. `labels` (`names` in `px.sunburst` since `labels` is reserved for overriding columns names): sets the labels of sunburst sectors.\n", + "2. `parents`: sets the parent sectors of sunburst sectors. An empty string `''` is used for the root node in the hierarchy. In this example, the root is \"Eve\".\n", + "3. `values`: sets the values associated with sunburst sectors, determining their width (See the `branchvalues` section below for different modes for setting the width)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "86f2b2a9", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig =go.Figure(go.Sunburst(\n", + " labels=[\"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\" ],\n", + " values=[10, 14, 12, 10, 2, 6, 6, 4, 4],\n", + "))\n", + "# Update layout for tight margin\n", + "# See https://plotly.com/python/creating-and-updating-figures/\n", + "fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c2595b32", + "metadata": {}, + "source": [ + "### Sunburst with Repeated Labels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d3e0d7d8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig =go.Figure(go.Sunburst(\n", + " ids=[\n", + " \"North America\", \"Europe\", \"Australia\", \"North America - Football\", \"Soccer\",\n", + " \"North America - Rugby\", \"Europe - Football\", \"Rugby\",\n", + " \"Europe - American Football\",\"Australia - Football\", \"Association\",\n", + " \"Australian Rules\", \"Autstralia - American Football\", \"Australia - Rugby\",\n", + " \"Rugby League\", \"Rugby Union\"\n", + " ],\n", + " labels= [\n", + " \"North
America\", \"Europe\", \"Australia\", \"Football\", \"Soccer\", \"Rugby\",\n", + " \"Football\", \"Rugby\", \"American
Football\", \"Football\", \"Association\",\n", + " \"Australian
Rules\", \"American
Football\", \"Rugby\", \"Rugby
League\",\n", + " \"Rugby
Union\"\n", + " ],\n", + " parents=[\n", + " \"\", \"\", \"\", \"North America\", \"North America\", \"North America\", \"Europe\",\n", + " \"Europe\", \"Europe\",\"Australia\", \"Australia - Football\", \"Australia - Football\",\n", + " \"Australia - Football\", \"Australia - Football\", \"Australia - Rugby\",\n", + " \"Australia - Rugby\"\n", + " ],\n", + "))\n", + "fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "eabf3de1", + "metadata": {}, + "source": [ + "### Branchvalues\n", + "\n", + "With branchvalues \"total\", the value of the parent represents the width of its wedge. In the example below, \"Enoch\" is 4 and \"Awan\" is 6 and so Enoch's width is 4/6ths of Awans. With branchvalues \"remainder\", the parent's width is determined by its own value plus those of its children. So, Enoch's width is 4/10ths of Awan's (4 / (6 + 4)).\n", + "\n", + "Note that this means that the sum of the values of the children cannot exceed the value of their parent when branchvalues is set to \"total\". When branchvalues is set to \"remainder\" (the default), children will not take up all of the space below their parent (unless the parent is the root and it has a value of 0)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "18400f9b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig =go.Figure(go.Sunburst(\n", + " labels=[ \"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\" ],\n", + " values=[ 65, 14, 12, 10, 2, 6, 6, 4, 4],\n", + " branchvalues=\"total\",\n", + "))\n", + "fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b7f4a6d5", + "metadata": {}, + "source": [ + "### Large Number of Slices\n", + "\n", + "This example uses a [plotly grid attribute](https://plotly.com/python/reference/layout/#layout-grid) for the subplots. Reference the row and column destination using the [domain](https://plotly.com/python/reference/sunburst/#sunburst-domain) attribute." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e4b2a167", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df1 = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/sunburst-coffee-flavors-complete.csv')\n", + "df2 = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/coffee-flavors.csv')\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Sunburst(\n", + " ids=df1.ids,\n", + " labels=df1.labels,\n", + " parents=df1.parents,\n", + " domain=dict(column=0)\n", + "))\n", + "\n", + "fig.add_trace(go.Sunburst(\n", + " ids=df2.ids,\n", + " labels=df2.labels,\n", + " parents=df2.parents,\n", + " domain=dict(column=1),\n", + " maxdepth=2\n", + "))\n", + "\n", + "fig.update_layout(\n", + " grid= dict(columns=2, rows=1),\n", + " margin = dict(t=0, l=0, r=0, b=0)\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7aa87236", + "metadata": {}, + "source": [ + "#### Controlling text orientation inside sunburst sectors\n", + "\n", + "The `insidetextorientation` attribute controls the orientation of text inside sectors. With\n", + "\"auto\" the texts may automatically be rotated to fit with the maximum size inside the slice. Using \"horizontal\" (resp. \"radial\", \"tangential\") forces text to be horizontal (resp. radial or tangential). Note that `plotly` may reduce the font size in order to fit the text with the requested orientation.\n", + "\n", + "For a figure `fig` created with plotly express, use `fig.update_traces(insidetextorientation='...')` to change the text orientation." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0eee9953", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/coffee-flavors.csv')\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Sunburst(\n", + " ids=df.ids,\n", + " labels=df.labels,\n", + " parents=df.parents,\n", + " domain=dict(column=1),\n", + " maxdepth=2,\n", + " insidetextorientation='radial'\n", + "))\n", + "\n", + "fig.update_layout(\n", + " margin = dict(t=10, l=10, r=10, b=10)\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f6175ccd", + "metadata": {}, + "source": [ + "### Controlling text fontsize with uniformtext\n", + "\n", + "If you want all the text labels to have the same size, you can use the `uniformtext` layout parameter. The `minsize` attribute sets the font size, and the `mode` attribute sets what happens for labels which cannot fit with the desired fontsize: either `hide` them or `show` them with overflow.\n", + "\n", + "*Note: animated transitions are currently not implemented when `uniformtext` is used.*" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "85046d3a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/sunburst-coffee-flavors-complete.csv')\n", + "\n", + "fig = go.Figure(go.Sunburst(\n", + " ids = df.ids,\n", + " labels = df.labels,\n", + " parents = df.parents))\n", + "fig.update_layout(uniformtext=dict(minsize=10, mode='hide'))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e6ae672a", + "metadata": {}, + "source": [ + "### Pattern Fills\n", + "\n", + "*New in 5.15*\n", + "\n", + "Sunburst charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color. In this example, we add a different pattern to each level of the hierarchy. We also specify the `solidity` of the pattern." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d48370c4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(\n", + " go.Sunburst(\n", + " labels=[\"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"],\n", + " values=[65, 14, 12, 10, 2, 6, 6, 4, 4],\n", + " branchvalues=\"total\",\n", + " textfont_size=16,\n", + " marker=dict(\n", + " pattern=dict(\n", + " shape=[\"\", \"/\", \"/\", \".\", \".\", \"/\", \"/\", \".\", \"/\"], solidity=0.9\n", + " )\n", + " ),\n", + " )\n", + ")\n", + "\n", + "fig.update_layout(margin=dict(t=0, l=0, r=0, b=0))\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "6adde393", + "metadata": {}, + "source": [ + "### Sunburst chart with a continuous colorscale\n", + "\n", + "The example below visualizes a breakdown of sales (corresponding to sector width) and call success rate (corresponding to sector color) by region, county and salesperson level. For example, when exploring the data you can see that although the East region is behaving poorly, the Tyler county is still above average -- however, its performance is reduced by the poor success rate of salesperson GT.\n", + "\n", + "In the right subplot which has a `maxdepth` of two levels, click on a sector to see its breakdown to lower levels." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0fd05073", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/sales_success.csv')\n", + "print(df.head())\n", + "\n", + "levels = ['salesperson', 'county', 'region'] # levels used for the hierarchical chart\n", + "color_columns = ['sales', 'calls']\n", + "value_column = 'calls'\n", + "\n", + "def build_hierarchical_dataframe(df, levels, value_column, color_columns=None):\n", + " \"\"\"\n", + " Build a hierarchy of levels for Sunburst or Treemap charts.\n", + "\n", + " Levels are given starting from the bottom to the top of the hierarchy,\n", + " ie the last level corresponds to the root.\n", + " \"\"\"\n", + " df_list = []\n", + " for i, level in enumerate(levels):\n", + " df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])\n", + " dfg = df.groupby(levels[i:]).sum()\n", + " dfg = dfg.reset_index()\n", + " df_tree['id'] = dfg[level].copy()\n", + " if i < len(levels) - 1:\n", + " df_tree['parent'] = dfg[levels[i+1]].copy()\n", + " else:\n", + " df_tree['parent'] = 'total'\n", + " df_tree['value'] = dfg[value_column]\n", + " df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]]\n", + " df_list.append(df_tree)\n", + " total = pd.Series(dict(id='total', parent='',\n", + " value=df[value_column].sum(),\n", + " color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0)\n", + " df_list.append(total)\n", + " df_all_trees = pd.concat(df_list, ignore_index=True)\n", + " return df_all_trees\n", + "\n", + "\n", + "df_all_trees = build_hierarchical_dataframe(df, levels, value_column, color_columns)\n", + "average_score = df['sales'].sum() / df['calls'].sum()\n", + "\n", + "fig = make_subplots(1, 2, specs=[[{\"type\": \"domain\"}, {\"type\": \"domain\"}]],)\n", + "\n", + "fig.add_trace(go.Sunburst(\n", + " labels=df_all_trees['id'],\n", + " parents=df_all_trees['parent'],\n", + " values=df_all_trees['value'],\n", + " branchvalues='total',\n", + " marker=dict(\n", + " colors=df_all_trees['color'],\n", + " colorscale='RdBu',\n", + " cmid=average_score),\n", + " hovertemplate='%{label}
Sales: %{value}
Success rate: %{color:.2f}',\n", + " name=''\n", + " ), 1, 1)\n", + "\n", + "fig.add_trace(go.Sunburst(\n", + " labels=df_all_trees['id'],\n", + " parents=df_all_trees['parent'],\n", + " values=df_all_trees['value'],\n", + " branchvalues='total',\n", + " marker=dict(\n", + " colors=df_all_trees['color'],\n", + " colorscale='RdBu',\n", + " cmid=average_score),\n", + " hovertemplate='%{label}
Sales: %{value}
Success rate: %{color:.2f}',\n", + " maxdepth=2\n", + " ), 1, 2)\n", + "\n", + "fig.update_layout(margin=dict(t=10, b=10, r=10, l=10))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "140cf88c", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.sunburst()`](https://plotly.com/python-api-reference/generated/plotly.express.sunburst) or https://plotly.com/python/reference/sunburst/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "9e10a862", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + }, + "plotly": { + "description": "How to make Sunburst Charts.", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "Sunburst Charts", + "order": 10, + "page_type": "u-guide", + "permalink": "python/sunburst-charts/", + "thumbnail": "thumbnail/sunburst.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/supported-colors.ipynb b/supported-colors.ipynb new file mode 100644 index 000000000..99a2eb42e --- /dev/null +++ b/supported-colors.ipynb @@ -0,0 +1,204 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "09f4cbd5", + "metadata": {}, + "source": [ + "# Supported CSS Colors\n", + "\n", + "Many properties in Plotly.py for configuring colors support named CSS colors. For example, marker colors:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0d53c582", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure([\n", + " go.Bar(\n", + " x=['Jan', 'Feb', 'Mar', 'Apr'],\n", + " y=[20, 14, 25, 16],\n", + " name='Primary Product',\n", + " # Named CSS color\n", + " marker_color='royalblue'\n", + " )\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6256635d", + "metadata": {}, + "source": [ + "These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bc43f84b", + "metadata": { + "hide_code": true, + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "supported_colors = [\"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\",\n", + " \"beige\", \"bisque\", \"black\", \"blanchedalmond\", \"blue\",\n", + " \"blueviolet\", \"brown\", \"burlywood\", \"cadetblue\",\n", + " \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n", + " \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\",\n", + " \"darkgoldenrod\", \"darkgray\", \"darkgrey\", \"darkgreen\",\n", + " \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\", \"darkorange\",\n", + " \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n", + " \"darkslateblue\", \"darkslategray\", \"darkslategrey\",\n", + " \"darkturquoise\", \"darkviolet\", \"deeppink\", \"deepskyblue\",\n", + " \"dimgray\", \"dimgrey\", \"dodgerblue\", \"firebrick\",\n", + " \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\",\n", + " \"ghostwhite\", \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\",\n", + " \"greenyellow\", \"honeydew\", \"hotpink\", \"indianred\", \"indigo\",\n", + " \"ivory\", \"khaki\", \"lavender\", \"lavenderblush\", \"lawngreen\",\n", + " \"lemonchiffon\", \"lightblue\", \"lightcoral\", \"lightcyan\",\n", + " \"lightgoldenrodyellow\", \"lightgray\", \"lightgrey\",\n", + " \"lightgreen\", \"lightpink\", \"lightsalmon\", \"lightseagreen\",\n", + " \"lightskyblue\", \"lightslategray\", \"lightslategrey\",\n", + " \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\",\n", + " \"linen\", \"magenta\", \"maroon\", \"mediumaquamarine\",\n", + " \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n", + " \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\",\n", + " \"mediumturquoise\", \"mediumvioletred\", \"midnightblue\",\n", + " \"mintcream\", \"mistyrose\", \"moccasin\", \"navajowhite\", \"navy\",\n", + " \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n", + " \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\",\n", + " \"palevioletred\", \"papayawhip\", \"peachpuff\", \"peru\", \"pink\",\n", + " \"plum\", \"powderblue\", \"purple\", \"red\", \"rosybrown\",\n", + " \"royalblue\", \"rebeccapurple\", \"saddlebrown\", \"salmon\",\n", + " \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\",\n", + " \"skyblue\", \"slateblue\", \"slategray\", \"slategrey\", \"snow\",\n", + " \"springgreen\", \"steelblue\", \"tan\", \"teal\", \"thistle\", \"tomato\",\n", + " \"turquoise\", \"violet\", \"wheat\", \"white\", \"whitesmoke\",\n", + " \"yellow\", \"yellowgreen\"]\n", + "\n", + "fig = go.Figure(layout=dict(title=\"Supported Named CSS Colors\"))\n", + "\n", + "for i, color in enumerate(supported_colors):\n", + " row, col = i // 5, i % 5\n", + " x0, y0 = col * 1.2, -row * 1.2\n", + "\n", + " fig.add_shape(\n", + " type=\"rect\",\n", + " x0=x0, y0=y0,\n", + " x1=x0+1, y1=y0+1,\n", + " fillcolor=color,\n", + " line=dict(color=\"black\", width=0.2),\n", + " )\n", + "\n", + " fig.add_annotation(\n", + " x=x0+0.5, y=y0-0.1,\n", + " text=color,\n", + " showarrow=False,\n", + " font=dict(size=10)\n", + " )\n", + "\n", + "fig.update_layout(\n", + " height=((len(supported_colors) // 5) + (1 if len(supported_colors) % 5 else 0)) * 120,\n", + " width=800,\n", + " showlegend=False,\n", + " plot_bgcolor='rgba(0,0,0,0)',\n", + " margin=dict(l=50, r=50, t=50, b=50),\n", + " xaxis=dict(\n", + " showgrid=False,\n", + " zeroline=False,\n", + " showticklabels=False,\n", + " range=[-0.5, 6]\n", + " ),\n", + " yaxis=dict(\n", + " showgrid=False,\n", + " zeroline=False,\n", + " showticklabels=False,\n", + " scaleanchor=\"x\",\n", + " scaleratio=1,\n", + " range=[-((len(supported_colors) // 5) + 1) * 1.2, 1.5]\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "18b40c53", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.2" + }, + "plotly": { + "description": "A list of supported named CSS Colors", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Supported CSS Colors", + "order": 41, + "page_type": "example_index", + "permalink": "python/css-colors/", + "thumbnail": "thumbnail/shape.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/table-subplots.ipynb b/table-subplots.ipynb new file mode 100644 index 000000000..95d7b73af --- /dev/null +++ b/table-subplots.ipynb @@ -0,0 +1,160 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "609d53fb", + "metadata": {}, + "source": [ + "#### Import CSV Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3b1326f7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "import pandas as pd\n", + "import re\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv\")\n", + "\n", + "for i, row in enumerate(df[\"Date\"]):\n", + " p = re.compile(\" 00:00:00\")\n", + " datetime = p.split(df[\"Date\"][i])[0]\n", + " df.iloc[i, 1] = datetime\n", + "\n", + "fig = make_subplots(\n", + " rows=3, cols=1,\n", + " shared_xaxes=True,\n", + " vertical_spacing=0.03,\n", + " specs=[[{\"type\": \"table\"}],\n", + " [{\"type\": \"scatter\"}],\n", + " [{\"type\": \"scatter\"}]]\n", + ")\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(\n", + " x=df[\"Date\"],\n", + " y=df[\"Mining-revenue-USD\"],\n", + " mode=\"lines\",\n", + " name=\"mining revenue\"\n", + " ),\n", + " row=3, col=1\n", + ")\n", + "\n", + "fig.add_trace(\n", + " go.Scatter(\n", + " x=df[\"Date\"],\n", + " y=df[\"Hash-rate\"],\n", + " mode=\"lines\",\n", + " name=\"hash-rate-TH/s\"\n", + " ),\n", + " row=2, col=1\n", + ")\n", + "\n", + "fig.add_trace(\n", + " go.Table(\n", + " header=dict(\n", + " values=[\"Date\", \"Number
Transactions\", \"Output
Volume (BTC)\",\n", + " \"Market
Price\", \"Hash
Rate\", \"Cost per
trans-USD\",\n", + " \"Mining
Revenue-USD\", \"Trasaction
fees-BTC\"],\n", + " font=dict(size=10),\n", + " align=\"left\"\n", + " ),\n", + " cells=dict(\n", + " values=[df[k].tolist() for k in df.columns[1:]],\n", + " align = \"left\")\n", + " ),\n", + " row=1, col=1\n", + ")\n", + "fig.update_layout(\n", + " height=800,\n", + " showlegend=False,\n", + " title_text=\"Bitcoin mining stats for 180 days\",\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1a6c0f2c", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/table/ for more information regarding chart attributes!
\n", + "For examples of Plotly Tables, see: https://plotly.com/python/table/\n" + ] + }, + { + "cell_type": "markdown", + "id": "58eb077e", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to create a subplot with tables and charts in Python with Plotly.", + "display_as": "multiple_axes", + "language": "python", + "layout": "base", + "name": "Table and Chart Subplots", + "order": 3, + "page_type": "example_index", + "permalink": "python/table-subplots/", + "thumbnail": "thumbnail/table_subplots.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/table.ipynb b/table.ipynb new file mode 100644 index 000000000..e25c259df --- /dev/null +++ b/table.ipynb @@ -0,0 +1,384 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "14ea95f8", + "metadata": {}, + "source": [ + "`go.Table` provides a Table object for detailed data viewing. The data are arranged in\n", + "a grid of rows and columns. Most styling can be specified for header, columns, rows or individual cells. Table is using a column-major order, ie. the grid is represented as a vector of column vectors.\n", + "\n", + "Note that [Dash](https://dash.plotly.com/) provides a different type of [DataTable](https://dash.plotly.com/datatable).\n", + "\n", + "#### Basic Table" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "772b1030", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[go.Table(header=dict(values=['A Scores', 'B Scores']),\n", + " cells=dict(values=[[100, 90, 80, 90], [95, 85, 75, 95]]))\n", + " ])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "80b0e179", + "metadata": {}, + "source": [ + "#### Styled Table" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27c6272c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " header=dict(values=['A Scores', 'B Scores'],\n", + " line_color='darkslategray',\n", + " fill_color='lightskyblue',\n", + " align='left'),\n", + " cells=dict(values=[[100, 90, 80, 90], # 1st column\n", + " [95, 85, 75, 95]], # 2nd column\n", + " line_color='darkslategray',\n", + " fill_color='lightcyan',\n", + " align='left'))\n", + "])\n", + "\n", + "fig.update_layout(width=500, height=300)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8ce75479", + "metadata": {}, + "source": [ + "#### Use a Pandas Dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d9e98a48", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv')\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " header=dict(values=list(df.columns),\n", + " fill_color='paleturquoise',\n", + " align='left'),\n", + " cells=dict(values=[df.Rank, df.State, df.Postal, df.Population],\n", + " fill_color='lavender',\n", + " align='left'))\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "84862d8b", + "metadata": {}, + "source": [ + "#### Tables in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "180c4688", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'table', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "b60758af", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "e160f344", + "metadata": {}, + "source": [ + "#### Changing Row and Column Size" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "42fd08d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "values = [['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL
EXPENSES
'], #1st col\n", + " [\"Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad\",\n", + " \"Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad\",\n", + " \"Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad\",\n", + " \"Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad\",\n", + " \"Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad\"]]\n", + "\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " columnorder = [1,2],\n", + " columnwidth = [80,400],\n", + " header = dict(\n", + " values = [['EXPENSES
as of July 2017'],\n", + " ['DESCRIPTION']],\n", + " line_color='darkslategray',\n", + " fill_color='royalblue',\n", + " align=['left','center'],\n", + " font=dict(color='white', size=12),\n", + " height=40\n", + " ),\n", + " cells=dict(\n", + " values=values,\n", + " line_color='darkslategray',\n", + " fill=dict(color=['paleturquoise', 'white']),\n", + " align=['left', 'center'],\n", + " font_size=12,\n", + " height=30)\n", + " )\n", + "])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "58612a5d", + "metadata": {}, + "source": [ + "#### Alternating Row Colors" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "97d6ae47", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "headerColor = 'grey'\n", + "rowEvenColor = 'lightgrey'\n", + "rowOddColor = 'white'\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " header=dict(\n", + " values=['EXPENSES','Q1','Q2','Q3','Q4'],\n", + " line_color='darkslategray',\n", + " fill_color=headerColor,\n", + " align=['left','center'],\n", + " font=dict(color='white', size=12)\n", + " ),\n", + " cells=dict(\n", + " values=[\n", + " ['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL'],\n", + " [1200000, 20000, 80000, 2000, 12120000],\n", + " [1300000, 20000, 70000, 2000, 130902000],\n", + " [1300000, 20000, 120000, 2000, 131222000],\n", + " [1400000, 20000, 90000, 2000, 14102000]],\n", + " line_color='darkslategray',\n", + " # 2-D list of colors for alternating rows\n", + " fill_color = [[rowOddColor,rowEvenColor,rowOddColor, rowEvenColor,rowOddColor]*5],\n", + " align = ['left', 'center'],\n", + " font = dict(color = 'darkslategray', size = 11)\n", + " ))\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "53e13b63", + "metadata": {}, + "source": [ + "#### Row Color Based on Variable" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c5916f4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "colors = ['rgb(239, 243, 255)', 'rgb(189, 215, 231)', 'rgb(107, 174, 214)',\n", + " 'rgb(49, 130, 189)', 'rgb(8, 81, 156)']\n", + "data = {'Year' : [2010, 2011, 2012, 2013, 2014], 'Color' : colors}\n", + "df = pd.DataFrame(data)\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " header=dict(\n", + " values=[\"Color\", \"YEAR\"],\n", + " line_color='white', fill_color='white',\n", + " align='center', font=dict(color='black', size=12)\n", + " ),\n", + " cells=dict(\n", + " values=[df.Color, df.Year],\n", + " line_color=[df.Color], fill_color=[df.Color],\n", + " align='center', font=dict(color='black', size=11)\n", + " ))\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ddf13851", + "metadata": {}, + "source": [ + "#### Cell Color Based on Variable" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7997a0a7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.colors import n_colors\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "colors = n_colors('rgb(255, 200, 200)', 'rgb(200, 0, 0)', 9, colortype='rgb')\n", + "a = np.random.randint(low=0, high=9, size=10)\n", + "b = np.random.randint(low=0, high=9, size=10)\n", + "c = np.random.randint(low=0, high=9, size=10)\n", + "\n", + "fig = go.Figure(data=[go.Table(\n", + " header=dict(\n", + " values=['Column A', 'Column B', 'Column C'],\n", + " line_color='white', fill_color='white',\n", + " align='center',font=dict(color='black', size=12)\n", + " ),\n", + " cells=dict(\n", + " values=[a, b, c],\n", + " line_color=[np.array(colors)[a],np.array(colors)[b], np.array(colors)[c]],\n", + " fill_color=[np.array(colors)[a],np.array(colors)[b], np.array(colors)[c]],\n", + " align='center', font=dict(color='white', size=11)\n", + " ))\n", + "])\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7e54d18f", + "metadata": {}, + "source": [ + "#### Reference\n", + "For more information on tables and table attributes see: https://plotly.com/python/reference/table/.\n" + ] + }, + { + "cell_type": "markdown", + "id": "636e68d7", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to make tables in Python with Plotly.", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "Tables", + "order": 11, + "page_type": "u-guide", + "permalink": "python/table/", + "thumbnail": "thumbnail/table.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/templates.ipynb b/templates.ipynb new file mode 100644 index 000000000..c0defb3b7 --- /dev/null +++ b/templates.ipynb @@ -0,0 +1,708 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "40f99df3", + "metadata": {}, + "source": [ + "### Theming and templates\n", + "\n", + "The Plotly Python library comes pre-loaded with several themes that you can get started using right away, and it also provides support for creating and registering your own themes.\n", + "\n", + "> Note on terminology: Theming generally refers to the process of defining default styles for visual elements. Themes in plotly are implemented using objects called templates. Templates are slightly more general than traditional themes because in addition to defining default styles, templates can pre-populate a figure with visual elements like annotations, shapes, images, and more. In the documentation we will refer to the overall process of defining default styles as theming, and when it comes to the plotly API we will talk about how themes are implemented using templates.\n", + "\n", + "### Using built-in themes\n", + "\n", + "#### View available themes\n", + "\n", + "To see information about the available themes and the current default theme, display the `plotly.io.templates` configuration object like this." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6c10db1c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "pio.templates" + ] + }, + { + "cell_type": "markdown", + "id": "41f5ac29", + "metadata": {}, + "source": [ + "From this, we can see that the default theme is `\"plotly\"`, and we can see the names of several additional themes that we can choose from.\n", + "\n", + "#### Specifying themes in Plotly Express\n", + "\n", + "All Plotly Express functions accept a `template` argument that can be set to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of using Plotly Express to build and display the same scatter plot with six different themes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6b70a015", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder()\n", + "df_2007 = df.query(\"year==2007\")\n", + "\n", + "for template in [\"plotly\", \"plotly_white\", \"plotly_dark\", \"ggplot2\", \"seaborn\", \"simple_white\", \"none\"]:\n", + " fig = px.scatter(df_2007,\n", + " x=\"gdpPercap\", y=\"lifeExp\", size=\"pop\", color=\"continent\",\n", + " log_x=True, size_max=60,\n", + " template=template, title=\"Gapminder 2007: '%s' theme\" % template)\n", + " fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "72fcb07b", + "metadata": {}, + "source": [ + "#### Specifying themes in graph object figures\n", + "\n", + "The theme for a particular graph object figure can be specified by setting the `template` property of the figure's `layout` to the name of a registered theme (or to a `Template` object as discussed later in this section). Here is an example of constructing a surface plot and then displaying it with each of six themes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8dd01ffa", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "z_data = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv\")\n", + "\n", + "fig = go.Figure(\n", + " data=go.Surface(z=z_data.values),\n", + " layout=go.Layout(\n", + " title=dict(text=\"Mt Bruno Elevation\"),\n", + " width=500,\n", + " height=500,\n", + " ))\n", + "\n", + "for template in [\"plotly\", \"plotly_white\", \"plotly_dark\", \"ggplot2\", \"seaborn\", \"simple_white\", \"none\"]:\n", + " fig.update_layout(template=template, title=dict(text=\"Mt Bruno Elevation: '%s' theme\" % template))\n", + " fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "18a9e2fe", + "metadata": {}, + "source": [ + "#### Specifying a default themes\n", + "\n", + "If a theme is not provided to a Plotly Express function or to a graph object figure, then the default theme is used. The default theme starts out as `\"plotly\"`, but it can be changed by setting the `plotly.io.templates.default` property to the name of a registered theme.\n", + "\n", + "Here is an example of changing to default theme to `\"plotly_white\"` and then constructing a scatter plot with Plotly Express without providing a template.\n", + "\n", + "> Note: Default themes persist for the duration of a single session, but they do not persist across sessions. If you are working in an IPython kernel, this means that default themes will persist for the life of the kernel, but they will not persist across kernel restarts." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a66370e1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "import plotly.express as px\n", + "\n", + "pio.templates.default = \"plotly_white\"\n", + "\n", + "df = px.data.gapminder()\n", + "df_2007 = df.query(\"year==2007\")\n", + "\n", + "fig = px.scatter(df_2007,\n", + " x=\"gdpPercap\", y=\"lifeExp\", size=\"pop\", color=\"continent\",\n", + " log_x=True, size_max=60,\n", + " title=\"Gapminder 2007: current default theme\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "738bbb06", + "metadata": {}, + "source": [ + "#### Disable default theming\n", + "\n", + "If you do not wish to use any of the new themes by default, or you want your figures to look exactly the way they did prior to plotly.py version 4, you can disable default theming by setting the default theme to `\"none\"`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "02e861ef", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "pio.templates.default = \"none\"" + ] + }, + { + "cell_type": "markdown", + "id": "ac922630", + "metadata": {}, + "source": [ + "### Creating themes\n", + "\n", + "#### Representing themes with Template objects\n", + "\n", + "Themes in plotly.py are represented by instances of the `Template` class from the `plotly.graph_objects.layout` module. A `Template` is a graph object that contains two top-level properties: `layout` and `data`. These template properties are described in their own sections below.\n", + "\n", + "#### The template layout property\n", + "\n", + "The `layout` property of a template is a graph object with the exact same structure as the `layout` property of a figure. When you provide values for properties of the template's `layout`, these values will be used as the defaults in any figure that this template is applied to.\n", + "\n", + "Here is an example that creates a template that sets the default title font to size 24 Rockwell, and then constructs a graph object figure with this template." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "234140fc", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "large_rockwell_template = dict(\n", + " layout=go.Layout(title_font=dict(family=\"Rockwell\", size=24))\n", + ")\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(title=dict(text=\"Figure Title\"),\n", + " template=large_rockwell_template)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f5596c62", + "metadata": {}, + "source": [ + "> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))`\n", + "\n", + "#### The template data property\n", + "\n", + "The `data` property of a template is used to customize the default values of the properties of traces that are added to a figure that the template is applied to. This `data` property holds a graph object, with type `go.layout.template.Data`, that has a property named after each supported trace type. These trace type properties are then assigned lists or tuples of graph object traces of the corresponding type.\n", + "\n", + "Here is an example that creates a template that sets the default scatter trace markers to be size 20 diamonds, and then constructs a graph object figure with this template." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a62197a4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "diamond_template = go.layout.Template()\n", + "diamond_template.data.scatter = [go.Scatter(marker=dict(symbol=\"diamond\", size=20))]\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(template=diamond_template)\n", + "fig.add_scatter(y=[2, 1, 3], mode=\"markers\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "81af166e", + "metadata": {}, + "source": [ + "If a trace type property is set to a list of more than one trace, then the default properties are cycled as more traces are added to the figure. Here is an example that creates a template that cycles the default marker symbol for scatter traces, and then constructs a figure that uses this template." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "764d5c40", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "symbol_template = go.layout.Template()\n", + "symbol_template.data.scatter = [\n", + " go.Scatter(marker=dict(symbol=\"diamond\", size=10)),\n", + " go.Scatter(marker=dict(symbol=\"square\", size=10)),\n", + " go.Scatter(marker=dict(symbol=\"circle\", size=10)),\n", + "]\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(template=symbol_template)\n", + "fig.add_scatter(y=[1, 2, 3], mode=\"markers\", name=\"first\")\n", + "fig.add_scatter(y=[2, 3, 4], mode=\"markers\", name=\"second\")\n", + "fig.add_scatter(y=[3, 4, 5], mode=\"markers\", name=\"third\")\n", + "fig.add_scatter(y=[4, 5, 6], mode=\"markers\", name=\"forth\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4c41ffb5", + "metadata": {}, + "source": [ + "Note that because we built the template with a list of 3 scatter trace [graph objects](/python/graph-objects/) (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).\n", + "\n", + "#### Theming object tuple properties\n", + "\n", + "Some properties in the figure hierarchy are specified as tuples of objects. For example, the text annotations for a graph object figure can be stored as a tuple of `go.layout.Annotation` objects in the `annotations` property of the figure's layout.\n", + "\n", + "To use a template to configure the default properties of all of the elements in an object tuple property (e.g. `layout.annotations`), use the `*defaults` property in the template that corresponds to the tuple property (e.g. `layout.template.layout.annotationdefaults`). The `*defaults` template property should be set to a single graph object that matches the type of the elements of the corresponding tuple. The properties of this `*defaults` object in the template will be applied to all elements of the object tuple in the figure that the template is applied to.\n", + "\n", + "Here is an example that creates a template that specifies the default annotation text color, and then constructs a figure that uses this template." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45b7c5b3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "annotation_template = go.layout.Template()\n", + "annotation_template.layout.annotationdefaults = dict(font=dict(color=\"crimson\"))\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(\n", + " template=annotation_template,\n", + " annotations=[\n", + " dict(text=\"Look Here\", x=1, y=1),\n", + " dict(text=\"Look There\", x=2, y=2)\n", + " ]\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ff1ba1ca", + "metadata": {}, + "source": [ + "#### Including tuple elements in a theme\n", + "\n", + "The previous section described how to use a template to customize the default properties of tuple elements that are added to a figure that the template is applied to. This is useful for styling, for example, any annotations, shapes, or images that will eventually be added to the figure.\n", + "\n", + "It is also possible for a template to define tuple elements that should be included, as is, in any figure that the template is applied to. This is done by specifying a list of one or more tuple element graph objects (e.g. `go.layout.Annotation` objects) as the value of the corresponding tuple property in the template (e.g. at `template.layout.annotations`). Note that the `name` property of these tuple element graph objects must be set to a unique non-empty string.\n", + "\n", + "Here is an example that creates a template that adds a large semi-transparent \"DRAFT\" watermark to the middle of the figure, and constructs a figure using this template." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3a2038a0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "draft_template = go.layout.Template()\n", + "draft_template.layout.annotations = [\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + "]\n", + "\n", + "fig=go.Figure()\n", + "fig.update_layout(template=draft_template)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e7b2db04", + "metadata": {}, + "source": [ + "#### Customizing theme tuple elements in a figure\n", + "\n", + "The previous section described how a template can be used to add default tuple element graph objects (e.g. annotations, shapes, or images) to a figure. The properties of these default tuple elements can be customized from within the figure by adding an tuple element with a `templateitemname` property that matches the `name` property of the template object.\n", + "\n", + "Here is an example, using the same `draft_template` defined above, that customizes the watermark from within the figure to read \"CONFIDENTIAL\" rather than \"DRAFT\"." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "32462f6a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "draft_template = go.layout.Template()\n", + "draft_template.layout.annotations = [\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + "]\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(\n", + " template=draft_template,\n", + " annotations=[\n", + " dict(\n", + " templateitemname=\"draft watermark\",\n", + " text=\"CONFIDENTIAL\",\n", + " )\n", + " ]\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a248319b", + "metadata": {}, + "source": [ + "#### Registering themes as named templates\n", + "\n", + "The examples above construct and configure a `Template` object and then pass that object as the template specification to graph object figures (as the `layout.template` property) or Plotly Express functions (as the `template` keyword argument). It is also possible to register custom templates by name so that the name itself can be used to refer to the template. To register a template, use dictionary-style assignment to associate the template object with a name in the `plotly.io.templates` configuration object.\n", + "\n", + "Here is an example of registering the draft watermark template from the previous sections as a template named `\"draft\"`. Then a graph object figure is created with the draft template specified by name." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8971f86b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import plotly.io as pio\n", + "\n", + "pio.templates[\"draft\"] = go.layout.Template(\n", + " layout_annotations=[\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + " ]\n", + ")\n", + "\n", + "fig = go.Figure()\n", + "fig.update_layout(template=\"draft\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5e43d940", + "metadata": {}, + "source": [ + "> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])`\n", + "\n", + "It is also possible to set your own custom template as the default so that you do not need to pass it by name when constructing graph object figures or calling Plotly Express functions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6b3624ff", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import plotly.io as pio\n", + "\n", + "pio.templates[\"draft\"] = go.layout.Template(\n", + " layout_annotations=[\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + " ]\n", + ")\n", + "pio.templates.default = \"draft\"\n", + "\n", + "fig = go.Figure()\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bd4cfadd", + "metadata": {}, + "source": [ + "#### Combining themes\n", + "\n", + "You may have noticed that figures displayed with the custom templates defined above do not have the gray background and white gridlines that are part of the default styling of figures created with plotly.py. The reason for this is that the default styling is specified in a template named `\"plotly\"`, and specifying a custom template overrides the default `\"plotly\"` template.\n", + "\n", + "If you want the styling of a custom template to be applied on top of the default styling of the `\"plotly\"` template, then you will need to combine the custom template with the `\"plotly\"` template. Multiple registered templates (whether built-in or user-defined) can be combined by specifying a template string that contains multiple template names joined on `\"+\"` characters.\n", + "\n", + "Here is an example of setting the default template to be a combination of the built-in `\"plotly\"` template and the custom `\"draft\"` template from the previous example." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "71afcb02", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import plotly.io as pio\n", + "\n", + "pio.templates[\"draft\"] = go.layout.Template(\n", + " layout_annotations=[\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + " ]\n", + ")\n", + "pio.templates.default = \"plotly+draft\"\n", + "\n", + "fig = go.Figure()\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "253acc1c", + "metadata": {}, + "source": [ + "Combining themes is also supported by Plotly Express" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9e3c6682", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "import plotly.graph_objects as go\n", + "import plotly.express as px\n", + "\n", + "pio.templates[\"draft\"] = go.layout.Template(\n", + " layout_annotations=[\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + " ]\n", + ")\n", + "pio.templates.default = \"plotly+draft\"\n", + "\n", + "df = px.data.gapminder()\n", + "df_2007 = df.query(\"year==2007\")\n", + "\n", + "fig = px.scatter(df_2007,\n", + " x=\"gdpPercap\", y=\"lifeExp\", size=\"pop\", color=\"continent\",\n", + " log_x=True, size_max=60,\n", + " title=\"Gapminder 2007: current default theme\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ff5cfd87", + "metadata": {}, + "source": [ + "\n", + "#### Saving and distributing custom themes\n", + "\n", + "The easiest way to save and distribute a custom template is to make a `*.py` file that creates and registers the template when it is imported. Here is an example of the contents of a file called `my_themes.py` that creates and registers the `\"draft\"` template when it is imported\n", + "\n", + "**my_themes.py**\n", + "\n", + "---\n", + "\n", + "```python\n", + "import plotly.graph_objects as go\n", + "import plotly.io as pio\n", + "\n", + "pio.templates[\"draft\"] = go.layout.Template(\n", + " layout_annotations=[\n", + " dict(\n", + " name=\"draft watermark\",\n", + " text=\"DRAFT\",\n", + " textangle=-30,\n", + " opacity=0.1,\n", + " font=dict(color=\"black\", size=100),\n", + " xref=\"paper\",\n", + " yref=\"paper\",\n", + " x=0.5,\n", + " y=0.5,\n", + " showarrow=False,\n", + " )\n", + " ]\n", + ")\n", + "```\n", + "\n", + "---\n", + "\n", + "To get access to the `\"draft\"` template, import the `my_themes` module.\n", + "\n", + "```python\n", + "import my_themes\n", + "import plotly.io as pio\n", + "pio.templates.default = \"draft\"\n", + "...\n", + "```\n", + "\n", + "> Note: In order for the import to succeed, the `my_themes.py` file must be on Python's module search path. See https://docs.python.org/3/tutorial/modules.html#the-module-search-path for more information.\n" + ] + }, + { + "cell_type": "markdown", + "id": "69cdaedc", + "metadata": {}, + "source": [ + "#### Examining built-in themes\n", + "\n", + "It may be useful to examine the contents and structure of the built-in templates when creating your own custom templates. The `Template` graph object for a registered template can be loaded using dictionary-style key access on the `plotly.io.templates` configuration object. Here is an example of loading the `Template` graph object for the `\"plotly\"` template, and then displaying the value of the template's `layout` property." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0a57e82d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "plotly_template = pio.templates[\"plotly\"]\n", + "plotly_template.layout" + ] + }, + { + "cell_type": "markdown", + "id": "e971d01c", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "Theming and templates with plotly with Python", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Theming and templates", + "order": 7, + "page_type": "u-guide", + "permalink": "python/templates/", + "thumbnail": "thumbnail/theming-and-templates.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ternary-contour.ipynb b/ternary-contour.ipynb new file mode 100644 index 000000000..05867ba79 --- /dev/null +++ b/ternary-contour.ipynb @@ -0,0 +1,265 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1e791828", + "metadata": {}, + "source": [ + "## Ternary contour plots" + ] + }, + { + "cell_type": "markdown", + "id": "29dd9234", + "metadata": {}, + "source": [ + "A ternary contour plots represents isovalue lines of a quantity defined inside a [ternary diagram](https://en.wikipedia.org/wiki/Ternary_plot), i.e. as a function of three variables which sum is constant. Coordinates of the ternary plot often correspond to concentrations of three species, and the quantity represented as contours is some property (e.g., physical, chemical, thermodynamical) varying with the composition.\n", + "\n", + "For ternary contour plots, use the [figure factory](/python/figure-factories/) called ``create_ternary_contour``. The figure factory interpolates between given data points in order to compute the contours.\n", + "\n", + "Below we represent an example from metallurgy, where the mixing enthalpy is represented as a contour plot for aluminum-copper-yttrium (Al-Cu-Y) alloys.\n", + "\n", + "#### Simple ternary contour plot with plotly" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2fda89cd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import numpy as np\n", + "Al = np.array([0. , 0. , 0., 0., 1./3, 1./3, 1./3, 2./3, 2./3, 1.])\n", + "Cu = np.array([0., 1./3, 2./3, 1., 0., 1./3, 2./3, 0., 1./3, 0.])\n", + "Y = 1 - Al - Cu\n", + "# synthetic data for mixing enthalpy\n", + "# See https://pycalphad.org/docs/latest/examples/TernaryExamples.html\n", + "enthalpy = (Al - 0.01) * Cu * (Al - 0.52) * (Cu - 0.48) * (Y - 1)**2\n", + "fig = ff.create_ternary_contour(np.array([Al, Y, Cu]), enthalpy,\n", + " pole_labels=['Al', 'Y', 'Cu'],\n", + " interp_mode='cartesian')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e223dbd4", + "metadata": {}, + "source": [ + "#### Customized ternary contour plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b6b158d2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import numpy as np\n", + "Al = np.array([0. , 0. , 0., 0., 1./3, 1./3, 1./3, 2./3, 2./3, 1.])\n", + "Cu = np.array([0., 1./3, 2./3, 1., 0., 1./3, 2./3, 0., 1./3, 0.])\n", + "Y = 1 - Al - Cu\n", + "# synthetic data for mixing enthalpy\n", + "# See https://pycalphad.org/docs/latest/examples/TernaryExamples.html\n", + "enthalpy = 2.e6 * (Al - 0.01) * Cu * (Al - 0.52) * (Cu - 0.48) * (Y - 1)**2 - 5000\n", + "fig = ff.create_ternary_contour(np.array([Al, Y, Cu]), enthalpy,\n", + " pole_labels=['Al', 'Y', 'Cu'],\n", + " interp_mode='cartesian',\n", + " ncontours=20,\n", + " colorscale='Viridis',\n", + " showscale=True,\n", + " title=dict(\n", + " text='Mixing enthalpy of ternary alloy'\n", + " ))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ca524155", + "metadata": {}, + "source": [ + "#### Ternary contour plot with lines only" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c1be2007", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import numpy as np\n", + "Al = np.array([0. , 0. , 0., 0., 1./3, 1./3, 1./3, 2./3, 2./3, 1.])\n", + "Cu = np.array([0., 1./3, 2./3, 1., 0., 1./3, 2./3, 0., 1./3, 0.])\n", + "Y = 1 - Al - Cu\n", + "# synthetic data for mixing enthalpy\n", + "# See https://pycalphad.org/docs/latest/examples/TernaryExamples.html\n", + "enthalpy = 2.e6 * (Al - 0.01) * Cu * (Al - 0.52) * (Cu - 0.48) * (Y - 1)**2 - 5000\n", + "fig = ff.create_ternary_contour(np.array([Al, Y, Cu]), enthalpy,\n", + " pole_labels=['Al', 'Y', 'Cu'],\n", + " interp_mode='cartesian',\n", + " ncontours=20,\n", + " coloring='lines')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ad14d639", + "metadata": {}, + "source": [ + "#### Ternary contour plot with data points\n", + "\n", + "With `showmarkers=True`, data points used to compute the contours are also displayed. They are best visualized for contour lines (no solid coloring). At the moment data points lying on the edges of the diagram are not displayed, this will be improved in future versions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c20662d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "import numpy as np\n", + "Al, Cu = np.mgrid[0:1:7j, 0:1:7j]\n", + "Al, Cu = Al.ravel(), Cu.ravel()\n", + "mask = Al + Cu <= 1\n", + "Al, Cu = Al[mask], Cu[mask]\n", + "Y = 1 - Al - Cu\n", + "\n", + "enthalpy = (Al - 0.5) * (Cu - 0.5) * (Y - 1)**2\n", + "fig = ff.create_ternary_contour(np.array([Al, Y, Cu]), enthalpy,\n", + " pole_labels=['Al', 'Y', 'Cu'],\n", + " ncontours=20,\n", + " coloring='lines',\n", + " showmarkers=True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6358794d", + "metadata": {}, + "source": [ + "#### Interpolation mode\n", + "\n", + "Two modes are available in order to interpolate between data points: interpolation in Cartesian space (`interp_mode='cartesian'`) or interpolation using the [isometric log-ratio transformation](https://link.springer.com/article/10.1023/A:1023818214614) (see also [preprint](https://www.researchgate.net/profile/Leon_Parent2/post/What_is_the_best_approach_for_diagnosing_nutrient_disorders_and_formulating_fertilizer_recommendations/attachment/59d62a69c49f478072e9cf3f/AS%3A272541220835360%401441990298625/download/Egozcue+et+al+2003.pdf)), `interp_mode='ilr'`. The `ilr` transformation preserves metrics in the [simplex](https://en.wikipedia.org/wiki/Simplex) but is not defined on its edges." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "abb12390", + "metadata": {}, + "outputs": [], + "source": [ + "a, b = np.mgrid[0:1:20j, 0:1:20j]\n", + "mask = a + b <= 1\n", + "a, b = a[mask], b[mask]\n", + "coords = np.stack((a, b, 1 - a - b))\n", + "value = np.sin(3.2 * np.pi * (a + b)) + np.sin(3 * np.pi * (a - b))\n", + "fig = ff.create_ternary_contour(coords, value, ncontours=9)\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "85d63f42", + "metadata": {}, + "outputs": [], + "source": [ + "a, b = np.mgrid[0:1:20j, 0:1:20j]\n", + "mask = a + b <= 1\n", + "a, b = a[mask], b[mask]\n", + "coords = np.stack((a, b, 1 - a - b))\n", + "value = np.sin(3.2 * np.pi * (a + b)) + np.sin(3 * np.pi * (a - b))\n", + "fig = ff.create_ternary_contour(coords, value, interp_mode='cartesian',\n", + " ncontours=9)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6b77eb5f", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "For more info on `ff.create_ternary_contour()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_ternary_contour.html)" + ] + }, + { + "cell_type": "markdown", + "id": "e80b5f7d", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to make Ternary Contour Plots in Python with plotly", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Ternary contours", + "order": 18, + "page_type": "u-guide", + "permalink": "python/ternary-contour/", + "thumbnail": "thumbnail/ternary-contour.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ternary-plots.ipynb b/ternary-plots.ipynb new file mode 100644 index 000000000..4125866c2 --- /dev/null +++ b/ternary-plots.ipynb @@ -0,0 +1,205 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "150c0123", + "metadata": {}, + "source": [ + "## Ternary Plots\n", + "\n", + "A ternary plot depicts the ratios of three variables as positions in an equilateral triangle.\n", + "\n", + "## Ternary scatter plot with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "Here we use `px.scatter_ternary` to visualize the three-way split between the three major candidates in a municipal election." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b93a166e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.election()\n", + "fig = px.scatter_ternary(df, a=\"Joly\", b=\"Coderre\", c=\"Bergeron\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "677ea054", + "metadata": {}, + "source": [ + "We can scale and color the markers to produce a ternary bubble chart." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c34b80bb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.election()\n", + "fig = px.scatter_ternary(df, a=\"Joly\", b=\"Coderre\", c=\"Bergeron\", hover_name=\"district\",\n", + " color=\"winner\", size=\"total\", size_max=15,\n", + " color_discrete_map = {\"Joly\": \"blue\", \"Bergeron\": \"green\", \"Coderre\":\"red\"} )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1bf159f1", + "metadata": {}, + "source": [ + "### Ternary scatter plot with Plotly Graph Objects" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e4100118", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "rawData = [\n", + " {'journalist':75,'developer':25,'designer':0,'label':'point 1'},\n", + " {'journalist':70,'developer':10,'designer':20,'label':'point 2'},\n", + " {'journalist':75,'developer':20,'designer':5,'label':'point 3'},\n", + " {'journalist':5,'developer':60,'designer':35,'label':'point 4'},\n", + " {'journalist':10,'developer':80,'designer':10,'label':'point 5'},\n", + " {'journalist':10,'developer':90,'designer':0,'label':'point 6'},\n", + " {'journalist':20,'developer':70,'designer':10,'label':'point 7'},\n", + " {'journalist':10,'developer':20,'designer':70,'label':'point 8'},\n", + " {'journalist':15,'developer':5,'designer':80,'label':'point 9'},\n", + " {'journalist':10,'developer':10,'designer':80,'label':'point 10'},\n", + " {'journalist':20,'developer':10,'designer':70,'label':'point 11'},\n", + "];\n", + "\n", + "def makeAxis(title, tickangle):\n", + " return {\n", + " 'title': {'text': title, 'font': { 'size': 20}},\n", + " 'tickangle': tickangle,\n", + " 'tickfont': { 'size': 15 },\n", + " 'tickcolor': 'rgba(0,0,0,0)',\n", + " 'ticklen': 5,\n", + " 'showline': True,\n", + " 'showgrid': True\n", + " }\n", + "\n", + "fig = go.Figure(go.Scatterternary({\n", + " 'mode': 'markers',\n", + " 'a': [i for i in map(lambda x: x['journalist'], rawData)],\n", + " 'b': [i for i in map(lambda x: x['developer'], rawData)],\n", + " 'c': [i for i in map(lambda x: x['designer'], rawData)],\n", + " 'text': [i for i in map(lambda x: x['label'], rawData)],\n", + " 'marker': {\n", + " 'symbol': 100,\n", + " 'color': '#DB7365',\n", + " 'size': 14,\n", + " 'line': { 'width': 2 }\n", + " }\n", + "}))\n", + "\n", + "fig.update_layout({\n", + " 'ternary': {\n", + " 'sum': 100,\n", + " 'aaxis': makeAxis('Journalist', 0),\n", + " 'baxis': makeAxis('
Developer', 45),\n", + " 'caxis': makeAxis('
Designer', -45)\n", + " },\n", + " 'annotations': [{\n", + " 'showarrow': False,\n", + " 'text': 'Simple Ternary Plot with Markers',\n", + " 'x': 0.5,\n", + " 'y': 1.3,\n", + " 'font': { 'size': 15 }\n", + " }]\n", + "})\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e3d71244", + "metadata": {}, + "source": [ + "#### Reference\n", + "See [function reference for `px.(scatter_ternary)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_ternary) or https://plotly.com/python/reference/scatterternary/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "2aa6b098", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "How to make Ternary plots in Python with Plotly.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Ternary Plots", + "order": 4, + "page_type": "example_index", + "permalink": "python/ternary-plots/", + "thumbnail": "thumbnail/v4-migration.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ternary-scatter-contour.ipynb b/ternary-scatter-contour.ipynb new file mode 100644 index 000000000..a7b93e3ac --- /dev/null +++ b/ternary-scatter-contour.ipynb @@ -0,0 +1,229 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3d637493", + "metadata": {}, + "source": [ + "#### Load and Process Data Files" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1f404a44", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import pandas as pd\n", + "\n", + "contour_raw_data = pd.read_json('https://raw.githubusercontent.com/plotly/datasets/master/contour_data.json')\n", + "scatter_raw_data = pd.read_json('https://raw.githubusercontent.com/plotly/datasets/master/scatter_data.json')\n", + "\n", + "scatter_data = scatter_raw_data['Data']\n", + "\n", + "def clean_data(data_in):\n", + " \"\"\"\n", + " Cleans data in a format which can be conveniently\n", + " used for drawing traces. Takes a dictionary as the\n", + " input, and returns a list in the following format:\n", + "\n", + " input = {'key': ['a b c']}\n", + " output = [key, [a, b, c]]\n", + " \"\"\"\n", + " key = list(data_in.keys())[0]\n", + " data_out = [key]\n", + " for i in data_in[key]:\n", + " data_out.append(list(map(float, i.split(' '))))\n", + "\n", + " return data_out\n", + "\n", + "\n", + "#Example:\n", + "print(clean_data({'L1': ['.03 0.5 0.47','0.4 0.5 0.1']}))" + ] + }, + { + "cell_type": "markdown", + "id": "9a1cb5d5", + "metadata": {}, + "source": [ + "#### Create Ternary Scatter Plot:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83ed5ee8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "a_list = []\n", + "b_list = []\n", + "c_list = []\n", + "text = []\n", + "\n", + "for raw_data in scatter_data:\n", + " data = clean_data(raw_data)\n", + " text.append(data[0])\n", + " c_list.append(data[1][0])\n", + " a_list.append(data[1][1])\n", + " b_list.append(data[1][2])\n", + "\n", + "fig = go.Figure(go.Scatterternary(\n", + " text=text,\n", + " a=a_list,\n", + " b=b_list,\n", + " c=c_list,\n", + " mode='markers',\n", + " marker={'symbol': 100,\n", + " 'color': 'green',\n", + " 'size': 10},\n", + "))\n", + "\n", + "fig.update_layout({\n", + " 'title': 'Ternary Scatter Plot',\n", + " 'ternary':\n", + " {\n", + " 'sum':1,\n", + " 'aaxis':{'title': 'X', 'min': 0.01, 'linewidth':2, 'ticks':'outside' },\n", + " 'baxis':{'title': 'W', 'min': 0.01, 'linewidth':2, 'ticks':'outside' },\n", + " 'caxis':{'title': 'S', 'min': 0.01, 'linewidth':2, 'ticks':'outside' }\n", + " },\n", + " 'showlegend': False\n", + "})\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0237ee58", + "metadata": {}, + "source": [ + "#### Create Ternary Contour Plot:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98233787", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "\n", + "contour_dict = contour_raw_data['Data']\n", + "\n", + "# Defining a colormap:\n", + "colors = ['#8dd3c7','#ffffb3','#bebada',\n", + " '#fb8072','#80b1d3','#fdb462',\n", + " '#b3de69','#fccde5','#d9d9d9',\n", + " '#bc80bd']\n", + "colors_iterator = iter(colors)\n", + "\n", + "fig = go.Figure()\n", + "\n", + "for raw_data in contour_dict:\n", + " data = clean_data(raw_data)\n", + "\n", + " a = [inner_data[0] for inner_data in data[1:]]\n", + " a.append(data[1][0]) # Closing the loop\n", + "\n", + " b = [inner_data[1] for inner_data in data[1:]]\n", + " b.append(data[1][1]) # Closing the loop\n", + "\n", + " c = [inner_data[2] for inner_data in data[1:]]\n", + " c.append(data[1][2]) # Closing the loop\n", + "\n", + " fig.add_trace(go.Scatterternary(\n", + " text = data[0],\n", + " a=a, b=b, c=c, mode='lines',\n", + " line=dict(color='#444', shape='spline'),\n", + " fill='toself',\n", + " fillcolor = colors_iterator.__next__()\n", + " ))\n", + "\n", + "fig.update_layout(title = 'Ternary Contour Plot')\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8489a6e6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "720514ba", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to make a scatter plot overlaid on ternary contour in Python with Plotly.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Ternary Overlay", + "order": 8, + "page_type": "u-guide", + "permalink": "python/ternary-scatter-contour/", + "thumbnail": "thumbnail/ternary-scatter-contour.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/text-and-annotations.ipynb b/text-and-annotations.ipynb new file mode 100644 index 000000000..c2d3c92fb --- /dev/null +++ b/text-and-annotations.ipynb @@ -0,0 +1,1292 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "972b0753", + "metadata": {}, + "source": [ + "### Adding Text to Figures\n", + "\n", + "As a general rule, there are two ways to add text labels to figures:\n", + "1. Certain trace types, notably in the `scatter` family (e.g. `scatter`, `scatter3d`, `scattergeo` etc), support a `text` attribute, and can be displayed with or without markers.\n", + "2. Standalone text annotations can be added to figures using `fig.add_annotation()`, with or without arrows, and they can be positioned absolutely within the figure, or they can be positioned relative to the axes of 2d or 3d cartesian subplots i.e. in data coordinates.\n", + "\n", + "The differences between these two approaches are that:\n", + "* Traces can optionally support hover labels and can appear in legends.\n", + "* Text annotations can be positioned absolutely or relative to data coordinates in 2d/3d cartesian subplots only.\n", + "* Traces cannot be positioned absolutely but can be positioned relative to data coordinates in any subplot type.\n", + "* Traces also be used to [draw shapes](/python/shapes/), although there is a [shape equivalent to text annotations](/python/shapes/)." + ] + }, + { + "cell_type": "markdown", + "id": "8f00c80e", + "metadata": {}, + "source": [ + "### Text on scatter plots with Plotly Express\n", + "\n", + "Here is an example that creates a scatter plot with text labels using Plotly Express." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b5a96898", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"year==2007 and continent=='Americas'\")\n", + "\n", + "fig = px.scatter(df, x=\"gdpPercap\", y=\"lifeExp\", text=\"country\", log_x=True, size_max=60)\n", + "\n", + "fig.update_traces(textposition='top center')\n", + "\n", + "fig.update_layout(\n", + " height=800,\n", + " title_text='GDP and Life Expectancy (Americas, 2007)'\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c9cbfefd", + "metadata": {}, + "source": [ + "### Text on scatter plots with Graph Objects" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bc4c37d5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[1, 1, 1],\n", + " mode=\"lines+markers+text\",\n", + " name=\"Lines, Markers and Text\",\n", + " text=[\"Text A\", \"Text B\", \"Text C\"],\n", + " textposition=\"top center\"\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[2, 2, 2],\n", + " mode=\"markers+text\",\n", + " name=\"Markers and Text\",\n", + " text=[\"Text D\", \"Text E\", \"Text F\"],\n", + " textposition=\"bottom center\"\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[3, 3, 3],\n", + " mode=\"lines+text\",\n", + " name=\"Lines and Text\",\n", + " text=[\"Text G\", \"Text H\", \"Text I\"],\n", + " textposition=\"bottom center\"\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1ca2d22a", + "metadata": {}, + "source": [ + "### Text positioning in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "223b59ca", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'text-and-annotations', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "d5cc8fd3", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "6c0c786b", + "metadata": {}, + "source": [ + "### Controlling Text Size with `uniformtext`\n", + "\n", + "For the [pie](/python/pie-charts), [bar](/python/bar-charts)-like, [sunburst](/python/sunburst-charts) and [treemap](/python/treemaps) traces, it is possible to force all the text labels to have the same size thanks to the `uniformtext` layout parameter. The `minsize` attribute sets the font size, and the `mode` attribute sets what happens for labels which cannot fit with the desired fontsize: either `hide` them or `show` them with overflow." + ] + }, + { + "cell_type": "markdown", + "id": "40c83013", + "metadata": {}, + "source": [ + "Here is a bar chart with the default behavior which will scale down text to fit." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9bb6f54f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder(year=2007)\n", + "fig = px.bar(df, x='continent', y='pop', color=\"lifeExp\", text='country',\n", + " title=\"Default behavior: some text is tiny\")\n", + "fig.update_traces(textposition='inside')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8362b417", + "metadata": {}, + "source": [ + "Here is the same figure with uniform text applied: the text for all bars is the same size, with a minimum size of 8. Any text at the minimum size which does not fit in the bar is hidden." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1d4c9084", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder(year=2007)\n", + "fig = px.bar(df, x='continent', y='pop', color=\"lifeExp\", text='country',\n", + " title=\"Uniform Text: min size is 8, hidden if can't fit\")\n", + "fig.update_traces(textposition='inside')\n", + "fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ab521fb6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"continent == 'Asia' and year == 2007\")\n", + "fig = px.pie(df, values='pop', names='country')\n", + "fig.update_traces(textposition='inside')\n", + "fig.update_layout(uniformtext_minsize=12, uniformtext_mode='hide')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "03946542", + "metadata": {}, + "source": [ + "### Controlling Maximum Text Size\n", + "\n", + "The `textfont_size` parameter of the the [pie](/python/pie-charts), [bar](/python/bar-charts)-like, [sunburst](/python/sunburst-charts) and [treemap](/python/treemaps) traces can be used to set the **maximum font size** used in the chart. Note that the `textfont` parameter sets the `insidetextfont` and `outsidetextfont` parameter, which can also be set independently." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7747138a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.gapminder().query(\"continent == 'Asia' and year == 2007\")\n", + "fig = px.pie(df, values='pop', names='country')\n", + "fig.update_traces(textposition='inside', textfont_size=14)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e0933f40", + "metadata": {}, + "source": [ + "### Text Annotations\n", + "\n", + "Annotations can be added to a figure using `fig.add_annotation()`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41492f40", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 1, 3, 2, 4, 3, 4, 6, 5]\n", + "))\n", + "\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 4, 5, 1, 2, 2, 3, 4, 2]\n", + "))\n", + "\n", + "fig.add_annotation(x=2, y=5,\n", + " text=\"Text annotation with arrow\",\n", + " showarrow=True,\n", + " arrowhead=1)\n", + "fig.add_annotation(x=4, y=4,\n", + " text=\"Text annotation without arrow\",\n", + " showarrow=False,\n", + " yshift=10)\n", + "\n", + "fig.update_layout(showlegend=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1c474280", + "metadata": {}, + "source": [ + "#### Text Annotations with Log Axes\n", + "\n", + "If the `x` or `y` positions of an annotation reference a log axis, you need to provide that position as a `log10` value when adding the annotation. In this example, the `yaxis` is a log axis so we pass the `log10` value of `1000` to the annotation's `y` position." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3e01de8c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import math\n", + "\n", + "dates = [\n", + " \"2024-01-01\",\n", + " \"2024-01-02\",\n", + " \"2024-01-03\",\n", + " \"2024-01-04\",\n", + " \"2024-01-05\",\n", + " \"2024-01-06\",\n", + "]\n", + "y_values = [1, 30, 70, 100, 1000, 10000000]\n", + "\n", + "fig = go.Figure(\n", + " data=[go.Scatter(x=dates, y=y_values, mode=\"lines+markers\")],\n", + " layout=go.Layout(\n", + " yaxis=dict(\n", + " type=\"log\",\n", + " )\n", + " ),\n", + ")\n", + "\n", + "fig.add_annotation(\n", + " x=\"2024-01-05\",\n", + " y=math.log10(1000),\n", + " text=\"Log axis annotation\",\n", + " showarrow=True,\n", + " xanchor=\"right\",\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ad1fd5c0", + "metadata": {}, + "source": [ + "### 3D Annotations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9dd0d8a6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter3d(\n", + " x=[\"2017-01-01\", \"2017-02-10\", \"2017-03-20\"],\n", + " y=[\"A\", \"B\", \"C\"],\n", + " z=[1, 1000, 100000],\n", + " name=\"z\",\n", + "))\n", + "\n", + "fig.update_layout(\n", + " scene=dict(\n", + " xaxis=dict(type=\"date\"),\n", + " yaxis=dict(type=\"category\"),\n", + " zaxis=dict(type=\"log\"),\n", + " annotations=[\n", + " dict(\n", + " showarrow=False,\n", + " x=\"2017-01-01\",\n", + " y=\"A\",\n", + " z=0,\n", + " text=\"Point 1\",\n", + " xanchor=\"left\",\n", + " xshift=10,\n", + " opacity=0.7),\n", + " dict(\n", + " x=\"2017-02-10\",\n", + " y=\"B\",\n", + " z=4,\n", + " text=\"Point 2\",\n", + " textangle=0,\n", + " ax=0,\n", + " ay=-75,\n", + " font=dict(\n", + " color=\"black\",\n", + " size=12\n", + " ),\n", + " arrowcolor=\"black\",\n", + " arrowsize=3,\n", + " arrowwidth=1,\n", + " arrowhead=1),\n", + " dict(\n", + " x=\"2017-03-20\",\n", + " y=\"C\",\n", + " z=5,\n", + " ax=50,\n", + " ay=0,\n", + " text=\"Point 3\",\n", + " arrowhead=1,\n", + " xanchor=\"left\",\n", + " yanchor=\"bottom\"\n", + " )]\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "46ef8f96", + "metadata": {}, + "source": [ + "### Font Color, Size, and Familiy\n", + "\n", + "Use `textfont` to specify a font `family`, `size`, or `color`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "953b20b3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[1, 1, 1],\n", + " mode=\"lines+markers+text\",\n", + " name=\"Lines, Markers and Text\",\n", + " text=[\"Text A\", \"Text B\", \"Text C\"],\n", + " textposition=\"top right\",\n", + " textfont=dict(\n", + " family=\"sans serif\",\n", + " size=18,\n", + " color=\"crimson\"\n", + " )\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2],\n", + " y=[2, 2, 2],\n", + " mode=\"lines+markers+text\",\n", + " name=\"Lines and Text\",\n", + " text=[\"Text G\", \"Text H\", \"Text I\"],\n", + " textposition=\"bottom center\",\n", + " textfont=dict(\n", + " family=\"sans serif\",\n", + " size=18,\n", + " color=\"LightSeaGreen\"\n", + " )\n", + "))\n", + "\n", + "fig.update_layout(showlegend=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b7eef9fe", + "metadata": {}, + "source": [ + "### Font Style, Variant, and Weight\n", + "\n", + "*New in 5.22*\n", + "\n", + "You can also configure a font's `variant`, `style`, and `weight` on `textfont`. Here, we configure an `italic` style on the first bar, `bold` weight on the second, and `small-caps` as the font variant on the third." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cca7c508", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.medals_wide()\n", + "\n", + "fig = go.Figure(\n", + " data=[\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.gold,\n", + " name=\"Gold\",\n", + " marker=dict(color=\"Gold\"),\n", + " text=\"Gold\",\n", + " textfont=dict(style=\"italic\"),\n", + " ),\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.silver,\n", + " name=\"Silver\",\n", + " marker=dict(color=\"MediumTurquoise\"),\n", + " text=\"Silver\",\n", + " textfont=dict(weight=\"bold\"),\n", + " ),\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.bronze,\n", + " name=\"Bronze\",\n", + " marker=dict(color=\"LightGreen\"),\n", + " text=\"Bronze\",\n", + " textfont=dict(variant=\"small-caps\"),\n", + " ),\n", + " ],\n", + " layout=dict(barcornerradius=15, showlegend=False),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "9ac5d358", + "metadata": {}, + "source": [ + "## Numeric Font Weight\n", + "\n", + "*New in 5.23*\n", + "\n", + "In the previous example, we set a font `weight` using a keyword value. You can also set font `weight` using a numeric value.\n", + "\n", + "The font weights that are available depend on the font family that is set. If you set a font `weight` that isn't available for a particular font family, the weight will be rounded to the nearest available value.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "508612d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.medals_wide()\n", + "\n", + "fig = go.Figure(\n", + " data=[\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.gold,\n", + " name=\"Gold\",\n", + " marker=dict(color=\"Gold\"),\n", + " text=\"Gold\",\n", + " textfont=dict(weight=900, size=17),\n", + " ),\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.silver,\n", + " name=\"Silver\",\n", + " marker=dict(color=\"MediumTurquoise\"),\n", + " text=\"Silver\",\n", + " textfont=dict(size=17),\n", + " ),\n", + " go.Bar(\n", + " x=df.nation,\n", + " y=df.bronze,\n", + " name=\"Bronze\",\n", + " marker=dict(color=\"LightGreen\"),\n", + " text=\"Bronze\",\n", + " textfont=dict(size=17),\n", + " ),\n", + " ],\n", + " layout=dict(barcornerradius=15, showlegend=False),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "909f9e10", + "metadata": {}, + "source": [ + "[scattergl](https://plotly.com/python/reference/scattergl) traces do not support all numeric font weights. When you specify a numeric font weight on `scattergl`, weights up to 500 are mapped to the keyword font weight \"normal\", while weights above 500 are mapped to \"bold\"." + ] + }, + { + "cell_type": "markdown", + "id": "82217035", + "metadata": {}, + "source": [ + "## Text Case\n", + "\n", + "*New in 5.23*\n", + "\n", + "You can configure text case using the `textfont.textcase` property. In this example, we set `textfont.textcase=\"upper\"` to transform the text on all bars to uppercase." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e5caa92b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.gapminder()\n", + "\n", + "grouped = df[df.year == 2007].loc[df[df.year == 2007].groupby('continent')['lifeExp'].idxmax()]\n", + "\n", + "fig = go.Figure(\n", + " data=go.Bar(\n", + " x=grouped['lifeExp'],\n", + " y=grouped['continent'],\n", + " text=grouped['country'],\n", + " orientation='h',\n", + " textfont=dict(\n", + " family=\"sans serif\",\n", + " size=14,\n", + " # Here we set textcase to \"upper.\n", + " # Set to lower\" for lowercase text, or \"word caps\" to capitalize the first letter of each word\n", + " textcase=\"upper\"\n", + "\n", + " )\n", + " ),\n", + " layout=go.Layout(\n", + " title_text='Country with Highest Life Expectancy per Continent, 2007',\n", + " yaxis=dict(showticklabels=False)\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "981dc2a1", + "metadata": {}, + "source": [ + "## Text Lines\n", + "\n", + "*New in 5.23*\n", + "\n", + "You can add decoration lines to text using the `textfont.lineposition` property. This property accepts `\"under\"`, `\"over\"`, and `\"through\"`, or a combination of these separated by a `+`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "726fb4f4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.gapminder()\n", + "\n", + "grouped = df[df.year == 2002].loc[df[df.year == 2002].groupby('continent')['lifeExp'].idxmax()]\n", + "\n", + "fig = go.Figure(\n", + " data=go.Bar(\n", + " x=grouped['lifeExp'],\n", + " y=grouped['continent'],\n", + " text=grouped['country'],\n", + " orientation='h',\n", + " marker_color='MediumSlateBlue',\n", + " textfont=dict(\n", + " lineposition=\"under\" # combine different line positions with a \"+\" to add more than one: \"under+over\"\n", + " )\n", + " ),\n", + " layout=go.Layout(\n", + " title_text='Country with Highest Life Expectancy per Continent, 2002',\n", + " yaxis=dict(showticklabels=False)\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0a7b4272", + "metadata": {}, + "source": [ + "## Text Shadow\n", + "\n", + "*New in 5.23*\n", + "\n", + "You can apply a shadow effect to text using the `textfont.shadow` property. This property accepts shadow specifications in the same format as the [text-shadow CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3a4d533e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly import data\n", + "\n", + "df = data.gapminder()\n", + "\n", + "grouped = df[df.year == 1997].loc[df[df.year == 1997].groupby('continent')['lifeExp'].idxmax()]\n", + "\n", + "fig = go.Figure(\n", + " data=go.Bar(\n", + " x=grouped['lifeExp'],\n", + " y=grouped['continent'],\n", + " text=grouped['country'],\n", + " orientation='h',\n", + " textfont=dict(\n", + " shadow=\"1px 1px 2px pink\"\n", + " )\n", + " ),\n", + " layout=go.Layout(\n", + " title_text='Country with Highest Life Expectancy per Continent, 1997',\n", + " yaxis=dict(showticklabels=False)\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "06e58499", + "metadata": {}, + "source": [ + "### Styling and Coloring Annotations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d774ad7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 1, 3, 2, 4, 3, 4, 6, 5]\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 4, 5, 1, 2, 2, 3, 4, 2]\n", + "))\n", + "\n", + "fig.add_annotation(\n", + " x=2,\n", + " y=5,\n", + " xref=\"x\",\n", + " yref=\"y\",\n", + " text=\"max=5\",\n", + " showarrow=True,\n", + " font=dict(\n", + " family=\"Courier New, monospace\",\n", + " size=16,\n", + " color=\"#ffffff\"\n", + " ),\n", + " align=\"center\",\n", + " arrowhead=2,\n", + " arrowsize=1,\n", + " arrowwidth=2,\n", + " arrowcolor=\"#636363\",\n", + " ax=20,\n", + " ay=-30,\n", + " bordercolor=\"#c7c7c7\",\n", + " borderwidth=2,\n", + " borderpad=4,\n", + " bgcolor=\"#ff7f0e\",\n", + " opacity=0.8\n", + " )\n", + "\n", + "fig.update_layout(showlegend=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3335fdcb", + "metadata": {}, + "source": [ + "### Text Font as an Array - Styling Each Text Element" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22222133", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scattergeo(\n", + " lat=[45.5, 43.4, 49.13, 51.1, 53.34, 45.24, 44.64, 48.25, 49.89, 50.45],\n", + " lon=[-73.57, -79.24, -123.06, -114.1, -113.28, -75.43, -63.57, -123.21, -97.13,\n", + " -104.6],\n", + " marker={\n", + " \"color\": [\"MidnightBlue\", \"IndianRed\", \"MediumPurple\", \"Orange\", \"Crimson\",\n", + " \"LightSeaGreen\", \"RoyalBlue\", \"LightSalmon\", \"DarkOrange\", \"MediumSlateBlue\"],\n", + " \"line\": {\n", + " \"width\": 1\n", + " },\n", + " \"size\": 10\n", + " },\n", + " mode=\"markers+text\",\n", + " name=\"\",\n", + " text=[\"Montreal\", \"Toronto\", \"Vancouver\", \"Calgary\", \"Edmonton\", \"Ottawa\",\n", + " \"Halifax\",\n", + " \"Victoria\", \"Winnipeg\", \"Regina\"],\n", + " textfont={\n", + " \"color\": [\"MidnightBlue\", \"IndianRed\", \"MediumPurple\", \"Gold\", \"Crimson\",\n", + " \"LightSeaGreen\",\n", + " \"RoyalBlue\", \"LightSalmon\", \"DarkOrange\", \"MediumSlateBlue\"],\n", + " \"family\": [\"Arial, sans-serif\", \"Balto, sans-serif\", \"Courier New, monospace\",\n", + " \"Droid Sans, sans-serif\", \"Droid Serif, serif\",\n", + " \"Droid Sans Mono, sans-serif\",\n", + " \"Gravitas One, cursive\", \"Old Standard TT, serif\",\n", + " \"Open Sans, sans-serif\",\n", + " \"PT Sans Narrow, sans-serif\", \"Raleway, sans-serif\",\n", + " \"Times New Roman, Times, serif\"],\n", + " \"size\": [22, 21, 20, 19, 18, 17, 16, 15, 14, 13]\n", + " },\n", + " textposition=[\"top center\", \"middle left\", \"top center\", \"bottom center\",\n", + " \"top right\",\n", + " \"middle left\", \"bottom right\", \"bottom left\", \"top right\",\n", + " \"top right\"]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " title_text=\"Canadian cities\",\n", + " geo=dict(\n", + " lataxis=dict(range=[40, 70]),\n", + " lonaxis=dict(range=[-130, -55]),\n", + " scope=\"north america\"\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f19a1a4c", + "metadata": {}, + "source": [ + "### HTML Tags in Text\n", + "\n", + "The `text` attribute supports the following HTML tags: `
`,``,``, ``, `` and ``.\n", + "In version 5.23 and later, `` and ``are also supported." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1df23796", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(\n", + " data=[\n", + " go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 1, 3, 2, 4, 3, 4, 6, 5],\n", + " mode=\"lines+markers\",\n", + " name=\"Series 1\",\n", + " ),\n", + " go.Scatter(\n", + " x=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", + " y=[0, 4, 5, 1, 2, 2, 3, 4, 2],\n", + " mode=\"lines+markers\",\n", + " name=\"Series 2\",\n", + " ),\n", + " ],\n", + " layout=go.Layout(\n", + " annotations=[\n", + " dict(\n", + " x=2,\n", + " y=5,\n", + " text=\"Text annotation using bolded text, italicized text, underlined text,
and a new line\",\n", + " showarrow=True,\n", + " arrowhead=1,\n", + " ),\n", + " dict(\n", + " x=4,\n", + " y=4,\n", + " text=\"Text annotation with
a link.\",\n", + " showarrow=False,\n", + " yshift=10,\n", + " ),\n", + " ],\n", + " showlegend=False,\n", + " ),\n", + ")\n", + "\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "beddfca3", + "metadata": {}, + "source": [ + "### Positioning Text Annotations Absolutely\n", + "\n", + "By default, text annotations have `xref` and `yref` set to `\"x\"` and `\"y\"`, respectively, meaning that their x/y coordinates are with respect to the axes of the plot. This means that panning the plot will cause the annotations to move. Setting `xref` and/or `yref` to `\"paper\"` will cause the `x` and `y` attributes to be interpreted in [paper coordinates](/python/figure-structure/#positioning-with-paper-container-coordinates-or-axis-domain-coordinates).\n", + "\n", + "Try panning or zooming in the following figure:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "855b216a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "fig = px.scatter(x=[1, 2, 3], y=[1, 2, 3], title=\"Try panning or zooming!\")\n", + "\n", + "fig.add_annotation(text=\"Absolutely-positioned annotation\",\n", + " xref=\"paper\", yref=\"paper\",\n", + " x=0.3, y=0.3, showarrow=False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8e7d0939", + "metadata": {}, + "source": [ + "### Adding Annotations Referenced to an Axis\n", + "\n", + "To place annotations relative to the length or height of an axis, the string\n", + "`' domain'` can be added after the axis reference in the `xref` or `yref` fields.\n", + "For example:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "941025d5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import plotly.graph_objects as go\n", + "\n", + "df = px.data.wind()\n", + "fig = px.scatter(df, y=\"frequency\")\n", + "\n", + "# Set a custom domain to see how the ' domain' string changes the behaviour\n", + "fig.update_layout(xaxis=dict(domain=[0, 0.5]), yaxis=dict(domain=[0.25, 0.75]))\n", + "\n", + "fig.add_annotation(\n", + " xref=\"x domain\",\n", + " yref=\"y domain\",\n", + " # The arrow head will be 25% along the x axis, starting from the left\n", + " x=0.25,\n", + " # The arrow head will be 40% along the y axis, starting from the bottom\n", + " y=0.4,\n", + " text=\"An annotation referencing the axes\",\n", + " arrowhead=2,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7a70a525", + "metadata": {}, + "source": [ + "### Specifying the Text's Position Absolutely\n", + "\n", + "The text coordinates / dimensions of the arrow can be specified absolutely, as\n", + "long as they use exactly the same coordinate system as the arrowhead. For\n", + "example:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ab8960bd", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import plotly.graph_objects as go\n", + "\n", + "df = px.data.wind()\n", + "fig = px.scatter(df, y=\"frequency\")\n", + "\n", + "fig.update_layout(xaxis=dict(domain=[0, 0.5]), yaxis=dict(domain=[0.25, 0.75]))\n", + "fig.add_annotation(\n", + " xref=\"x domain\",\n", + " yref=\"y\",\n", + " x=0.75,\n", + " y=1,\n", + " text=\"An annotation whose text and arrowhead reference the axes and the data\",\n", + " # If axref is exactly the same as xref, then the text's position is\n", + " # absolute and specified in the same coordinates as xref.\n", + " axref=\"x domain\",\n", + " # The same is the case for yref and ayref, but here the coordinates are data\n", + " # coordinates\n", + " ayref=\"y\",\n", + " ax=0.5,\n", + " ay=2,\n", + " arrowhead=2,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b6717e45", + "metadata": {}, + "source": [ + "### Specifying Source Lines or Figure Notes on the Bottom of a Figure\n", + "\n", + "This example shows how to add a note about the data source or interpretation at the bottom of the figure. This example aligns the note in the bottom right corner using the title element and container coordinates and then uses an annotation to add a figure title. A near zero container coordinate is an easy and robust way to put text -- such as a source line or figure note -- at the bottom of a figure. It is easier to specify the bottom of the figure in container coordinates than using paper coordinates, since uncertainty about the size of legends and x-axis labels make the paper coordinate of the bottom of the figure uncertain. Making the y container coordinate very slightly positive avoids cutting off the descending strokes of letters like y, p, and q. Only the title command supports container coordinates, so this example re-purposes the title element to insert the note and re-purposes an annotation element for the title. The top of the figure is typically less cluttered and more predictable than the bottom of the figure, so an annotation with its bottom at a paper y-coordinate slightly greater than 1 is a reasonable title location on many graphs." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "52447a02", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.iris()\n", + "\n", + "fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\",\n", + " size='petal_length', hover_data=['petal_width'])\n", + "\n", + "\n", + "fig.update_layout(\n", + " title=dict(text=\"Note: this is the Plotly title element.\",\n", + " # keeping this title string short avoids getting the text cut off in small windows\n", + " # if you need longer text, consider 1) embedding your graphic on a web page and\n", + " # putting the note in the HTML to use the browser's automated word wrap,\n", + " # 2) using this approach and also specifying a graph width that shows the whole title,\n", + " # or 3) using
tags to wrap the text onto multiple lines\n", + " yref=\"container\",\n", + " y=0.005,\n", + " # The \"paper\" x-coordinates lets us align this with either the right or left\n", + " # edge of the plot region.\n", + " # The code to align this flush with the right edge of the plot area is\n", + " # predictable and simple.\n", + " # Putting the title in the lower left corner, aligned with the left edge of the axis labeling would\n", + " # require graph specific coordinate adjustments.\n", + " xref=\"paper\",\n", + " xanchor=\"right\",\n", + " x=1,\n", + " font=dict(size=12)),\n", + " plot_bgcolor=\"white\",\n", + "\n", + " # We move the legend out of the right margin so the right-aligned note is\n", + " # flush with the right most element of the graph.\n", + " # Here we put the legend in a corner of the graph region\n", + " # because it has consistent coordinates at all screen resolutions.\n", + " legend=dict(\n", + " yanchor=\"top\",\n", + " y=1,\n", + " xanchor=\"right\",\n", + " x=1,\n", + " borderwidth=1)\n", + " )\n", + "\n", + "# Insert a title by repurposing an annotation\n", + "fig.add_annotation(\n", + " yref=\"paper\",\n", + " yanchor=\"bottom\",\n", + " y=1.025, # y = 1 is the top of the plot area; the top is typically uncluttered, so placing\n", + " # the bottom of the title slightly above the graph region works on a wide variety of graphs\n", + " text=\"This title is a Plotly annotation\",\n", + "\n", + " # Center the title horizontally over the plot area\n", + " xref=\"paper\",\n", + " xanchor=\"center\",\n", + " x=0.5,\n", + "\n", + " showarrow=False,\n", + " font=dict(size=18)\n", + " )\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6ee67d52", + "metadata": {}, + "source": [ + "### Customize Displayed Text with a Text Template\n", + "\n", + "To show an arbitrary text in your chart you can use [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate), which is a template string used for rendering the information, and will override [textinfo](https://plotly.com/python/reference/treemap/#treemap-textinfo).\n", + "This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format).\n", + "`texttemplate` customizes the text that appears on your plot vs. [hovertemplate](https://plotly.com/python/reference/pie/#pie-hovertemplate) that customizes the tooltip text." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8e9f6bb8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Pie(\n", + " values = [40000000, 20000000, 30000000, 10000000],\n", + " labels = [\"Wages\", \"Operating expenses\", \"Cost of sales\", \"Insurance\"],\n", + " texttemplate = \"%{label}: %{value:$,s}
(%{percent})\",\n", + " textposition = \"inside\"))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b97af598", + "metadata": {}, + "source": [ + "### Customize Text Template\n", + "\n", + "The following example uses [textfont](https://plotly.com/python/reference/scatterternary/#scatterternary-textfont) to customize the added text." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0b32d429", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatterternary(\n", + " a = [3, 2, 5],\n", + " b = [2, 5, 2],\n", + " c = [5, 2, 2],\n", + " mode = \"markers+text\",\n", + " text = [\"A\", \"B\", \"C\"],\n", + " texttemplate = \"%{text}
(%{a:.2f}, %{b:.2f}, %{c:.2f})\",\n", + " textposition = \"bottom center\",\n", + " textfont = {'family': \"Times\", 'size': [18, 21, 20], 'color': [\"IndianRed\", \"MediumPurple\", \"DarkOrange\"]}\n", + "))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c0bc7e3f", + "metadata": {}, + "source": [ + "### Set Date in Text Template\n", + "\n", + "The following example shows how to show date by setting [axis.type](https://plotly.com/python/reference/layout/yaxis/#layout-yaxis-type) in [funnel charts](https://plotly.com/python/funnel-charts/).\n", + "As you can see [textinfo](https://plotly.com/python/reference/funnel/#funnel-textinfo) and [texttemplate](https://plotly.com/python/reference/funnel/#funnel-texttemplate) have the same functionality when you want to determine 'just' the trace information on the graph." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "423a694b", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly import graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Funnel(\n", + " name = 'Montreal',\n", + " orientation = \"h\",\n", + " y = [\"2018-01-01\", \"2018-07-01\", \"2019-01-01\", \"2020-01-01\"],\n", + " x = [100, 60, 40, 20],\n", + " textposition = \"inside\",\n", + " texttemplate = \"%{y| %a. %_d %b %Y}\"))\n", + "\n", + "fig.add_trace(go.Funnel(\n", + " name = 'Vancouver',\n", + " orientation = \"h\",\n", + " y = [\"2018-01-01\", \"2018-07-01\", \"2019-01-01\", \"2020-01-01\"],\n", + " x = [90, 70, 50, 10],\n", + " textposition = \"inside\",\n", + " textinfo = \"label\"))\n", + "\n", + "fig.update_layout(yaxis = {'type': 'date'})\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "937d1144", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See https://plotly.com/python/reference/layout/annotations/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "16b1e58d", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.14" + }, + "plotly": { + "description": "How to add text labels and annotations to plots in python.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Text and Annotations", + "order": 22, + "permalink": "python/text-and-annotations/", + "thumbnail": "thumbnail/text-and-annotations.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tick-formatting.ipynb b/tick-formatting.ipynb new file mode 100644 index 000000000..e328eb75c --- /dev/null +++ b/tick-formatting.ipynb @@ -0,0 +1,377 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "325aca83", + "metadata": {}, + "source": [ + "#### Tickmode - Linear" + ] + }, + { + "cell_type": "markdown", + "id": "5e944c7a", + "metadata": {}, + "source": [ + "If `\"linear\"`, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d9509e1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n", + " y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " xaxis = dict(\n", + " tickmode = 'linear',\n", + " tick0 = 0.5,\n", + " dtick = 0.75\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9174d615", + "metadata": {}, + "source": [ + "#### Tickmode - Array" + ] + }, + { + "cell_type": "markdown", + "id": "c50ccdcd", + "metadata": {}, + "source": [ + "If `\"array\"`, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d941043a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n", + " y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " xaxis = dict(\n", + " tickmode = 'array',\n", + " tickvals = [1, 3, 5, 7, 9, 11],\n", + " ticktext = ['One', 'Three', 'Five', 'Seven', 'Nine', 'Eleven']\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5e8241c9", + "metadata": {}, + "source": [ + "### Dynamic tickmode in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dfcf5a90", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'tick-formatting', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "23d81130", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "e9bba9a7", + "metadata": {}, + "source": [ + "#### Using Tickformat Attribute" + ] + }, + { + "cell_type": "markdown", + "id": "ccbf19c6", + "metadata": {}, + "source": [ + "For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8470b950", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n", + " y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]\n", + "))\n", + "\n", + "fig.update_layout(yaxis_tickformat = '%')\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "21ce562e", + "metadata": {}, + "source": [ + "#### Using Tickformat Attribute - Date/Time" + ] + }, + { + "cell_type": "markdown", + "id": "56a445f5", + "metadata": {}, + "source": [ + "For more date/time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cb2dfd1d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = df['Date'],\n", + " y = df['AAPL.High'],\n", + "))\n", + "\n", + "fig.update_layout(\n", + " title = 'Time Series with Custom Date-Time Format',\n", + " xaxis_tickformat = '%d %B (%a)
%Y'\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "36fc1bde", + "metadata": {}, + "source": [ + "#### Using Exponentformat Attribute" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8cdea3af", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n", + " y = [68000, 52000, 60000, 20000, 95000, 40000, 60000, 79000, 74000, 42000, 20000, 90000]\n", + "))\n", + "\n", + "fig.update_layout(\n", + " yaxis = dict(\n", + " showexponent = 'all',\n", + " exponentformat = 'e'\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3c615096", + "metadata": {}, + "source": [ + "#### Tickformatstops to customize for different zoom levels" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "867d07f5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = df['Date'],\n", + " y = df['mavg']\n", + "))\n", + "\n", + "fig.update_layout(\n", + " xaxis_tickformatstops = [\n", + " dict(dtickrange=[None, 1000], value=\"%H:%M:%S.%L ms\"),\n", + " dict(dtickrange=[1000, 60000], value=\"%H:%M:%S s\"),\n", + " dict(dtickrange=[60000, 3600000], value=\"%H:%M m\"),\n", + " dict(dtickrange=[3600000, 86400000], value=\"%H:%M h\"),\n", + " dict(dtickrange=[86400000, 604800000], value=\"%e. %b d\"),\n", + " dict(dtickrange=[604800000, \"M1\"], value=\"%e. %b w\"),\n", + " dict(dtickrange=[\"M1\", \"M12\"], value=\"%b '%y M\"),\n", + " dict(dtickrange=[\"M12\", None], value=\"%Y Y\")\n", + " ]\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c897b661", + "metadata": {}, + "source": [ + "#### Placing ticks and gridlines between categories" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b5960f21", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Bar(\n", + " x = [\"apples\", \"oranges\", \"pears\"],\n", + " y = [1, 2, 3]\n", + "))\n", + "\n", + "fig.update_xaxes(\n", + " showgrid=True,\n", + " ticks=\"outside\",\n", + " tickson=\"boundaries\",\n", + " ticklen=20\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c56e2eaf", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/layout/xaxis/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "e5d59043", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to format axes ticks in Python with Plotly.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Formatting Ticks", + "order": 12, + "permalink": "python/tick-formatting/", + "thumbnail": "thumbnail/tick-formatting.gif" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tile-county-choropleth.ipynb b/tile-county-choropleth.ipynb new file mode 100644 index 000000000..7f078e8e9 --- /dev/null +++ b/tile-county-choropleth.ipynb @@ -0,0 +1,424 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6b8e7f97", + "metadata": {}, + "source": [ + "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **tile-map** choropleth maps, but you can also build [**outline** choropleth maps](/python/choropleth-maps).\n", + "\n", + "Below we show how to create Choropleth Maps using either Plotly Express' `px.choropleth_map` function or the lower-level `go.Choroplethmap` graph object.\n", + "\n", + "### Introduction: main parameters for choropleth tile maps\n", + "\n", + "Making choropleth maps requires two main types of input:\n", + "\n", + "1. GeoJSON-formatted geometry information where each feature has either an `id` field or some identifying value in `properties`.\n", + "2. A list of values indexed by feature identifier.\n", + "\n", + "The GeoJSON data is passed to the `geojson` argument, and the data is passed into the `color` argument of `px.choropleth_map` (`z` if using `graph_objects`), in the same order as the IDs are passed into the `location` argument.\n", + "\n", + "**Note** the `geojson` attribute can also be the URL to a GeoJSON file, which can speed up map rendering in certain cases.\n", + "\n", + "#### GeoJSON with `feature.id`\n", + "\n", + "Here we load a GeoJSON file containing the geometry information for US counties, where `feature.id` is a [FIPS code](https://en.wikipedia.org/wiki/FIPS_county_code)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8504b243", + "metadata": {}, + "outputs": [], + "source": [ + "from urllib.request import urlopen\n", + "import json\n", + "with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:\n", + " counties = json.load(response)\n", + "\n", + "counties[\"features\"][0]" + ] + }, + { + "cell_type": "markdown", + "id": "dfbb6a4e", + "metadata": {}, + "source": [ + "#### Data indexed by `id`\n", + "\n", + "Here we load unemployment data by county, also indexed by [FIPS code](https://en.wikipedia.org/wiki/FIPS_county_code)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fb70a214", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv\",\n", + " dtype={\"fips\": str})\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "3e7d7e53", + "metadata": {}, + "source": [ + "### Choropleth map using plotly.express and carto base map\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "With `px.choropleth_map`, each row of the DataFrame is represented as a region of the choropleth." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a59382bf", + "metadata": {}, + "outputs": [], + "source": [ + "from urllib.request import urlopen\n", + "import json\n", + "with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:\n", + " counties = json.load(response)\n", + "\n", + "import pandas as pd\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv\",\n", + " dtype={\"fips\": str})\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.choropleth_map(df, geojson=counties, locations='fips', color='unemp',\n", + " color_continuous_scale=\"Viridis\",\n", + " range_color=(0, 12),\n", + " map_style=\"carto-positron\",\n", + " zoom=3, center = {\"lat\": 37.0902, \"lon\": -95.7129},\n", + " opacity=0.5,\n", + " labels={'unemp':'unemployment rate'}\n", + " )\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a885359c", + "metadata": {}, + "source": [ + "### Choropleth maps in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "79543dc2", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'mapbox-county-choropleth', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "aabca4a6", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "6f3385de", + "metadata": {}, + "source": [ + "### Indexing by GeoJSON Properties\n", + "\n", + "If the GeoJSON you are using either does not have an `id` field or you wish to use one of the keys in the `properties` field, you may use the `featureidkey` parameter to specify where to match the values of `locations`.\n", + "\n", + "In the following GeoJSON object/data-file pairing, the values of `properties.district` match the values of the `district` column:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "06e86383", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.election()\n", + "geojson = px.data.election_geojson()\n", + "\n", + "print(df[\"district\"][2])\n", + "print(geojson[\"features\"][0][\"properties\"])" + ] + }, + { + "cell_type": "markdown", + "id": "f417be92", + "metadata": {}, + "source": [ + "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2355dfef", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.election()\n", + "geojson = px.data.election_geojson()\n", + "\n", + "fig = px.choropleth_map(df, geojson=geojson, color=\"Bergeron\",\n", + " locations=\"district\", featureidkey=\"properties.district\",\n", + " center={\"lat\": 45.5517, \"lon\": -73.7073},\n", + " map_style=\"carto-positron\", zoom=9)\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1e971476", + "metadata": {}, + "source": [ + "### Discrete Colors\n", + "\n", + "In addition to [continuous colors](/python/colorscales/), we can [discretely-color](/python/discrete-color/) our choropleth maps by setting `color` to a non-numerical column, like the name of the winner of an election." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c018281e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.election()\n", + "geojson = px.data.election_geojson()\n", + "\n", + "fig = px.choropleth_map(df, geojson=geojson, color=\"winner\",\n", + " locations=\"district\", featureidkey=\"properties.district\",\n", + " center={\"lat\": 45.5517, \"lon\": -73.7073},\n", + " map_style=\"carto-positron\", zoom=9)\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8880787f", + "metadata": {}, + "source": [ + "### Using GeoPandas Data Frames\n", + "\n", + "`px.choropleth_map` accepts the `geometry` of a [GeoPandas](https://geopandas.org/) data frame as the input to `geojson` if the `geometry` contains polygons." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22e7c212", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import geopandas as gpd\n", + "\n", + "df = px.data.election()\n", + "geo_df = gpd.GeoDataFrame.from_features(\n", + " px.data.election_geojson()[\"features\"]\n", + ").merge(df, on=\"district\").set_index(\"district\")\n", + "\n", + "fig = px.choropleth_map(geo_df,\n", + " geojson=geo_df.geometry,\n", + " locations=geo_df.index,\n", + " color=\"Joly\",\n", + " center={\"lat\": 45.5517, \"lon\": -73.7073},\n", + " map_style=\"open-street-map\",\n", + " zoom=8.5)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f3cf889a", + "metadata": {}, + "source": [ + "### Choropleth map using plotly.graph_objects and carto base map\n", + "\n", + "If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Choroplethmap` class from `plotly.graph_objects`](/python/graph-objects/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "48e6ceed", + "metadata": {}, + "outputs": [], + "source": [ + "from urllib.request import urlopen\n", + "import json\n", + "with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:\n", + " counties = json.load(response)\n", + "\n", + "import pandas as pd\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv\",\n", + " dtype={\"fips\": str})\n", + "\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Choroplethmap(geojson=counties, locations=df.fips, z=df.unemp,\n", + " colorscale=\"Viridis\", zmin=0, zmax=12,\n", + " marker_opacity=0.5, marker_line_width=0))\n", + "fig.update_layout(map_style=\"carto-positron\",\n", + " map_zoom=3, map_center = {\"lat\": 37.0902, \"lon\": -95.7129})\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d9cd953c", + "metadata": {}, + "source": [ + "### Mapbox Maps\n", + "\n", + "> Mapbox traces are deprecated and may be removed in a future version of Plotly.py.\n", + "\n", + "The earlier examples using `px.choropleth_map` and `go.Choroplethmap` use [Maplibre](https://maplibre.org/maplibre-gl-js/docs/) for rendering. These traces were introduced in Plotly.py 5.24 and are now the recommended way to create tile-based choropleth maps. There are also choropleth traces that use [Mapbox](https://docs.mapbox.com): `px.choropleth_mapbox` and `go.Choroplethmapbox`\n", + "\n", + "To plot on Mapbox maps with Plotly you _may_ need a Mapbox account and a public [Mapbox Access Token](https://www.mapbox.com/studio). See our [Mapbox Map Layers](/python/mapbox-layers/) documentation for more information.\n", + "\n", + "Here's an example of using the Mapbox Light base map, which requires a free token." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "589097d1", + "metadata": {}, + "outputs": [], + "source": [ + "token = open(\".mapbox_token\").read() # you will need your own token\n", + "\n", + "from urllib.request import urlopen\n", + "import json\n", + "with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:\n", + " counties = json.load(response)\n", + "\n", + "import pandas as pd\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv\",\n", + " dtype={\"fips\": str})\n", + "\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Choroplethmapbox(geojson=counties, locations=df.fips, z=df.unemp,\n", + " colorscale=\"Viridis\", zmin=0, zmax=12, marker_line_width=0))\n", + "fig.update_layout(mapbox_style=\"light\", mapbox_accesstoken=token,\n", + " mapbox_zoom=3, mapbox_center = {\"lat\": 37.0902, \"lon\": -95.7129})\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9427c52b", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.choropleth_map`](https://plotly.com/python-api-reference/generated/plotly.express.choropleth_map) or https://plotly.com/python/reference/choroplethmap/ for more information about the attributes available.\n", + "\n", + "For (deprecated) Mapbox-based tile maps, see [function reference for `px.choropleth_mapbox`](https://plotly.com/python-api-reference/generated/plotly.express.choropleth_mapbox) or https://plotly.com/python/reference/choroplethmapbox/.\n" + ] + }, + { + "cell_type": "markdown", + "id": "837a5064", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.0" + }, + "plotly": { + "description": "How to make tile choropleth maps in Python with Plotly.", + "display_as": "maps", + "language": "python", + "layout": "base", + "name": "Tile Choropleth Maps", + "order": 2, + "page_type": "example_index", + "permalink": "python/tile-county-choropleth/", + "redirect_from": "python/mapbox-county-choropleth/", + "thumbnail": "thumbnail/mapbox-choropleth.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tile-map-layers.ipynb b/tile-map-layers.ipynb new file mode 100644 index 000000000..a9c7d72b0 --- /dev/null +++ b/tile-map-layers.ipynb @@ -0,0 +1,496 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "808f2c1c", + "metadata": {}, + "source": [ + "\n", + "## Tile Maps vs Outline Maps\n", + "\n", + "Plotly supports two different kinds of maps:\n", + "\n", + "- **[Tile-based maps](https://en.wikipedia.org/wiki/Tiled_web_map)**\n", + "\n", + "If your figure is created with a `px.scatter_map`, `px.scatter_mapbox`, `px.line_map`, `px.line_mapbox`, `px.choropleth_map`, `px.choropleth_mapbox`, `px.density_map`, or `px.density_mapbox` function or otherwise contains one or more traces of type `go.Scattermap`, `go.Scattermapbox`, `go.Choroplethmap`, `go.Choroplethmapbox`, `go.Densitymap`, or `go.Densitymapbox`, the `layout.map` or `layout.mapbox` object in your figure contains configuration information for the map itself.\n", + "\n", + "- **Outline-based maps**\n", + "\n", + "Geo maps are outline-based maps. If your figure is created with a `px.scatter_geo`, `px.line_geo` or `px.choropleth` function or otherwise contains one or more traces of type `go.Scattergeo` or `go.Choropleth`, the `layout.geo` object in your figure contains configuration information for the map itself.\n", + "\n", + "> This page documents tile-based maps, and the [Geo map documentation](/python/map-configuration/) describes how to configure outline-based maps.\n", + "\n", + "## Tile Map Renderers\n", + "\n", + "Tile-based traces in Plotly use Maplibre or Mapbox.\n", + "\n", + "Maplibre-based traces (new in 5.24) are ones generated in Plotly Express using `px.scatter_map`, `px.line_map`, `px.choropleth_map`, `px.density_map`, or Graph Objects using `go.Scattermap`, `go.Choroplethmap`, or `go.Densitymap`.\n", + "\n", + "Mapbox-based traces are suffixed with `mapbox`, for example `go.Scattermapbox`. These are deprecated as of version 5.24 and we recommend using the Maplibre-based traces.\n", + "\n", + "### Maplibre\n", + "\n", + "*New in 5.24*\n", + "\n", + "Maplibre-based tile maps have three different types of layers:\n", + "\n", + "- `layout.map.style` defines the lowest layers of the map, also known as the \"base map\".\n", + "- The various traces in `data` are by default rendered above the base map (although this can be controlled via the `below` attribute).\n", + "- `layout.map.layers` is an array that defines more layers that are by default rendered above the traces in `data` (although this can also be controlled via the `below` attribute.\n", + "\n", + "\n", + "#### Base Maps in `layout.map.style`.\n", + "\n", + "The accepted values for `layout.map.style` are one of:\n", + "\n", + "- \"basic\"\n", + "- \"carto-darkmatter\"\n", + "- \"carto-darkmatter-nolabels\"\n", + "- \"carto-positron\"\n", + "- \"carto-positron-nolabels\"\n", + "- \"carto-voyager\"\n", + "- \"carto-voyager-nolabels\"\n", + "- \"dark\"\n", + "- \"light\"\n", + "- \"open-street-map\"\n", + "- \"outdoors\"\n", + "- \"satellite\"\n", + "- \"satellite-streets\"\n", + "- \"streets\"\n", + "- \"white-bg\" - an empty white canvas which results in no external HTTP requests\n", + "\n", + "- A custom style URL. For example: https://tiles.stadiamaps.com/styles/stamen_watercolor.json?api_key=YOUR-API-KEY\n", + "\n", + "- A Map Style object as defined at https://maplibre.org/maplibre-style-spec/\n", + "\n", + "\n", + "#### OpenStreetMap tiles\n", + "\n", + "Here is a simple map rendered with OpenStreetMaps tiles." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b4064d0e", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_map(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(map_style=\"open-street-map\")\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "4470b36a", + "metadata": {}, + "source": [ + "#### Using `layout.map.layers` to Specify a Base Map\n", + "\n", + "If you have access to your own private tile servers, or wish to use a tile server not included in the list above, the recommended approach is to set `layout.map.style` to `\"white-bg\"` and to use `layout.map.layers` with `below` to specify a custom base map.\n", + "\n", + "> If you omit the `below` attribute when using this approach, your data will likely be hidden by fully-opaque raster tiles!\n", + "\n", + "#### Base Tiles from the USGS: no token needed\n", + "\n", + "Here is an example of a map which uses a public USGS imagery map, specified in `layout.map.layers`, and which is rendered _below_ the `data` layer." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "269de45b", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_map(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(\n", + " map_style=\"white-bg\",\n", + " map_layers=[\n", + " {\n", + " \"below\": 'traces',\n", + " \"sourcetype\": \"raster\",\n", + " \"sourceattribution\": \"United States Geological Survey\",\n", + " \"source\": [\n", + " \"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}\"\n", + " ]\n", + " }\n", + " ])\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5037bbe0", + "metadata": {}, + "source": [ + "#### Base Tiles from the USGS, radar overlay from Environment Canada\n", + "\n", + "Here is the same example, with in addition, a WMS layer from Environment Canada which displays near-real-time radar imagery in partly-transparent raster tiles, rendered above the `go.Scattermap` trace, as is the default:\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2dea5098", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_map(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(\n", + " map_style=\"white-bg\",\n", + " map_layers=[\n", + " {\n", + " \"below\": 'traces',\n", + " \"sourcetype\": \"raster\",\n", + " \"sourceattribution\": \"United States Geological Survey\",\n", + " \"source\": [\n", + " \"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}\"\n", + " ]\n", + " },\n", + " {\n", + " \"sourcetype\": \"raster\",\n", + " \"sourceattribution\": \"Government of Canada\",\n", + " \"source\": [\"https://geo.weather.gc.ca/geomet/?\"\n", + " \"SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX={bbox-epsg-3857}&CRS=EPSG:3857\"\n", + " \"&WIDTH=1000&HEIGHT=1000&LAYERS=RADAR_1KM_RDBR&TILED=true&FORMAT=image/png\"],\n", + " }\n", + " ])\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d23e306b", + "metadata": {}, + "source": [ + "#### Dark tiles example\n", + "\n", + "Here is a map rendered with the `\"dark\"` style." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bae996a4", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_map(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(map_style=\"dark\")\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "246e6adc", + "metadata": {}, + "source": [ + "#### Stamen Watercolor using a Custom Style URL\n", + "\n", + "Here's an example of using a custom style URL that points to the [Stadia Maps](https://docs.stadiamaps.com/map-styles/stamen-watercolor) service to use the `stamen_watercolor` base map.\n", + "\n", + "```python\n", + "import pandas as pd\n", + "quakes = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv')\n", + "\n", + "import plotly.graph_objects as go\n", + "fig = go.Figure(go.Densitymap(lat=quakes.Latitude, lon=quakes.Longitude, z=quakes.Magnitude,\n", + " radius=10))\n", + "fig.update_layout(map_style=\"https://tiles.stadiamaps.com/styles/stamen_watercolor.json?api_key=YOUR-API-KEY\", map_center_lon=180)\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "4e7389b0", + "metadata": {}, + "source": [ + "### Mapbox\n", + "\n", + "> Mapbox traces are deprecated and may be removed in a future version of Plotly.py.\n", + "\n", + "#### How Layers Work in Mapbox Tile Maps\n", + "\n", + "Mapbox tile maps are composed of various layers, of three different types:\n", + "\n", + "1. `layout.mapbox.style` defines the lowest layers, also known as your \"base map\"\n", + "2. The various traces in `data` are by default rendered above the base map (although this can be controlled via the `below` attribute).\n", + "3. `layout.mapbox.layers` is an array that defines more layers that are by default rendered above the traces in `data` (although this can also be controlled via the `below` attribute).\n", + "\n", + "#### Mapbox Access Tokens and When You Need Them\n", + "\n", + "The word \"mapbox\" in the trace names and `layout.mapbox` refers to the Mapbox GL JS open-source library, which is integrated into Plotly.py.\n", + "\n", + "If your basemap in `layout.mapbox.style` uses data from the Mapbox _service_, then you will need to register for a free account at https://mapbox.com/ and obtain a Mapbox Access token. This token should be provided in `layout.mapbox.access_token` (or, if using Plotly Express, via the `px.set_mapbox_access_token()` configuration function).\n", + "\n", + "If you basemap in `layout.mapbox.style` uses maps from the [Stadia Maps service](https://www.stadiamaps.com) (see below for details), you'll need to register for a Stadia Maps account and token.\n", + "\n", + "\n", + "#### Base Maps in `layout.mapbox.style`\n", + "\n", + "The accepted values for `layout.mapbox.style` are one of:\n", + "\n", + "- `\"white-bg\"` yields an empty white canvas which results in no external HTTP requests\n", + "- `\"open-street-map\"`, `\"carto-positron\"`, and `\"carto-darkmatter\"` yield maps composed of _raster_ tiles from various public tile servers which do not require signups or access tokens.\n", + "- `\"basic\"`, `\"streets\"`, `\"outdoors\"`, `\"light\"`, `\"dark\"`, `\"satellite\"`, or `\"satellite-streets\"` yield maps composed of _vector_ tiles from the Mapbox service, and _do_ require a Mapbox Access Token or an on-premise Mapbox installation.\n", + "- `\"stamen-terrain\"`, `\"stamen-toner\"` or `\"stamen-watercolor\"` yield maps composed of _raster_ tiles from the [Stadia Maps service](https://www.stadiamaps.com), and require a Stadia Maps account and token.\n", + "- A Mapbox service style URL, which requires a Mapbox Access Token or an on-premise Mapbox installation.\n", + "- A Mapbox Style object as defined at https://docs.mapbox.com/mapbox-gl-js/style-spec/\n", + "\n", + "#### OpenStreetMap tiles: no token needed\n", + "\n", + "Here is a simple map rendered with OpenStreetMaps tiles, without needing a Mapbox Access Token:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e7b6c7a7", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_mapbox(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(mapbox_style=\"open-street-map\")\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "39c0a43f", + "metadata": {}, + "source": [ + "#### Using `layout.mapbox.layers` to Specify a Base Map\n", + "\n", + "If you have access to your own private tile servers, or wish to use a tile server not included in the list above, the recommended approach is to set `layout.mapbox.style` to `\"white-bg\"` and to use `layout.mapbox.layers` with `below` to specify a custom base map.\n", + "\n", + "> If you omit the `below` attribute when using this approach, your data will likely be hidden by fully-opaque raster tiles!\n", + "\n", + "#### Base Tiles from the USGS: no token needed\n", + "\n", + "Here is an example of a map which uses a public USGS imagery map, specified in `layout.mapbox.layers`, and which is rendered _below_ the `data` layer.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec3138b6", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_mapbox(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(\n", + " mapbox_style=\"white-bg\",\n", + " mapbox_layers=[\n", + " {\n", + " \"below\": 'traces',\n", + " \"sourcetype\": \"raster\",\n", + " \"sourceattribution\": \"United States Geological Survey\",\n", + " \"source\": [\n", + " \"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}\"\n", + " ]\n", + " }\n", + " ])\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "849a31a6", + "metadata": {}, + "source": [ + "#### Dark tiles from Mapbox service: free token needed\n", + "\n", + "Here is a map rendered with the `\"dark\"` style from the Mapbox service, which requires an Access Token:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bce1fa34", + "metadata": {}, + "outputs": [], + "source": [ + "token = open(\".mapbox_token\").read() # you will need your own token\n", + "\n", + "import pandas as pd\n", + "us_cities = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\")\n", + "\n", + "import plotly.express as px\n", + "\n", + "fig = px.scatter_mapbox(us_cities, lat=\"lat\", lon=\"lon\", hover_name=\"City\", hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"], zoom=3, height=300)\n", + "fig.update_layout(mapbox_style=\"dark\", mapbox_accesstoken=token)\n", + "fig.update_layout(margin={\"r\":0,\"t\":0,\"l\":0,\"b\":0})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "630cc11f", + "metadata": {}, + "source": [ + "## Setting Map Bounds\n", + "\n", + "*New in 5.11*\n", + "\n", + "Set bounds for a map to specify an area outside which a user interacting with the map can't pan or zoom. Here we set a maximum longitude of `-180`, a minimum longitude of `-50`, a maximum latitude of `90`, and a minimum latitude of `20`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa02f160", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "us_cities = pd.read_csv(\n", + " \"https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv\"\n", + ")\n", + "\n", + "fig = px.scatter_map(\n", + " us_cities,\n", + " lat=\"lat\",\n", + " lon=\"lon\",\n", + " hover_name=\"City\",\n", + " hover_data=[\"State\", \"Population\"],\n", + " color_discrete_sequence=[\"fuchsia\"],\n", + " zoom=3,\n", + " height=300,\n", + ")\n", + "fig.update_layout(map_style=\"open-street-map\")\n", + "fig.update_layout(margin={\"r\": 0, \"t\": 0, \"l\": 0, \"b\": 0})\n", + "fig.update_layout(map_bounds={\"west\": -180, \"east\": -50, \"south\": 20, \"north\": 90})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2b5d3f19", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See https://plotly.com/python/reference/layout/map/ for more information and options on Maplibre-based tile maps and https://plotly.com/python/reference/layout/mapbox/ for Mapbox-based tile maps.\n" + ] + }, + { + "cell_type": "markdown", + "id": "e8547f07", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.0" + }, + "plotly": { + "description": "How to make tile-based maps in Python with various base layers.", + "display_as": "maps", + "language": "python", + "layout": "base", + "name": "Tile Map Layers", + "order": 9, + "page_type": "u-guide", + "permalink": "python/tile-map-layers/", + "redirect_from": "python/mapbox-layers/", + "thumbnail": "thumbnail/mapbox-layers.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tile-scatter-maps.ipynb b/tile-scatter-maps.ipynb new file mode 100644 index 000000000..235f8f7eb --- /dev/null +++ b/tile-scatter-maps.ipynb @@ -0,0 +1,562 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0a1a8675", + "metadata": {}, + "source": [ + "### Basic example with Plotly Express\n", + "\n", + "Here we show the [Plotly Express](/python/plotly-express/) function `px.scatter_map` for a scatter plot on a tile map.\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "977db984", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.carshare()\n", + "fig = px.scatter_map(df, lat=\"centroid_lat\", lon=\"centroid_lon\", color=\"peak_hour\", size=\"car_hours\",\n", + " color_continuous_scale=px.colors.cyclical.IceFire, size_max=15, zoom=10)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d171d3e3", + "metadata": {}, + "source": [ + "### Basic Example with GeoPandas\n", + "\n", + "`px.scatter_map` can work well with [GeoPandas](https://geopandas.org/) dataframes whose `geometry` is of type `Point`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09b34359", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import geopandas as gpd\n", + "\n", + "geo_df = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))\n", + "\n", + "fig = px.scatter_map(geo_df,\n", + " lat=geo_df.geometry.y,\n", + " lon=geo_df.geometry.x,\n", + " hover_name=\"name\",\n", + " zoom=1)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "26c288a9", + "metadata": {}, + "source": [ + "#### Basic Example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "82dafbd5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattermap(\n", + " lat=['45.5017'],\n", + " lon=['-73.5673'],\n", + " mode='markers',\n", + " marker=go.scattermap.Marker(\n", + " size=14\n", + " ),\n", + " text=['Montreal'],\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " hovermode='closest',\n", + " map=dict(\n", + " bearing=0,\n", + " center=go.layout.map.Center(\n", + " lat=45,\n", + " lon=-73\n", + " ),\n", + " pitch=0,\n", + " zoom=5\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e7a52687", + "metadata": {}, + "source": [ + "#### Multiple Markers" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "02d9f33d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattermap(\n", + " lat=['38.91427','38.91538','38.91458',\n", + " '38.92239','38.93222','38.90842',\n", + " '38.91931','38.93260','38.91368',\n", + " '38.88516','38.921894','38.93206',\n", + " '38.91275'],\n", + " lon=['-77.02827','-77.02013','-77.03155',\n", + " '-77.04227','-77.02854','-77.02419',\n", + " '-77.02518','-77.03304','-77.04509',\n", + " '-76.99656','-77.042438','-77.02821',\n", + " '-77.01239'],\n", + " mode='markers',\n", + " marker=go.scattermap.Marker(\n", + " size=9\n", + " ),\n", + " text=[\"The coffee bar\",\"Bistro Bohem\",\"Black Cat\",\n", + " \"Snap\",\"Columbia Heights Coffee\",\"Azi's Cafe\",\n", + " \"Blind Dog Cafe\",\"Le Caprice\",\"Filter\",\n", + " \"Peregrine\",\"Tryst\",\"The Coupe\",\n", + " \"Big Bear Cafe\"],\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " autosize=True,\n", + " hovermode='closest',\n", + " map=dict(\n", + " bearing=0,\n", + " center=dict(\n", + " lat=38.92,\n", + " lon=-77.07\n", + " ),\n", + " pitch=0,\n", + " zoom=10\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3c73c840", + "metadata": {}, + "source": [ + "#### Nuclear Waste Sites on Campuses" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f843f1d3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/Nuclear%20Waste%20Sites%20on%20American%20Campuses.csv')\n", + "site_lat = df.lat\n", + "site_lon = df.lon\n", + "locations_name = df.text\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Scattermap(\n", + " lat=site_lat,\n", + " lon=site_lon,\n", + " mode='markers',\n", + " marker=go.scattermap.Marker(\n", + " size=17,\n", + " color='rgb(255, 0, 0)',\n", + " opacity=0.7\n", + " ),\n", + " text=locations_name,\n", + " hoverinfo='text'\n", + " ))\n", + "\n", + "fig.add_trace(go.Scattermap(\n", + " lat=site_lat,\n", + " lon=site_lon,\n", + " mode='markers',\n", + " marker=go.scattermap.Marker(\n", + " size=8,\n", + " color='rgb(242, 177, 172)',\n", + " opacity=0.7\n", + " ),\n", + " hoverinfo='none'\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " title=dict(text='Nuclear Waste Sites on Campus'),\n", + " autosize=True,\n", + " hovermode='closest',\n", + " showlegend=False,\n", + " map=dict(\n", + " bearing=0,\n", + " center=dict(\n", + " lat=38,\n", + " lon=-94\n", + " ),\n", + " pitch=0,\n", + " zoom=3,\n", + " style='light'\n", + " ),\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5656cae2", + "metadata": {}, + "source": [ + "### Set Marker Symbols\n", + "\n", + "You can define the symbol on your map by setting [`symbol`](https://plotly.com/python/reference/scattermap/#scattermap-marker-symbol) attribute." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eb32d1de", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattermap(\n", + " mode = \"markers+text+lines\",\n", + " lon = [-75, -80, -50], lat = [45, 20, -20],\n", + " marker = {'size': 20, 'symbol': [\"bus\", \"harbor\", \"airport\"]},\n", + " text = [\"Bus\", \"Harbor\", \"airport\"],textposition = \"bottom right\"))\n", + "\n", + "fig.update_layout(\n", + " map = {\n", + " 'style': \"outdoors\", 'zoom': 0.7},\n", + " showlegend = False)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "47320202", + "metadata": {}, + "source": [ + "#### Supported Symbols\n", + "\n", + "Plotly uses [Maki v2.1.0](https://app.unpkg.com/maki@2.1.0/files/icons) for symbols and supports the following values for `symbol`:\n", + "\n", + "\"aerialway\", \"airfield\", \"airport\", \"alcohol-shop\", \"america-football\", \n", + "\"amusement-park\", \"aquarium\", \"art-gallery\", \"attraction\", \"bakery\",\n", + "\"bank\", \"bar\", \"baseball\", \"basketball\", \"beer\", \"bicycle\", \"bicycle-share\",\n", + "\"blood-bank\", \"buddhism\", \"building\", \"bus\", \"cafe\", \"campsite\", \"car\",\n", + "\"castle\", \"cemetery\", \"central-building\", \"cinema\", \"circle\", \"circle-stroked\",\n", + "\"clothing-store\", \"college\", \"commercial\", \"cricket\", \"cross\", \"dam\",\n", + "\"danger\", \"dentist\", \"doctor\", \"dog-park\", \"drinking-water\", \"embassy\",\n", + "\"entrance\", \"farm\", \"fast-food\", \"ferry\", \"fire-station\", \"fuel\", \"gaming\",\n", + "\"garden\", \"garden-center\", \"gift\", \"golf\", \"grocery\", \"hairdresser\",\n", + "\"harbor\", \"heart\", \"heliport\", \"hospital\", \"ice-cream\", \"industry\",\n", + "\"information\", \"karaoke\", \"landmark\", \"laundry\", \"library\", \"lighthouse\",\n", + "\"lodging\", \"marker\", \"monument\", \"mountain\", \"museum\", \"music\", \"park\",\n", + "\"parking\", \"parking-garage\", \"pharmacy\", \"picnic-site\", \"pitch\",\n", + "\"place-of-worship\", \"playground\", \"police\", \"post\", \"prison\", \"rail\",\n", + "\"rail-light\", \"rail-metro\", \"ranger-station\", \"religious-christian\",\n", + "\"religious-jewish\", \"religious-muslim\", \"residential-community\",\n", + "\"restaurant\", \"roadblock\", \"rocket\", \"school\", \"shelter\", \"shop\",\n", + "\"skiing\", \"soccer\", \"square\", \"square-stroked\", \"stadium\", \"star\",\n", + "\"star-stroked\", \"suitcase\", \"sushi\", \"swimming\", \"teahouse\", \"telephone\",\n", + "\"tennis\", \"theatre\", \"toilet\", \"town-hall\", \"triangle\", \"triangle-stroked\",\n", + "\"veterinary\", \"volcano\", \"warehouse\", \"waste-basket\", \"water\", \"wetland\",\n", + "\"wheelchair\", \"zoo\"" + ] + }, + { + "cell_type": "markdown", + "id": "c7a7b9db", + "metadata": {}, + "source": [ + "#### Add Clusters\n", + "\n", + "*New in 5.11*\n", + "\n", + "Display clusters of data points by setting `cluster`. Here, we enable clusters with `enabled=True`. You can also enable clusters by setting other `cluster` properties. Other available properties include `color` (for setting the color of the clusters), `size` (for setting the size of a cluster step), and `step` (for configuring how many points it takes to create a cluster or advance to the next cluster step)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "904174d1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\n", + " \"https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv\"\n", + ")\n", + "fig = px.scatter_map(df, lat=\"lat\", lon=\"long\", size=\"cnt\", zoom=3)\n", + "fig.update_traces(cluster=dict(enabled=True))\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "7c82b9ac", + "metadata": {}, + "source": [ + "#### Font Customization\n", + "\n", + "You can customize the font on `go.Scattermap` traces with `textfont`. For example, you can set the font `family`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "07bcffc6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattermap(\n", + " mode = \"markers+text+lines\",\n", + " lon = [-75, -80, -50], lat = [45, 20, -20],\n", + " marker = {'size': 20, 'symbol': [\"bus\", \"harbor\", \"airport\"]},\n", + " text = [\"Bus\", \"Harbor\", \"airport\"], textposition = \"bottom right\",\n", + " textfont = dict(size=18, color=\"black\", family=\"Open Sans Bold\")\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " map = {\n", + " 'style': \"outdoors\", 'zoom': 0.7},\n", + " showlegend = False,)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b274a10f", + "metadata": {}, + "source": [ + "`go.Scattermap` supports the following values for `textfont.family`:\n", + "\n", + "'Metropolis Black Italic', 'Metropolis Black', 'Metropolis Bold Italic', 'Metropolis Bold', 'Metropolis Extra Bold Italic', 'Metropolis Extra Bold', 'Metropolis Extra Light Italic', 'Metropolis Extra Light', 'Metropolis Light Italic', 'Metropolis Light', 'Metropolis Medium Italic', 'Metropolis Medium', 'Metropolis Regular Italic', 'Metropolis Regular', 'Metropolis Semi Bold Italic', 'Metropolis Semi Bold', 'Metropolis Thin Italic', 'Metropolis Thin', 'Open Sans Bold Italic', 'Open Sans Bold', 'Open Sans Extrabold Italic', 'Open Sans Extrabold', 'Open Sans Italic', 'Open Sans Light Italic', 'Open Sans Light', 'Open Sans Regular', 'Open Sans Semibold Italic', 'Open Sans Semibold', 'Klokantech Noto Sans Bold', 'Klokantech Noto Sans CJK Bold', 'Klokantech Noto Sans CJK Regular', 'Klokantech Noto Sans Italic', and 'Klokantech Noto Sans Regular'." + ] + }, + { + "cell_type": "markdown", + "id": "bddbca66", + "metadata": {}, + "source": [ + "##### Font Weight\n", + "\n", + "*New in 5.23*\n", + "\n", + "You can specify a numeric font weight on `go.Scattermap` with `textfont.weight`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "480a0b95", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Scattermap(\n", + " mode = \"markers+text+lines\",\n", + " lon = [-75, -80, -50], lat = [45, 20, -20],\n", + " marker = dict(size=20, symbol=[\"bus\", \"harbor\", \"airport\"]),\n", + " text = [\"Bus\", \"Harbor\", \"airport\"], textposition = \"bottom right\",\n", + " textfont = dict(size=18, color=\"black\", weight=900)\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " map = dict(\n", + " style=\"outdoors\", zoom=0.7),\n", + " showlegend = False,)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c7fa9960", + "metadata": {}, + "source": [ + "## Mapbox Maps\n", + "\n", + "> Mapbox traces are deprecated and may be removed in a future version of Plotly.py.\n", + "\n", + "The earlier examples using `px.scatter_map` and `go.Scattermap` use [Maplibre](https://maplibre.org/maplibre-gl-js/docs/) for rendering. These traces were introduced in Plotly.py 5.24 and are now the recommended way to create scatter plots on tile-based maps. There are also traces that use [Mapbox](https://docs.mapbox.com): `px.scatter_mapbox` and `go.Scattermapbox`\n", + "\n", + "To plot on Mapbox maps with Plotly you _may_ need a Mapbox account and a public [Mapbox Access Token](https://www.mapbox.com/studio). See our [Mapbox Map Layers](/python/mapbox-layers/) documentation for more information.\n", + "\n", + "Here's the first example rewritten to use `px.scatter_mapbox`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5d915174", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "px.set_mapbox_access_token(open(\".mapbox_token\").read())\n", + "df = px.data.carshare()\n", + "fig = px.scatter_mapbox(df, lat=\"centroid_lat\", lon=\"centroid_lon\", color=\"peak_hour\", size=\"car_hours\",\n", + " color_continuous_scale=px.colors.cyclical.IceFire, size_max=15, zoom=10)\n", + "fig.show()\n" + ] + }, + { + "cell_type": "markdown", + "id": "15ac2031", + "metadata": {}, + "source": [ + "And here's an example using Graph Objects:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "987afc33", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "mapbox_access_token = open(\".mapbox_token\").read()\n", + "\n", + "fig = go.Figure(go.Scattermapbox(\n", + " lat=['45.5017'],\n", + " lon=['-73.5673'],\n", + " mode='markers',\n", + " marker=go.scattermapbox.Marker(\n", + " size=14\n", + " ),\n", + " text=['Montreal'],\n", + " ))\n", + "\n", + "fig.update_layout(\n", + " hovermode='closest',\n", + " mapbox=dict(\n", + " accesstoken=mapbox_access_token,\n", + " bearing=0,\n", + " center=go.layout.mapbox.Center(\n", + " lat=45,\n", + " lon=-73\n", + " ),\n", + " pitch=0,\n", + " zoom=5\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "243433bd", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.scatter_map`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_map) or https://plotly.com/python/reference/scattermap/ for more information about the attributes available.\n", + "\n", + "For Mapbox-based tile maps, see [function reference for `px.scatter_mapbox`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermapbox/.\n" + ] + }, + { + "cell_type": "markdown", + "id": "b9e88a63", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.16" + }, + "plotly": { + "description": "How to make scatter plots on tile maps in Python.", + "display_as": "maps", + "language": "python", + "layout": "base", + "name": "Scatter Plots on Tile Maps", + "order": 10, + "page_type": "u-guide", + "permalink": "python/tile-scatter-maps/", + "redirect_from": "python/scattermapbox/", + "thumbnail": "thumbnail/scatter-mapbox.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/time-series.ipynb b/time-series.ipynb new file mode 100644 index 000000000..42aa164e9 --- /dev/null +++ b/time-series.ipynb @@ -0,0 +1,769 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "67ed5d48", + "metadata": {}, + "source": [ + "### Time Series using Axes of type `date`\n", + "\n", + "Time series can be represented using either `plotly.express` functions (`px.line`, `px.scatter`, `px.bar` etc) or `plotly.graph_objects` charts objects (`go.Scatter`, `go.Bar` etc). For more examples of such charts, see the documentation of [line and scatter plots](https://plotly.com/python/line-and-scatter/) or [bar charts](/python/bar-charts/).\n", + "\n", + "For financial applications, Plotly can also be used to create [Candlestick charts](/python/candlestick-charts/) and [OHLC charts](/python/ohlc-charts/), which default to date axes.\n", + "\n", + "Plotly auto-sets the axis type to a date format when the corresponding data are either ISO-formatted date strings or if they're a [date pandas column](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html) or [datetime NumPy array](https://docs.scipy.org/doc/numpy/reference/arrays.datetime.html)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a39de459", + "metadata": {}, + "outputs": [], + "source": [ + "# Using plotly.express\n", + "import plotly.express as px\n", + "\n", + "df = px.data.stocks()\n", + "fig = px.line(df, x='date', y=\"GOOG\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7db72c40", + "metadata": {}, + "outputs": [], + "source": [ + "# Using graph_objects\n", + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = go.Figure([go.Scatter(x=df['Date'], y=df['AAPL.High'])])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9df50170", + "metadata": {}, + "source": [ + "### Time Series in Dash\n", + "\n", + "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", + "\n", + "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b167a8f2", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'time-series', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "31f052f3", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "a87b07bd", + "metadata": {}, + "source": [ + "### Different Chart Types on Date Axes\n", + "\n", + "Any kind of cartesian chart can be placed on `date` axes, for example this bar chart of relative stock ticker values." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cbc6df13", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks(indexed=True)-1\n", + "fig = px.bar(df, x=df.index, y=\"GOOG\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cf8595d3", + "metadata": {}, + "source": [ + "Or this [facetted](/python/facet-plots/) area plot:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c7ab120e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.stocks(indexed=True)-1\n", + "fig = px.area(df, facet_col=\"company\", facet_col_wrap=2)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d781aedc", + "metadata": {}, + "source": [ + "### Configuring Tick Labels\n", + "\n", + "By default, the tick labels (and optional ticks) are associated with a specific grid-line, and represent an *instant* in time, for example, \"00:00 on February 1, 2018\". Tick labels can be formatted using the `tickformat` attribute (which accepts the [d3 time-format formatting strings](https://github.com/d3/d3-time-format)) to display only the month and year, but they still represent an instant by default, so in the figure below, the text of the label \"Feb 2018\" spans part of the month of January and part of the month of February. The `dtick` attribute controls the spacing between gridlines, and the `\"M1\"` setting means \"1 month\". This attribute also accepts a number of milliseconds, which can be scaled up to days by multiplying by `24*60*60*1000`.\n", + "\n", + "Date axis tick labels have the special property that any portion after the first instance of `'\\n'` in `tickformat` will appear on a second line only once per unique value, as with the year numbers in the example below. To have the year number appear on every tick label, `'
'` should be used instead of `'\\n'`.\n", + "\n", + "Note that by default, the formatting of values of X and Y values in the hover label matches that of the tick labels of the corresponding axes, so when customizing the tick labels to something broad like \"month\", it's usually necessary to [customize the hover label](/python/hover-text-and-formatting/) to something narrower like the actual date, as below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "992b5803", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.stocks()\n", + "fig = px.line(df, x=\"date\", y=df.columns,\n", + " hover_data={\"date\": \"|%B %d, %Y\"},\n", + " title='custom tick labels')\n", + "fig.update_xaxes(\n", + " dtick=\"M1\",\n", + " tickformat=\"%b\\n%Y\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8d936e76", + "metadata": {}, + "source": [ + "### Moving Tick Labels to the Middle of the Period\n", + "\n", + "_new in 4.10_\n", + "\n", + "By setting the `ticklabelmode` attribute to `\"period\"` (the default is `\"instant\"`) we can move the tick labels to the middle of the period they represent. The gridlines remain at the beginning of each month (thanks to `dtick=\"M1\"`) but the labels now span the month they refer to." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1dc70643", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.stocks()\n", + "fig = px.line(df, x=\"date\", y=df.columns,\n", + " hover_data={\"date\": \"|%B %d, %Y\"},\n", + " title='custom tick labels with ticklabelmode=\"period\"')\n", + "fig.update_xaxes(\n", + " dtick=\"M1\",\n", + " tickformat=\"%b\\n%Y\",\n", + " ticklabelmode=\"period\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a3051560", + "metadata": {}, + "source": [ + "### Adding Minor Ticks\n", + "\n", + "_new in 5.8_\n", + "\n", + "You can add minor ticks to an axis with `minor`. This takes a `dict` of properties to apply to minor ticks. See the [figure reference](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-minor) for full details on the accepted keys in this dict.\n", + "\n", + "In this example, we've added minor ticks to the inside of the x-axis and turned on minor grid lines." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca1ddcbc", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "\n", + "df = px.data.stocks()\n", + "fig = px.line(df, x='date', y=\"GOOG\")\n", + "\n", + "fig.update_xaxes(minor=dict(ticks=\"inside\", showgrid=True))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "66114ee8", + "metadata": {}, + "source": [ + "#### Monthly Period Labels With Weekly Minor Ticks\n", + "\n", + "_new in 5.8_\n", + "\n", + "You can set `dtick` on `minor` to control the spacing for minor ticks and grid lines. In the following example, by setting `dtick=7*24*60*60*1000` (the number of milliseconds in a week) and setting `tick0=\"2016-07-03\"` (the first Sunday in our data), a minor tick and grid line is displayed for the start of each week. When zoomed out, we can see where each month and week begins and ends." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "56483f52", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "df = df.loc[(df[\"Date\"] >= \"2016-07-01\") & (df[\"Date\"] <= \"2016-12-01\")]\n", + "\n", + "fig = px.line(df, x='Date', y='AAPL.High')\n", + "fig.update_xaxes(ticks= \"outside\",\n", + " ticklabelmode= \"period\",\n", + " tickcolor= \"black\",\n", + " ticklen=10,\n", + " minor=dict(\n", + " ticklen=4,\n", + " dtick=7*24*60*60*1000,\n", + " tick0=\"2016-07-03\",\n", + " griddash='dot',\n", + " gridcolor='white')\n", + " )\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1cd840f3", + "metadata": {}, + "source": [ + "### Summarizing Time-series Data with Histograms\n", + "\n", + "Plotly [histograms](/python/histograms/) are powerful data-aggregation tools which even work on date axes. In the figure below, we pass in daily data and display it as monthly averages by setting `histfunc=\"avg` and `xbins_size=\"M1\"`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b5476a87", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.histogram(df, x=\"Date\", y=\"AAPL.Close\", histfunc=\"avg\", title=\"Histogram on Date Axes\")\n", + "fig.update_traces(xbins_size=\"M1\")\n", + "fig.update_xaxes(showgrid=True, ticklabelmode=\"period\", dtick=\"M1\", tickformat=\"%b\\n%Y\")\n", + "fig.update_layout(bargap=0.1)\n", + "fig.add_trace(go.Scatter(mode=\"markers\", x=df[\"Date\"], y=df[\"AAPL.Close\"], name=\"daily\"))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fad6c8d6", + "metadata": {}, + "source": [ + "### Displaying Period Data\n", + "\n", + "_new in 4.11_\n", + "\n", + "If your data coded \"January 1\" or \"January 31\" in fact refers to data collected throughout the month of January, for example, you can configure your traces to display their marks at the start end, or middle of the month with the `xperiod` and `xperiodalignment` attributes. In the example below, the raw data is all coded with an X value of the 10th of the month, but is binned into monthly periods with `xperiod=\"M1\"` and then displayed at the start, middle and end of the period." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b7cbc70c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.DataFrame(dict(\n", + " date=[\"2020-01-10\", \"2020-02-10\", \"2020-03-10\", \"2020-04-10\", \"2020-05-10\", \"2020-06-10\"],\n", + " value=[1,2,3,1,2,3]\n", + "))\n", + "\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Scatter(\n", + " name=\"Raw Data\",\n", + " mode=\"markers+lines\", x=df[\"date\"], y=df[\"value\"],\n", + " marker_symbol=\"star\"\n", + "))\n", + "fig.add_trace(go.Scatter(\n", + " name=\"Start-aligned\",\n", + " mode=\"markers+lines\", x=df[\"date\"], y=df[\"value\"],\n", + " xperiod=\"M1\",\n", + " xperiodalignment=\"start\"\n", + "))\n", + "fig.add_trace(go.Scatter(\n", + " name=\"Middle-aligned\",\n", + " mode=\"markers+lines\", x=df[\"date\"], y=df[\"value\"],\n", + " xperiod=\"M1\",\n", + " xperiodalignment=\"middle\"\n", + "))\n", + "fig.add_trace(go.Scatter(\n", + " name=\"End-aligned\",\n", + " mode=\"markers+lines\", x=df[\"date\"], y=df[\"value\"],\n", + " xperiod=\"M1\",\n", + " xperiodalignment=\"end\"\n", + "))\n", + "fig.add_trace(go.Bar(\n", + " name=\"Middle-aligned\",\n", + " x=df[\"date\"], y=df[\"value\"],\n", + " xperiod=\"M1\",\n", + " xperiodalignment=\"middle\"\n", + "))\n", + "fig.update_xaxes(showgrid=True, ticklabelmode=\"period\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8705d865", + "metadata": {}, + "source": [ + "### Hover Templates with Mixtures of Period data\n", + "\n", + "*New in v5.0*\n", + "\n", + "When displaying periodic data with mixed-sized periods (i.e. quarterly and monthly) in conjunction with [`x` or `x unified` hovermodes and using `hovertemplate`](https://plotly.com/python/hover-text-and-formatting/), the `xhoverformat` attribute can be used to control how each period's X value is displayed, and the special `%{xother}` hover-template directive can be used to control how the X value is displayed for points that do not share the exact X coordinate with the point that is being hovered on. `%{xother}` will return an empty string when the X value is the one being hovered on, otherwise it will return `(%{x})`. The special `%{_xother}`, `%{xother_}` and `%{_xother_}` variations will display with spaces before, after or around the parentheses, respectively." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9851b728", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Bar(\n", + " x=[\"2020-01-01\", \"2020-04-01\", \"2020-07-01\"],\n", + " y=[1000, 1500, 1700],\n", + " xperiod=\"M3\",\n", + " xperiodalignment=\"middle\",\n", + " xhoverformat=\"Q%q\",\n", + " hovertemplate=\"%{y}%{_xother}\"\n", + "))\n", + "\n", + "fig.add_trace(go.Scatter(\n", + " x=[\"2020-01-01\", \"2020-02-01\", \"2020-03-01\",\n", + " \"2020-04-01\", \"2020-05-01\", \"2020-06-01\",\n", + " \"2020-07-01\", \"2020-08-01\", \"2020-09-01\"],\n", + " y=[1100,1050,1200,1300,1400,1700,1500,1400,1600],\n", + " xperiod=\"M1\",\n", + " xperiodalignment=\"middle\",\n", + " hovertemplate=\"%{y}%{_xother}\"\n", + "))\n", + "\n", + "fig.update_layout(hovermode=\"x unified\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "5c0624eb", + "metadata": { + "tags": [] + }, + "source": [ + "### Time Series Plot with Custom Date Range\n", + "\n", + "The data range can be set manually using either `datetime.datetime` objects, or date strings." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f30df76b", + "metadata": {}, + "outputs": [], + "source": [ + "# Using plotly.express\n", + "import plotly.express as px\n", + "\n", + "import pandas as pd\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.line(df, x='Date', y='AAPL.High', range_x=['2016-07-01','2016-12-31'])\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d7d94a39", + "metadata": {}, + "outputs": [], + "source": [ + "# Using graph_objects\n", + "\n", + "import plotly.graph_objects as go\n", + "import datetime\n", + "\n", + "x = [datetime.datetime(year=2013, month=10, day=4),\n", + " datetime.datetime(year=2013, month=11, day=5),\n", + " datetime.datetime(year=2013, month=12, day=6)]\n", + "\n", + "fig = go.Figure(data=[go.Scatter(x=x, y=[1, 3, 6])])\n", + "# Use datetime objects to set xaxis range\n", + "fig.update_layout(xaxis_range=[datetime.datetime(2013, 10, 17),\n", + " datetime.datetime(2013, 11, 20)])\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "06b7c879", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.line(df, x='Date', y='AAPL.High')\n", + "\n", + "# Use date string to set xaxis range\n", + "fig.update_layout(xaxis_range=['2016-07-01','2016-12-31'],\n", + " title_text=\"Manually Set Date Range\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a8a5a076", + "metadata": {}, + "source": [ + "### Time Series With Range Slider\n", + "\n", + "A range slider is a small subplot-like area below a plot which allows users to pan and zoom the X-axis while maintaining an overview of the chart. Check out the reference for more options: https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeslider" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6821ce11", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.line(df, x='Date', y='AAPL.High', title='Time Series with Rangeslider')\n", + "\n", + "fig.update_xaxes(rangeslider_visible=True)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "43f085a0", + "metadata": {}, + "source": [ + "### Time Series with Range Selector Buttons\n", + "\n", + "Range selector buttons are special controls that work well with time series and range sliders, and allow users to easily set the range of the x-axis. Check out the reference for more options: https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeselector" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27e309c6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.line(df, x='Date', y='AAPL.High', title='Time Series with Range Slider and Selectors')\n", + "\n", + "fig.update_xaxes(\n", + " rangeslider_visible=True,\n", + " rangeselector=dict(\n", + " buttons=list([\n", + " dict(count=1, label=\"1m\", step=\"month\", stepmode=\"backward\"),\n", + " dict(count=6, label=\"6m\", step=\"month\", stepmode=\"backward\"),\n", + " dict(count=1, label=\"YTD\", step=\"year\", stepmode=\"todate\"),\n", + " dict(count=1, label=\"1y\", step=\"year\", stepmode=\"backward\"),\n", + " dict(step=\"all\")\n", + " ])\n", + " )\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0ac067a5", + "metadata": {}, + "source": [ + "### Customizing Tick Label Formatting by Zoom Level\n", + "\n", + "The `tickformatstops` attribute can be used to customize the formatting of tick labels depending on the zoom level. Try zooming in to the chart below and see how the tick label formatting changes. Check out the reference for more options: https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-tickformatstops" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b2a7f193", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = go.Figure(go.Scatter(\n", + " x = df['Date'],\n", + " y = df['mavg']\n", + "))\n", + "\n", + "fig.update_xaxes(\n", + " rangeslider_visible=True,\n", + " tickformatstops = [\n", + " dict(dtickrange=[None, 1000], value=\"%H:%M:%S.%L ms\"),\n", + " dict(dtickrange=[1000, 60000], value=\"%H:%M:%S s\"),\n", + " dict(dtickrange=[60000, 3600000], value=\"%H:%M m\"),\n", + " dict(dtickrange=[3600000, 86400000], value=\"%H:%M h\"),\n", + " dict(dtickrange=[86400000, 604800000], value=\"%e. %b d\"),\n", + " dict(dtickrange=[604800000, \"M1\"], value=\"%e. %b w\"),\n", + " dict(dtickrange=[\"M1\", \"M12\"], value=\"%b '%y M\"),\n", + " dict(dtickrange=[\"M12\", None], value=\"%Y Y\")\n", + " ]\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7fd01012", + "metadata": {}, + "source": [ + "### Hiding Weekends and Holidays\n", + "\n", + "The `rangebreaks` attribute available on x- and y-axes of type `date` can be used to hide certain time-periods. In the example below, we show two plots: one in default mode to show gaps in the data, and one where we hide weekends and holidays to show an uninterrupted trading history. Note the smaller gaps between the grid lines for December 21 and January 4, where holidays were removed. Check out the reference for more options: https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangebreaks\n", + "\n", + "> Note: a known limitation of this feature is that it does not support `scattergl` traces. When using this feature on plots with more than a few hundred data points with `px.scatter` or `px.line` or `px.area`, you may need to pass in `render_mode=\"svg\"` to ensure that the underlying trace type is `scatter` and not `scattergl`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b6b87c4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.scatter(df, x='Date', y='AAPL.High', range_x=['2015-12-01', '2016-01-15'],\n", + " title=\"Default Display with Gaps\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2630f0b4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')\n", + "\n", + "fig = px.scatter(df, x='Date', y='AAPL.High', range_x=['2015-12-01', '2016-01-15'],\n", + " title=\"Hide Weekend and Holiday Gaps with rangebreaks\")\n", + "fig.update_xaxes(\n", + " rangebreaks=[\n", + " dict(bounds=[\"sat\", \"mon\"]), #hide weekends\n", + " dict(values=[\"2015-12-25\", \"2016-01-01\"]) # hide Christmas and New Year's\n", + " ]\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "49c17a87", + "metadata": {}, + "source": [ + "### Hiding Non-Business Hours\n", + "\n", + "The `rangebreaks` feature described above works for hiding hourly periods as well." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12215daa", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "work_week_40h = pd.date_range(start='2020-03-01', end='2020-03-07', freq=\"BH\")\n", + "\n", + "df = pd.DataFrame(dict(\n", + " date = work_week_40h,\n", + " value = np.cumsum(np.random.rand(40)-0.5)\n", + "))\n", + "\n", + "fig = px.scatter(df, x=\"date\", y=\"value\",\n", + " title=\"Default Display with Gaps\")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f64b0a47", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "work_week_40h = pd.date_range(start='2020-03-01', end='2020-03-07', freq=\"BH\")\n", + "\n", + "df = pd.DataFrame(dict(\n", + " date = work_week_40h,\n", + " value = np.cumsum(np.random.rand(40)-0.5)\n", + "))\n", + "\n", + "fig = px.scatter(df, x=\"date\", y=\"value\",\n", + " title=\"Hide Non-Business Hour Gaps with rangebreaks\")\n", + "fig.update_xaxes(\n", + " rangebreaks=[\n", + " dict(bounds=[17, 9], pattern=\"hour\"), #hide hours outside of 9am-5pm\n", + " ]\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8805d792", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "plotly": { + "description": "How to plot date and time in python.", + "display_as": "financial", + "language": "python", + "layout": "base", + "name": "Time Series and Date Axes", + "order": 1, + "page_type": "example_index", + "permalink": "python/time-series/", + "thumbnail": "thumbnail/time-series.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tree-plots.ipynb b/tree-plots.ipynb new file mode 100644 index 000000000..008db049d --- /dev/null +++ b/tree-plots.ipynb @@ -0,0 +1,234 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "b4f4f374", + "metadata": {}, + "source": [ + "#### Set Up Tree with [igraph](http://igraph.org/python/)\n", + "\n", + "Install igraph with `pip install igraph`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "55585b9d", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install igraph" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d66d57cf", + "metadata": {}, + "outputs": [], + "source": [ + "import igraph\n", + "from igraph import Graph, EdgeSeq\n", + "nr_vertices = 25\n", + "v_label = list(map(str, range(nr_vertices)))\n", + "G = Graph.Tree(nr_vertices, 2) # 2 stands for children number\n", + "lay = G.layout('rt')\n", + "\n", + "position = {k: lay[k] for k in range(nr_vertices)}\n", + "Y = [lay[k][1] for k in range(nr_vertices)]\n", + "M = max(Y)\n", + "\n", + "es = EdgeSeq(G) # sequence of edges\n", + "E = [e.tuple for e in G.es] # list of edges\n", + "\n", + "L = len(position)\n", + "Xn = [position[k][0] for k in range(L)]\n", + "Yn = [2*M-position[k][1] for k in range(L)]\n", + "Xe = []\n", + "Ye = []\n", + "for edge in E:\n", + " Xe+=[position[edge[0]][0],position[edge[1]][0], None]\n", + " Ye+=[2*M-position[edge[0]][1],2*M-position[edge[1]][1], None]\n", + "\n", + "labels = v_label" + ] + }, + { + "cell_type": "markdown", + "id": "a030793f", + "metadata": {}, + "source": [ + "#### Create Plotly Traces" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7214d2f0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "fig = go.Figure()\n", + "fig.add_trace(go.Scatter(x=Xe,\n", + " y=Ye,\n", + " mode='lines',\n", + " line=dict(color='rgb(210,210,210)', width=1),\n", + " hoverinfo='none'\n", + " ))\n", + "fig.add_trace(go.Scatter(x=Xn,\n", + " y=Yn,\n", + " mode='markers',\n", + " name='bla',\n", + " marker=dict(symbol='circle-dot',\n", + " size=18,\n", + " color='#6175c1', #'#DB4551',\n", + " line=dict(color='rgb(50,50,50)', width=1)\n", + " ),\n", + " text=labels,\n", + " hoverinfo='text',\n", + " opacity=0.8\n", + " ))" + ] + }, + { + "cell_type": "markdown", + "id": "2d85da20", + "metadata": {}, + "source": [ + "#### Create Text Inside the Circle via Annotations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3df76b4a", + "metadata": {}, + "outputs": [], + "source": [ + "def make_annotations(pos, text, font_size=10, font_color='rgb(250,250,250)'):\n", + " L=len(pos)\n", + " if len(text)!=L:\n", + " raise ValueError('The lists pos and text must have the same len')\n", + " annotations = []\n", + " for k in range(L):\n", + " annotations.append(\n", + " dict(\n", + " text=labels[k], # or replace labels with a different list for the text within the circle\n", + " x=pos[k][0], y=2*M-position[k][1],\n", + " xref='x1', yref='y1',\n", + " font=dict(color=font_color, size=font_size),\n", + " showarrow=False)\n", + " )\n", + " return annotations" + ] + }, + { + "cell_type": "markdown", + "id": "a86e2fe1", + "metadata": {}, + "source": [ + "#### Add Axis Specifications and Create the Layout" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd3a91d0", + "metadata": {}, + "outputs": [], + "source": [ + "axis = dict(showline=False, # hide axis line, grid, ticklabels and title\n", + " zeroline=False,\n", + " showgrid=False,\n", + " showticklabels=False,\n", + " )\n", + "\n", + "fig.update_layout(title= 'Tree with Reingold-Tilford Layout',\n", + " annotations=make_annotations(position, v_label),\n", + " font_size=12,\n", + " showlegend=False,\n", + " xaxis=axis,\n", + " yaxis=axis,\n", + " margin=dict(l=40, r=40, b=85, t=100),\n", + " hovermode='closest',\n", + " plot_bgcolor='rgb(248,248,248)'\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "2cfed538", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/ for more information and chart attribute options and http://igraph.org/python/ for more information about the igraph package!" + ] + }, + { + "cell_type": "markdown", + "id": "c1a70bc2", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "plotly": { + "description": "How to make interactive tree-plot in Python with Plotly. An examples of a tree-plot in Plotly.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "Tree-plots", + "order": 9, + "permalink": "python/tree-plots/", + "thumbnail": "thumbnail/treeplot.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/treemaps.ipynb b/treemaps.ipynb new file mode 100644 index 000000000..1278aa8e3 --- /dev/null +++ b/treemaps.ipynb @@ -0,0 +1,695 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "62078fc0", + "metadata": {}, + "source": [ + "[Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. The input data format is the same as for [Sunburst Charts](https://plotly.com/python/sunburst-charts/) and [Icicle Charts](https://plotly.com/python/icicle-charts/): the hierarchy is defined by [labels](https://plotly.com/python/reference/treemap/#treemap-labels) (`names` for `px.treemap`) and [parents](https://plotly.com/python/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.\n", + "\n", + "### Basic Treemap with plotly.express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).\n", + "\n", + "With `px.treemap`, each row of the DataFrame is represented as a sector of the treemap." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3f6012b0", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "fig = px.treemap(\n", + " names = [\"Eve\",\"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents = [\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"]\n", + ")\n", + "fig.update_traces(root_color=\"lightgrey\")\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fedffd13", + "metadata": {}, + "source": [ + "### Treemap of a rectangular DataFrame with plotly.express\n", + "\n", + "Hierarchical data are often stored as a rectangular dataframe, with different columns corresponding to different levels of the hierarchy. `px.treemap` can take a `path` parameter corresponding to a list of columns. Note that `id` and `parent` should not be provided if `path` is given." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e20c4e96", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.treemap(df, path=[px.Constant(\"all\"), 'day', 'time', 'sex'], values='total_bill')\n", + "fig.update_traces(root_color=\"lightgrey\")\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "be1d6da8", + "metadata": {}, + "source": [ + "### Treemap of a rectangular DataFrame with continuous color argument in px.treemap\n", + "\n", + "If a `color` argument is passed, the color of a node is computed as the average of the color values of its children, weighted by their values.\n", + "\n", + "**Note**: for best results, ensure that the first `path` element is a single root node. In the examples below we are creating a dummy column containing identical values for each row to achieve this." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "639a70e3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import numpy as np\n", + "df = px.data.gapminder().query(\"year == 2007\")\n", + "fig = px.treemap(df, path=[px.Constant(\"world\"), 'continent', 'country'], values='pop',\n", + " color='lifeExp', hover_data=['iso_alpha'],\n", + " color_continuous_scale='RdBu',\n", + " color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a495b2f0", + "metadata": {}, + "source": [ + "### Treemap of a rectangular DataFrame with discrete color argument in px.treemap\n", + "\n", + "When the argument of `color` corresponds to non-numerical data, discrete colors are used. If a sector has the same value of the `color` column for all its children, then the corresponding color is used, otherwise the first color of the discrete color sequence is used." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "49baecb6", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.treemap(df, path=[px.Constant(\"all\"), 'sex', 'day', 'time'],\n", + " values='total_bill', color='day')\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e167bf6a", + "metadata": {}, + "source": [ + "In the example below the color of Saturday and Sunday sectors is the same as Dinner because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "36bcb2b8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.treemap(df, path=[px.Constant(\"all\"), 'sex', 'day', 'time'],\n", + " values='total_bill', color='time')\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "56c8216d", + "metadata": {}, + "source": [ + "### Using an explicit mapping for discrete colors\n", + "\n", + "For more information about discrete colors, see the [dedicated page](/python/discrete-color)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3f0efd90", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.treemap(df, path=[px.Constant(\"all\"), 'sex', 'day', 'time'],\n", + " values='total_bill', color='time',\n", + " color_discrete_map={'(?)':'lightgrey', 'Lunch':'gold', 'Dinner':'darkblue'})\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6b801d4f", + "metadata": {}, + "source": [ + "### Rectangular data with missing values\n", + "\n", + "If the dataset is not fully rectangular, missing values should be supplied as `None`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2094b950", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "import pandas as pd\n", + "vendors = [\"A\", \"B\", \"C\", \"D\", None, \"E\", \"F\", \"G\", \"H\", None]\n", + "sectors = [\"Tech\", \"Tech\", \"Finance\", \"Finance\", \"Other\",\n", + " \"Tech\", \"Tech\", \"Finance\", \"Finance\", \"Other\"]\n", + "regions = [\"North\", \"North\", \"North\", \"North\", \"North\",\n", + " \"South\", \"South\", \"South\", \"South\", \"South\"]\n", + "sales = [1, 3, 2, 4, 1, 2, 2, 1, 4, 1]\n", + "df = pd.DataFrame(\n", + " dict(vendors=vendors, sectors=sectors, regions=regions, sales=sales)\n", + ")\n", + "df[\"all\"] = \"all\" # in order to have a single root node\n", + "print(df)\n", + "fig = px.treemap(df, path=['all', 'regions', 'sectors', 'vendors'], values='sales')\n", + "fig.update_traces(root_color=\"lightgrey\")\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "bb137f2a", + "metadata": {}, + "source": [ + "### Treemap with Rounded Corners" + ] + }, + { + "cell_type": "markdown", + "id": "285c95a7", + "metadata": {}, + "source": [ + "*New in 5.12*\n", + "\n", + "Update treemap sectors to have rounded corners by configuring the `cornerradius` in px." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb36b6a2", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "fig = px.treemap(\n", + " names = [\"Eve\",\"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents = [\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"]\n", + ")\n", + "fig.update_traces(marker=dict(cornerradius=5))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e33b8b51", + "metadata": {}, + "source": [ + "### Basic Treemap with go.Treemap\n", + "\n", + "If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Treemap` class from `plotly.graph_objects`](/python/graph-objects/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1df9f0cd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Treemap(\n", + " labels = [\"Eve\",\"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents = [\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"],\n", + " root_color=\"lightgrey\"\n", + "))\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3ea6cf9c", + "metadata": {}, + "source": [ + "### Set Different Attributes in Treemap\n", + "\n", + "This example uses the following attributes:\n", + "\n", + "1. [values](https://plotly.com/python/reference/treemap/#treemap-values): sets the values associated with each of the sectors.\n", + "2. [textinfo](https://plotly.com/python/reference/treemap/#treemap-textinfo): determines which trace information appear on the graph that can be 'text', 'value', 'current path', 'percent root', 'percent entry', and 'percent parent', or any combination of them.\n", + "3. [pathbar](https://plotly.com/python/reference/treemap/#treemap-pathbar): a main extra feature of treemap to display the current path of the visible portion of the hierarchical map. It may also be useful for zooming out of the graph.\n", + "4. [branchvalues](https://plotly.com/python/reference/treemap/#treemap-branchvalues): determines how the items in `values` are summed. When set to \"total\", items in `values` are taken to be value of all its descendants. In the example below Eve = 65, which is equal to 14 + 12 + 10 + 2 + 6 + 6 + 1 + 4.\n", + " When set to \"remainder\", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4cb10627", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "\n", + "labels = [\"Eve\", \"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"]\n", + "parents = [\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"]\n", + "\n", + "fig = make_subplots(\n", + " cols = 2, rows = 1,\n", + " column_widths = [0.4, 0.4],\n", + " subplot_titles = ('branchvalues: remainder
 
', 'branchvalues: total
 
'),\n", + " specs = [[{'type': 'treemap', 'rowspan': 1}, {'type': 'treemap'}]]\n", + ")\n", + "\n", + "fig.add_trace(go.Treemap(\n", + " labels = labels,\n", + " parents = parents,\n", + " values = [10, 14, 12, 10, 2, 6, 6, 1, 4],\n", + " textinfo = \"label+value+percent parent+percent entry+percent root\",\n", + " root_color=\"lightgrey\"\n", + "),row = 1, col = 1)\n", + "\n", + "fig.add_trace(go.Treemap(\n", + " branchvalues = \"total\",\n", + " labels = labels,\n", + " parents = parents,\n", + " values = [65, 14, 12, 10, 2, 6, 6, 1, 4],\n", + " textinfo = \"label+value+percent parent+percent entry\",\n", + " root_color=\"lightgrey\"\n", + "),row = 1, col = 2)\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e54d7df3", + "metadata": {}, + "source": [ + "### Set Color of Treemap Sectors\n", + "\n", + "There are three different ways to change the color of the sectors in Treemap:\n", + "\n", + "1. [marker.colors](https://plotly.com/python/reference/treemap/#treemap-marker-colors), 2) [colorway](https://plotly.com/python/reference/treemap/#treemap-colorway), 3) [colorscale](https://plotly.com/python/reference/treemap/#treemap-colorscale). The following examples show how to use each of them." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7fabcf37", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "values = [0, 11, 12, 13, 14, 15, 20, 30]\n", + "labels = [\"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"A5\", \"B1\", \"B2\"]\n", + "parents = [\"\", \"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"container\", \"B1\"]\n", + "\n", + "fig = go.Figure(go.Treemap(\n", + " labels = labels,\n", + " values = values,\n", + " parents = parents,\n", + " marker_colors = [\"pink\", \"royalblue\", \"lightgray\", \"purple\",\n", + " \"cyan\", \"lightgray\", \"lightblue\", \"lightgreen\"]\n", + "))\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0db66731", + "metadata": {}, + "source": [ + "This example uses `treemapcolorway` attribute, which should be set in layout." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3ae666d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "values = [0, 11, 12, 13, 14, 15, 20, 30]\n", + "labels = [\"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"A5\", \"B1\", \"B2\"]\n", + "parents = [\"\", \"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"container\", \"B1\"]\n", + "\n", + "fig = go.Figure(go.Treemap(\n", + " labels = labels,\n", + " values = values,\n", + " parents = parents,\n", + " root_color=\"lightblue\"\n", + "))\n", + "\n", + "fig.update_layout(\n", + " treemapcolorway = [\"pink\", \"lightgray\"],\n", + " margin = dict(t=50, l=25, r=25, b=25)\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a5e3cbcb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "values = [0, 11, 12, 13, 14, 15, 20, 30]\n", + "labels = [\"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"A5\", \"B1\", \"B2\"]\n", + "parents = [\"\", \"container\", \"A1\", \"A2\", \"A3\", \"A4\", \"container\", \"B1\"]\n", + "\n", + "fig = go.Figure(go.Treemap(\n", + " labels = labels,\n", + " values = values,\n", + " parents = parents,\n", + " marker_colorscale = 'Blues'\n", + "))\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "dfa07a99", + "metadata": {}, + "source": [ + "### Treemap chart with a continuous colorscale\n", + "\n", + "The example below visualizes a breakdown of sales (corresponding to sector width) and call success rate (corresponding to sector color) by region, county and salesperson level. For example, when exploring the data you can see that although the East region is behaving poorly, the Tyler county is still above average -- however, its performance is reduced by the poor success rate of salesperson GT.\n", + "\n", + "In the right subplot which has a `maxdepth` of two levels, click on a sector to see its breakdown to lower levels." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3c1be4e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/sales_success.csv')\n", + "print(df.head())\n", + "\n", + "levels = ['salesperson', 'county', 'region'] # levels used for the hierarchical chart\n", + "color_columns = ['sales', 'calls']\n", + "value_column = 'calls'\n", + "\n", + "def build_hierarchical_dataframe(df, levels, value_column, color_columns=None):\n", + " \"\"\"\n", + " Build a hierarchy of levels for Sunburst or Treemap charts.\n", + "\n", + " Levels are given starting from the bottom to the top of the hierarchy,\n", + " ie the last level corresponds to the root.\n", + " \"\"\"\n", + " df_list = []\n", + " for i, level in enumerate(levels):\n", + " df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])\n", + " dfg = df.groupby(levels[i:]).sum()\n", + " dfg = dfg.reset_index()\n", + " df_tree['id'] = dfg[level].copy()\n", + " if i < len(levels) - 1:\n", + " df_tree['parent'] = dfg[levels[i+1]].copy()\n", + " else:\n", + " df_tree['parent'] = 'total'\n", + " df_tree['value'] = dfg[value_column]\n", + " df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]]\n", + " df_list.append(df_tree)\n", + " total = pd.Series(dict(id='total', parent='',\n", + " value=df[value_column].sum(),\n", + " color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0)\n", + " df_list.append(total)\n", + " df_all_trees = pd.concat(df_list, ignore_index=True)\n", + " return df_all_trees\n", + "\n", + "\n", + "df_all_trees = build_hierarchical_dataframe(df, levels, value_column, color_columns)\n", + "average_score = df['sales'].sum() / df['calls'].sum()\n", + "\n", + "fig = make_subplots(1, 2, specs=[[{\"type\": \"domain\"}, {\"type\": \"domain\"}]],)\n", + "\n", + "fig.add_trace(go.Treemap(\n", + " labels=df_all_trees['id'],\n", + " parents=df_all_trees['parent'],\n", + " values=df_all_trees['value'],\n", + " branchvalues='total',\n", + " marker=dict(\n", + " colors=df_all_trees['color'],\n", + " colorscale='RdBu',\n", + " cmid=average_score),\n", + " hovertemplate='%{label}
Sales: %{value}
Success rate: %{color:.2f}',\n", + " name=''\n", + " ), 1, 1)\n", + "\n", + "fig.add_trace(go.Treemap(\n", + " labels=df_all_trees['id'],\n", + " parents=df_all_trees['parent'],\n", + " values=df_all_trees['value'],\n", + " branchvalues='total',\n", + " marker=dict(\n", + " colors=df_all_trees['color'],\n", + " colorscale='RdBu',\n", + " cmid=average_score),\n", + " hovertemplate='%{label}
Sales: %{value}
Success rate: %{color:.2f}',\n", + " maxdepth=2\n", + " ), 1, 2)\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c15d5e81", + "metadata": {}, + "source": [ + "### Nested Layers in Treemap\n", + "\n", + "The following example uses hierarchical data that includes layers and grouping. Treemap and [Sunburst](https://plotly.com/python/sunburst-charts/) charts reveal insights into the data, and the format of your hierarchical data. [maxdepth](https://plotly.com/python/reference/treemap/#treemap-maxdepth) attribute sets the number of rendered sectors from the given level." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0afbe528", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/96c0bd/sunburst-coffee-flavors-complete.csv')\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Treemap(\n", + " ids = df.ids,\n", + " labels = df.labels,\n", + " parents = df.parents,\n", + " maxdepth=3,\n", + " root_color=\"lightgrey\"\n", + "))\n", + "\n", + "fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "561a4e64", + "metadata": {}, + "source": [ + "### Controlling text fontsize with uniformtext\n", + "\n", + "If you want all the text labels to have the same size, you can use the `uniformtext` layout parameter. The `minsize` attribute sets the font size, and the `mode` attribute sets what happens for labels which cannot fit with the desired fontsize: either `hide` them or `show` them with overflow.\n", + "\n", + "*Note: animated transitions are currently not implemented when `uniformtext` is used.*" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f8b0e7e5", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/96c0bd/sunburst-coffee-flavors-complete.csv')\n", + "\n", + "fig = go.Figure(go.Treemap(\n", + " ids = df.ids,\n", + " labels = df.labels,\n", + " parents = df.parents,\n", + " pathbar_textfont_size=15,\n", + " root_color=\"lightgrey\"\n", + "))\n", + "fig.update_layout(\n", + " uniformtext=dict(minsize=10, mode='hide'),\n", + " margin = dict(t=50, l=25, r=25, b=25)\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "580e26cd", + "metadata": {}, + "source": [ + "### Pattern Fills\n", + "\n", + "*New in 5.15*\n", + "\n", + "Treemap charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color. In this example, we apply a pattern to the root node." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "675ba177", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(\n", + " go.Treemap(\n", + " labels = [\"Eve\",\"Cain\", \"Seth\", \"Enos\", \"Noam\", \"Abel\", \"Awan\", \"Enoch\", \"Azura\"],\n", + " parents=[\"\", \"Eve\", \"Eve\", \"Seth\", \"Seth\", \"Eve\", \"Eve\", \"Awan\", \"Eve\"],\n", + " root_color=\"lightgrey\",\n", + " textfont_size=20,\n", + " marker=dict(pattern=dict(shape=[\"|\"], solidity=0.80)),\n", + " )\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3e62c5a6", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.treemap()`](https://plotly.com/python-api-reference/generated/plotly.express.treemap) or https://plotly.com/python/reference/treemap/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "3fae783f", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + }, + "plotly": { + "description": "How to make Treemap Charts with Plotly", + "display_as": "basic", + "language": "python", + "layout": "base", + "name": "Treemap Charts", + "order": 13, + "page_type": "u-guide", + "permalink": "python/treemaps/", + "thumbnail": "thumbnail/treemap.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/trisurf.ipynb b/trisurf.ipynb new file mode 100644 index 000000000..544ffd1d6 --- /dev/null +++ b/trisurf.ipynb @@ -0,0 +1,206 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "eb4dc6d8", + "metadata": {}, + "source": [ + "Trisurf plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", + "\n", + "#### Torus" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0e83fa99", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "import numpy as np\n", + "from scipy.spatial import Delaunay\n", + "\n", + "u = np.linspace(0, 2*np.pi, 20)\n", + "v = np.linspace(0, 2*np.pi, 20)\n", + "u,v = np.meshgrid(u,v)\n", + "u = u.flatten()\n", + "v = v.flatten()\n", + "\n", + "x = (3 + (np.cos(v)))*np.cos(u)\n", + "y = (3 + (np.cos(v)))*np.sin(u)\n", + "z = np.sin(v)\n", + "\n", + "points2D = np.vstack([u,v]).T\n", + "tri = Delaunay(points2D)\n", + "simplices = tri.simplices\n", + "\n", + "fig = ff.create_trisurf(x=x, y=y, z=z,\n", + " simplices=simplices,\n", + " title=dict(text=\"Torus\"), aspectratio=dict(x=1, y=1, z=0.3))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fc719e7f", + "metadata": {}, + "source": [ + "#### Mobius Band\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "400d5312", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "import numpy as np\n", + "from scipy.spatial import Delaunay\n", + "\n", + "u = np.linspace(0, 2*np.pi, 24)\n", + "v = np.linspace(-1, 1, 8)\n", + "u,v = np.meshgrid(u,v)\n", + "u = u.flatten()\n", + "v = v.flatten()\n", + "\n", + "tp = 1 + 0.5*v*np.cos(u/2.)\n", + "x = tp*np.cos(u)\n", + "y = tp*np.sin(u)\n", + "z = 0.5*v*np.sin(u/2.)\n", + "\n", + "points2D = np.vstack([u,v]).T\n", + "tri = Delaunay(points2D)\n", + "simplices = tri.simplices\n", + "\n", + "fig = ff.create_trisurf(x=x, y=y, z=z,\n", + " colormap=\"Portland\",\n", + " simplices=simplices,\n", + " title=dict(text=\"Mobius Band\"))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "fd61d9f7", + "metadata": {}, + "source": [ + "#### Boy's Surface\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec8ebdcc", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "import numpy as np\n", + "from scipy.spatial import Delaunay\n", + "\n", + "u=np.linspace(-np.pi/2, np.pi/2, 60)\n", + "v=np.linspace(0, np.pi, 60)\n", + "u,v=np.meshgrid(u,v)\n", + "u=u.flatten()\n", + "v=v.flatten()\n", + "\n", + "x = (np.sqrt(2)*(np.cos(v)*np.cos(v))*np.cos(2*u) + np.cos(u)*np.sin(2*v))/(2 - np.sqrt(2)*np.sin(3*u)*np.sin(2*v))\n", + "y = (np.sqrt(2)*(np.cos(v)*np.cos(v))*np.sin(2*u) - np.sin(u)*np.sin(2*v))/(2 - np.sqrt(2)*np.sin(3*u)*np.sin(2*v))\n", + "z = (3*(np.cos(v)*np.cos(v)))/(2 - np.sqrt(2)*np.sin(3*u)*np.sin(2*v))\n", + "\n", + "points2D = np.vstack([u, v]).T\n", + "tri = Delaunay(points2D)\n", + "simplices = tri.simplices\n", + "\n", + "fig = ff.create_trisurf(x=x, y=y, z=z,\n", + " colormap=['rgb(50, 0, 75)', 'rgb(200, 0, 200)', '#c8dcc8'],\n", + " show_colorbar=True,\n", + " simplices=simplices,\n", + " title=dict(text=\"Boy's Surface\"))\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d8ba2520", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "For more info on `ff.create_trisurf()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_trisurf.html)\n" + ] + }, + { + "cell_type": "markdown", + "id": "e730c896", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.7" + }, + "plotly": { + "description": "How to make tri-surf plots in Python with Plotly. Trisurfs are formed by replacing the boundaries of a compact surface by touching triangles.", + "display_as": "3d_charts", + "language": "python", + "layout": "base", + "name": "Trisurf Plots", + "order": 8, + "permalink": "python/trisurf/", + "thumbnail": "thumbnail/trisurf.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb new file mode 100644 index 000000000..627e76ae6 --- /dev/null +++ b/troubleshooting.ipynb @@ -0,0 +1,141 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1c522670", + "metadata": {}, + "source": [ + "### Version Problems\n", + "\n", + "In order to follow the examples in this documentation site, you should have the latest version of `plotly` installed (5.x), as detailed in the [Getting Started](/python/getting-started) guide. This documentation (under https://plotly.com/python) is compatible with `plotly` version 4.x but *not* with version 3.x, for which the documentation is available under https://plotly.com/python/v3. In general you must also have the correct version of the underlying Plotly.js rendering engine installed, and the way to do that depends on the environment in which you are rendering figures: Dash, Jupyter Lab or Classic Notebook, VSCode etc. Read on for details about troubleshooting `plotly` in these environments.\n", + "\n", + "### Import Problems\n", + "\n", + "It's very important that you not have a file named `plotly.py` in the same directory as the Python script you're running, and this includes not naming the script itself `plotly.py`, otherwise importing `plotly` can fail with mysterious error messages.\n", + "\n", + "Beyond this, most `import` problems or `AttributeError`s can be traced back to having multiple versions of `plotly` installed, for example once with `conda` and once with `pip`. It's often worthwhile to uninstall with both methods before following the [Getting Started](/python/getting-started) instructions from scratch with one or the other. You can run the following commands in a terminal to fully remove `plotly` before installing again:\n", + "\n", + "```bash\n", + "$ conda uninstall plotly\n", + "$ pip uninstall plotly\n", + "```\n", + "\n", + "> Problems can also arise if you have a file named `plotly.py` in the same directory as the code you are executing.\n", + "\n", + "### Dash Problems\n", + "\n", + "If you are encountering problems using `plotly` with [Dash](https://dash.plotly.com/) please first ensure that you have upgraded `dash` to the latest version, which will automatically upgrade `dash-core-components` to the latest version, ensuring that Dash is using an up-to-date version of the Plotly.js rendering engine for `plotly`. If this does not resolve your issue, please visit our [Dash Community Forum](https://community.plotly.com/) and we will be glad to help you out.\n", + "\n", + "This is an example of a `plotly` graph correctly rendering inside `dash`:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cefde0a4", + "metadata": { + "hide_code": true + }, + "outputs": [], + "source": [ + "from IPython.display import IFrame\n", + "snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-snippets/'\n", + "IFrame(snippet_url + 'renderers', width='100%', height=1200)" + ] + }, + { + "cell_type": "markdown", + "id": "4bd2a26b", + "metadata": {}, + "source": [ + "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", + "Join now.

" + ] + }, + { + "cell_type": "markdown", + "id": "81efac6a", + "metadata": {}, + "source": [ + "### VSCode Notebook, Nteract and Streamlit Problems\n", + "\n", + "Plotly figures render in VSCode using a Plotly.js version bundled with the [vscode-python extension](https://code.visualstudio.com/docs/languages/python), and unfortunately it's often a little out of date compared to the latest version of the `plotly` module, so the very latest features may not work until the following release of the vscode-python extension. In any case, regularly upgrading your vscode-python extension to the latest version will ensure you have access to the greatest number of recent features.\n", + "\n", + "The situation is similar for environments like Nteract and Streamlit: in these environments you will need a version of these projects that bundles a version Plotly.js that supports the features in the version of `plotly` that you are running.\n", + "\n", + "### Orca Problems\n", + "\n", + "> Orca support in Plotly.py is deprecated and will be removed after September 2025. See the [Static Image Export page](/python/static-image-export/) for details on using Kaleido for static image generation.\n", + "\n", + "If you get an error message stating that the `orca` executable that was found is not valid, this may be because another executable with the same name was found on your system. Please specify the complete path to the Plotly-Orca binary that you downloaded (for instance in the Miniconda folder) with the following command:\n", + "\n", + "`plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'`\n" + ] + }, + { + "cell_type": "markdown", + "id": "ba971a3d", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "How to troubleshoot import and rendering problems in Plotly with Python.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Troubleshooting", + "order": 27, + "page_type": "u-guide", + "permalink": "python/troubleshooting/", + "thumbnail": "thumbnail/modebar-icons.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/v4-migration.ipynb b/v4-migration.ipynb new file mode 100644 index 000000000..03e5b9749 --- /dev/null +++ b/v4-migration.ipynb @@ -0,0 +1,441 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "498bd39c", + "metadata": {}, + "source": [ + "### Upgrading to Version 4\n", + "\n", + "Upgrading to version 4 of `plotly` is a matter of following the instructions in the [Getting Started](/python/getting-started/) guide and reinstalling the packages, subject to the notices below.\n", + "\n", + "### Getting Help\n", + "\n", + "If you encounter issues in upgrading from version 3 to version 4, please reach out in our [Community Forum](https://community.plotly.com/c/api/python) or if you've found an issue or regression in version 4, please report a [Github Issue](https://github.com/plotly/plotly.py/issues/new)" + ] + }, + { + "cell_type": "markdown", + "id": "da5fd04e", + "metadata": {}, + "source": [ + "### Online features (`plotly.plotly`) moved to `chart-studio` package\n", + "\n", + "Prior versions of plotly.py contained functionality for creating figures in both \"online\" and \"offline\" modes. In \"online\" mode figures were uploaded to the Chart Studio cloud (or on-premise) service, whereas in \"offline\" mode figures were rendered locally. **Version 4 of `plotly` is \"offline\"-only: all \"online\" functionality has been removed from the main `plotly` distribution package and moved to the new `chart-studio` distribution package.**\n", + "\n", + "To migrate version 3 \"online\" functionality, first install the `chart-studio` package using pip...\n", + "\n", + "```\n", + "$ pip install chart-studio\n", + "```\n", + "\n", + "or conda.\n", + "\n", + "```\n", + "$ conda install -c plotly chart-studio\n", + "```\n", + "\n", + "Then, update your Python import statements to import \"online\" functionality from the top-level `chart_studio` package, rather than the top-level `plotly` package. For example. replace\n", + "\n", + "```python\n", + "from plotly.plotly import plot, iplot\n", + "```\n", + "\n", + "with\n", + "\n", + "```python\n", + "from chart_studio.plotly import plot, iplot\n", + "```\n", + "\n", + "Similarly,\n", + " - Replace **`plotly.api`** with **`chart_studio.api`**\n", + " - Replace **`plotly.dashboard_objs`** with **`chart_studio.dashboard_objs`**\n", + " - Replace **`plotly.grid_objs`** with **`chart_studio.grid_objs`**\n", + " - Replace **`plotly.presentation_objs`** with **`chart_studio.presentation_objs`**\n", + " - Replace **`plotly.widgets`** with **`chart_studio.widgets`**" + ] + }, + { + "cell_type": "markdown", + "id": "119a0ae6", + "metadata": {}, + "source": [ + "### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export\n", + "\n", + "Version 4 introduces a new renderers framework that is a generalization of version 3's `plotly.offline.init_notebook_mode` and `plotly.offline.iplot` functions for displaying figures. *This is a non-breaking change*: the `plotly.offline.iplot` function is still available and has been reimplemented on top of the renderers framework, so no changes are required when porting to version 4. Going forward, we recommend using the renderers framework directly. See [Displaying plotly figures](/python/renderers) for more information.\n", + "\n", + "\n", + "In version 3, the `plotly.offline.plot` function was used to export figures to HTML files. In version 4, this function has been reimplemented on top of the new `to_html` and `write_html` functions from the `plotly.io` module. These functions have a slightly more consistent API (see docstrings for details), and going forward we recommend using them directly when performing HTML export. When working with a graph object figure, these functions are also available as the `.to_html` and `.write_html` figure methods." + ] + }, + { + "cell_type": "markdown", + "id": "fc0434d3", + "metadata": {}, + "source": [ + "### New default theme\n", + "An updated `\"plotly\"` theme has been enabled by default in version 4." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ecdfb49", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import pandas as pd\n", + "\n", + "# Make figure with subplots\n", + "fig = make_subplots(rows=1, cols=2, specs=[[{\"type\": \"bar\"},\n", + " {\"type\": \"surface\"}]])\n", + "\n", + "# Add bar traces to subplot (1, 1)\n", + "fig.add_trace(go.Bar(y=[2, 1, 3]), row=1, col=1)\n", + "fig.add_trace(go.Bar(y=[3, 2, 1]), row=1, col=1)\n", + "fig.add_trace(go.Bar(y=[2.5, 2.5, 3.5]), row=1, col=1)\n", + "\n", + "# Add surface trace to subplot (1, 2)\n", + "# Read data from a csv\n", + "z_data = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv\")\n", + "fig.add_surface(z=z_data)\n", + "\n", + "# Hide legend\n", + "fig.update_layout(\n", + " showlegend=False,\n", + " title_text=\"Default Theme\",\n", + " height=500,\n", + " width=800,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f827b71f", + "metadata": {}, + "source": [ + "You can revert to the version 3 figure appearance by disabling the default theme as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3301f85e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.io as pio\n", + "pio.templates.default = \"none\"\n", + "\n", + "import plotly.graph_objects as go\n", + "from plotly.subplots import make_subplots\n", + "import pandas as pd\n", + "\n", + "# Make figure with subplots\n", + "fig = make_subplots(rows=1, cols=2, specs=[[{\"type\": \"bar\"},\n", + " {\"type\": \"surface\"}]])\n", + "\n", + "# Add bar traces to subplot (1, 1)\n", + "fig.add_trace(go.Bar(y=[2, 1, 3]), row=1, col=1)\n", + "fig.add_trace(go.Bar(y=[3, 2, 1]), row=1, col=1)\n", + "fig.add_trace(go.Bar(y=[2.5, 2.5, 3.5]), row=1, col=1)\n", + "\n", + "# Add surface trace to subplot (1, 2)\n", + "# Read data from a csv\n", + "z_data = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv\")\n", + "fig.add_surface(z=z_data)\n", + "\n", + "# Hide legend\n", + "fig.update_layout(\n", + " showlegend=False,\n", + " title_text=\"Default Theme Disabled\",\n", + " height=500,\n", + " width=800,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2e3dd9d7", + "metadata": {}, + "outputs": [], + "source": [ + "# Restore default theme\n", + "pio.templates.default = \"plotly\"" + ] + }, + { + "cell_type": "markdown", + "id": "4b02a38c", + "metadata": {}, + "source": [ + "See [Theming and templates](/python/templates) for more information on theming in plotly.py version 4.\n", + "\n", + "### Add trace return value\n", + "In version 3, the `add_trace` graph object figure method returned a reference to the newly created trace. This was also the case for the `add_{trace_type}` methods (e.g. `add_scatter`, `add_bar`, etc.). In version 4, these methods return a reference to the calling figure. This change was made to support method chaining of figure operations. For example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f008e218", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "(make_subplots(rows=1, cols=2)\n", + " .add_scatter(y=[2, 1, 3], row=1, col=1)\n", + " .add_bar(y=[3, 2, 1], row=1, col=2)\n", + " .update_layout(\n", + " title_text=\"Figure title\",\n", + " showlegend=False,\n", + " width=800,\n", + " height=500,\n", + " )\n", + " .show())" + ] + }, + { + "cell_type": "markdown", + "id": "eceb7912", + "metadata": {}, + "source": [ + "Code that relied on the `add_*` methods to return a reference to the newly created trace will need to be updated to access the trace from the returned figure. This can be done by appending `.data[-1]` to the add trace expression.\n", + "\n", + "Here is an example of a version 3 code snippet that adds a scatter trace to a figure, assigns the result to a variable named `scatter`, and then modifies the marker size of the scatter trace.\n", + "\n", + "```python\n", + "import plotly.graph_objs as go\n", + "fig = go.Figure()\n", + "scatter = fig.add_trace(go.Scatter(y=[2, 3, 1]))\n", + "scatter.marker.size = 20\n", + "```\n", + "In version 4, this would be replaced with the following:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go\n", + "fig = go.Figure()\n", + "scatter = fig.add_trace(go.Scatter(y=[2, 3, 1])).data[-1]\n", + "scatter.marker.size = 20\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "a4a84eba", + "metadata": {}, + "source": [ + "### `make_subplots` updates\n", + "The `make_subplots` function has been overhauled to support all trace types and to support the integration of Plotly Express. Here are a few changes to be aware of when porting code that uses `make_subplots` to version 4.\n", + "\n", + "#### New preferred import location\n", + "The preferred import location of the `make_subplots` function is now `plotly.subplots.make_subplots`. For compatibility, this function is still available as `plotly.tools.make_subplots`.\n", + "\n", + "#### Grid no longer printed by default\n", + "When the `print_grid` argument to `make_subplots` is set to `True`, a text representation of the subplot grid is printed by the `make_subplots` function. In version 3, the default value of `print_grid` was `True`. In version 4, the default value of `print_grid` is `False`.\n", + "\n", + "#### New `row_heights` argument to replace `row_width`\n", + "The legacy argument for specifying the relative height of subplot rows was called `row_width`. A new `row_heights` argument has been introduced for this purpose.\n", + "\n", + "> Note: Although it is not mentioned in the docstring for `plotly.subplots.make_subplots`, the legacy `row_width` argument, with the legacy behavior, is still available in version 4.\n", + "\n", + "In addition to having a more consistent name, values specified to the new `row_heights` argument properly honor the `start_cell` argument. With the legacy `row_width` argument, the list of heights was always interpreted from the bottom row to the top row, even if `start_cell==\"top-left\"`. With the new `row_heights` argument, the list of heights is interpreted from top to bottom if `start_cell==\"top-left\"` and from bottom to top if `start_cell==\"bottom-left\"`.\n", + "\n", + "When porting code from `row_width` to `row_heights`, the order of the heights list must be reversed if `start_cell==\"top-left\"` or `start_cell` was unspecified.\n", + "\n", + "Here is a version 3 compatible example that uses the `row_width` argument to create a figure with subplots where the top row is twice as tall as the bottom row." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "adb3b88b", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=1,\n", + " row_width=[0.33, 0.67],\n", + " start_cell=\"top-left\")\n", + "\n", + "fig.add_scatter(y=[2, 1, 3], row=1, col=1)\n", + "fig.add_bar(y=[2, 3, 1], row=2, col=1)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "abf1f3a7", + "metadata": {}, + "source": [ + "And here is the equivalent, version 4 example. Note how the order to the height list is reversed compared to the example above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c2a190a6", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "\n", + "fig = make_subplots(\n", + " rows=2, cols=1,\n", + " row_heights=[0.67, 0.33],\n", + " start_cell=\"top-left\")\n", + "\n", + "fig.add_scatter(y=[2, 1, 3], row=1, col=1)\n", + "fig.add_bar(y=[2, 3, 1], row=2, col=1)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d1d99687", + "metadata": {}, + "source": [ + "#### Implementation of shared axes with `make_subplots`\n", + "The implementation of shared axis support in the `make_subplots` function has been simplified. Prior to version 4, shared y-axes were implemented by associating a single `yaxis` object with multiple `xaxis` objects, and vica versa.\n", + "\n", + "In version 4, every 2D Cartesian subplot has a dedicated x-axis and and a dedicated y-axis. Axes are now \"shared\" by being linked together using the `matches` axis property.\n", + "\n", + "For legacy code that makes use of the `make_subplots` and add trace APIs, this change does not require any action on the user's part. However, legacy code that uses `make_subplots` to create a figure with shared axes, and then manipulates the axes directly, may require updates. The output of the `.print_grid` method on a figure created using `make_subplots` can be used to identify which axis objects are associated with each subplot." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5b93b57b", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots\n", + "fig = make_subplots(rows=1, cols=2, shared_yaxes=True)\n", + "fig.print_grid()\n", + "print(fig)" + ] + }, + { + "cell_type": "markdown", + "id": "691f3144", + "metadata": {}, + "source": [ + "### Trace UIDs\n", + "In version 3, all trace graph objects were copied and assigned a new `uid` property when being added to a `Figure`. In version 4, these `uid` properties are only generated automatically when a trace is added to a `FigureWidget`. When a trace is added to a standard `Figure` graph object the input `uid`, if provided, is accepted as is.\n", + "\n", + "### Timezones\n", + "Prior to version 4, when plotly.py was passed a `datetime` that included a timezone, the `datetime` was automatically converted to UTC. In version 4, this conversion is no longer performed, and `datetime` objects are accepted and displayed in local time." + ] + }, + { + "cell_type": "markdown", + "id": "79428e3e", + "metadata": {}, + "source": [ + "### Headless image export on Linux with Xvfb.\n", + "In version 4, the static image export logic attempts to automatically detect whether to call the orca image export utility using Xvfb. Xvfb is needed for orca to work in a Linux environment if an X11 display server is not available. By default, Xvfb is used if plotly.py is running on Linux if no X11 display server is detected and `Xvfb` is available on the system `PATH`.\n", + "\n", + "This new behavior can be disabled by setting the `use_xvfb` orca configuration option to `False` as follows:\n", + "\n", + "```python\n", + "import plotly.io as pio\n", + "pio.orca.config.use_xvfb = False\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "9f9d9eaf", + "metadata": {}, + "source": [ + "### Removals\n", + "\n", + "#### fileopt argument removal\n", + "The `fileopt` argument to `chart_studio.plotly.plot` has been removed, so in-place modifications to previously published figures are no longer supported.\n", + "\n", + "#### Legacy online `GraphWidget`\n", + "The legacy online-only `GraphWidget` class has been removed. Please use the `plotly.graph_objects.FigureWidget` class instead. See the [Figure Widget Overview](/python/figurewidget/) for more information.\n", + "\n", + "### Recommended style updates\n", + "\n", + "#### Import from `graph_objects` instead of `graph_objs`\n", + "The legacy `plotly.graph_objs` package has been aliased as `plotly.graph_objects` because the latter is much easier to communicate verbally. The `plotly.graph_objs` package is still available for backward compatibility." + ] + }, + { + "cell_type": "markdown", + "id": "b9bc2942", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "Migration guide for upgrading from version 3 to version 4", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Version 4 Migration Guide", + "order": 39, + "page_type": "example_index", + "permalink": "python/v4-migration/", + "thumbnail": "thumbnail/v4-migration.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/v6-changes.ipynb b/v6-changes.ipynb new file mode 100644 index 000000000..da9743cc9 --- /dev/null +++ b/v6-changes.ipynb @@ -0,0 +1,193 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "13c854e4", + "metadata": {}, + "source": [ + "This page outlines the changes in Plotly.py version 6 and cases where you may need to update your charts or tools that you use for working with Plotly.py." + ] + }, + { + "cell_type": "markdown", + "id": "c56f832c", + "metadata": {}, + "source": [ + "## Jupyter Notebook Support\n", + "\n", + "Versions of Jupyter Notebook earlier than version 7 are no longer supported. To upgrade to the latest Jupyter Notebook:\n", + "\n", + "```\n", + "pip install notebook --upgrade\n", + "```\n", + "\n", + "## Change to anywidget for go.FigureWidget\n", + "\n", + "[go.FigureWidget](https://plotly.com/python/figurewidget/) now uses [anywidget](https://anywidget.dev/). Install `anywidget` with:\n", + "\n", + "```python\n", + "pip install anywidget\n", + "```\n", + "\n", + "## Processing NumPy and NumPy-Convertible Arrays\n", + "\n", + "Plotly.py now takes advantage of recent changes in how Plotly.js handles typed arrays for improved performance. See the [performance page](https://plotly.com/python/performance/) for more details.\n", + "\n", + "> If you are using Plotly.py 6 or later with Dash Design Kit, you may need to upgrade your Dash Design Kit version. See the [Dash Design Kit Compatibility section on the performance page](/python/performance/#dash-design-kit-compatibility) for more details.\n", + "\n", + "\n", + "## Dataframe Support\n", + "\n", + "Plotly Express now uses [Narwhals](https://narwhals-dev.github.io/narwhals/) to natively support pandas, Polars, and PyArrow. With this change, the [performance](https://plotly.com/python/performance/) of using Polars or PyArrow with Plotly Express is significantly improved.\n", + "\n", + "## Mapbox Deprecation\n", + "\n", + "Mapbox-based traces are deprecated and will be removed in a future version of Plotly.py. Use [Maplibre-based](https://plotly.com/python/mapbox-to-maplibre/) traces instead.\n", + "\n", + "## Removed Attributes\n", + "\n", + "The following attributes have been removed in Plotly.py 6.\n", + "\n", + "### `titlefont`,`titleposition`, `titleside`, and `titleoffset`\n", + "\n", + "The layout attributes `titlefont`,`titleposition`, `titleside`, and `titleoffset` have been removed. Replace them with `title.font`, `title.position`, `title.side`, and `title.offset`.\n", + "\n", + "The following example shows how to use `layout.title.font`:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(\n", + " data=[\n", + " go.Bar(\n", + " x=[\"A\", \"B\", \"C\", \"D\"],\n", + " y=[10, 15, 13, 17]\n", + " )\n", + " ],\n", + " layout=dict(\n", + " title=dict(\n", + " text=\"Chart Title\",\n", + " font=dict(\n", + " size=40\n", + " )\n", + " )\n", + " ),\n", + " # Previously the title font could be set like this:\n", + " # titlefont=dict(size=40)\n", + ")\n", + "\n", + "fig.show()\n", + "```\n", + "\n", + "## Removed Traces\n", + "\n", + "The following traces have been removed.\n", + "\n", + "### `heatmapgl`\n", + "\n", + "The `heatmapgl` trace has been removed. Use [`heatmap`](/python/heatmaps/) instead.\n", + "\n", + "\n", + "### `pointcloud`\n", + "\n", + "The `pointcloud` trace has been removed. Use [`scattergl`](/python/reference/scattergl/).\n" + ] + }, + { + "cell_type": "markdown", + "id": "482427c8", + "metadata": { + "lines_to_next_cell": 2 + }, + "source": [ + "## Other Removed Features\n", + "\n", + "### Transforms\n", + "\n", + "Transforms, which were deprecated in Plotly.py v5, have been removed. You can achieve similar functionality by preprocessing the data with a dataframe library.\n", + "\n", + "For example, a transform to filter the data:\n", + "\n", + "```python\n", + " dict(\n", + " type = 'filter',\n", + " target = df['year'],\n", + " orientation = '=',\n", + " value = 2007\n", + " ),\n", + "```\n", + "\n", + "Could be rewritten using Pandas:\n", + "\n", + "```python\n", + "df_2007 = df[df['year'] == 2007]\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "5d269660", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + }, + "plotly": { + "description": "Guide to changes in version 6 of Plotly.py and how to migrate from version 5", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Changes in Version 6", + "order": 8, + "page_type": "example_index", + "permalink": "python/v6-migration/", + "thumbnail": "thumbnail/v4-migration.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/violin.ipynb b/violin.ipynb new file mode 100644 index 000000000..ed4fe60d0 --- /dev/null +++ b/violin.ipynb @@ -0,0 +1,479 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "761564a1", + "metadata": {}, + "source": [ + "## Violin Plot with Plotly Express\n", + "\n", + "A [violin plot](https://en.wikipedia.org/wiki/Violin_plot) is a statistical representation of numerical data. It is similar to a [box plot](https://plotly.com/python/box-plots/), with the addition of a rotated [kernel density](https://en.wikipedia.org/wiki/Kernel_density_estimation) plot on each side.\n", + "\n", + "Alternatives to violin plots for visualizing distributions include [histograms](https://plotly.com/python/histograms/), [box plots](https://plotly.com/python/box-plots/), [ECDF plots](https://plotly.com/python/ecdf-plots/) and [strip charts](https://plotly.com/python/strip-charts/).\n", + "\n", + "\n", + "### Basic Violin Plot with Plotly Express\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c18fc828", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"total_bill\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "05395eff", + "metadata": {}, + "source": [ + "### Violin plot with box and data points" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bcd7b8a4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"total_bill\", box=True, # draw box plot inside the violin\n", + " points='all', # can be 'outliers', or False\n", + " )\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c4e7b77b", + "metadata": {}, + "source": [ + "### Multiple Violin Plots" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2a9bdd3b", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"tip\", x=\"smoker\", color=\"sex\", box=True, points=\"all\",\n", + " hover_data=df.columns)\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4ef04247", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"tip\", color=\"sex\",\n", + " violinmode='overlay', # draw violins on top of each other\n", + " # default violinmode is 'group' as in example above\n", + " hover_data=df.columns)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ba7cc9bc", + "metadata": {}, + "source": [ + "## Violin Plot with go.Violin\n", + "\n", + "If Plotly Express does not provide a good starting point, you can use [the more generic `go.Violin` class from `plotly.graph_objects`](/python/graph-objects/). All the options of `go.Violin` are documented in the reference https://plotly.com/python/reference/violin/\n", + "\n", + "#### Basic Violin Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "900d55d7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv\")\n", + "\n", + "fig = go.Figure(data=go.Violin(y=df['total_bill'], box_visible=True, line_color='black',\n", + " meanline_visible=True, fillcolor='lightseagreen', opacity=0.6,\n", + " x0='Total Bill'))\n", + "\n", + "fig.update_layout(yaxis_zeroline=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "7ec3f977", + "metadata": {}, + "source": [ + "#### Multiple Traces" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "51620bbd", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv\")\n", + "\n", + "fig = go.Figure()\n", + "\n", + "days = ['Thur', 'Fri', 'Sat', 'Sun']\n", + "\n", + "for day in days:\n", + " fig.add_trace(go.Violin(x=df['day'][df['day'] == day],\n", + " y=df['total_bill'][df['day'] == day],\n", + " name=day,\n", + " box_visible=True,\n", + " meanline_visible=True))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3c1afbc8", + "metadata": {}, + "source": [ + "#### Grouped Violin Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "238b2dac", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv\")\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Violin(x=df['day'][ df['sex'] == 'Male' ],\n", + " y=df['total_bill'][ df['sex'] == 'Male' ],\n", + " legendgroup='M', scalegroup='M', name='M',\n", + " line_color='blue')\n", + " )\n", + "fig.add_trace(go.Violin(x=df['day'][ df['sex'] == 'Female' ],\n", + " y=df['total_bill'][ df['sex'] == 'Female' ],\n", + " legendgroup='F', scalegroup='F', name='F',\n", + " line_color='orange')\n", + " )\n", + "\n", + "fig.update_traces(box_visible=True, meanline_visible=True)\n", + "fig.update_layout(violinmode='group')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "b8b1592c", + "metadata": {}, + "source": [ + "#### Split Violin Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a13a64a", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv\")\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Violin(x=df['day'][ df['smoker'] == 'Yes' ],\n", + " y=df['total_bill'][ df['smoker'] == 'Yes' ],\n", + " legendgroup='Yes', scalegroup='Yes', name='Yes',\n", + " side='negative',\n", + " line_color='blue')\n", + " )\n", + "fig.add_trace(go.Violin(x=df['day'][ df['smoker'] == 'No' ],\n", + " y=df['total_bill'][ df['smoker'] == 'No' ],\n", + " legendgroup='No', scalegroup='No', name='No',\n", + " side='positive',\n", + " line_color='orange')\n", + " )\n", + "fig.update_traces(meanline_visible=True)\n", + "fig.update_layout(violingap=0, violinmode='overlay')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "090d6798", + "metadata": {}, + "source": [ + "#### Advanced Violin Plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d852915e", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "import pandas as pd\n", + "\n", + "df = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv\")\n", + "\n", + "pointpos_male = [-0.9,-1.1,-0.6,-0.3]\n", + "pointpos_female = [0.45,0.55,1,0.4]\n", + "show_legend = [True,False,False,False]\n", + "\n", + "fig = go.Figure()\n", + "\n", + "for i in range(0,len(pd.unique(df['day']))):\n", + " fig.add_trace(go.Violin(x=df['day'][(df['sex'] == 'Male') &\n", + " (df['day'] == pd.unique(df['day'])[i])],\n", + " y=df['total_bill'][(df['sex'] == 'Male')&\n", + " (df['day'] == pd.unique(df['day'])[i])],\n", + " legendgroup='M', scalegroup='M', name='M',\n", + " side='negative',\n", + " pointpos=pointpos_male[i], # where to position points\n", + " line_color='lightseagreen',\n", + " showlegend=show_legend[i])\n", + " )\n", + " fig.add_trace(go.Violin(x=df['day'][(df['sex'] == 'Female') &\n", + " (df['day'] == pd.unique(df['day'])[i])],\n", + " y=df['total_bill'][(df['sex'] == 'Female')&\n", + " (df['day'] == pd.unique(df['day'])[i])],\n", + " legendgroup='F', scalegroup='F', name='F',\n", + " side='positive',\n", + " pointpos=pointpos_female[i],\n", + " line_color='mediumpurple',\n", + " showlegend=show_legend[i])\n", + " )\n", + "\n", + "# update characteristics shared by all traces\n", + "fig.update_traces(meanline_visible=True,\n", + " points='all', # show all points\n", + " jitter=0.05, # add some jitter on points for better visibility\n", + " scalemode='count') #scale violin plot area with total count\n", + "fig.update_layout(\n", + " title_text=\"Total bill distribution
scaled by number of bills per gender\",\n", + " violingap=0, violingroupgap=0, violinmode='overlay')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "3624a795", + "metadata": {}, + "source": [ + "#### Ridgeline plot\n", + "\n", + "A ridgeline plot ([previously known as Joy Plot](https://serialmentor.com/blog/2017/9/15/goodbye-joyplots)) shows the distribution of a numerical value for several groups. They can be used for visualizing changes in distributions over time or space." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4917e6fb", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "from plotly.colors import n_colors\n", + "import numpy as np\n", + "np.random.seed(1)\n", + "\n", + "# 12 sets of normal distributed random data, with increasing mean and standard deviation\n", + "data = (np.linspace(1, 2, 12)[:, np.newaxis] * np.random.randn(12, 200) +\n", + " (np.arange(12) + 2 * np.random.random(12))[:, np.newaxis])\n", + "\n", + "colors = n_colors('rgb(5, 200, 200)', 'rgb(200, 10, 10)', 12, colortype='rgb')\n", + "\n", + "fig = go.Figure()\n", + "for data_line, color in zip(data, colors):\n", + " fig.add_trace(go.Violin(x=data_line, line_color=color))\n", + "\n", + "fig.update_traces(orientation='h', side='positive', width=3, points=False)\n", + "fig.update_layout(xaxis_showgrid=False, xaxis_zeroline=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "97dca615", + "metadata": {}, + "source": [ + "### Violin Plot With Only Points\n", + "\n", + "A [strip chart](/python/strip-charts/) is like a violin plot with points showing, and no violin:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "88c45df7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.tips()\n", + "fig = px.strip(df, x='day', y='tip')\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "dee1e12e", + "metadata": {}, + "source": [ + "### Choosing The Algorithm For Computing Quartiles\n", + "\n", + "*New in 5.10*\n", + "\n", + "By default, quartiles for violin plots are computed using the `linear` method (for more about linear interpolation, see #10 listed on [http://jse.amstat.org/v14n3/langford.html](http://jse.amstat.org/v14n3/langford.html) and [https://en.wikipedia.org/wiki/Quartile](https://en.wikipedia.org/wiki/Quartile) for more details).\n", + "\n", + "However, you can also choose to use an `exclusive` or an `inclusive` algorithm to compute quartiles.\n", + "\n", + "The _exclusive_ algorithm 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 is the median of the upper half.\n", + "\n", + "The _inclusive_ algorithm 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." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "de38a36c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "df = px.data.tips()\n", + "fig = px.violin(df, y=\"total_bill\")\n", + "fig.update_traces(quartilemethod=\"exclusive\") # or \"inclusive\", or \"linear\" by default\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f61c3979", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.violin()`](https://plotly.com/python-api-reference/generated/plotly.express.violin) or https://plotly.com/python/reference/violin/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "7a3010f0", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.0" + }, + "plotly": { + "description": "How to make violin plots in Python with Plotly.", + "display_as": "statistical", + "language": "python", + "layout": "base", + "name": "Violin Plots", + "order": 10, + "page_type": "u-guide", + "permalink": "python/violin/", + "redirect_from": [ + "/python/violin-plot/", + "/python/violin-plots/" + ], + "thumbnail": "thumbnail/violin.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/waterfall-charts.ipynb b/waterfall-charts.ipynb new file mode 100644 index 000000000..19994fb6e --- /dev/null +++ b/waterfall-charts.ipynb @@ -0,0 +1,221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "39fc89de", + "metadata": {}, + "source": [ + "### Simple Waterfall Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "be1aeca7", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Waterfall(\n", + " name = \"20\", orientation = \"v\",\n", + " measure = [\"relative\", \"relative\", \"total\", \"relative\", \"relative\", \"total\"],\n", + " x = [\"Sales\", \"Consulting\", \"Net revenue\", \"Purchases\", \"Other expenses\", \"Profit before tax\"],\n", + " textposition = \"outside\",\n", + " text = [\"+60\", \"+80\", \"\", \"-40\", \"-20\", \"Total\"],\n", + " y = [60, 80, 0, -40, -20, 0],\n", + " connector = {\"line\":{\"color\":\"rgb(63, 63, 63)\"}},\n", + "))\n", + "\n", + "fig.update_layout(\n", + " title = \"Profit and loss statement 2018\",\n", + " showlegend = True\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "96a82919", + "metadata": {}, + "source": [ + "### Multi Category Waterfall Chart\n", + "This example uses the [waterfallgroupgap attribute](https://plotly.com/python/reference/layout/#layout-waterfallgroupgap), which sets a gap between bars." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "47b25baa", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Waterfall(\n", + " x = [[\"2016\", \"2017\", \"2017\", \"2017\", \"2017\", \"2018\", \"2018\", \"2018\", \"2018\"],\n", + " [\"initial\", \"q1\", \"q2\", \"q3\", \"total\", \"q1\", \"q2\", \"q3\", \"total\"]],\n", + " measure = [\"absolute\", \"relative\", \"relative\", \"relative\", \"total\", \"relative\", \"relative\", \"relative\", \"total\"],\n", + " y = [1, 2, 3, -1, None, 1, 2, -4, None],\n", + " base = 1000\n", + "))\n", + "\n", + "fig.add_trace(go.Waterfall(\n", + " x = [[\"2016\", \"2017\", \"2017\", \"2017\", \"2017\", \"2018\", \"2018\", \"2018\", \"2018\"],\n", + " [\"initial\", \"q1\", \"q2\", \"q3\", \"total\", \"q1\", \"q2\", \"q3\", \"total\"]],\n", + " measure = [\"absolute\", \"relative\", \"relative\", \"relative\", \"total\", \"relative\", \"relative\", \"relative\", \"total\"],\n", + " y = [1.1, 2.2, 3.3, -1.1, None, 1.1, 2.2, -4.4, None],\n", + " base = 1000\n", + "))\n", + "\n", + "fig.update_layout(\n", + " waterfallgroupgap = 0.5,\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "1cae3559", + "metadata": {}, + "source": [ + "### Setting Marker Size and Color\n", + "This example uses [decreasing](https://plotly.com/python/reference/waterfall/#waterfall-decreasing), [increasing](https://plotly.com/python/reference/waterfall/#waterfall-increasing), and [totals](https://plotly.com/python/reference/waterfall/#waterfall-totals) attributes to customize the bars." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "396eae2d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Waterfall(\n", + " x = [[\"2016\", \"2017\", \"2017\", \"2017\", \"2017\", \"2018\", \"2018\", \"2018\", \"2018\"],\n", + " [\"initial\", \"q1\", \"q2\", \"q3\", \"total\", \"q1\", \"q2\", \"q3\", \"total\"]],\n", + " measure = [\"absolute\", \"relative\", \"relative\", \"relative\", \"total\", \"relative\", \"relative\", \"relative\", \"total\"],\n", + " y = [10, 20, 30, -10, None, 10, 20, -40, None], base = 300,\n", + " decreasing = {\"marker\":{\"color\":\"Maroon\", \"line\":{\"color\":\"red\", \"width\":2}}},\n", + " increasing = {\"marker\":{\"color\":\"Teal\"}},\n", + " totals = {\"marker\":{\"color\":\"deep sky blue\", \"line\":{\"color\":\"blue\", \"width\":3}}}\n", + "))\n", + "\n", + "fig.update_layout(title = \"Profit and loss statement\", waterfallgap = 0.3)\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8f0d67c3", + "metadata": {}, + "source": [ + "### Horizontal Waterfall Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cebd874d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure(go.Waterfall(\n", + " name = \"2018\", orientation = \"h\", measure = [\"relative\", \"relative\", \"relative\", \"relative\", \"total\", \"relative\",\n", + " \"relative\", \"relative\", \"relative\", \"total\", \"relative\", \"relative\", \"total\", \"relative\", \"total\"],\n", + " y = [\"Sales\", \"Consulting\", \"Maintenance\", \"Other revenue\", \"Net revenue\", \"Purchases\", \"Material expenses\",\n", + " \"Personnel expenses\", \"Other expenses\", \"Operating profit\", \"Investment income\", \"Financial income\",\n", + " \"Profit before tax\", \"Income tax (15%)\", \"Profit after tax\"],\n", + " x = [375, 128, 78, 27, None, -327, -12, -78, -12, None, 32, 89, None, -45, None],\n", + " connector = {\"mode\":\"between\", \"line\":{\"width\":4, \"color\":\"rgb(0, 0, 0)\", \"dash\":\"solid\"}}\n", + "))\n", + "\n", + "fig.update_layout(title = \"Profit and loss statement 2018\")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d3a9da44", + "metadata": {}, + "source": [ + "#### Reference\n", + "See https://plotly.com/python/reference/waterfall/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "d5e4233c", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to make waterfall plots in Python with Plotly.", + "display_as": "financial", + "language": "python", + "layout": "base", + "name": "Waterfall Charts", + "order": 3, + "page_type": "example_index", + "permalink": "python/waterfall-charts/", + "thumbnail": "thumbnail/waterfall-charts.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/wide-form.ipynb b/wide-form.ipynb new file mode 100644 index 000000000..7fa84e641 --- /dev/null +++ b/wide-form.ipynb @@ -0,0 +1,605 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "34e2da2a", + "metadata": {}, + "source": [ + "### Plotly Express works with Column-oriented, Matrix or Geographic Data\n", + "\n", + "Plotly Express provides functions to visualize a variety of types of data. Most functions such as `px.bar` or `px.scatter` expect to operate on column-oriented data of the type you might store in a `DataFrame` (in either \"long\" or \"wide\" format, see below). These functions use Pandas internally to process the data, but also accept other types of DataFrames as arguments. See the [Plotly Express arguments page](/python/px-arguments/) for more details.\n", + "\n", + "[`px.imshow` operates on matrix-like data](/python/imshow/) you might store in a `numpy` or `xarray` array and functions like [`px.choropleth` and `px.choropleth_mapbox` can operate on geographic data](/python/maps/) of the kind you might store in a GeoPandas `GeoDataFrame`. This page details how to provide a specific form of column-oriented data to 2D-Cartesian Plotly Express functions, but you can also check out our [detailed column-input-format documentation](/python/px-arguments/).\n", + "\n", + "### Plotly Express works with Long-, Wide-, and Mixed-Form Data\n", + "\n", + "*Until version 4.8, Plotly Express only operated on long-form (previously called \"tidy\") data, but now accepts wide-form and mixed-form data as well.*\n", + "\n", + "There are three common conventions for storing column-oriented data, usually in a data frame with column names:\n", + "\n", + "* **long-form data** has one row per observation, and one column per variable. This is suitable for storing and displaying multivariate data i.e. with dimension greater than 2. This format is sometimes called \"tidy\".\n", + "* **wide-form data** has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.\n", + "* **mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables.\n", + "\n", + "Every Plotly Express function can operate on long-form data (other than `px.imshow` which operates only on wide-form input), and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.\n", + "\n", + "By way of example here is the same data, represented in long-form first, and then in wide-form:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2ec8d6c1", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "long_df = px.data.medals_long()\n", + "long_df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "840361be", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "wide_df" + ] + }, + { + "cell_type": "markdown", + "id": "fde2db73", + "metadata": {}, + "source": [ + "Plotly Express can produce **the same plot from either form**. For the long-form input, `x` and `y` are set to the respective column names." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f50675a8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "long_df = px.data.medals_long()\n", + "\n", + "fig = px.bar(long_df, x=\"nation\", y=\"count\", color=\"medal\", title=\"Long-Form Input\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "a9508874", + "metadata": {}, + "source": [ + "For the wide-form input, we **pass in a list of column-names `y`**, which is enough to trigger the wide-form processing mode. Wide-form mode is also the default if neither `x` nor `y` are specified, see section at bottom regarding Wide-Form Defaults." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ee58f4c", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], title=\"Wide-Form Input\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "6368c4c6", + "metadata": {}, + "source": [ + "### Labeling axes, legends and hover text\n", + "\n", + "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. This is because Plotly Express performed an [internal Pandas `melt()` operation](https://pandas.pydata.org/docs/reference/api/pandas.melt.html) to convert the wide-form data into long-form for plotting, and used the Pandas convention for assign column names to the intermediate long-form data. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, (or see below regarding using a data frame with named row- and column-indexes). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2993ec81", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], title=\"Wide-Form Input, relabelled\",\n", + " labels={\"value\": \"count\", \"variable\": \"medal\"})\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "d44b6354", + "metadata": {}, + "source": [ + "Plotly Express figures created using wide-form data can be [styled just like any other Plotly Express figure](/python/styling-plotly-express/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "958fe9a3", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"],\n", + " title=\"Wide-Form Input, styled\",\n", + " labels={\"value\": \"Medal Count\", \"variable\": \"Medal\", \"nation\": \"Olympic Nation\"},\n", + " color_discrete_map={\"gold\": \"gold\", \"silver\": \"silver\", \"bronze\": \"#c96\"},\n", + " template=\"simple_white\"\n", + " )\n", + "fig.update_layout(font_family=\"Rockwell\", showlegend=False)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "f7c5ba91", + "metadata": {}, + "source": [ + "### Data Frames with Named Indexes\n", + "\n", + "Pandas `DataFrames` support not only column names and \"row names\" via the value of `index`, but the indexes themselves can be named. Here is how to assign one column of the wide sample data frame above as the index, and to name the column index. The result \"indexed\" sample data frame can also be obtained by calling `px.data.medals_wide(indexed=True)`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "92a73864", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide()\n", + "wide_df = wide_df.set_index(\"nation\")\n", + "wide_df.columns.name = \"medals\"\n", + "wide_df" + ] + }, + { + "cell_type": "markdown", + "id": "863539e4", + "metadata": {}, + "source": [ + "When working with a data frame like the one above, you can pass the index references directly as arguments, to benefit from automatic labelling for everything except the y axis label, which will default to \"values\", but this can be overridden with the `labels` argument as above:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "004eb455", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=True)\n", + "\n", + "fig = px.bar(wide_df, x=wide_df.index, y=wide_df.columns)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "be54132c", + "metadata": {}, + "source": [ + "If you transpose `x` and `y`, thereby assigning the columns to `x`, the orientation will be switched to horizontal:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "00e54ece", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=True)\n", + "\n", + "fig = px.bar(wide_df, x=wide_df.columns, y=wide_df.index)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "9c466877", + "metadata": {}, + "source": [ + "### Assigning Inferred Columns to Non-Default Arguments" + ] + }, + { + "cell_type": "markdown", + "id": "7135374d", + "metadata": {}, + "source": [ + "In the examples above, the columns of the wide data frame are assigned by default as an \"inferred\" column named `variable` to the `color` argument (see section below for documentation of the default behaviours), but this is not a hard constraint. The `variable` column can be assigned to any Plotly Express argument, for example to accomplish faceting, and `color` can be reassigned to any other value. More generally, when plotting with a data frame without named indexes, you can reassign the inferred column named `variable` and `value` to any argument:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf2fcb9f", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=False)\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], facet_col=\"variable\", color=\"nation\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "91b43387", + "metadata": {}, + "source": [ + "You can also prevent `color` from getting assigned if you're mapping `variable` to some other argument:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43095d44", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=False)\n", + "\n", + "fig = px.bar(wide_df, x=\"nation\", y=[\"gold\", \"silver\", \"bronze\"], facet_col=\"variable\", color=px.NO_COLOR)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "cbfacfac", + "metadata": {}, + "source": [ + "If using a data frame's named indexes, either explicitly or relying on the defaults, the row-index references (i.e. `df.index`) or column-index names (i.e. the value of `df.columns.name`) must be used:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "615d6de4", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=True)\n", + "\n", + "fig = px.bar(wide_df, facet_col=\"medal\", color=wide_df.index)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ba0025b0", + "metadata": {}, + "source": [ + "### Mixed-Form Data\n", + "\n", + "In some cases, a data frame is neither clearly long-form nor wide-form, and we can call this \"mixed-form\". For example, in the data frame below, if it contained only the `experiment` columns, the data could be described as wide-form, and if it contained only `gender` and `group` it could be described as long-form, but it contains both, so it is best described as mixed-form data:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "69f939ab", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "mixed_df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "836d0918", + "metadata": {}, + "source": [ + "We can visualize just the wide-form portion of the data frame easily with a [violin chart](/python/violin/). As a special note, we'll assign the index, which is the participant ID, to the `hover_data`, so that hovering over outlier points will identify their row." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eeebd767", + "metadata": { + "lines_to_next_cell": 0 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "\n", + "fig = px.violin(mixed_df, y=[\"experiment_1\", \"experiment_2\", \"experiment_3\"], hover_data=[mixed_df.index])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "baf00244", + "metadata": {}, + "source": [ + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "7e1c3657", + "metadata": {}, + "source": [ + "We are not limited to visualizing only the wide-form portion of the data, however. We can also leverage the long-form portion of the data frame, for example to color by participant `gender` and facet by participant `group`, all without having to manipulate the data frame:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "75f8da83", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "\n", + "fig = px.violin(mixed_df, y=[\"experiment_1\", \"experiment_2\", \"experiment_3\"],\n", + " color=\"gender\", facet_col=\"group\", hover_data=[mixed_df.index])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "ea0725ea", + "metadata": {}, + "source": [ + "In the plots above, the column names provided to `y` are internally mapped to long-form column called `variable`, as is apparent in the x-axis labels. We can reassign `variable` to another argument as well, in this case we'll assign it to `facet_col` and reassign `group` to the `x` axis. We'll switch to a [box plot](/python/box-plots/) for variety." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1ee6ee6d", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "\n", + "fig = px.box(mixed_df, x=\"group\", y=[\"experiment_1\", \"experiment_2\", \"experiment_3\"],\n", + " color=\"gender\", facet_col=\"variable\", hover_data=[mixed_df.index])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8a55687e", + "metadata": {}, + "source": [ + "One interesting thing about a mixed-form data frame like this is that it remains easy to plot, say, one experiment against another, which would require some preliminary data wrangling if this was represented as a pure long-form dataset:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e86e5923", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "\n", + "fig = px.scatter(mixed_df, x=\"experiment_1\", y=\"experiment_2\",\n", + " color=\"group\", facet_col=\"gender\", hover_data=[mixed_df.index])\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "e6543010", + "metadata": {}, + "source": [ + "In fact, we can even visualize the results of every experiment against every other, using a [scatterplot matrix](/python/splom/):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "722ef7dc", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "\n", + "fig = px.scatter_matrix(mixed_df, dimensions=[\"experiment_1\", \"experiment_2\", \"experiment_3\"], color=\"gender\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "c51d6d42", + "metadata": {}, + "source": [ + "### Wide-Form Defaults\n", + "\n", + "For bar, scatter, line and area charts, the pattern of assigning `x=df.index`, `y=df.columns`, `color=\"variable\"` is so common that if you provide neither `x` nor `y` this is the default behaviour. An exception is made for bar charts when the values are not continuous variables, in which case the default is similar to histograms, with `x=df.columns`, `color=\"variable\"` and `y=`.\n", + "\n", + "For violin and box plots, the default is to assign `x=variable`, `y=df.columns` and for histograms the default is `x=df.columns`, `color=\"variable\"`\n", + "\n", + "These defaults are also filled in if you specify only `y` (`x` for histograms) as a list-of-columns. See below for orientation control." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8695c802", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=True)\n", + "\n", + "fig = px.bar(wide_df)\n", + "fig.show()\n", + "\n", + "fig = px.area(wide_df)\n", + "fig.show()\n", + "\n", + "fig = px.line(wide_df)\n", + "fig.show()\n", + "\n", + "fig = px.scatter(wide_df)\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b0b395f8", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "wide_df = mixed_df[[\"experiment_1\", \"experiment_2\", \"experiment_3\"]]\n", + "\n", + "fig = px.histogram(wide_df)\n", + "fig.show()\n", + "\n", + "fig = px.violin(wide_df)\n", + "fig.show()\n", + "\n", + "fig = px.box(wide_df)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "84f26f35", + "metadata": {}, + "source": [ + "### Orientation Control When Using Defaults\n", + "\n", + "If you specify neither `x` nor `y`, you can swap the default behaviour of `x` and `y` by setting `orientation=\"h\"`.\n", + "\n", + "If you specify only `x` as a list-of-columns (`y` in the case of histograms), then the defaults are filled in as if `orientation=\"h\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5bc7cd46", + "metadata": { + "lines_to_next_cell": 2 + }, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "wide_df = px.data.medals_wide(indexed=True)\n", + "\n", + "fig = px.bar(wide_df, orientation=\"h\")\n", + "fig.show()\n", + "\n", + "fig = px.area(wide_df, x=wide_df.columns)\n", + "fig.show()\n", + "\n", + "mixed_df = px.data.experiment(indexed=True)\n", + "wide_df = mixed_df[[\"experiment_1\", \"experiment_2\", \"experiment_3\"]]\n", + "\n", + "fig = px.histogram(wide_df, orientation=\"h\")\n", + "fig.show()\n", + "\n", + "fig = px.violin(wide_df, orientation=\"h\")\n", + "fig.show()\n", + "\n", + "fig = px.box(wide_df, orientation=\"h\")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "69a80c9a", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + }, + "plotly": { + "description": "Plotly Express' 2D-Cartesian functions accept data in long-, wide-, and mixed-form.", + "display_as": "file_settings", + "language": "python", + "layout": "base", + "name": "Plotly Express Wide-Form Support", + "order": 34, + "page_type": "u-guide", + "permalink": "python/wide-form/", + "thumbnail": "thumbnail/plotly-express.png" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/wind-rose-charts.ipynb b/wind-rose-charts.ipynb new file mode 100644 index 000000000..103eac9bc --- /dev/null +++ b/wind-rose-charts.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "7ec3fa65", + "metadata": {}, + "source": [ + "### Wind Rose Chart with Plotly Express\n", + "\n", + "A [wind rose chart](https://en.wikipedia.org/wiki/Wind_rose) (also known as a polar bar chart) is a graphical tool used to visualize how wind speed and direction are typically distributed at a given location. You can use the `px.bar_polar` function from Plotly Express as below, otherwise use `go.Barpolar` as explained in the next section.\n", + "\n", + "[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f5fab58", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "df = px.data.wind()\n", + "fig = px.bar_polar(df, r=\"frequency\", theta=\"direction\",\n", + " color=\"strength\", template=\"plotly_dark\",\n", + " color_discrete_sequence= px.colors.sequential.Plasma_r)\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "df1b2420", + "metadata": {}, + "source": [ + "#### Basic Wind Rose Chart" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "66da5759", + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.graph_objects as go\n", + "\n", + "fig = go.Figure()\n", + "\n", + "fig.add_trace(go.Barpolar(\n", + " r=[77.5, 72.5, 70.0, 45.0, 22.5, 42.5, 40.0, 62.5],\n", + " name='11-14 m/s',\n", + " marker_color='rgb(106,81,163)'\n", + "))\n", + "fig.add_trace(go.Barpolar(\n", + " r=[57.5, 50.0, 45.0, 35.0, 20.0, 22.5, 37.5, 55.0],\n", + " name='8-11 m/s',\n", + " marker_color='rgb(158,154,200)'\n", + "))\n", + "fig.add_trace(go.Barpolar(\n", + " r=[40.0, 30.0, 30.0, 35.0, 7.5, 7.5, 32.5, 40.0],\n", + " name='5-8 m/s',\n", + " marker_color='rgb(203,201,226)'\n", + "))\n", + "fig.add_trace(go.Barpolar(\n", + " r=[20.0, 7.5, 15.0, 22.5, 2.5, 2.5, 12.5, 22.5],\n", + " name='< 5 m/s',\n", + " marker_color='rgb(242,240,247)'\n", + "))\n", + "\n", + "fig.update_traces(text=['North', 'N-E', 'East', 'S-E', 'South', 'S-W', 'West', 'N-W'])\n", + "fig.update_layout(\n", + " title=dict(text='Wind Speed Distribution in Laurel, NE'),\n", + " font_size=16,\n", + " legend_font_size=16,\n", + " polar_radialaxis_ticksuffix='%',\n", + " polar_angularaxis_rotation=90,\n", + "\n", + ")\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "id": "08535408", + "metadata": {}, + "source": [ + "#### Reference\n", + "\n", + "See [function reference for `px.(bar_polar)`](https://plotly.com/python-api-reference/generated/plotly.express.bar_polar) or https://plotly.com/python/reference/barpolar/ for more information and chart attribute options!\n" + ] + }, + { + "cell_type": "markdown", + "id": "e1eb6401", + "metadata": {}, + "source": [ + "### What About Dash?\n", + "\n", + "[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.\n", + "\n", + "Learn about how to install Dash at https://dash.plot.ly/installation.\n", + "\n", + "Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this:\n", + "\n", + "```python\n", + "import plotly.graph_objects as go # or plotly.express as px\n", + "fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)\n", + "# fig.add_trace( ... )\n", + "# fig.update_layout( ... )\n", + "\n", + "from dash import Dash, dcc, html\n", + "\n", + "app = Dash()\n", + "app.layout = html.Div([\n", + " dcc.Graph(figure=fig)\n", + "])\n", + "\n", + "app.run(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter\n", + "```" + ] + } + ], + "metadata": { + "jupytext": { + "notebook_metadata_filter": "all" + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + }, + "plotly": { + "description": "How to graph wind rose charts in python. Wind Rose charts display wind speed and direction of a given location.", + "display_as": "scientific", + "language": "python", + "layout": "base", + "name": "Wind Rose and Polar Bar Charts", + "order": 19, + "page_type": "u-guide", + "permalink": "python/wind-rose-charts/", + "thumbnail": "thumbnail/wind-rose.jpg" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 6fb386fa1c6d20c7d4d317348e630e03a1e774ad Mon Sep 17 00:00:00 2001 From: plotlydocbot Date: Mon, 16 Mar 2026 17:44:50 +0000 Subject: [PATCH 2/5] build of https://github.com/plotly/plotly.py/commit/dff6abcf431794da82bea5b452696ebaba0cfe6c --- 2D-Histogram.ipynb | 51 +++--- 2d-histogram-contour.ipynb | 42 ++--- 3d-axes.ipynb | 30 ++-- 3d-bubble-charts.ipynb | 20 +-- 3d-camera-controls.ipynb | 44 ++--- 3d-isosurface-plots.ipynb | 36 ++-- 3d-line-plots.ipynb | 14 +- 3d-mesh.ipynb | 32 ++-- 3d-scatter-plots.ipynb | 30 ++-- 3d-subplots.ipynb | 10 +- 3d-surface-plots.ipynb | 32 ++-- 3d-volume.ipynb | 30 ++-- LaTeX.ipynb | 8 +- animations.ipynb | 36 ++-- annotated-heatmap.ipynb | 40 ++--- axes.ipynb | 212 ++++++++++++------------ bar-charts.ipynb | 164 +++++++++--------- bio-alignment-chart.ipynb | 10 +- bio-clustergram.ipynb | 18 +- bio-manhattanplot.ipynb | 14 +- bio-volcano-plot.ipynb | 14 +- box-plots.ipynb | 86 +++++----- bubble-charts.ipynb | 32 ++-- bubble-maps.ipynb | 20 +-- builtin-colorscales.ipynb | 28 ++-- bullet-charts.ipynb | 22 +-- candlestick-charts.ipynb | 30 ++-- carpet-contour.ipynb | 16 +- carpet-plot.ipynb | 32 ++-- carpet-scatter.ipynb | 18 +- categorical-axes.ipynb | 48 +++--- choropleth-maps.ipynb | 62 +++---- click-events.ipynb | 14 +- colorscales.ipynb | 124 +++++++------- cone-plot.ipynb | 24 +-- configuration-options.ipynb | 60 +++---- continuous-error-bars.ipynb | 10 +- contour-plots.ipynb | 60 +++---- county-choropleth.ipynb | 42 ++--- creating-and-updating-figures.ipynb | 128 +++++++------- custom-buttons.ipynb | 24 +-- dash.ipynb | 4 +- dendrogram.ipynb | 20 +-- density-heatmaps.ipynb | 16 +- discrete-color.ipynb | 66 ++++---- distplot.ipynb | 58 +++---- dot-plots.ipynb | 16 +- dropdowns.ipynb | 26 +-- dumbbell-plots.ipynb | 12 +- ecdf-plots.ipynb | 56 +++---- error-bars.ipynb | 40 ++--- facet-plots.ipynb | 52 +++--- figure-factories.ipynb | 4 +- figure-factory-subplots.ipynb | 26 +-- figure-factory-table.ipynb | 42 ++--- figure-introspection.ipynb | 58 +++---- figure-labels.ipynb | 40 ++--- figure-structure.ipynb | 18 +- figurewidget-app.ipynb | 34 ++-- figurewidget.ipynb | 42 ++--- filled-area-plots.ipynb | 46 ++--- filled-area-tile-maps.ipynb | 18 +- funnel-charts.ipynb | 44 ++--- gantt.ipynb | 34 ++-- gauge-charts.ipynb | 16 +- getting-started.ipynb | 30 ++-- graph-objects.ipynb | 8 +- graphing-multiple-chart-types.ipynb | 26 +-- heatmaps.ipynb | 56 +++---- hexbin-mapbox.ipynb | 28 ++-- histograms.ipynb | 118 ++++++------- horizontal-bar-charts.ipynb | 36 ++-- horizontal-vertical-shapes.ipynb | 36 ++-- hover-text-and-formatting.ipynb | 136 +++++++-------- icicle-charts.ipynb | 86 +++++----- images.ipynb | 28 ++-- imshow.ipynb | 114 ++++++------- indicator.ipynb | 36 ++-- interactive-html-export.ipynb | 20 +-- ipython-vs-python.ipynb | 16 +- jupyter-lab-tools.ipynb | 12 +- legend.ipynb | 120 +++++++------- line-and-scatter.ipynb | 120 +++++++------- line-charts.ipynb | 70 ++++---- linear-fits.ipynb | 54 +++--- lines-on-maps.ipynb | 28 ++-- lines-on-tile-maps.ipynb | 20 +-- location-mode.ipynb | 28 ++-- log-plot.ipynb | 28 ++-- map-configuration.ipynb | 46 ++--- map-subplots-and-small-multiples.ipynb | 8 +- marginal-plots.ipynb | 28 ++-- marker-style.ipynb | 64 +++---- migrate-to-maplibre.ipynb | 4 +- mixed-subplots.ipynb | 10 +- ml-knn.ipynb | 34 ++-- ml-pca.ipynb | 38 ++--- ml-regression.ipynb | 64 +++---- ml-roc-pr.ipynb | 30 ++-- ml-tsne-umap-projections.ipynb | 28 ++-- ml_apps.ipynb | 4 +- multiple-axes.ipynb | 38 ++--- network-graphs.ipynb | 28 ++-- ohlc-charts.ipynb | 28 ++-- orca-management.ipynb | 56 +++---- pandas-backend.ipynb | 40 ++--- parallel-categories-diagram.ipynb | 32 ++-- parallel-coordinates-plot.ipynb | 30 ++-- pattern-hatching-texture.ipynb | 40 ++--- peak-finding.ipynb | 18 +- performance.ipynb | 30 ++-- pie-charts.ipynb | 72 ++++---- plot-data-from-csv.ipynb | 22 +-- plotly-express.ipynb | 154 ++++++++--------- polar-chart.ipynb | 52 +++--- px-arguments.ipynb | 70 ++++---- quiver-plots.ipynb | 12 +- radar-chart.ipynb | 20 +-- random-walk.ipynb | 18 +- range-slider.ipynb | 12 +- renderers.ipynb | 56 +++---- sankey-diagram.ipynb | 46 ++--- scatter-plots-on-maps.ipynb | 28 ++-- selections.ipynb | 46 ++--- setting-graph-size.ipynb | 30 ++-- shapes.ipynb | 134 +++++++-------- sliders.ipynb | 14 +- smith-charts.ipynb | 16 +- smoothing.ipynb | 14 +- splom.ipynb | 42 ++--- static-image-export.ipynb | 34 ++-- static-image-generation-migration.ipynb | 4 +- streamline-plots.ipynb | 14 +- streamtube-plot.ipynb | 20 +-- strip-charts.ipynb | 12 +- styling-plotly-express.ipynb | 22 +-- subplots.ipynb | 90 +++++----- sunburst-charts.ipynb | 64 +++---- supported-colors.ipynb | 10 +- table-subplots.ipynb | 8 +- table.ipynb | 38 ++--- templates.ipynb | 68 ++++---- ternary-contour.ipynb | 28 ++-- ternary-plots.ipynb | 16 +- ternary-scatter-contour.ipynb | 16 +- text-and-annotations.ipynb | 114 ++++++------- tick-formatting.ipynb | 46 ++--- tile-county-choropleth.ipynb | 46 ++--- tile-map-layers.ipynb | 38 ++--- tile-scatter-maps.ipynb | 52 +++--- time-series.ipynb | 82 ++++----- tree-plots.ipynb | 22 +-- treemaps.ipynb | 72 ++++---- trisurf.ipynb | 16 +- troubleshooting.ipynb | 10 +- v4-migration.ipynb | 42 ++--- v6-changes.ipynb | 8 +- violin.ipynb | 50 +++--- waterfall-charts.ipynb | 20 +-- wide-form.ipynb | 86 +++++----- wind-rose-charts.ipynb | 12 +- 161 files changed, 3263 insertions(+), 3262 deletions(-) diff --git a/2D-Histogram.ipynb b/2D-Histogram.ipynb index cdcdedf1a..baa51c6db 100644 --- a/2D-Histogram.ipynb +++ b/2D-Histogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "01dceb6e", + "id": "8dc84dc0", "metadata": {}, "source": [ "## 2D Histograms or Density Heatmaps\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d97e993", + "id": "cfe5e1c2", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "910366c9", + "id": "36d8bba7", "metadata": {}, "source": [ "The number of bins can be controlled with `nbinsx` and `nbinsy` and the [color scale](/python/colorscales/) with `color_continuous_scale`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cce16ab2", + "id": "0756e4e0", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "a3b17138", + "id": "afcd39e2", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67b949c3", + "id": "d1f30426", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "b3f10b2e", + "id": "3644c5b0", "metadata": {}, "source": [ "Density heatmaps can also be [faceted](/python/facet-plots/):" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89108f32", + "id": "7f225595", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "9be862a0", + "id": "5cba3817", "metadata": {}, "source": [ "### Displaying Text\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f015060b", + "id": "0c8406c7", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "24efb450", + "id": "dd56481d", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9ba9116", + "id": "0227938c", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "23bc9473", + "id": "9ae1c057", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "826868e8", + "id": "65677ddc", "metadata": {}, "source": [ "### 2D Histogram of a Bivariate Normal Distribution ###" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3149fb4", + "id": "aa777ab6", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "87b282dc", + "id": "a4fb0de3", "metadata": {}, "source": [ "### 2D Histogram Binning and Styling Options ###" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fca0188c", + "id": "d2bdaed7", "metadata": { "lines_to_next_cell": 0 }, @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "491606f4", + "id": "a47087e6", "metadata": {}, "source": [ "### Sharing bin settings between 2D Histograms\n", @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2dbe0a5", + "id": "0808f8cd", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "7a322e08", + "id": "290daf0b", "metadata": {}, "source": [ "### 2D Histogram Overlaid with a Scatter Chart ###" @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d2342ee", + "id": "601cf338", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ }, { "cell_type": "markdown", - "id": "60b1861f", + "id": "a4b32380", "metadata": {}, "source": [ "### Text on 2D Histogram Points\n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac655123", + "id": "aeabff2d", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "cee4594b", + "id": "d82eb2d7", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "423b7747", + "id": "48661e41", "metadata": {}, "source": [ "### What About Dash?\n", @@ -443,6 +443,7 @@ "page_type": "u-guide", "permalink": "python/2D-Histogram/", "redirect_from": [ + "python/2d-histogram/", "python/2d-histograms/" ], "thumbnail": "thumbnail/histogram2d.jpg" diff --git a/2d-histogram-contour.ipynb b/2d-histogram-contour.ipynb index 12d9cb855..7e99a5831 100644 --- a/2d-histogram-contour.ipynb +++ b/2d-histogram-contour.ipynb @@ -2,12 +2,12 @@ "cells": [ { "cell_type": "markdown", - "id": "578f43ab", + "id": "4273cc9c", "metadata": {}, "source": [ "## 2D Histogram Contours or Density Contours\n", "\n", - "A 2D histogram contour plot, also known as a density contour plot, is a 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [contour plot](/python/contour-plots/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the value to be used to compute contours. This kind of visualization (and the related [2D histogram, or density heatmap](/python/2D-Histogram/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns.\n", + "A 2D histogram contour plot, also known as a density contour plot, is a 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [contour plot](/python/contour-plots/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the value to be used to compute contours. This kind of visualization (and the related [2D histogram, or density heatmap](/python/2d-histogram/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns.\n", "\n", "## Density Contours with Plotly Express\n", "\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cad8cce1", + "id": "5ee78e9e", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "9d5f416d", + "id": "5e295c95", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a32e159", + "id": "bde6d7d2", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "a741522a", + "id": "29683cd5", "metadata": {}, "source": [ "Density contours can also be [faceted](/python/facet-plots/) and [discretely colored](/python/discrete-color/):" @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63f77a30", + "id": "ca1937c3", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "8c470fb9", + "id": "17061dc9", "metadata": {}, "source": [ "Plotly Express density contours can be [continuously-colored](/python/colorscales/) and labeled:" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc5c58c0", + "id": "59716818", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "abbff28b", + "id": "3c6d1d46", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f53f2c7", + "id": "3e41d308", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "6b5b9513", + "id": "5b13b078", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1009f306", + "id": "6ca37cb5", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "d42837b7", + "id": "a01a53ab", "metadata": {}, "source": [ "#### 2D Histogram Contour Colorscale" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c95c2b1f", + "id": "0890fcd8", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "6760ee76", + "id": "fb337951", "metadata": {}, "source": [ "#### 2D Histogram Contour Styled" @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdd50930", + "id": "6e6be156", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "63441d20", + "id": "b04b7237", "metadata": {}, "source": [ "#### 2D Histogram Contour Subplot" @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e75241f8", + "id": "f782aee7", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "da0aa3b2", + "id": "90783ffa", "metadata": {}, "source": [ "#### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "89ae25db", + "id": "8a506e51", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-axes.ipynb b/3d-axes.ipynb index ba56c0d28..d167656db 100644 --- a/3d-axes.ipynb +++ b/3d-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9bb9f26e", + "id": "33ddeeec", "metadata": {}, "source": [ "### Range of axes\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9601dfdf", + "id": "8bbb0f41", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "402ced08", + "id": "5e2dc448", "metadata": {}, "source": [ "### Setting only a Lower or Upper Bound for Range\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3c9ba69", + "id": "f1abb904", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "13da267c", + "id": "5246c45a", "metadata": {}, "source": [ "### Fixed Ratio Axes" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33444419", + "id": "0911c371", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "e3d50957", + "id": "665afa7c", "metadata": {}, "source": [ "### Set Axes Title" @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54023603", + "id": "cb94510c", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "510af730", + "id": "9d97885a", "metadata": {}, "source": [ "### Ticks Formatting" @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7421e50", + "id": "a2f81ec2", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "0fbc434a", + "id": "6dc46794", "metadata": {}, "source": [ "### Background and Grid Color" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ed2160b", + "id": "ff2944f5", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "e6fd06eb", + "id": "d4a491a3", "metadata": {}, "source": [ "### Disabling tooltip spikes\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74e4dc08", + "id": "920a897f", "metadata": { "lines_to_next_cell": 2 }, @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "4a0f8e32", + "id": "932451ef", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-bubble-charts.ipynb b/3d-bubble-charts.ipynb index 2eda41c5e..d7b0c3931 100644 --- a/3d-bubble-charts.ipynb +++ b/3d-bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8dbf6dc6", + "id": "57ecf3a2", "metadata": {}, "source": [ "### 3d Bubble chart with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4693501", + "id": "2c7267dd", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "0536c5f1", + "id": "ab6a15a7", "metadata": {}, "source": [ "#### Simple Bubble Chart" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "447699fd", + "id": "32c112c6", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "4c3b019c", + "id": "69110ffc", "metadata": {}, "source": [ "#### Bubble Chart Sized by a Variable\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2452fd38", + "id": "d427507f", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "df02d827", + "id": "bf16dbe2", "metadata": {}, "source": [ "#### Edit the Colorbar\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a63efcf", + "id": "abbd8739", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "b71dcc6d", + "id": "9ad71454", "metadata": {}, "source": [ "#### Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "fbc79fd9", + "id": "b7552a8e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-camera-controls.ipynb b/3d-camera-controls.ipynb index c975a096d..4ae6c0904 100644 --- a/3d-camera-controls.ipynb +++ b/3d-camera-controls.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8dab23b0", + "id": "26553a31", "metadata": {}, "source": [ "### How camera controls work\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "6679256d", + "id": "f952b116", "metadata": {}, "source": [ "### Default parameters" @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9654caf", + "id": "2aa9bf3e", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "66df7136", + "id": "05647546", "metadata": {}, "source": [ "### Changing the camera position by setting the eye parameter\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f91249c2", + "id": "34658d37", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "f1b6042e", + "id": "1616b0a4", "metadata": {}, "source": [ "#### X-Z plane\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fab17af", + "id": "4969bc6a", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "6cb5bf8a", + "id": "ac34709b", "metadata": {}, "source": [ "#### Y-Z plane" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea1b5cf2", + "id": "7dce7801", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "a3a0193e", + "id": "0cd916ad", "metadata": {}, "source": [ "#### View from Above (X-Y plane)" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ddcf0ea4", + "id": "25cdfc1a", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "51537395", + "id": "e7edf960", "metadata": {}, "source": [ "#### Zooming In\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3999c810", + "id": "621c6465", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "13e6c1e6", + "id": "74997a15", "metadata": {}, "source": [ "### Tilting the camera vertical by setting the up parameter\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e488f245", + "id": "140ea857", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "d039ae46", + "id": "72129e30", "metadata": {}, "source": [ "Note when `up` does not correspond to the direction of an axis, you also need to set `layout.scene.dragmode='orbit'`." @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67f70500", + "id": "95e0f809", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "397afabe", + "id": "54320ae5", "metadata": {}, "source": [ "### Changing the focal point by setting center\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88bcbc55", + "id": "b1c5084a", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "c3f92466", + "id": "58bb7805", "metadata": {}, "source": [ "#### Reference" @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "679b2ae7", + "id": "297e9794", "metadata": {}, "source": [ "See https://plotly.com/python/reference/layout/scene/#layout-scene-camera for more information and chart attribute options!" @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "9b62cc45", + "id": "a108863c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-isosurface-plots.ipynb b/3d-isosurface-plots.ipynb index b279a0cc6..569c292c2 100644 --- a/3d-isosurface-plots.ipynb +++ b/3d-isosurface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d70a3088", + "id": "b4218774", "metadata": {}, "source": [ "With ``go.Isosurface``, you can plot [isosurface contours](https://en.wikipedia.org/wiki/Isosurface) of a scalar field ``value``, which is defined on ``x``, ``y`` and ``z`` coordinates.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f6588b5", + "id": "448df02f", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "4c982843", + "id": "5648bf0c", "metadata": {}, "source": [ "### Removing caps when visualizing isosurfaces\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb351d64", + "id": "0a27368f", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "772552a3", + "id": "3067e799", "metadata": {}, "source": [ "### Modifying the number of isosurfaces" @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46f0b4a3", + "id": "3d9801e4", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "6fae98a7", + "id": "a2698071", "metadata": {}, "source": [ "### Changing the opacity of isosurfaces" @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4464107", + "id": "7a23911f", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "2a944190", + "id": "8b12ed49", "metadata": {}, "source": [ "#### Isosurface with Additional Slices\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5e3a58f", + "id": "6f9e3d18", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "2161d6f0", + "id": "5cef91d9", "metadata": {}, "source": [ "#### Multiple Isosurfaces with Caps" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c0b8806", + "id": "54cb9bd0", "metadata": {}, "outputs": [], "source": [ @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "a83f2c34", + "id": "073df59d", "metadata": {}, "source": [ "### Changing the default colorscale of isosurfaces" @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b752e396", + "id": "5b9786b7", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "d115cf10", + "id": "7ba6042c", "metadata": {}, "source": [ "### Customizing the layout and appearance of isosurface plots" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0caa95a", + "id": "d7f6265b", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "8d4102d3", + "id": "b7f7f9e0", "metadata": {}, "source": [ "#### Reference\n", @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "46cfcb6c", + "id": "02a30060", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-line-plots.ipynb b/3d-line-plots.ipynb index efde7da4b..0dd54f181 100644 --- a/3d-line-plots.ipynb +++ b/3d-line-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1b2b8f2b", + "id": "3607a5d2", "metadata": {}, "source": [ "### 3D Line plot with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed3005d3", + "id": "bf5975b6", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d2db2cb", + "id": "4bc552b4", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "83289632", + "id": "a0c0309c", "metadata": {}, "source": [ "#### 3D Line Plot of Brownian Motion\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5959800e", + "id": "304b4ef7", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "cb632b43", + "id": "78079711", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "63b7b008", + "id": "5381107a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-mesh.ipynb b/3d-mesh.ipynb index 13023226c..591196289 100644 --- a/3d-mesh.ipynb +++ b/3d-mesh.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "51798fe8", + "id": "64640c9d", "metadata": {}, "source": [ "### Simple 3D Mesh example ###\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8906b45f", + "id": "d130c0ec", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "aa481809", + "id": "179c718d", "metadata": {}, "source": [ "### 3D Mesh example with Alphahull" @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "75f0cd52", + "id": "235aba92", "metadata": {}, "source": [ "The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body)." @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dbab7a8", + "id": "b2eb4010", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "19972ae1", + "id": "1224b3b8", "metadata": {}, "source": [ "### 3D Mesh in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5212c7d1", + "id": "fdeb1da2", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "c472884c", + "id": "2b966616", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "3ab8f99e", + "id": "8ecc668d", "metadata": {}, "source": [ "### Mesh Tetrahedron\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c39ebebb", + "id": "f14378e9", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "caa62d5f", + "id": "a81403e6", "metadata": {}, "source": [ "### Mesh Cube" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40b3600a", + "id": "5103a0f6", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "f0ce0c12", + "id": "44b262a1", "metadata": {}, "source": [ "### Intensity values defined on vertices or cells\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "303e9046", + "id": "569c7277", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "8f132268", + "id": "907c2fc4", "metadata": {}, "source": [ "## Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "c6e2cb1a", + "id": "604c8bff", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-scatter-plots.ipynb b/3d-scatter-plots.ipynb index 8696c1142..30ea7ad96 100644 --- a/3d-scatter-plots.ipynb +++ b/3d-scatter-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ebb4c1a0", + "id": "19218a41", "metadata": {}, "source": [ "## 3D scatter plot with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a8cf608", + "id": "c629cc06", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "a8525f48", + "id": "ed73e1b9", "metadata": {}, "source": [ "A 4th dimension of the data can be represented thanks to the color of the markers. Also, values from the `species` column are used below to assign symbols to markers." @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9c50203", + "id": "38446313", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "5cdbbc96", + "id": "ba6d1371", "metadata": {}, "source": [ "#### Style 3d scatter plot\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "252bb271", + "id": "bd801780", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "7061709b", + "id": "a39bed90", "metadata": {}, "source": [ "#### 3d scatter plots in Dash\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1053d390", + "id": "1cd9c38a", "metadata": { "hide_code": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "8261a38a", + "id": "8fbb9a5a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "cafef261", + "id": "a35b07bf", "metadata": {}, "source": [ "### 3D Scatter Plot with go.Scatter3d\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51a057cc", + "id": "90fefb71", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "e334c9d1", + "id": "42e0b157", "metadata": {}, "source": [ "#### 3D Scatter Plot with Colorscaling and Marker Styling" @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "993fbad0", + "id": "4f8b0769", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "c1897dd4", + "id": "d56d9ab2", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "b1872dd0", + "id": "301d1dd4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-subplots.ipynb b/3d-subplots.ipynb index ec7e8733a..4ce2d9369 100644 --- a/3d-subplots.ipynb +++ b/3d-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "762e5b43", + "id": "3c0e141a", "metadata": {}, "source": [ "#### 3D Surface Subplots" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c760e8e4", + "id": "823fb48b", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "6b32dff8", + "id": "d67a66b9", "metadata": {}, "source": [ "#### Reference" @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "0078256c", + "id": "cd733457", "metadata": {}, "source": [ "See https://plotly.com/python/subplots/ for more information regarding subplots!" @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "726ae258", + "id": "b288cdc4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-surface-plots.ipynb b/3d-surface-plots.ipynb index bd0777ee0..f3727df2a 100644 --- a/3d-surface-plots.ipynb +++ b/3d-surface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e38136c2", + "id": "2eee3f8c", "metadata": {}, "source": [ "#### Topographical 3D Surface Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db247622", + "id": "e979bc8f", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "4e38bf3d", + "id": "1d7d0545", "metadata": {}, "source": [ "### Passing x and y data to 3D Surface Plot\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "982ac4a7", + "id": "8b0774dc", "metadata": { "lines_to_next_cell": 2 }, @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "fd9e7ab7", + "id": "b73008d9", "metadata": {}, "source": [ "#### Surface Plot With Contours" @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "3b06a814", + "id": "b251ea1b", "metadata": {}, "source": [ "Display and customize contour data for each axis using the `contours` attribute ([reference](https://plotly.com/python/reference/surface/#surface-contours))." @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce6232db", + "id": "69312444", "metadata": { "lines_to_next_cell": 0 }, @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "ea1eec22", + "id": "64685c4a", "metadata": {}, "source": [ "#### Configure Surface Contour Levels\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adfbb06f", + "id": "44d0fc6a", "metadata": { "lines_to_next_cell": 0 }, @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "c37c1ab0", + "id": "c38c11b4", "metadata": {}, "source": [ "#### Multiple 3D Surface Plots" @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fc5914d", + "id": "2d01b733", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "b943a7ce", + "id": "2cd4d31a", "metadata": {}, "source": [ "### Setting the Surface Color\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1882b305", + "id": "ae39b431", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "b7255f31", + "id": "ae3b3470", "metadata": {}, "source": [ "#### Reference" @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "b3c22655", + "id": "ba6b63dc", "metadata": {}, "source": [ "See https://plotly.com/python/reference/surface/ for more information!\n" @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "540be9eb", + "id": "2d4b5862", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-volume.ipynb b/3d-volume.ipynb index 8a9e295e3..c170cf2b3 100644 --- a/3d-volume.ipynb +++ b/3d-volume.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5158bfb4", + "id": "7a26351b", "metadata": {}, "source": [ "A volume plot with `go.Volume` shows several partially transparent isosurfaces for volume rendering. The API of `go.Volume` is close to the one of `go.Isosurface`. However, whereas [isosurface plots](/python/3d-isosurface-plots/) show all surfaces with the same opacity, tweaking the `opacityscale` parameter of `go.Volume` results in a depth effect and better volume rendering.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a412cd65", + "id": "c267fc55", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35a52523", + "id": "a2351e21", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6993ce43", + "id": "26164806", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "9f644a33", + "id": "4bde799c", "metadata": {}, "source": [ "### Defining the opacity scale of volume plots\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "333dad73", + "id": "afc3c292", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "463fa282", + "id": "5bcc0c1d", "metadata": {}, "source": [ "### Defining a custom opacity scale\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94ac2d65", + "id": "31feff01", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "446ce450", + "id": "b97f6e69", "metadata": {}, "source": [ "### Adding caps to a volume plot\n", @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e75f6f8", + "id": "124788db", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ff27dc7", + "id": "38c76161", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "e9cd6142", + "id": "88f743c2", "metadata": {}, "source": [ "### Adding slices to a volume plot\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6518c74c", + "id": "2aa62af9", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "14b81639", + "id": "a68ef2bb", "metadata": {}, "source": [ "#### Reference\n", @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "12010189", + "id": "18238b22", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/LaTeX.ipynb b/LaTeX.ipynb index 451031f3f..617575488 100644 --- a/LaTeX.ipynb +++ b/LaTeX.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5c6dd276", + "id": "319bc510", "metadata": {}, "source": [ "#### LaTeX Typesetting\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5187f07", + "id": "08456004", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83df6f6e", + "id": "223394e3", "metadata": { "lines_to_next_cell": 2 }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "12d56ef3", + "id": "0d3f67cb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/animations.ipynb b/animations.ipynb index 6416fd287..c2faddb71 100644 --- a/animations.ipynb +++ b/animations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1b0a0639", + "id": "5b4c9ded", "metadata": {}, "source": [ "#### Animated figures with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "044b6c56", + "id": "6360c2d7", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "66c13d7f", + "id": "2ca4c38a", "metadata": {}, "source": [ "#### Animated figures in Dash\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd25e348", + "id": "f66b3862", "metadata": { "hide_code": true }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "5d363cdc", + "id": "13af89aa", "metadata": {}, "source": [ "#### Animated Bar Charts with Plotly Express\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2494adf", + "id": "f7c2f137", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "2134e73d", + "id": "df2d2670", "metadata": {}, "source": [ "### Current Animation Limitations and Caveats\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "39183c98", + "id": "d3d9e442", "metadata": {}, "source": [ "\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "a926fd48", + "id": "921e0d28", "metadata": {}, "source": [ "#### Defining Button Arguments\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64411ba6", + "id": "d9e8ec15", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "8a171f5e", + "id": "56d0fada", "metadata": {}, "source": [ "#### Moving Point on a Curve" @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1ca2039", + "id": "39e32316", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "1e84bce0", + "id": "9f429125", "metadata": {}, "source": [ "#### Moving Frenet Frame Along a Planar Curve" @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c1d0163", + "id": "65d167bd", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "bb63c16d", + "id": "1701f156", "metadata": {}, "source": [ "#### Using a Slider and Buttons\n", @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91ec2011", + "id": "9c452de4", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "adde20e8", + "id": "0e779ae8", "metadata": {}, "source": [ "#### Important Notes\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "a41852db", + "id": "9398f7a0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/annotated-heatmap.ipynb b/annotated-heatmap.ipynb index 16afa2b74..d85910fb0 100644 --- a/annotated-heatmap.ipynb +++ b/annotated-heatmap.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "763ecf11", + "id": "9264da9c", "metadata": {}, "source": [ "### Annotated Heatmaps with Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "ce3e07d6", + "id": "5e7ce647", "metadata": {}, "source": [ "#### Basic Annotated Heatmap for z-annotations\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "044876c0", + "id": "6b9eddc1", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "5ab7b72e", + "id": "a1b218cb", "metadata": {}, "source": [ "### Deprecated Figure Factory\n", @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "9b85ad59", + "id": "f01b7538", "metadata": {}, "source": [ "#### Simple Annotated Heatmap" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8864fd54", + "id": "1a1b8971", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "e248163d", + "id": "aa45f7b2", "metadata": {}, "source": [ "#### Custom Text and X & Y Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfd6cfd0", + "id": "e5fe25c0", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "1eecfbfe", + "id": "1042667b", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc161c9f", + "id": "fe9918e4", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "8413b7c7", + "id": "e5888252", "metadata": {}, "source": [ "#### Annotated Heatmap with numpy" @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a5e599d", + "id": "1f1eafd1", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "901dc415", + "id": "ca9185fa", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16266902", + "id": "56dbe878", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "dfce4b50", + "id": "50cb43da", "metadata": {}, "source": [ "Here is a fairly contrived example showing how one can display a periodic table with custom text and hover using `ff.create_annotated_heatmap()` (scroll below to see the `px.imshow()` equivalent)." @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcbc1e7e", + "id": "21d9a8ab", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "9772ae18", + "id": "9f9c9be7", "metadata": {}, "source": [ "Here is the same output using `px.imshow()` with much less array manipulation:" @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2d78bc4", + "id": "9a32aa99", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "4a19413b", + "id": "080cf408", "metadata": {}, "source": [ "#### Reference\n", @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "ac82d394", + "id": "39a8ab79", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/axes.ipynb b/axes.ipynb index 807d88b83..e56d2e2e9 100644 --- a/axes.ipynb +++ b/axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "38915f36", + "id": "e887ad35", "metadata": {}, "source": [ "This tutorial explains how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/yaxis/).\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "27fa6ad2", + "id": "ee69ae05", "metadata": {}, "source": [ "### Forcing an axis to be categorical\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9e3f96c", + "id": "80fa3e78", "metadata": { "lines_to_next_cell": 2 }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "49e39863", + "id": "dfe8d33f", "metadata": {}, "source": [ "#### General Axis properties\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "001b77d7", + "id": "9ebfc1ca", "metadata": {}, "source": [ "#### Set and Style Axes Title Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f26ef9fb", + "id": "120b10f1", "metadata": {}, "outputs": [], "source": [ @@ -106,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "c0abd3d0", + "id": "8dfd2ca0", "metadata": {}, "source": [ "Axis titles (and [legend titles](/python/legend/)) can also be overridden using the `labels` argument of Plotly Express functions:" @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "916bbf64", + "id": "fef31960", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "12157907", + "id": "b6ba6d5a", "metadata": {}, "source": [ "The PX `labels` argument can also be used without a data frame argument:\n" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5645ad29", + "id": "04533c46", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "5b1dabd9", + "id": "56b288bc", "metadata": {}, "source": [ "##### Rotating tick labels in Dash\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd5644ca", + "id": "ac7e9a5b", "metadata": { "hide_code": true }, @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "35584cc1", + "id": "7a891523", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "b1a9dcdf", + "id": "92e79c3d", "metadata": {}, "source": [ "#### Moving Tick Labels Inside the Plot\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbf7d8a5", + "id": "67b70acd", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "d721fa0a", + "id": "0c6737db", "metadata": {}, "source": [ "#### Specifying Label Aliases\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11f60dbd", + "id": "eb6512c7", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "be09a92e", + "id": "0a8f6771", "metadata": {}, "source": [ "##### Set axis title text with Graph Objects\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6740844a", + "id": "4b2e446d", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "a03e6d21", + "id": "85be7c9e", "metadata": {}, "source": [ "### Set axis title position\n", @@ -280,7 +280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "819a671d", + "id": "ebef35d2", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "4e9c0bf4", + "id": "9037434c", "metadata": {}, "source": [ "##### Set axis title font\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1a9f0e3", + "id": "a06fe45f", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "95774f53", + "id": "22b1c806", "metadata": {}, "source": [ "#### Tick Placement, Color, and Style\n", @@ -348,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72822f81", + "id": "aaecc6ed", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "8bbf053c", + "id": "ffb4d10a", "metadata": {}, "source": [ "##### Set number of tick marks (and grid lines)\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a87ee814", + "id": "bddbbb9a", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "c1bd4f45", + "id": "ba660806", "metadata": {}, "source": [ "##### Set start position and distance between ticks\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1127a2d", + "id": "e67b3b94", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "f3258b91", + "id": "1ee4fd60", "metadata": {}, "source": [ "##### Set exact location of axis ticks\n", @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38bac4c1", + "id": "57e6ff42", "metadata": {}, "outputs": [], "source": [ @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "48ffc68c", + "id": "e9048c37", "metadata": {}, "source": [ "##### Style tick marks\n", @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b9e7e38", + "id": "7212f623", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "86f2a779", + "id": "150fc91e", "metadata": {}, "source": [ "##### Step for tick labels\n", @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "343a22ab", + "id": "2d659a61", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "82b038ca", + "id": "79f84a2a", "metadata": {}, "source": [ "##### Toggling axis labels\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e517e10", + "id": "61be9d10", "metadata": {}, "outputs": [], "source": [ @@ -536,7 +536,7 @@ }, { "cell_type": "markdown", - "id": "e46a60c8", + "id": "0d5026af", "metadata": {}, "source": [ "##### Set axis label rotation and font\n", @@ -549,7 +549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524c29a2", + "id": "fefadc6e", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "e8ce0050", + "id": "8563c281", "metadata": {}, "source": [ "##### Auto Tick Angle Options\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7dbba76", + "id": "119db8f5", "metadata": {}, "outputs": [], "source": [ @@ -593,7 +593,7 @@ }, { "cell_type": "markdown", - "id": "bb1d322c", + "id": "6271aeab", "metadata": {}, "source": [ "#### Enumerated Ticks with Tickvals and Ticktext\n", @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2700569a", + "id": "78783fae", "metadata": {}, "outputs": [], "source": [ @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "418c80e9", + "id": "cc2cd17a", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12f53913", + "id": "ea106db6", "metadata": {}, "outputs": [], "source": [ @@ -685,7 +685,7 @@ }, { "cell_type": "markdown", - "id": "a3b06633", + "id": "48f1ee45", "metadata": {}, "source": [ "#### Adjust Tick Label Positions\n", @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4da54ba", + "id": "36af67c0", "metadata": {}, "outputs": [], "source": [ @@ -727,7 +727,7 @@ }, { "cell_type": "markdown", - "id": "1810d2c1", + "id": "848b841d", "metadata": {}, "source": [ "#### Use Minor Tick for Label\n", @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5b3f3fc", + "id": "e4d75e50", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "24b033ac", + "id": "6ec2450f", "metadata": {}, "source": [ "### Axis lines: grid and zerolines\n", @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022688d7", + "id": "0ae70809", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "391fdbf7", + "id": "a3c6d551", "metadata": {}, "source": [ "##### Toggling Axis zero lines\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cb2fcb6", + "id": "439f8c6e", "metadata": {}, "outputs": [], "source": [ @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "4702ec79", + "id": "aa872e2a", "metadata": {}, "source": [ "#### Styling and Coloring Axes and the Zero-Line\n", @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a72d7600", + "id": "51cba33f", "metadata": {}, "outputs": [], "source": [ @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "ab6bf649", + "id": "fb750e63", "metadata": {}, "source": [ "##### Mirroring axis lines\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2604863", + "id": "15d92ba1", "metadata": {}, "outputs": [], "source": [ @@ -882,7 +882,7 @@ }, { "cell_type": "markdown", - "id": "45b00dff", + "id": "2aa0b1a2", "metadata": {}, "source": [ "##### Styling grid lines\n", @@ -895,7 +895,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5f69d72", + "id": "b684da50", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "774c12a5", + "id": "58942ba7", "metadata": {}, "source": [ "_new in 5.8_\n", @@ -922,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34d5a334", + "id": "693310cb", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "5e5299a8", + "id": "45be420d", "metadata": {}, "source": [ "##### Styling zero lines\n", @@ -950,7 +950,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbdcd9b3", + "id": "887a770f", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "5ea67a84", + "id": "d8d9066b", "metadata": {}, "source": [ "##### Controlling Zero Line Layer\n", @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10dd44b5", + "id": "127f6aaa", "metadata": {}, "outputs": [], "source": [ @@ -1010,7 +1010,7 @@ }, { "cell_type": "markdown", - "id": "fcf4ae9e", + "id": "7f979e76", "metadata": {}, "source": [ "#### Setting the Range of Axes Manually\n", @@ -1023,7 +1023,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66b84ad4", + "id": "12446377", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "03d1df85", + "id": "a668bfde", "metadata": {}, "source": [ "#### Exclude Inside Tick Labels from Range\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "872470e4", + "id": "4bfb84f2", "metadata": {}, "outputs": [], "source": [ @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "250dd959", + "id": "56ca29b6", "metadata": {}, "source": [ "#### Setting only a Lower or Upper Bound for Range\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c32991ae", + "id": "49d6041e", "metadata": {}, "outputs": [], "source": [ @@ -1099,7 +1099,7 @@ }, { "cell_type": "markdown", - "id": "47aad082", + "id": "13dcdaba", "metadata": {}, "source": [ "#### Setting a Maximum and Minimum Allowed Axis Value\n", @@ -1112,7 +1112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77647dd9", + "id": "17fd6b41", "metadata": {}, "outputs": [], "source": [ @@ -1129,7 +1129,7 @@ }, { "cell_type": "markdown", - "id": "a2965d5e", + "id": "ed78c6ac", "metadata": {}, "source": [ "#### Disabling Pan/Zoom on Axes (Fixed Range)\n", @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fb05933", + "id": "2b013798", "metadata": {}, "outputs": [], "source": [ @@ -1155,7 +1155,7 @@ }, { "cell_type": "markdown", - "id": "b056f146", + "id": "2e33cf24", "metadata": {}, "source": [ "### Fixed Ratio Axes\n", @@ -1168,7 +1168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "480d5c2c", + "id": "28c7f061", "metadata": {}, "outputs": [], "source": [ @@ -1196,7 +1196,7 @@ }, { "cell_type": "markdown", - "id": "6cde8062", + "id": "da856997", "metadata": {}, "source": [ "### Fixed Ratio Axes with Compressed domain\n", @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c032e949", + "id": "c5d293f6", "metadata": {}, "outputs": [], "source": [ @@ -1235,7 +1235,7 @@ }, { "cell_type": "markdown", - "id": "fcc9a164", + "id": "f0a9fed7", "metadata": {}, "source": [ "##### Decreasing the domain spanned by an axis\n", @@ -1246,7 +1246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bd657bd", + "id": "ea82e5c9", "metadata": {}, "outputs": [], "source": [ @@ -1279,7 +1279,7 @@ }, { "cell_type": "markdown", - "id": "3c104956", + "id": "687d1904", "metadata": {}, "source": [ "#### Reversed Axes\n", @@ -1292,7 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88ca26af", + "id": "ab89be52", "metadata": {}, "outputs": [], "source": [ @@ -1307,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "8a6ad615", + "id": "4094bbc5", "metadata": {}, "source": [ "#### Reversed Axes with Range ( Min/Max ) Specified\n", @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7f6df6a", + "id": "f3c5dcbb", "metadata": {}, "outputs": [], "source": [ @@ -1335,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "71c88824", + "id": "1da0b7be", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1346,7 +1346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dfde437", + "id": "30543289", "metadata": {}, "outputs": [], "source": [ @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "3d8ef8ac", + "id": "0a7bfe1e", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1373,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "874d4dfd", + "id": "c681d2d6", "metadata": {}, "outputs": [], "source": [ @@ -1389,7 +1389,7 @@ }, { "cell_type": "markdown", - "id": "34fff1be", + "id": "cbcb7189", "metadata": {}, "source": [ "### Axis range for log axis type\n", @@ -1400,7 +1400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "288b592d", + "id": "216a6ac3", "metadata": {}, "outputs": [], "source": [ @@ -1415,7 +1415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03850698", + "id": "04aef08f", "metadata": {}, "outputs": [], "source": [ @@ -1431,7 +1431,7 @@ }, { "cell_type": "markdown", - "id": "f8aa8055", + "id": "fd37530e", "metadata": {}, "source": [ "#### Setting the domain of the axis" @@ -1440,7 +1440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39655414", + "id": "ab6ee697", "metadata": {}, "outputs": [], "source": [ @@ -1459,7 +1459,7 @@ }, { "cell_type": "markdown", - "id": "1b2ca50d", + "id": "c3970061", "metadata": {}, "source": [ "#### Synchronizing axes in subplots with `matches`\n", @@ -1472,7 +1472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4c67afa", + "id": "5e73ed38", "metadata": {}, "outputs": [], "source": [ @@ -1492,7 +1492,7 @@ }, { "cell_type": "markdown", - "id": "e741b845", + "id": "9e58af58", "metadata": {}, "source": [ "#### nonnegative, tozero, and normal Rangemode\n", @@ -1509,7 +1509,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19655082", + "id": "0d541de4", "metadata": {}, "outputs": [], "source": [ @@ -1525,7 +1525,7 @@ }, { "cell_type": "markdown", - "id": "e91c818d", + "id": "37ba484e", "metadata": {}, "source": [ "#### Autorange Options\n", @@ -1542,7 +1542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98e0ac7c", + "id": "19c57b0d", "metadata": {}, "outputs": [], "source": [ @@ -1559,7 +1559,7 @@ }, { "cell_type": "markdown", - "id": "7e4c16da", + "id": "03b4e33e", "metadata": {}, "source": [ "##### Clip Minimum and Maximum\n", @@ -1570,7 +1570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9eb7eb89", + "id": "2aa1c46d", "metadata": {}, "outputs": [], "source": [ @@ -1587,7 +1587,7 @@ }, { "cell_type": "markdown", - "id": "2218396b", + "id": "8e520eb9", "metadata": {}, "source": [ "##### Specify Values to be Included\n", @@ -1598,7 +1598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de32057a", + "id": "310b6625", "metadata": {}, "outputs": [], "source": [ @@ -1614,7 +1614,7 @@ }, { "cell_type": "markdown", - "id": "5362eb2b", + "id": "037550b8", "metadata": {}, "source": [ "#### Reference\n", @@ -1624,7 +1624,7 @@ }, { "cell_type": "markdown", - "id": "76e7a347", + "id": "974fdc0d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bar-charts.ipynb b/bar-charts.ipynb index e31ec1752..9660b1758 100644 --- a/bar-charts.ipynb +++ b/bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5b1547ee", + "id": "786fa8cc", "metadata": {}, "source": [ "### Bar chart with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de75acca", + "id": "66f18235", "metadata": { "lines_to_next_cell": 2 }, @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "0e7d76fa", + "id": "6abf7bbb", "metadata": {}, "source": [ "#### Bar charts with Long Format Data\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8b484cc", + "id": "9140d3e1", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "000f5963", + "id": "b2161e71", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "3eea1e3b", + "id": "3c531809", "metadata": {}, "source": [ "#### Bar charts with Wide Format Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e00fa7c", + "id": "6d91f0ef", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f4b2c2f", + "id": "5a67549b", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "628cd5a3", + "id": "11854d3f", "metadata": {}, "source": [ "### Bar charts in Dash\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20509da2", + "id": "7f103a4e", "metadata": { "hide_code": true }, @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "ac00f73b", + "id": "7d5d1d15", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "8e6e72ee", + "id": "07bd2166", "metadata": {}, "source": [ "### Colored Bars\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87e18a6f", + "id": "c12de409", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b0386ae", + "id": "f8c3c0c8", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "26d8e190", + "id": "42bba1e2", "metadata": {}, "source": [ "### Stacked vs Grouped Bars\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b82bd4a", + "id": "c10e9af7", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "f96db242", + "id": "ade58bae", "metadata": {}, "source": [ "The default stacked bar chart behavior can be changed to grouped (also known as clustered) using the `barmode` argument:" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e87346cc", + "id": "7001e378", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "25694541", + "id": "0291bf2c", "metadata": {}, "source": [ "### Aggregating into Single Colored Bars\n", @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c91094ce", + "id": "6506b1e6", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "69a6fe17", + "id": "caa11bfb", "metadata": {}, "source": [ "`px.histogram()` will aggregate `y` values by summing them by default, but the `histfunc` argument can be used to set this to `avg` to create what is sometimes called a \"barplot\" which summarizes the central tendency of a dataset, rather than visually representing the totality of the dataset.\n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2df8a79", + "id": "dfeb735f", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "ac25109d", + "id": "9d813469", "metadata": {}, "source": [ "### Bar Charts with Text\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40c7d03b", + "id": "ce3dea0e", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "14a28ca0", + "id": "18889a9a", "metadata": {}, "source": [ "The `text` argument can be used to display arbitrary text on the bars:" @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b90240c0", + "id": "2d80eeb3", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "8508ac36", + "id": "9deeb782", "metadata": {}, "source": [ "By default, Plotly will scale and rotate text labels to maximize the number of visible labels, which can result in a variety of text angles and sizes and positions in the same figure. The `textfont`, `textposition` and `textangle` trace attributes can be used to control these.\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2405eec6", + "id": "aa76f47a", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "4006230d", + "id": "367a09c7", "metadata": {}, "source": [ "Here is the same data with less variation in text formatting. Note that `textfont_size` will set the *maximum* size. The `layout.uniformtext` attribute can be used to guarantee that all text labels are the same size. See the [documentation on text and annotations](/python/text-and-annotations/) for details.\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdb490cf", + "id": "7bb97bd4", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "62ed87b8", + "id": "ef29221c", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "94487263", + "id": "45d60daf", "metadata": {}, "source": [ "Bar charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:" @@ -399,7 +399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95aae984", + "id": "c09714a3", "metadata": {}, "outputs": [], "source": [ @@ -413,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "5601839c", + "id": "c90262a5", "metadata": {}, "source": [ "### Facetted subplots\n", @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f07d5d7", + "id": "561f9b27", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "33c57ca2", + "id": "525d1119", "metadata": {}, "source": [ "#### Basic Bar Charts with plotly.graph_objects\n", @@ -450,7 +450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7df0a38", + "id": "b693356a", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "221be03f", + "id": "0edcc1e4", "metadata": {}, "source": [ "#### Grouped Bar Chart\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1135f2ba", + "id": "16bcb632", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "b2cf468c", + "id": "6af4a01c", "metadata": {}, "source": [ "### Stacked Bar Chart" @@ -501,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a9b88c3", + "id": "c0ed60d7", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "3d3d17dd", + "id": "37db9a52", "metadata": {}, "source": [ "### Bar Chart with Relative Barmode\n", @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed08a27a", + "id": "fbc42b0d", "metadata": {}, "outputs": [], "source": [ @@ -550,7 +550,7 @@ }, { "cell_type": "markdown", - "id": "f94bb426", + "id": "9c76245a", "metadata": {}, "source": [ "### Grouped Stacked Bar Chart\n", @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3516e649", + "id": "fb23bff4", "metadata": {}, "outputs": [], "source": [ @@ -620,7 +620,7 @@ }, { "cell_type": "markdown", - "id": "127096e1", + "id": "3bfedff9", "metadata": {}, "source": [ "### Stacked Bar Chart From Aggregating a DataFrame\n", @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60fd3481", + "id": "4f61b8af", "metadata": { "lines_to_next_cell": 2 }, @@ -683,7 +683,7 @@ }, { "cell_type": "markdown", - "id": "91c5e4b5", + "id": "efffc5d8", "metadata": {}, "source": [ "### Bar Chart with Hover Text" @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75b28c7b", + "id": "feff484a", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "8be566ec", + "id": "462966f1", "metadata": {}, "source": [ "### Bar Chart with Direct Labels" @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18de9e02", + "id": "0d6049f0", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "ea3b9761", + "id": "37a2e84b", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -754,7 +754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8726de43", + "id": "99ef12cb", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "c9e52f43", + "id": "8f3b629c", "metadata": {}, "source": [ "### Rotated Bar Chart Labels" @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df9a59ba", + "id": "72108c11", "metadata": {}, "outputs": [], "source": [ @@ -808,7 +808,7 @@ }, { "cell_type": "markdown", - "id": "89ab5d3b", + "id": "f28366c3", "metadata": {}, "source": [ "### Customizing Individual Bar Colors" @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "109ffe42", + "id": "219b0f7e", "metadata": {}, "outputs": [], "source": [ @@ -837,7 +837,7 @@ }, { "cell_type": "markdown", - "id": "adf18458", + "id": "f44ddded", "metadata": {}, "source": [ "### Customizing Individual Bar Widths" @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a86c7c91", + "id": "a2b4a17a", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "022a0ce6", + "id": "aee39c33", "metadata": {}, "source": [ "Bar charts with custom widths can be used to make mekko charts (also known as marimekko charts, mosaic plots, or variwide charts)." @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eecb5329", + "id": "a4201fa1", "metadata": {}, "outputs": [], "source": [ @@ -925,7 +925,7 @@ }, { "cell_type": "markdown", - "id": "826bd474", + "id": "7699a0c7", "metadata": {}, "source": [ "### Using a scatterplot to wrap long bars into multiple columns\n", @@ -936,7 +936,7 @@ { "cell_type": "code", "execution_count": null, - "id": "757598dd", + "id": "994eed47", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "719b6f70", + "id": "ebacf404", "metadata": {}, "source": [ "### Customizing Individual Bar Base" @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39abd59d", + "id": "516446a9", "metadata": {}, "outputs": [], "source": [ @@ -1072,7 +1072,7 @@ }, { "cell_type": "markdown", - "id": "bf59c0d6", + "id": "4f3f2870", "metadata": {}, "source": [ "### Rounded Bars\n", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "213293f0", + "id": "a0dbaa31", "metadata": {}, "outputs": [], "source": [ @@ -1112,7 +1112,7 @@ }, { "cell_type": "markdown", - "id": "842a76c3", + "id": "4a7c732c", "metadata": {}, "source": [ "When you don't want all bar traces in a figure to have the same rounded corners, you can instead configure rounded corners on each trace using `marker.cornerradius`. In this example, which uses subplots, the first trace has a corner radius of 30 pixels, the second trace has a bar corner radius of 30% of the bar width, and the third trace has no rounded corners set." @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42d87ade", + "id": "c8debfef", "metadata": {}, "outputs": [], "source": [ @@ -1154,7 +1154,7 @@ }, { "cell_type": "markdown", - "id": "24f7faa6", + "id": "92df771c", "metadata": {}, "source": [ "### Colored and Styled Bar Chart\n", @@ -1165,7 +1165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3afd62bd", + "id": "2dfaf989", "metadata": {}, "outputs": [], "source": [ @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "aee56b9d", + "id": "2236c5fc", "metadata": {}, "source": [ "### Bar Chart with Sorted or Ordered Categories\n", @@ -1227,7 +1227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd0c2408", + "id": "493e0281", "metadata": {}, "outputs": [], "source": [ @@ -1244,7 +1244,7 @@ }, { "cell_type": "markdown", - "id": "525dfb33", + "id": "abfe0449", "metadata": {}, "source": [ "This example shows how to customise sort ordering by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -1253,7 +1253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3d362b1", + "id": "5037f1e5", "metadata": {}, "outputs": [], "source": [ @@ -1270,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "0f7e1bd4", + "id": "d64bfa93", "metadata": {}, "source": [ "This example orders the bar chart by descending value with `categoryorder: 'total descending'`" @@ -1279,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49f5aaad", + "id": "0f399ef2", "metadata": {}, "outputs": [], "source": [ @@ -1296,7 +1296,7 @@ }, { "cell_type": "markdown", - "id": "604df2d5", + "id": "284250c2", "metadata": {}, "source": [ "### Horizontal Bar Charts\n", @@ -1311,7 +1311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4d66cf2", + "id": "16c5529c", "metadata": { "lines_to_next_cell": 0 }, @@ -1331,7 +1331,7 @@ }, { "cell_type": "markdown", - "id": "dfb1f27d", + "id": "f0a43e4c", "metadata": {}, "source": [ "\n" @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "11f7324c", + "id": "24d8b128", "metadata": {}, "source": [ "### Reference\n", @@ -1349,7 +1349,7 @@ }, { "cell_type": "markdown", - "id": "c0ee0d2f", + "id": "df659838", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-alignment-chart.ipynb b/bio-alignment-chart.ipynb index bebc77a70..e1099f09d 100644 --- a/bio-alignment-chart.ipynb +++ b/bio-alignment-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "20fcdd82", + "id": "c155e344", "metadata": {}, "source": [ "## Alignment Viewer\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55595b4c", + "id": "78076e8c", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "83b80b84", + "id": "50a93bd6", "metadata": {}, "source": [ "## Alignment Chart in dash_bio" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc7b80e7", + "id": "518e9580", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "4c85e132", + "id": "59a3f8cf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-clustergram.ipynb b/bio-clustergram.ipynb index f3ff1bb4b..bf8425f84 100644 --- a/bio-clustergram.ipynb +++ b/bio-clustergram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d02fac08", + "id": "eeeedb9b", "metadata": {}, "source": [ "## Default Clustergram\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfcdc778", + "id": "10b0374f", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "2d603c93", + "id": "504645b3", "metadata": {}, "source": [ "## Dendrogram Cluster Colors/Line Widths\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9ecb49a", + "id": "80141cb3", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "0caff7e2", + "id": "70216c08", "metadata": {}, "source": [ "## Relative Dendrogram Size\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de9b1acb", + "id": "ce3d86ad", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "82ff8c9a", + "id": "7b8a233d", "metadata": {}, "source": [ "## Clustergram with Dash" @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e7faa64", + "id": "ca1c408a", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "6eeccbf4", + "id": "5970a5f1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-manhattanplot.ipynb b/bio-manhattanplot.ipynb index e642a308e..81b78cd00 100644 --- a/bio-manhattanplot.ipynb +++ b/bio-manhattanplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ce1248e9", + "id": "dac78c6d", "metadata": {}, "source": [ "## Manhattan Plot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e15f45c1", + "id": "a31efb51", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "85119da8", + "id": "e9d65a0b", "metadata": {}, "source": [ "## Highlighted points color, and colors of the suggestive line and the genome-wide line\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1829c22b", + "id": "e38c3ab4", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "ca1e3a06", + "id": "60080d4b", "metadata": {}, "source": [ "## ManhattanPlot with Dash" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea2ea9d7", + "id": "7b6726e2", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "5cce6cdd", + "id": "af65624f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-volcano-plot.ipynb b/bio-volcano-plot.ipynb index d3e386fb0..420e8d9ee 100644 --- a/bio-volcano-plot.ipynb +++ b/bio-volcano-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d4fc1699", + "id": "bb5c5df7", "metadata": {}, "source": [ "## VolcanoPlot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b81f159", + "id": "b1b3935c", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "3793826b", + "id": "6d6261e8", "metadata": {}, "source": [ "## Point Sizes And Line Widths\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beb4ae8d", + "id": "a8f04446", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "c8371e7b", + "id": "6955fad5", "metadata": {}, "source": [ "## VolcanoPlot with Dash" @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1c07443", + "id": "c72048dc", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "5fefeb2a", + "id": "2c666d26", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/box-plots.ipynb b/box-plots.ipynb index 8bd30ffdd..334ffaf27 100644 --- a/box-plots.ipynb +++ b/box-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6275cfae", + "id": "298eb4dc", "metadata": {}, "source": [ "A [box plot](https://en.wikipedia.org/wiki/Box_plot) is a statistical representation of the distribution of a variable through its quartiles. The ends of the box represent the lower and upper quartiles, while the median (second quartile) is marked by a line inside the box. For other statistical representations of numerical data, see [other statistical charts](https://plotly.com/python/statistical-charts/).\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e0b72f2", + "id": "a7a336fb", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "8e846c29", + "id": "880c9033", "metadata": {}, "source": [ "If a column name is given as `x` argument, a box plot is drawn for each value of `x`." @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f520dec0", + "id": "1463d0f6", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "ffd9746f", + "id": "9e010cca", "metadata": {}, "source": [ "### Box Plots in Dash\n", @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b6b361a", + "id": "b61dc8e9", "metadata": { "hide_code": true }, @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "8abe01d9", + "id": "39307d09", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "676367d9", + "id": "e1b615a2", "metadata": {}, "source": [ "### Display the underlying data\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "143cefbb", + "id": "7bce3810", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "d549c0d5", + "id": "bbfaf40c", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5aebe1bd", + "id": "2e04ba72", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "a7322e63", + "id": "8b315e8f", "metadata": {}, "source": [ "#### Difference Between Quartile Algorithms\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f03659ea", + "id": "a6d85a86", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "55f38197", + "id": "df37fc92", "metadata": {}, "source": [ "#### Styled box plot\n", @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eafa1826", + "id": "d4f41d2a", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "28a29143", + "id": "fa57cdbc", "metadata": {}, "source": [ "## Box plot with go.Box\n", @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f63a0b1c", + "id": "086b1e5a", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "5b19d144", + "id": "a22b0d71", "metadata": {}, "source": [ "### Basic Horizontal Box Plot" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c7ee77e", + "id": "18949396", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "de8684a7", + "id": "e97301c7", "metadata": {}, "source": [ "### Box Plot That Displays The Underlying Data" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42838f13", + "id": "79116fae", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "604b2aa9", + "id": "fdcf645e", "metadata": {}, "source": [ "### Modifying The Algorithm For Computing Quartiles\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9e2b752", + "id": "b5af48db", "metadata": {}, "outputs": [], "source": [ @@ -325,7 +325,7 @@ }, { "cell_type": "markdown", - "id": "1ee2cb2e", + "id": "7c02b42e", "metadata": {}, "source": [ "### Box Plot With Precomputed Quartiles\n", @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2612aec", + "id": "306d695e", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "c8707a48", + "id": "c3b6e43e", "metadata": {}, "source": [ "### Colored Box Plot" @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0d11000", + "id": "e96dd403", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "df91b74f", + "id": "8a5d4edc", "metadata": {}, "source": [ "### Box Plot Styling Mean & Standard Deviation" @@ -395,7 +395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04488eef", + "id": "8310a629", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "d9c80307", + "id": "f9810dfc", "metadata": {}, "source": [ "### Styling Outliers\n", @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fedc1c2b", + "id": "3f7dc616", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ }, { "cell_type": "markdown", - "id": "8cec0a6e", + "id": "a65bf875", "metadata": {}, "source": [ "### Grouped Box Plots" @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d85d6603", + "id": "80409bf2", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "bed23851", + "id": "92d09499", "metadata": {}, "source": [ "### Grouped Horizontal Box Plot" @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffa534c0", + "id": "228317a8", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "e2c513ac", + "id": "23f7a6dc", "metadata": {}, "source": [ "### Rainbow Box Plots" @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10f4cedb", + "id": "4f2bfaa1", "metadata": {}, "outputs": [], "source": [ @@ -631,7 +631,7 @@ }, { "cell_type": "markdown", - "id": "104e8b84", + "id": "5947d49b", "metadata": {}, "source": [ "### Fully Styled Box Plots" @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5d1720e", + "id": "4b7d6456", "metadata": {}, "outputs": [], "source": [ @@ -707,7 +707,7 @@ }, { "cell_type": "markdown", - "id": "fb49fa82", + "id": "326cfb43", "metadata": {}, "source": [ "### Box Plot With Only Points\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05c279bc", + "id": "ac082ba4", "metadata": {}, "outputs": [], "source": [ @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "876bd468", + "id": "1ee10ba0", "metadata": {}, "source": [ "#### Reference\n", @@ -740,7 +740,7 @@ }, { "cell_type": "markdown", - "id": "04ec1f2e", + "id": "1a85876c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-charts.ipynb b/bubble-charts.ipynb index 5e4011c3a..5935c8e05 100644 --- a/bubble-charts.ipynb +++ b/bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c0d19d2f", + "id": "b65df19f", "metadata": {}, "source": [ "## Bubble chart with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adfdea34", + "id": "5b1b3d5c", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "851ecc0f", + "id": "2aeb77cb", "metadata": {}, "source": [ "## Bubble Chart with plotly.graph_objects\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23675705", + "id": "580475da", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "ba154bad", + "id": "a6b90ee9", "metadata": {}, "source": [ "### Setting Marker Size and Color" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01708a56", + "id": "c61187c5", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "0c837bce", + "id": "6df0637d", "metadata": {}, "source": [ "### Scaling the Size of Bubble Charts\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a2b94c9", + "id": "9b61c567", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "2bc1ccc3", + "id": "42d39b82", "metadata": {}, "source": [ "### Hover Text with Bubble Charts" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54a966bb", + "id": "8d14ce27", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "e6b2aa22", + "id": "f8ce23c4", "metadata": {}, "source": [ "### Bubble Charts with Colorscale" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e9edc5a", + "id": "dcc14b25", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "07c7e94a", + "id": "d9f9e2b4", "metadata": {}, "source": [ "### Categorical Bubble Charts" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c525ff0", + "id": "99dcb53b", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "f073302c", + "id": "dfc1fd46", "metadata": {}, "source": [ "### Reference\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "a074cce8", + "id": "71046ec5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-maps.ipynb b/bubble-maps.ipynb index 3afa88c7c..ffe4f2e30 100644 --- a/bubble-maps.ipynb +++ b/bubble-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0588cf92", + "id": "058d2e77", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13350c19", + "id": "710812cc", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "1ba079ec", + "id": "0828ef97", "metadata": {}, "source": [ "### Bubble Map with animation" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8554946", + "id": "08e1444f", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "5045e945", + "id": "9dd7b445", "metadata": {}, "source": [ "### Bubble Map with go.Scattergeo\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2e06887", + "id": "af912262", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "50b0020b", + "id": "91e6039a", "metadata": {}, "source": [ "#### Ebola Cases in West Africa" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc3e6dee", + "id": "d46953e4", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "66cba1ca", + "id": "a49e4aaa", "metadata": {}, "source": [ "#### Reference\n", @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "b3259b4e", + "id": "43b0b659", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/builtin-colorscales.ipynb b/builtin-colorscales.ipynb index 730520155..e0ee58635 100644 --- a/builtin-colorscales.ipynb +++ b/builtin-colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4b144005", + "id": "76b5643e", "metadata": {}, "source": [ "### Using Built-In Continuous Color Scales\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "644250e0", + "id": "8d2cb13c", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "9198caf5", + "id": "fc12ec6c", "metadata": {}, "source": [ "Built-in color scales are stored as lists of CSS colors:" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f222a14c", + "id": "445fb332", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "b4cb091f", + "id": "c89cb03a", "metadata": {}, "source": [ "### Continuous Color Scales in Dash\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4f29abb", + "id": "2ed6e8e6", "metadata": { "hide_code": true }, @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "e26724b3", + "id": "aed3d173", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "f7e98d83", + "id": "cebedbc3", "metadata": {}, "source": [ "### Built-In Sequential Color scales\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf636fc0", + "id": "5fcd8901", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "32d937fa", + "id": "0ea84d1a", "metadata": {}, "source": [ "Note: `RdBu` was included in the `sequential` module by mistake, even though it is a diverging color scale.\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "805e58d8", + "id": "d910e059", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "443b5cf2", + "id": "9c094413", "metadata": {}, "source": [ "### Built-In Cyclical Color scales\n", @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d8d0c0c", + "id": "a27b4f5d", "metadata": { "lines_to_next_cell": 2 }, @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "6d9bdd6e", + "id": "d34cca79", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bullet-charts.ipynb b/bullet-charts.ipynb index 6e69226d2..029b64770 100644 --- a/bullet-charts.ipynb +++ b/bullet-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ae7ede10", + "id": "1ab01fed", "metadata": {}, "source": [ "#### Basic Bullet Charts\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f274dcd3", + "id": "09344a80", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "26dbaa06", + "id": "48ce3678", "metadata": {}, "source": [ "#### Add Steps, and Threshold\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5659d0d", + "id": "25790209", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "68f5c742", + "id": "e633422f", "metadata": {}, "source": [ "#### Custom Bullet\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e483117", + "id": "b4bfe721", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "e458bd95", + "id": "12f84348", "metadata": {}, "source": [ "#### Multi Bullet\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f86b795", + "id": "5b24bdb8", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "08d467dc", + "id": "fc7de636", "metadata": {}, "source": [ "#### Reference\n", @@ -193,14 +193,14 @@ { "cell_type": "code", "execution_count": null, - "id": "20809cf9", + "id": "81a448e6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "d32c72e1", + "id": "d6668e13", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/candlestick-charts.ipynb b/candlestick-charts.ipynb index b8512cb99..bdcaacde4 100644 --- a/candlestick-charts.ipynb +++ b/candlestick-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ff7c813e", + "id": "3dee2e43", "metadata": {}, "source": [ "The [candlestick chart](https://en.wikipedia.org/wiki/Candlestick_chart) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e73f00b4", + "id": "1e8a1611", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "a104b31c", + "id": "c8d71ba9", "metadata": {}, "source": [ "#### Candlestick without Rangeslider" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f051bcdd", + "id": "d7ef7bff", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "c2b35eb8", + "id": "6d157156", "metadata": {}, "source": [ "#### Candlestick in Dash\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffacad38", + "id": "f4c066bf", "metadata": { "hide_code": true }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "7512c1ce", + "id": "dcc49a31", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "1e0a8ce4", + "id": "41734327", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1481230", + "id": "ac4c22b6", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "9305c338", + "id": "9a815388", "metadata": {}, "source": [ "#### Custom Candlestick Colors" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd324eec", + "id": "e8a3224e", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ }, { "cell_type": "markdown", - "id": "cf93b94d", + "id": "d9f0b466", "metadata": {}, "source": [ "#### Simple Example with `datetime` Objects" @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "840f1709", + "id": "5a35809a", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "c0f1cd3d", + "id": "167a58be", "metadata": {}, "source": [ "#### Reference\n", @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "04015040", + "id": "4362ed81", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-contour.ipynb b/carpet-contour.ipynb index ed6291fc3..e85f5d451 100644 --- a/carpet-contour.ipynb +++ b/carpet-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fac3f15e", + "id": "56d75171", "metadata": {}, "source": [ "### Basic Carpet Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62c4b91b", + "id": "7eccd16c", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "7d37cfe9", + "id": "76cb9d8c", "metadata": {}, "source": [ "### Add Contours" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7628c1a1", + "id": "09db86ca", "metadata": { "inputHidden": false, "outputHidden": false @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "965b22ce", + "id": "b1856883", "metadata": {}, "source": [ "### Add Multiple Traces" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5584616", + "id": "bf34e336", "metadata": { "inputHidden": false, "outputHidden": false @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "b750e771", + "id": "f8528d49", "metadata": {}, "source": [ "### Reference\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "f84d5c31", + "id": "5b6eb04e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-plot.ipynb b/carpet-plot.ipynb index ff3061155..e1115ffcb 100644 --- a/carpet-plot.ipynb +++ b/carpet-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "50ea0dbc", + "id": "6e1fa11d", "metadata": {}, "source": [ "### Set X and Y Coordinates\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01eb6c47", + "id": "2bd80070", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "5748c47c", + "id": "edfef313", "metadata": {}, "source": [ "### Add Parameter Values\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbb64f7b", + "id": "72c9f7e5", "metadata": { "inputHidden": false, "outputHidden": false @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "f171bcff", + "id": "44687d7c", "metadata": {}, "source": [ "### Add A and B axis\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c18dbe2e", + "id": "acad180b", "metadata": { "inputHidden": false, "outputHidden": false @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "98d37b5f", + "id": "35059347", "metadata": {}, "source": [ "### Alternate input format\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "054eed60", + "id": "cd2e2658", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "c8925437", + "id": "78a8dc31", "metadata": {}, "source": [ "### Cheater plot layout" @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "d980044a", + "id": "a92352f2", "metadata": {}, "source": [ "The layout of cheater plots is not unique and depends upon the `cheaterslope` and axis `cheatertype` parameters. If `x` is not specified, each row of the `x` array is constructed based on the the formula `a + cheaterslope * b`, where `a` and `b` are either the value or the integer index of `a` and `b` respectively, depending on the corresponding axis `cheatertype`. Although the layout of the axis below is different than the plots above, it represents the same data as the axes above." @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbfba2c7", + "id": "8c82003c", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "537f8307", + "id": "d8a50ff4", "metadata": {}, "source": [ "### Style A and B axis" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2a55f27", + "id": "3a1435c7", "metadata": { "inputHidden": false, "outputHidden": false @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "3050db5d", + "id": "caf2eb7e", "metadata": {}, "source": [ "### Add Points and Contours\n", @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "d80d5b15", + "id": "24000ae7", "metadata": {}, "source": [ "### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "902a8eaf", + "id": "4928a32f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-scatter.ipynb b/carpet-scatter.ipynb index 1aae070a0..a589309bc 100644 --- a/carpet-scatter.ipynb +++ b/carpet-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d8c474fa", + "id": "1aa8a846", "metadata": {}, "source": [ "### Basic Carpet Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a484a9d", + "id": "3a413c31", "metadata": { "inputHidden": false, "outputHidden": false @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "e85deaa0", + "id": "38eb1e82", "metadata": {}, "source": [ "### Add Carpet Scatter Trace" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3fbbc24", + "id": "61725285", "metadata": { "inputHidden": false, "outputHidden": false @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "4c022abb", + "id": "07cf0e51", "metadata": {}, "source": [ "### Add Multiple Scatter Traces" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8782c2d0", + "id": "15175242", "metadata": { "inputHidden": false, "outputHidden": false @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "5068a935", + "id": "c3e7be2f", "metadata": {}, "source": [ "### Reference" @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "67351b11", + "id": "74272b7e", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattercarpet/ for more information and chart attribute options!" @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "fb356c80", + "id": "776fec57", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/categorical-axes.ipynb b/categorical-axes.ipynb index 4a869f85e..d4ee68127 100644 --- a/categorical-axes.ipynb +++ b/categorical-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c7a9510c", + "id": "5ad71365", "metadata": {}, "source": [ "\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40fdde4f", + "id": "634a9623", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "53d40048", + "id": "89289171", "metadata": {}, "source": [ "### Categorical Axes and Trace Types\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30890a88", + "id": "02c56f2a", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "f8736656", + "id": "c84bfb04", "metadata": {}, "source": [ "[Box plots]() and [violin plots]() are often shown with one categorical and one continuous axis." @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5448a74", + "id": "e1d9ff33", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3f29259", + "id": "17e1b586", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "bc9128dc", + "id": "56ab286b", "metadata": {}, "source": [ "### Controlling the Category Order with Plotly Express\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3a9845c", + "id": "9adae12d", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "28cddda3", + "id": "e9f4318d", "metadata": {}, "source": [ "### Automatically Sorting Categories by Name or Total Value\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d633d248", + "id": "8bdae531", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "f655bf64", + "id": "ebedba9a", "metadata": {}, "source": [ "This example orders the categories **by total value** with `categoryorder: 'total descending'`" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85425ef7", + "id": "1acd0ba2", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "dda1c1e8", + "id": "49b5db06", "metadata": {}, "source": [ "This example shows how to control category order when using `plotly.graph_objects` by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9620430f", + "id": "4d1b03b4", "metadata": { "lines_to_next_cell": 0 }, @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "c2b3135d", + "id": "20fe42b3", "metadata": {}, "source": [ "### Gridlines, Ticks and Tick Labels" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "64c9c978", + "id": "0225639e", "metadata": {}, "source": [ "By default, gridlines and ticks are not shown on categorical axes but they can be activated:" @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84f63f48", + "id": "2f548955", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "71c75628", + "id": "8c972bfc", "metadata": {}, "source": [ "By default, ticks and gridlines appear on the categories but the `tickson` attribute can be used to move them to the category boundaries:" @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4ebd82f", + "id": "72126705", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "02d4da9d", + "id": "714fad23", "metadata": {}, "source": [ "### Multi-categorical Axes\n", @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03933ed6", + "id": "c86381cb", "metadata": { "lines_to_next_cell": 0 }, @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "982d6723", + "id": "10b53369", "metadata": {}, "source": [ "### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "444908d0", + "id": "461aee4c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/choropleth-maps.ipynb b/choropleth-maps.ipynb index 7cedfe615..20ec67eb8 100644 --- a/choropleth-maps.ipynb +++ b/choropleth-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b35a1509", + "id": "401c3f2f", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).\n", @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e3f3cbe", + "id": "9057f0b8", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "9278b946", + "id": "29f69b48", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b88f4d2", + "id": "42e02299", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "5a02933d", + "id": "78da014c", "metadata": {}, "source": [ "### Choropleth map using GeoJSON\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "041fad2a", + "id": "41e62ec2", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "fe978c01", + "id": "18793cb9", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de172f47", + "id": "4688c167", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "6f44b0af", + "id": "009b3d83", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron.\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7adcd39", + "id": "3558167e", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "87012666", + "id": "380f3a14", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83ff6b40", + "id": "1b6fd7b4", "metadata": { "hide_code": true }, @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "6ca35dcf", + "id": "712adcbc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "17167a27", + "id": "a250b381", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cddfa516", + "id": "67546675", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "f2fd96c1", + "id": "5d977348", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4510947", + "id": "113a1d31", "metadata": { "lines_to_next_cell": 2 }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "25f259f3", + "id": "15e36506", "metadata": {}, "source": [ "### Using Built-in Country and State Geometries\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea395ec0", + "id": "19f2635c", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "387101e8", + "id": "0aa7a449", "metadata": {}, "source": [ "To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes):" @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce198cf7", + "id": "af59f7d7", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "f6d2c001", + "id": "b6d42858", "metadata": {}, "source": [ "### Choropleth Maps with go.Choropleth\n", @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d121846f", + "id": "4c7091ac", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "808e5779", + "id": "e8a716b9", "metadata": {}, "source": [ "#### Customize choropleth chart" @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4a67396", + "id": "78304fda", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "be181136", + "id": "f6172cce", "metadata": {}, "source": [ "#### World Choropleth Map" @@ -437,7 +437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee7074b4", + "id": "5218ebc1", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "a5edf243", + "id": "a71f810e", "metadata": {}, "source": [ "#### County Choropleth Figure Factory\n", @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6350f50", + "id": "70747301", "metadata": {}, "outputs": [], "source": [ @@ -531,7 +531,7 @@ }, { "cell_type": "markdown", - "id": "e9109ed0", + "id": "65715c4a", "metadata": {}, "source": [ "#### Reference\n", @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "26bc909a", + "id": "d3e79b77", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/click-events.ipynb b/click-events.ipynb index 44e42a809..f8ec41bd7 100644 --- a/click-events.ipynb +++ b/click-events.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "451b5935", + "id": "9a4958a3", "metadata": {}, "source": [ "#### Update Points Using a Click Callback" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a34fe8a4", + "id": "e3dd25ee", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "7c101af7", + "id": "ecd85548", "metadata": {}, "source": [ "" @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "ceb0859b", + "id": "c3da6751", "metadata": {}, "source": [ "#### Reference" @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "6777def5", + "id": "4643a7f0", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b96fc2af", + "id": "634ebdc6", "metadata": { "lines_to_next_cell": 2 }, @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "c8ad8023", + "id": "e9e92796", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/colorscales.ipynb b/colorscales.ipynb index 9f283687d..95b8aa69c 100644 --- a/colorscales.ipynb +++ b/colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9f26d6b5", + "id": "5b3a7e60", "metadata": {}, "source": [ "### Continuous vs Discrete Color\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ddfed974", + "id": "047d9732", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "b6b6a195", + "id": "bb5d7433", "metadata": {}, "source": [ "Converting this column to strings is very straightforward:" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fce0395", + "id": "9ecfcbba", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "2c60b8f7", + "id": "6d5908ad", "metadata": {}, "source": [ "If you have stringified numbers you can convert back just as easily:" @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37ac2336", + "id": "c31b703e", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "8dfe4d89", + "id": "9e828136", "metadata": {}, "source": [ "### Colorscales in Dash\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9942aa10", + "id": "be1b908d", "metadata": { "hide_code": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "c30d1904", + "id": "8626d217", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "3a3fb589", + "id": "a7d98411", "metadata": {}, "source": [ "### Color Scales in Plotly Express\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dddf6bc", + "id": "d0e9bb94", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "7cedad96", + "id": "821751a8", "metadata": {}, "source": [ "It is also possible to specify color scales by name. Here is an example that specifies the `Inferno` color scale by name, as a string" @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "517e0f0b", + "id": "9852fc0b", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "cd8e8b58", + "id": "326c2cdf", "metadata": {}, "source": [ "### Reversing a built-in color scale\n", @@ -187,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3be6b7e", + "id": "e4901a20", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc5d4fdd", + "id": "057ccd0f", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "8e865a6e", + "id": "95710cdf", "metadata": {}, "source": [ "### Explicitly Constructing a Color scale\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ed08bb1", + "id": "43fb938e", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "b5c1c231", + "id": "112cbfaf", "metadata": {}, "source": [ "The example above provided a list of CSS colors to construct a scale, which inferred the reference points to be evenly spaced, but specific reference points can be provided as well. The following example has the same result:" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b52426e", + "id": "f2405359", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "ad80688c", + "id": "bb8c7831", "metadata": {}, "source": [ "### Constructing a Discrete or Discontinuous Color Scale\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65de69ed", + "id": "d77fdbf1", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "1a0fb6ee", + "id": "96f0ee8c", "metadata": {}, "source": [ "### Explicitly setting a Color Range\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4f10859", + "id": "6602bb9a", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "a8aa54d1", + "id": "b067fc5b", "metadata": {}, "source": [ "### Setting the Midpoint of a Color Range for a Diverging Color scale\n", @@ -327,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d9952b1", + "id": "9f516a58", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "ecad86e4", + "id": "7c20d738", "metadata": {}, "source": [ "### Hiding or Customizing the Plotly Express Color Bar\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec7dc22d", + "id": "2c2578e9", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "39cf361e", + "id": "79df68a6", "metadata": {}, "source": [ "You can also configure the title, size, placement and tick marks and labels on a color bar:" @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84a7d538", + "id": "34e5e105", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "24d88c06", + "id": "50f709d3", "metadata": {}, "source": [ "### Customizing Tick Text on Discrete Color Bars\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "506c211c", + "id": "af8a6be1", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "d07ef86d", + "id": "149f1c34", "metadata": {}, "source": [ "### Customizing Tick Text on Logarithmic Color Bars\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f0522ee", + "id": "80bb4b5e", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "57f69d71", + "id": "df292fc0", "metadata": {}, "source": [ "### Using Label Aliases on Colorbars\n", @@ -480,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e8e12a1", + "id": "a7af2105", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "a59f4f50", + "id": "7378195b", "metadata": {}, "source": [ "### Custom Discretized Heatmap Color scale with Graph Objects" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d55b294", + "id": "ad6e54bf", "metadata": {}, "outputs": [], "source": [ @@ -582,7 +582,7 @@ }, { "cell_type": "markdown", - "id": "ec54ae41", + "id": "0b884575", "metadata": {}, "source": [ "### Color scale for Scatter Plots with Graph Objects" @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17bde5a6", + "id": "fb54f4c1", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "2ebb3b60", + "id": "cabcf06f", "metadata": {}, "source": [ "### Color scale for Contour Plot with Graph Objects" @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17487ebc", + "id": "4a41b3e0", "metadata": {}, "outputs": [], "source": [ @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "5d2a42c3", + "id": "30233690", "metadata": {}, "source": [ "### Custom Heatmap Color scale with Graph Objects" @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa0eb941", + "id": "506eb037", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "9d089350", + "id": "1370c4ce", "metadata": {}, "source": [ "### Setting the Midpoint of a Diverging Color scale with Graph Objects\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5322eafb", + "id": "0715db62", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "c6418d3c", + "id": "a4a3598a", "metadata": {}, "source": [ "The heatmap chart uses [marker.zmid](https://plotly.com/python/reference/scatter/#scatter-marker-zmid) attribute to set the mid-point of the color domain." @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3356a326", + "id": "20831c14", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "3c974023", + "id": "fd94e151", "metadata": {}, "source": [ "### Custom Contour Plot Color scale with Graph Objects" @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00241e69", + "id": "43a4680e", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "b658d999", + "id": "bb04a263", "metadata": {}, "source": [ "### Custom Color bar Title, Labels, and Ticks with Graph Objects\n", @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c462db1d", + "id": "a8ec7bbd", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "f8aa1d82", + "id": "1f63c161", "metadata": {}, "source": [ "### Color Bar Displayed Horizontally\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3035b0a7", + "id": "3570fe9b", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "b1ffc974", + "id": "19dbee39", "metadata": {}, "source": [ "### Sharing a Color Axis with Graph Objects\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7b87d06", + "id": "b6f2f546", "metadata": {}, "outputs": [], "source": [ @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "65aadf76", + "id": "14ef9a64", "metadata": {}, "source": [ "### Logarithmic Color scale with Graph Objects" @@ -916,7 +916,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97e7d571", + "id": "dfb056f0", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "277852cb", + "id": "c484d1d7", "metadata": {}, "source": [ "### Positioning Colorbars\n", @@ -962,7 +962,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fad613d8", + "id": "0c070215", "metadata": {}, "outputs": [], "source": [ @@ -991,7 +991,7 @@ }, { "cell_type": "markdown", - "id": "37ed8973", + "id": "2f020325", "metadata": {}, "source": [ "### Reference\n", @@ -1001,7 +1001,7 @@ }, { "cell_type": "markdown", - "id": "89dcee8e", + "id": "40a7d03a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/cone-plot.ipynb b/cone-plot.ipynb index 851aa12ac..516ff9ff1 100644 --- a/cone-plot.ipynb +++ b/cone-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e0516b39", + "id": "0d823ef7", "metadata": {}, "source": [ "A cone plot is the 3D equivalent of a 2D [quiver plot](/python/quiver-plots/), i.e., it represents a 3D vector field using cones to represent the direction and norm of the vectors. 3-D coordinates are given by `x`, `y` and `z`, and the coordinates of the vector field by `u`, `v` and `w`.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18b6e784", + "id": "956250dd", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "47d13b72", + "id": "d1bf4067", "metadata": {}, "source": [ "### Multiple 3D Cones" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8bb7a6b", + "id": "c4f5cea5", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "fd0054dc", + "id": "fc3dcb27", "metadata": {}, "source": [ "### 3D Cone Lighting" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5edb14b0", + "id": "a9625741", "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "b22f6aa4", + "id": "8773156e", "metadata": {}, "source": [ "### 3D Cone Vortex" @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a3ac067", + "id": "d94d32a0", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "f5a045e8", + "id": "9b1840f1", "metadata": {}, "source": [ "### Sizemode\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "128367dd", + "id": "8b8c9816", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "2c64482d", + "id": "bd49e9e7", "metadata": {}, "source": [ "#### Reference\n", @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "3faf91c6", + "id": "dcd058f4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/configuration-options.ipynb b/configuration-options.ipynb index 959788b77..a403771df 100644 --- a/configuration-options.ipynb +++ b/configuration-options.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d911364e", + "id": "f5f486a5", "metadata": {}, "source": [ "## Configuration Options\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9d575d2", + "id": "3b1a1002", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "46c19dd4", + "id": "8bca747a", "metadata": {}, "source": [ "### Turning Off Responsiveness\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cab5785", + "id": "e1e10fb6", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "efb30df6", + "id": "e18533d7", "metadata": {}, "source": [ "### Making A Static Chart" @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c97aac18", + "id": "efaf7aa4", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "dbae886f", + "id": "80fc0f08", "metadata": {}, "source": [ "### Forcing The Modebar to Always Be Visible\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1aceca0e", + "id": "88b86c0f", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "cd956fcb", + "id": "f4cf3d8c", "metadata": {}, "source": [ "### Preventing the Modebar from Appearing\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd2969e3", + "id": "b8858dfe", "metadata": { "lines_to_next_cell": 2 }, @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "c3f1f86b", + "id": "a7c3f52e", "metadata": {}, "source": [ "### Hiding the Plotly Logo on the Modebar" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d691af0d", + "id": "2ccf2210", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "4c05dfa0", + "id": "6391d8ac", "metadata": {}, "source": [ "### Customizing Modebar \"Download Plot\" Button\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "162646bc", + "id": "754ad461", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "5cd53549", + "id": "ba6d9496", "metadata": {}, "source": [ "Figures can be set to download at the currently-rendered size by setting `height` and `width` to `None`:\n" @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce84e493", + "id": "8244a749", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "12c4334a", + "id": "696fbce7", "metadata": {}, "source": [ "### Removing Modebar Buttons\n", @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4c7a3c7", + "id": "060a4d7a", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "18ee05a7", + "id": "7ce4e0b5", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a758055", + "id": "f9117432", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "4aa126f9", + "id": "cb63eeaf", "metadata": {}, "source": [ "### Add optional shape-drawing buttons to modebar\n", @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5205cf89", + "id": "44f05675", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "f275ddd9", + "id": "0c0cf88c", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3aae9103", + "id": "62588322", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "3506055e", + "id": "577bc9bf", "metadata": {}, "source": [ "### Double-Click Delay\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dd0aaf8", + "id": "ec7165cb", "metadata": {}, "outputs": [], "source": [ @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "55a9ade1", + "id": "2d844ecf", "metadata": {}, "source": [ "### Disabling Buttons for Specific Axes\n", @@ -460,7 +460,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5950b2c", + "id": "bdfb69b0", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "11ee7c67", + "id": "e82a7390", "metadata": {}, "source": [ "### Configuring Figures in Dash Apps\n", @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "fadf663e", + "id": "7e25fe03", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/continuous-error-bars.ipynb b/continuous-error-bars.ipynb index 4ed54f828..9a044cd73 100644 --- a/continuous-error-bars.ipynb +++ b/continuous-error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "08f12d8a", + "id": "401448e0", "metadata": {}, "source": [ "Continuous error bands are a graphical representation of error or uncertainty as a shaded region around a main trace, rather than as discrete whisker-like error bars. They can be implemented in a manner similar to [filled area plots](/python/filled-area-plots/) using `scatter` traces with the `fill` attribute.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "635c7c6c", + "id": "014f34f7", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "b94e9604", + "id": "c7e8670b", "metadata": {}, "source": [ "#### Filling between two traces\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d364aa0", + "id": "a6b7328f", "metadata": { "lines_to_next_cell": 2 }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "2c4012b5", + "id": "7c545993", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/contour-plots.ipynb b/contour-plots.ipynb index e36814280..7262dcf1c 100644 --- a/contour-plots.ipynb +++ b/contour-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "166e8ce6", + "id": "4ca30f5f", "metadata": {}, "source": [ "### Basic Contour Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1db0a9d1", + "id": "bc65d83e", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "f63dc430", + "id": "29872596", "metadata": {}, "source": [ "### Setting X and Y Coordinates in a Contour Plot ###" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f27c8d20", + "id": "524277ff", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "ae9c615b", + "id": "416ac002", "metadata": {}, "source": [ "### Colorscale for Contour Plot ###" @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f400b8e1", + "id": "3b938c0e", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "ec4d1351", + "id": "e197edae", "metadata": {}, "source": [ "### Customizing Size and Range of a Contour Plot's Contours ###" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20f6488f", + "id": "6f8db8f2", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "65b9dac3", + "id": "ad34d8ba", "metadata": {}, "source": [ "### Customizing Spacing Between X and Y Axis Ticks ###" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74964f46", + "id": "af4f9004", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "1852a22f", + "id": "e55ee4a1", "metadata": {}, "source": [ "### Connect the Gaps Between None Values in the Z Matrix ###" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "161e2fb2", + "id": "22c07c1b", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "b982ff17", + "id": "a7f986d6", "metadata": {}, "source": [ "### Smoothing the Contour lines ###" @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56dbf534", + "id": "7d897167", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "aa0b7136", + "id": "375a48c6", "metadata": {}, "source": [ "### Smooth Contour Coloring ###" @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4182830f", + "id": "4e9e6f7e", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "e132c085", + "id": "7ee23cb9", "metadata": {}, "source": [ "### Contour Line Labels ###" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f352656d", + "id": "2a3a089a", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "d29f9392", + "id": "c0bad35f", "metadata": {}, "source": [ "### Contour Lines ###" @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47b97c6b", + "id": "e6a334f8", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "3935b478", + "id": "b965d0a5", "metadata": {}, "source": [ "### Custom Contour Plot Colorscale ###" @@ -344,7 +344,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82dc525c", + "id": "5f391962", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "c3677d15", + "id": "2c3169cd", "metadata": {}, "source": [ "### Color Bar Title ###" @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3163adde", + "id": "f868724b", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "5942fef3", + "id": "8b499be6", "metadata": {}, "source": [ "### Color Bar Size for Contour Plots\n", @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30b7845d", + "id": "5bf3a60a", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ }, { "cell_type": "markdown", - "id": "8e81ff27", + "id": "c1758630", "metadata": {}, "source": [ "### Styling Color Bar Ticks for Contour Plots" @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51f75a3d", + "id": "f17ccb26", "metadata": {}, "outputs": [], "source": [ @@ -477,7 +477,7 @@ }, { "cell_type": "markdown", - "id": "606e2120", + "id": "923efdfd", "metadata": {}, "source": [ "#### Reference\n", @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "907cd6b6", + "id": "61fa7fc1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/county-choropleth.ipynb b/county-choropleth.ipynb index 180805352..50a883aa2 100644 --- a/county-choropleth.ipynb +++ b/county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "64415c87", + "id": "2805becd", "metadata": {}, "source": [ "### Deprecation warning" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "47147330", + "id": "b9a8fd21", "metadata": {}, "source": [ "This page describes a [legacy \"figure factory\" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth)." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "d839aee0", + "id": "c907af04", "metadata": {}, "source": [ "#### Required Packages\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d151fdd", + "id": "64ab03e5", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "69959fd6", + "id": "b4e6bc7a", "metadata": {}, "source": [ "If you are using Windows, follow this post to properly install geopandas and dependencies: http://geoffboeing.com/2014/09/using-geopandas-windows/. If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:" @@ -50,7 +50,7 @@ }, { "cell_type": "raw", - "id": "a03c73cd", + "id": "bde8b27d", "metadata": {}, "source": [ "conda install plotly\n", @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "8af31dee", + "id": "55c0b8c9", "metadata": {}, "source": [ "#### FIPS and Values\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "bbfd60e3", + "id": "2965c8c7", "metadata": {}, "source": [ "#### Simple Example\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0a24b6e", + "id": "e53c4f9f", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "571ca633", + "id": "d50aa828", "metadata": {}, "source": [ "#### Change the Scope\n", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b3e2281", + "id": "fe3287fa", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "7f9a36b8", + "id": "556c3ea6", "metadata": {}, "source": [ "#### Single State" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7537180", + "id": "1f93ac33", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "0aceb1a5", + "id": "64ed881b", "metadata": {}, "source": [ "#### Multiple States" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66d7bd06", + "id": "4922504b", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "5a54aa83", + "id": "90bb7563", "metadata": {}, "source": [ "#### Simplify County, State Lines\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18c33d78", + "id": "3379508b", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "8624188d", + "id": "b150aaac", "metadata": {}, "source": [ "#### The Entire USA" @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73e1e9aa", + "id": "0c1c2867", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "7330d594", + "id": "0b87396e", "metadata": {}, "source": [ "Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)\n", @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "59c02ff6", + "id": "9777221e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/creating-and-updating-figures.ipynb b/creating-and-updating-figures.ipynb index c37b49932..3c6830dd1 100644 --- a/creating-and-updating-figures.ipynb +++ b/creating-and-updating-figures.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9d2052d2", + "id": "3c6c2f57", "metadata": {}, "source": [ "The `plotly` Python package exists to create, manipulate and [render](/python/renderers/) graphical figures (i.e. charts, plots, maps and diagrams) represented by [data structures also referred to as figures](/python/figure-structure/). The rendering process uses the [Plotly.js JavaScript library](https://plotly.com/javascript/) under the hood although Python developers using this module very rarely need to interact with the Javascript library directly, if ever. Figures can be represented in Python either as dicts or as instances of the `plotly.graph_objects.Figure` class, and are serialized as text in [JavaScript Object Notation (JSON)](https://json.org/) before being passed to Plotly.js.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5db6869", + "id": "bbc5663e", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "c0d879d5", + "id": "3708ee84", "metadata": {}, "source": [ "### Figures as Graph Objects\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "4cbcfa1f", + "id": "27fca4e1", "metadata": {}, "source": [ "Below you can find an example of one way that the figure in the example above could be specified using a graph object instead of a dictionary." @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95fd7dac", + "id": "70c88ce0", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "3cb9ae75", + "id": "b418b98b", "metadata": {}, "source": [ "You can also create a graph object figure from a dictionary representation by passing the dictionary to the `go.Figure` constructor." @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09767bde", + "id": "68454713", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "d7e306e7", + "id": "ac5422da", "metadata": {}, "source": [ "##### Converting Graph Objects To Dictionaries and JSON\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5965ccb6", + "id": "f65a18c9", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "39db7143", + "id": "c7e9138b", "metadata": {}, "source": [ "### Representing Figures in Dash\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3801dcd", + "id": "d73029af", "metadata": { "hide_code": true }, @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "efed8885", + "id": "4935299c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "4b883e4d", + "id": "21555856", "metadata": {}, "source": [ "### Creating Figures\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "0461890f", + "id": "5d72cce0", "metadata": {}, "source": [ "#### Plotly Express\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71e0c9e8", + "id": "1ab4d2ed", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "103667ca", + "id": "1117fcff", "metadata": {}, "source": [ "#### Graph Objects `Figure` Constructor\n", @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f45716f", + "id": "7d14933c", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "6bf9ecb9", + "id": "124e74a3", "metadata": {}, "source": [ "#### Figure Factories\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3911007e", + "id": "173fd67a", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "3a66bc81", + "id": "9dff24b5", "metadata": {}, "source": [ "#### Make Subplots\n", @@ -289,7 +289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "511b13b8", + "id": "90c6af01", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "2ee9fa97", + "id": "da094a1b", "metadata": {}, "source": [ "### Updating Figures\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cacf35ef", + "id": "ce78e8e7", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "c17cc42b", + "id": "4f66fb2e", "metadata": {}, "source": [ "You can also add traces to a figure produced by a figure factory or Plotly Express." @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49cf4d0a", + "id": "8d37860c", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "10e1ab80", + "id": "ce2e5ed8", "metadata": {}, "source": [ "#### Adding Traces To Subplots\n", @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c371929", + "id": "8c5e2f1b", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "572681ce", + "id": "c534d293", "metadata": {}, "source": [ "This also works for figures created by Plotly Express using the `facet_row` and or `facet_col` arguments." @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ed10bf1", + "id": "e5695b71", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "c7b35e4b", + "id": "d9deced3", "metadata": {}, "source": [ "#### Add Trace Convenience Methods\n", @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de267e19", + "id": "7c742d42", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "f1b78066", + "id": "62f8160e", "metadata": {}, "source": [ "#### Magic Underscore Notation\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf9793ee", + "id": "99d722f5", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "15cdbefa", + "id": "57c89522", "metadata": {}, "source": [ "With magic underscore notation, you can accomplish the same thing by passing the figure constructor a keyword argument named `layout_title_text`, and by passing the `go.Scatter` constructor a keyword argument named `line_color`." @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "517d4267", + "id": "7ab83135", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "b51fb9f1", + "id": "550b321f", "metadata": {}, "source": [ "Magic underscore notation is supported throughout the graph objects API, and it can often significantly simplify operations involving deeply nested properties.\n", @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edf00980", + "id": "345ed6a0", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +553,7 @@ }, { "cell_type": "markdown", - "id": "caa288e2", + "id": "a19b32cc", "metadata": {}, "source": [ "Note that the following `update_layout()` operations are equivalent:" @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65e29ce9", + "id": "70014bbb", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "a7b7105b", + "id": "f038fd28", "metadata": {}, "source": [ "#### Updating Traces\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41f5385d", + "id": "67c7435b", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "6e59b364", + "id": "df347c68", "metadata": {}, "source": [ "Note that both `scatter` and `bar` traces have a `marker.color` property to control their coloring. Here is an example of using `update_traces()` to modify the color of all traces." @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c76bf63", + "id": "19d35bc0", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "3dc46bdd", + "id": "52081a87", "metadata": {}, "source": [ "The `update_traces()` method supports a `selector` argument to control which traces should be updated. Only traces with properties that match the selector will be updated. Here is an example of using a selector to only update the color of the `bar` traces." @@ -676,7 +676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e8c28ff", + "id": "12f5d966", "metadata": {}, "outputs": [], "source": [ @@ -708,7 +708,7 @@ }, { "cell_type": "markdown", - "id": "011e7f80", + "id": "c55fb8da", "metadata": {}, "source": [ "Magic underscore notation can be used in the selector to match nested properties. Here is an example of updating the color of all traces that were formally colored `\"MediumPurple\"`." @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76e38a1c", + "id": "4c231e2c", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "338149d6", + "id": "34ef6178", "metadata": {}, "source": [ "For figures with subplots, the `update_traces()` method also supports `row` and `col` arguments to control which traces should be updated. Only traces in the specified subplot row and column will be updated. Here is an example of updating the color of all traces in the second subplot column." @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61f70a60", + "id": "59920487", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "b1476bc7", + "id": "4bc262ab", "metadata": {}, "source": [ "The `update_traces()` method can also be used on figures produced by figure factories or Plotly Express. Here's an example of updating the regression lines produced by Plotly Express to be dotted." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68f34f45", + "id": "08dd824f", "metadata": {}, "outputs": [], "source": [ @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "ac6ad7ae", + "id": "e7f71cf9", "metadata": {}, "source": [ "### Overwrite Existing Properties When Using Update Methods\n", @@ -833,7 +833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaf61592", + "id": "73b17fd4", "metadata": {}, "outputs": [], "source": [ @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "5b6e0714", + "id": "5cc730c7", "metadata": {}, "source": [ "#### Conditionally Updating Traces\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29ad97d6", + "id": "7f1cf0d2", "metadata": {}, "outputs": [], "source": [ @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "920bbffa", + "id": "68f95f01", "metadata": {}, "source": [ "#### Updating Figure Axes\n", @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93b58dcd", + "id": "6b3dc11e", "metadata": {}, "outputs": [], "source": [ @@ -917,7 +917,7 @@ }, { "cell_type": "markdown", - "id": "e322d97d", + "id": "c1dee38a", "metadata": {}, "source": [ "There are also `for_each_xaxis()` and `for_each_yaxis()` methods that are analogous to the `for_each_trace()` method described above. For non-cartesian subplot types (e.g. polar), there are additional `update_{type}` and `for_each_{type}` methods (e.g. `update_polar()`, `for_each_polar()`).\n", @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c19d182", + "id": "232bee33", "metadata": {}, "outputs": [], "source": [ @@ -967,7 +967,7 @@ }, { "cell_type": "markdown", - "id": "0d7e0f07", + "id": "8b475c94", "metadata": {}, "source": [ "#### Property Assignment\n", @@ -978,7 +978,7 @@ { "cell_type": "code", "execution_count": null, - "id": "719b4102", + "id": "7921c890", "metadata": {}, "outputs": [], "source": [ @@ -990,7 +990,7 @@ }, { "cell_type": "markdown", - "id": "6089a690", + "id": "d8c82b67", "metadata": {}, "source": [ "And here is an example of updating the bar outline using property assignment." @@ -999,7 +999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be6d8797", + "id": "9130eba9", "metadata": { "lines_to_next_cell": 2 }, @@ -1017,7 +1017,7 @@ }, { "cell_type": "markdown", - "id": "59b02f2b", + "id": "60b25822", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/custom-buttons.ipynb b/custom-buttons.ipynb index 56082279b..7b39510c4 100644 --- a/custom-buttons.ipynb +++ b/custom-buttons.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "45e75667", + "id": "c5fb67ff", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "6d70bc1a", + "id": "5236b526", "metadata": {}, "source": [ "#### Restyle Button\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0361d2d", + "id": "15c85000", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "8a19ec3b", + "id": "93b43247", "metadata": {}, "source": [ "**Update Several Data Attributes**
\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e016cfd", + "id": "b574eb26", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "7ea55abb", + "id": "ad7271ea", "metadata": {}, "source": [ "#### Relayout Button\n", @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3ffdfdf", + "id": "b19646e7", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "0cf5bf84", + "id": "57846991", "metadata": {}, "source": [ "#### Update Button\n", @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5260a54", + "id": "6c82e89e", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "ea389497", + "id": "cd94033c", "metadata": {}, "source": [ "#### Animate Button\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "f7ab6157", + "id": "60750435", "metadata": {}, "source": [ "#### Reference\n", @@ -503,7 +503,7 @@ }, { "cell_type": "markdown", - "id": "655aedc6", + "id": "9b2ac148", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dash.ipynb b/dash.ipynb index b211b8f71..112d69d2a 100644 --- a/dash.ipynb +++ b/dash.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "977e5610", + "id": "49dee383", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "298b8188", + "id": "b1ea5b79", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dendrogram.ipynb b/dendrogram.ipynb index 0756a297a..b1bcd6aa8 100644 --- a/dendrogram.ipynb +++ b/dendrogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bbc451fd", + "id": "1119b869", "metadata": {}, "source": [ "#### Basic Dendrogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68745390", + "id": "ca5c3c62", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "67c3fcd4", + "id": "1cd9a25b", "metadata": {}, "source": [ "#### Set Color Threshold" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df6ff1f9", + "id": "e7bf7c34", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "1893612a", + "id": "69262b3f", "metadata": {}, "source": [ "#### Set Orientation and Add Labels" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a02451db", + "id": "ef9bab4b", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "17ff430c", + "id": "d34d22ef", "metadata": {}, "source": [ "#### Plot a Dendrogram with a Heatmap\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "331b2813", + "id": "a206ab63", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "5cddebe2", + "id": "0a016352", "metadata": {}, "source": [ "### Reference\n", @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "e62d7254", + "id": "21a9a72b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/density-heatmaps.ipynb b/density-heatmaps.ipynb index 1fa9366cb..4a43f42b5 100644 --- a/density-heatmaps.ipynb +++ b/density-heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ccdb8ea0", + "id": "b867eb40", "metadata": {}, "source": [ "### Density map with `plotly.express`\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "110b6d5b", + "id": "14d635e5", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "4b5ee1d9", + "id": "318dce45", "metadata": {}, "source": [ "### Density map with `plotly.graph_objects`\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e13a03d0", + "id": "fdf1c8cd", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "5867d36b", + "id": "9222fd52", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "6e2ba77b", + "id": "086a6391", "metadata": {}, "source": [ "#### Stamen Terrain base map with Mapbox (Stadia Maps token needed): density heatmap with `plotly.express`\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "cfb7ae9a", + "id": "4e11608c", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "fdc33274", + "id": "0cc0fae9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/discrete-color.ipynb b/discrete-color.ipynb index 6226e3377..a7a066de9 100644 --- a/discrete-color.ipynb +++ b/discrete-color.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c97515b0", + "id": "60a79dc1", "metadata": {}, "source": [ "### Discrete vs Continuous Color\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4436ff81", + "id": "1921b0a5", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "b488d45a", + "id": "36b446da", "metadata": {}, "source": [ "The `size` column, however, contains numbers:" @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9953bfd", + "id": "71c286d6", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "e3934010", + "id": "a4c70874", "metadata": {}, "source": [ "Converting this column to strings is very straightforward, but note that the ordering in the legend is not sequential by default (see below for how to control discrete order):" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6828e584", + "id": "f44a09ca", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "8a089f23", + "id": "a8a489c5", "metadata": {}, "source": [ "Converting a string column to a numeric one is also quite straightforward:" @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5a9cd83", + "id": "70611031", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "bd289a61", + "id": "3f1a004d", "metadata": {}, "source": [ "### Discrete Colors in Dash\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5523f87", + "id": "36dcb7b2", "metadata": { "hide_code": true }, @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "7935a6a0", + "id": "9f39cd3f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "06ef567f", + "id": "c7b8f291", "metadata": {}, "source": [ "### Color Sequences in Plotly Express\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96c51c62", + "id": "7afc4319", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "a36ddac8", + "id": "2e182f4b", "metadata": {}, "source": [ "Color sequences in the `px.colors.qualitative` module are stored as lists of CSS colors:" @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1069c4b4", + "id": "d1aad475", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "4ff2e032", + "id": "6ce7fe76", "metadata": {}, "source": [ "Here is an example that creates a scatter plot using Plotly Express, with points colored using the built-in qualitative `G10` color sequence." @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "731a5fd6", + "id": "4f5454ed", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "cca9791f", + "id": "b759228a", "metadata": {}, "source": [ "### Explicitly Constructing a Color Sequence\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82803f83", + "id": "7a1384b8", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "cab7d05d", + "id": "98988cbd", "metadata": {}, "source": [ "**_Warning_**: If your color sequence has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:" @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7f25627", + "id": "ad22d52f", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "6cf2a54c", + "id": "f33f14d0", "metadata": {}, "source": [ "### Directly Mapping Colors to Data Values\n", @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83db3c0a", + "id": "c5bcc85f", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "2d2c5a5f", + "id": "ff6c8468", "metadata": {}, "source": [ "If your data set already contains valid CSS colors which you wish to use directly, you can pass the special value `\"identity\"` to `color_discrete_map`, in which case the legend is hidden by default, and the color does not appear in the hover label:" @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66f9ee7e", + "id": "93ff45bc", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "83e5eaf9", + "id": "e650b81c", "metadata": {}, "source": [ "### Controlling Discrete Color Order\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2aefebe9", + "id": "efd25c99", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "276cc4a8", + "id": "2bf38e3d", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "cfb2b261", + "id": "f3adc6fd", "metadata": {}, "source": [ "### Using Sequential Scales as Discrete Sequences\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc2fc1f1", + "id": "e51767e1", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "89d1797b", + "id": "36234238", "metadata": {}, "source": [ "This works because just like in `px.colors.qualitative`, all [built-in continuous color scales](/python/builtin-colorscales/) are stored as lists of CSS colors:" @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70af1b81", + "id": "d31ca5a2", "metadata": { "lines_to_next_cell": 2 }, @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "fac7b640", + "id": "bf23be0e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/distplot.ipynb b/distplot.ipynb index 05321027a..7558893d3 100644 --- a/distplot.ipynb +++ b/distplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "62d6aa66", + "id": "f715e554", "metadata": {}, "source": [ "## Combined statistical representations with px.histogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88a801b0", + "id": "548b9231", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dfb9d9a", + "id": "20665ce8", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "70452ce0", + "id": "684271ea", "metadata": {}, "source": [ "### Combined statistical representations in Dash\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce67ae87", + "id": "5d9f59d6", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "4c9e6220", + "id": "14122ea3", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "386de489", + "id": "808c6cae", "metadata": {}, "source": [ "## Combined statistical representations with distplot figure factory\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c87d6e1", + "id": "fcf3b3c7", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "8d5e1f7e", + "id": "e9468e68", "metadata": {}, "source": [ "#### Plot Multiple Datasets" @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5cee5ea", + "id": "12398b9b", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "8f87cbf2", + "id": "9ad59d18", "metadata": {}, "source": [ "#### Use Multiple Bin Sizes\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60354994", + "id": "cbbcac12", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "91cce166", + "id": "78f08115", "metadata": {}, "source": [ "#### Customize Rug Text, Colors & Title" @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ece592f2", + "id": "6fd41c83", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "cad20dbe", + "id": "f511f6d2", "metadata": {}, "source": [ "#### Plot Normal Curve" @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c269ed5f", + "id": "4a9ce46b", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "ddb8eb52", + "id": "c67a0b84", "metadata": {}, "source": [ "#### Plot Only Curve and Rug" @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a9bb01c", + "id": "bf2d30c8", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "fe6a5343", + "id": "ee7045f0", "metadata": {}, "source": [ "#### Plot Only Hist and Rug" @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07ebe518", + "id": "d5522019", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "5039d686", + "id": "68833c9a", "metadata": {}, "source": [ "#### Plot Hist and Rug with Different Bin Sizes" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c8fefe1", + "id": "0b8c1ff1", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "92fae0ee", + "id": "b944c110", "metadata": {}, "source": [ "#### Plot Only Hist and Curve" @@ -374,7 +374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00ff1503", + "id": "50d348a8", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "80cd2a2a", + "id": "a29bae90", "metadata": {}, "source": [ "#### Distplot with Pandas" @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6d79e8a", + "id": "ae03063a", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "5bb7345b", + "id": "e5193f9d", "metadata": {}, "source": [ "#### Reference" @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "413a4515", + "id": "99f5d9cc", "metadata": {}, "source": [ "For more info on `ff.create_distplot()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_distplot.html)\n" @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "f978c5d3", + "id": "5a1d05c4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dot-plots.ipynb b/dot-plots.ipynb index 3f0e909ef..1728a4ce0 100644 --- a/dot-plots.ipynb +++ b/dot-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "653eb81c", + "id": "d1a913b7", "metadata": {}, "source": [ "#### Basic Dot Plot\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d0668f4", + "id": "6e7605c2", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c6ecf56", + "id": "6a794c68", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e3f4eff", + "id": "dbba11b5", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "4cb06e50", + "id": "4fe23f5f", "metadata": {}, "source": [ "#### Styled Categorical Dot Plot" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e4e53b6", + "id": "7e2148ee", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "4f9bdfaa", + "id": "3ff16847", "metadata": {}, "source": [ "### Reference\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "04ffe47b", + "id": "aa50bd72", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dropdowns.ipynb b/dropdowns.ipynb index b26cb4d61..88cfb09b3 100644 --- a/dropdowns.ipynb +++ b/dropdowns.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c2f41e8c", + "id": "733eee97", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "d7242a46", + "id": "582432bc", "metadata": {}, "source": [ "## Restyle Dropdown\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f643cd3b", + "id": "8fd00fd6", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "b6bdd9c5", + "id": "ca981c00", "metadata": {}, "source": [ "### Update Several Data Attributes\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c705d5f9", + "id": "1b89f2da", "metadata": {}, "outputs": [], "source": [ @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "ecaa8dd7", + "id": "4fc1c170", "metadata": {}, "source": [ "## Relayout Dropdown\n", @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66da24db", + "id": "fabbdc10", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "b01d0965", + "id": "ec4ceab5", "metadata": {}, "source": [ "### Update Dropdown\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c66a764c", + "id": "e0cc6e29", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "c002e490", + "id": "ce670c08", "metadata": {}, "source": [ "### Graph Selection Dropdowns in Jinja\n", @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "53f79fc7", + "id": "d9c784ce", "metadata": {}, "source": [ "\n", @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "7eb9132c", + "id": "7ec707fa", "metadata": {}, "source": [ "#### Reference\n", @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "ab6fb25d", + "id": "d1b442c7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dumbbell-plots.ipynb b/dumbbell-plots.ipynb index 32eb111a5..1375f97c4 100644 --- a/dumbbell-plots.ipynb +++ b/dumbbell-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fb7ad765", + "id": "748b82d0", "metadata": {}, "source": [ "## Basic Dumbbell Plot" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "cca10b72", + "id": "0854308e", "metadata": {}, "source": [ "Dumbbell plots are useful for demonstrating change between two sets of data points, for example, the population change for a selection of countries for two different years.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e14fb81", + "id": "5d0fb228", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "f8c3b279", + "id": "d465050e", "metadata": {}, "source": [ "## Dumbbell Plot with Arrow Markers\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20aa0481", + "id": "b4922b79", "metadata": { "lines_to_next_cell": 2 }, @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "9412971b", + "id": "e8d31333", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ecdf-plots.ipynb b/ecdf-plots.ipynb index ca7f4faec..23e92bc28 100644 --- a/ecdf-plots.ipynb +++ b/ecdf-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c00d9626", + "id": "92fbb984", "metadata": {}, "source": [ "### Overview\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6016193", + "id": "6ff5fdf1", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "f0d51ffb", + "id": "4bf4586d", "metadata": {}, "source": [ "Providing multiple columns leverage's Plotly Express' [wide-form data support](https://plotly.com/python/wide-form/) to show multiple variables on the same plot." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02f5b223", + "id": "7c33deed", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "eb6bab73", + "id": "63a4ed44", "metadata": {}, "source": [ "It is also possible to map another variable to the color dimension of a plot." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6563bfbc", + "id": "a7c9d01f", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "f69b0381", + "id": "7424ae00", "metadata": {}, "source": [ "### Configuring the Y axis\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8159ae22", + "id": "6fab90e7", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "d0ff39f9", + "id": "ce40d490", "metadata": {}, "source": [ "If a `y` value is provided, the Y axis is set to the sum of `y` rather than counts." @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "990f7378", + "id": "0fd062df", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "717f099a", + "id": "6a16886b", "metadata": {}, "source": [ "### Reversed and Complementary CDF plots\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e1ab4a8", + "id": "26ac447c", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "57c75772", + "id": "095ddacf", "metadata": {}, "source": [ "In `reversed` mode, the right-most point is at 1 (or the total count/sum, depending on `ecdfnorm`) and the left-most point is above 0." @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26d80195", + "id": "4656a065", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "42b879d8", + "id": "a7e15e80", "metadata": {}, "source": [ "In `complementary` mode, the right-most point is at 0 and no points are at 1 (or the total count/sum) per the definition of the CCDF as 1-ECDF, which has no point at 0." @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64da6038", + "id": "e70ae16d", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "a48a4a1e", + "id": "3819f3c1", "metadata": {}, "source": [ "### Orientation\n", @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fad1b32", + "id": "30a7ee1f", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "c5b48735", + "id": "1228f1a7", "metadata": {}, "source": [ "### Markers and/or Lines\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6695e725", + "id": "cc19d48d", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d050086", + "id": "c2272199", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "0412f8ac", + "id": "e4ccb748", "metadata": {}, "source": [ "### Marginal Plots\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b782ba82", + "id": "45c0eb66", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c39c8c42", + "id": "bafe5823", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "4a60d67a", + "id": "b5ba5ce9", "metadata": {}, "source": [ "### Facets\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e702ec98", + "id": "5c9432d7", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d592d6fe", + "id": "e4fbd3d2", "metadata": { "lines_to_next_cell": 2 }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "eb596633", + "id": "cbb6227c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/error-bars.ipynb b/error-bars.ipynb index c54fcb9aa..67143fea7 100644 --- a/error-bars.ipynb +++ b/error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bb15cd50", + "id": "d0a5afaf", "metadata": {}, "source": [ "### Error Bars with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "398852cb", + "id": "d485a7bc", "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "aa7d72cf", + "id": "221551b3", "metadata": {}, "source": [ "#### Asymmetric Error Bars with Plotly Express" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc2e1265", + "id": "7c929b7f", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "7552ff51", + "id": "5a04250d", "metadata": {}, "source": [ "### Error Bars with graph_objects\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "282b870f", + "id": "0e402fd8", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "c01f3b6a", + "id": "b0e2fc82", "metadata": {}, "source": [ "#### Asymmetric Error Bars" @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f29d610", + "id": "7ee1bf26", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "0227eae1", + "id": "aeaa1928", "metadata": {}, "source": [ "#### Error Bars as a Percentage of the y Value" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fadae34", + "id": "44c6d357", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "77617185", + "id": "241a8f75", "metadata": {}, "source": [ "#### Asymmetric Error Bars with a Constant Offset" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f116144", + "id": "7714458d", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "e17f52cc", + "id": "fd43558d", "metadata": {}, "source": [ "#### Horizontal Error Bars" @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf80e20b", + "id": "f6c1eb6c", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "734b6749", + "id": "bf790ed2", "metadata": {}, "source": [ "#### Bar Chart with Error Bars" @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74d12c3d", + "id": "3b782b94", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "aadc9a57", + "id": "068c55f2", "metadata": {}, "source": [ "#### Colored and Styled Error Bars" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78a8ba61", + "id": "16d47b1f", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "cead708a", + "id": "52967c83", "metadata": {}, "source": [ "#### Reference\n", @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "5bd9dd64", + "id": "18101c92", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/facet-plots.ipynb b/facet-plots.ipynb index 0e8af75c4..fe2de4500 100644 --- a/facet-plots.ipynb +++ b/facet-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "99e0317c", + "id": "c2842462", "metadata": {}, "source": [ "### Facet and Trellis Plots\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6a98a89", + "id": "5917124f", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "1630fbe1", + "id": "da322f7a", "metadata": {}, "source": [ "### Bar Chart Row Facets\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dccf7894", + "id": "6eaa093d", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "0fd91d9e", + "id": "6a544154", "metadata": {}, "source": [ "### Wrapping Column Facets\n", @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bc5841b", + "id": "c10abb1f", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "36c8273a", + "id": "b5fc45a1", "metadata": {}, "source": [ "### Histogram Facet Grids" @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "562dc9fb", + "id": "7b04c863", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "af648139", + "id": "0330b274", "metadata": {}, "source": [ "### Choropleth Column Facets\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1671910c", + "id": "dc46734d", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "79309a38", + "id": "6cb747d5", "metadata": {}, "source": [ "### Adding Lines and Rectangles to Facet Plots\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e2fa149", + "id": "427a4913", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "c2c09e4f", + "id": "3f419932", "metadata": {}, "source": [ "### Adding the Same Trace to All Facets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c58f506", + "id": "5b647423", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "aac5b66d", + "id": "8b9ecd18", "metadata": {}, "source": [ "### Facets With Independent Axes\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d7ec87d", + "id": "623e4514", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eba09416", + "id": "aeb1c25d", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "ddb2c952", + "id": "4c1d4aa9", "metadata": {}, "source": [ "### Customizing Subplot Figure Titles\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f77cb42", + "id": "438e095a", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "20b8bb7c", + "id": "ceeb052a", "metadata": {}, "source": [ "### Controlling Facet Ordering\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38cce142", + "id": "f12cc6ba", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "fb7aae53", + "id": "b95d6d18", "metadata": {}, "source": [ "### Controlling Facet Spacing\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b45d8bec", + "id": "7ba409ea", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "32739a05", + "id": "e46d6e61", "metadata": {}, "source": [ "### Synchronizing axes in subplots with `matches`\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb9f5b09", + "id": "7a8157d4", "metadata": { "lines_to_next_cell": 2 }, @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "0fdfeabf", + "id": "c4494a38", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factories.ipynb b/figure-factories.ipynb index 7e7f95aa3..024e2a1cc 100644 --- a/figure-factories.ipynb +++ b/figure-factories.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "18272ea3", + "id": "e515d417", "metadata": {}, "source": [ "#### `plotly.figure_factory`\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "4842e052", + "id": "60be1744", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-subplots.ipynb b/figure-factory-subplots.ipynb index 8faacb6d2..414af21f2 100644 --- a/figure-factory-subplots.ipynb +++ b/figure-factory-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "54cb59d2", + "id": "53aa995f", "metadata": {}, "source": [ "#### Plotly's Figure Factory Module\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "cd11180e", + "id": "d15089fb", "metadata": {}, "source": [ "#### Vertical Figure Factory Charts\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "663920de", + "id": "62427ff7", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "c2362e95", + "id": "d9deba2c", "metadata": {}, "source": [ "Edit the figures' x and y axes attributes to create subplots:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbbfd954", + "id": "22ab6874", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "40411721", + "id": "d5468052", "metadata": {}, "source": [ "Combine the data and layout objects to create a figure" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "510b1885", + "id": "7130754e", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "0bb5757b", + "id": "16ccde54", "metadata": {}, "source": [ "#### Horizontal Table and Chart" @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f01e3f27", + "id": "f324e936", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "45e3a822", + "id": "b152887f", "metadata": {}, "source": [ "#### Vertical Table and Chart" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92aa6bbe", + "id": "00b695c3", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "d1862735", + "id": "579a8bbe", "metadata": {}, "source": [ "#### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "f1d5877e", + "id": "08b7d533", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-table.ipynb b/figure-factory-table.ipynb index 762d3b528..fe0f892c3 100644 --- a/figure-factory-table.ipynb +++ b/figure-factory-table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b90611b1", + "id": "37a3a753", "metadata": {}, "source": [ "Tables can be created using a [`table` trace type](/python/table/), or by using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97f78652", + "id": "7326bba3", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "8cf23ed5", + "id": "3d1ea959", "metadata": {}, "source": [ "#### Add Links" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4833c4e", + "id": "ff568268", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "94a4bb72", + "id": "5abeb873", "metadata": {}, "source": [ "### Use LaTeX" @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9c3d13d", + "id": "4409e303", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "69163423", + "id": "bea6a6ee", "metadata": {}, "source": [ "### Use a Pandas Dataframe" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e866b2a", + "id": "4cad9d66", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "83b7d911", + "id": "49b65a67", "metadata": {}, "source": [ "### Modify Row Height\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55570659", + "id": "14935158", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "f86a5a59", + "id": "ca185a33", "metadata": {}, "source": [ "### Custom Table Colors\n" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f4c5444", + "id": "145275d8", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "d62150f2", + "id": "091c4d21", "metadata": {}, "source": [ "### Custom Font Colors" @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ef187e1", + "id": "fbb8d3bb", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "a895ff48", + "id": "4e06fd51", "metadata": {}, "source": [ "### Change Font Size" @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "669447e3", + "id": "5daed1cb", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "95ce2ee0", + "id": "bc41acd1", "metadata": {}, "source": [ "#### Tables with Graphs" @@ -259,7 +259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1c8a86c", + "id": "f208bf2e", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a69d44f", + "id": "178b4cc6", "metadata": { "lines_to_next_cell": 2 }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "a7bf8547", + "id": "a69da82e", "metadata": {}, "source": [ "#### Reference\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "8a508f83", + "id": "7488a830", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-introspection.ipynb b/figure-introspection.ipynb index e85240f1a..93756477f 100644 --- a/figure-introspection.ipynb +++ b/figure-introspection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e19c5ed4", + "id": "b75cee1c", "metadata": {}, "source": [ "### The Figure Lifecycle\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "61aeec6c", + "id": "91caee8c", "metadata": {}, "source": [ "### Introspecting Plotly Express Figures\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c8b5bf1", + "id": "8ebc7ad6", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "2205372b", + "id": "8712c164", "metadata": {}, "source": [ "We can learn more about the attributes Plotly Express has set for us with the Python `help()` function:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c01b138a", + "id": "609e1c4d", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "c0682f50", + "id": "ebd5d0e1", "metadata": {}, "source": [ "### Accessing Javascript-Computed Defaults\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53734645", + "id": "3c0e4b32", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "ae529440", + "id": "5a1a68e7", "metadata": {}, "source": [ "Let's print this figure to see the very small JSON object that is passed to Plotly.js as input:" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "def840c7", + "id": "796a9ac3", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "21ee56c7", + "id": "6e252fa3", "metadata": {}, "source": [ "Now let's look at the \"full\" figure after Plotly.js has computed the default values for every necessary attribute.\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1117aae7", + "id": "026eb874", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "5af2540d", + "id": "4d3a9767", "metadata": {}, "source": [ "As you can see, Plotly.js does a lot of work filling things in for us! Let's look at the examples described at the top of the page of static and dynamic defaults. If we look just at `layout.font` and `layout.xaxis.range` we can see that the static default font size is 12 and that the dynamic default range is computed to be a bit beyond the data range which was 10-20:" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4331490a", + "id": "5f7ad99d", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "11588ec4", + "id": "b447d47a", "metadata": {}, "source": [ "### Learning About Attributes" @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "177dec0d", + "id": "c7ee93b5", "metadata": {}, "source": [ "What else can we use this `full_fig` for? Let's start by looking at the first entry of the `data`" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c54636d", + "id": "06d22ff9", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "1e1f2784", + "id": "acd94582", "metadata": {}, "source": [ "We see that this is an instance of `go.Scatter` (as expected, given the input) and that it has an attribute we've maybe never heard of called `cliponaxis` which by default seems to be set to `True` in this case. Let's find out more about this attribute using the built-in Python `help()` function" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b020542b", + "id": "d0ed70bb", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "516d7d17", + "id": "3c93b223", "metadata": {}, "source": [ "Aha! This explains why in our original figure above, the text was cut off by the edge of the plotting area! Let's try forcing that to `False`, and let's also use the attribute `textposition` which we see in the full figure is by default set to `\"middle center\"` to get our text off of our markers:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0c32228", + "id": "cee147a2", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "7b4306be", + "id": "61df182c", "metadata": {}, "source": [ "We can use this technique (of making a figure, and querying Plotly.js for the \"full\" version of that figure, and then exploring the attributes that are automatically set for us) to learn more about the range of possibilities that the figure schema makes available. We can drill down into `layout` attributes also:" @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21680316", + "id": "64e598b8", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "e9b40969", + "id": "666b0fd9", "metadata": {}, "source": [ "### More about Layout\n", @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66466240", + "id": "d64df934", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "f9051d4c", + "id": "630fa4c9", "metadata": {}, "source": [ "If I then set `showrivers=True` and re-query the full figure, I see that new keys have appeared in the `layout.geo` object for `rivercolor` and `riverwidth`, showing the dynamic nature of these defaults." @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3377d7e", + "id": "8ffdc9e1", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "5611231a", + "id": "ec7aeb9c", "metadata": {}, "source": [ "### Reference\n", @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c81ecdae", + "id": "fdbd3ece", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "081f3fc9", + "id": "269652c1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-labels.ipynb b/figure-labels.ipynb index e347e0596..823dc4218 100644 --- a/figure-labels.ipynb +++ b/figure-labels.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8fa276c1", + "id": "6011ddec", "metadata": {}, "source": [ "### Automatic Labelling with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78bf748d", + "id": "f0e89b7d", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5854f32", + "id": "f77c97a9", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "2b25e15d", + "id": "cce0a92e", "metadata": {}, "source": [ "### Global and Local Font Specification\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84c58cc0", + "id": "a70fa60f", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "04b2d8a6", + "id": "4106d2b0", "metadata": {}, "source": [ "### Set Automargin on the Plot Title\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc06441d", + "id": "f7c3c05f", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "68aa13a9", + "id": "a17b679b", "metadata": {}, "source": [ "### Fonts and Labels in Dash\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02c2d763", + "id": "1ec6c778", "metadata": { "hide_code": true }, @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "b8b61b0d", + "id": "a23899cd", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "1b8bcf79", + "id": "73c50b01", "metadata": {}, "source": [ "### Manual Labelling with Graph Objects\n", @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6874a8c4", + "id": "da3d6849", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "a691b09c", + "id": "b055a092", "metadata": {}, "source": [ "### Configuring Font Variant, Style, and Weight\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3eda4daa", + "id": "d23291f3", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "bc2f89ce", + "id": "a362bd2d", "metadata": {}, "source": [ "The configuration of the legend is discussed in detail in the [Legends](/python/legend/) page.\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e25e9ff", + "id": "489a62cd", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "1af8172c", + "id": "1f6c4b90", "metadata": {}, "source": [ "### Adding a Plot Subtitle\n", @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9e50689", + "id": "e620e3ae", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "6773dcab", + "id": "165e9f2c", "metadata": {}, "source": [ "#### Reference\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "db13e803", + "id": "27140fe4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-structure.ipynb b/figure-structure.ipynb index 8e99229bb..b1e79b774 100644 --- a/figure-structure.ipynb +++ b/figure-structure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a82e1179", + "id": "4aed708b", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f02dbda", + "id": "3af80dc2", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "73d0f5a2", + "id": "0fab77f4", "metadata": {}, "source": [ "### Accessing figure structures in Dash\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6994f082", + "id": "17f981ed", "metadata": { "hide_code": true }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "75558960", + "id": "8c173441", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "57fad5b2", + "id": "b1a59f9b", "metadata": {}, "source": [ "### Figures as Trees of Attributes\n", @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "0ff5ab88", + "id": "cce47ebc", "metadata": {}, "source": [ "### The Top-Level `layout` Attribute\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4c37768", + "id": "10bcce41", "metadata": { "lines_to_next_cell": 2 }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "f94c7b5b", + "id": "37eef76b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget-app.ipynb b/figurewidget-app.ipynb index 16e646bb2..d4b45d166 100644 --- a/figurewidget-app.ipynb +++ b/figurewidget-app.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cdf76c44", + "id": "68b405ac", "metadata": {}, "source": [ "#### NYC Flights Database" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9891e708", + "id": "2df5f6ec", "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "bb04eab4", + "id": "406f29de", "metadata": {}, "source": [ "We'll be making an application to take a look at delays from all flights out of NYC in the year 2013." @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b2c71d2", + "id": "511b3edf", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18c6869c", + "id": "f68eb8ba", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "66ef0536", + "id": "7f531e63", "metadata": {}, "source": [ "Let's get the set of all the `airlines`, so that we can type the right things into the search box later." @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85c8dc18", + "id": "d63c9e2b", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "bd890ef8", + "id": "504ad59f", "metadata": {}, "source": [ "Let's assign the widgets that we're going to be using in our app. In general all these widgets will be used to filter the data set, and thus what we visualize." @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94a17b36", + "id": "086186a4", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "0b39c9a6", + "id": "7059c55c", "metadata": {}, "source": [ "Let now write a function that will handle the input from the widgets, and alter the state of the graph." @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "118008ab", + "id": "4247bb3d", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "9dbe97b5", + "id": "36f68f31", "metadata": {}, "source": [ "Time to try the app out!!" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ab33dd1", + "id": "2eebb87c", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa20019a", + "id": "a7739216", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "dee867b2", + "id": "0dbdabef", "metadata": {}, "source": [ "#### Reference" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15ad79f1", + "id": "2f2d38f0", "metadata": { "lines_to_next_cell": 2 }, @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "b81998c1", + "id": "7af7c124", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget.ipynb b/figurewidget.ipynb index 18eab7ce2..84eac826d 100644 --- a/figurewidget.ipynb +++ b/figurewidget.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ee91d0ef", + "id": "cca67938", "metadata": {}, "source": [ "The Plotly FigureWidget allows you to add Plotly charts as interactive widgets in Jupyter and other compatible notebooks. To use the FigureWidget, you'll need to install `anywidget`: " @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22397904", + "id": "251af1e5", "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "4fe3e260", + "id": "49b73c6d", "metadata": {}, "source": [ "#### Create a Simple FigureWidget\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dc67a73", + "id": "85e33410", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "f156b691", + "id": "d1edc8a6", "metadata": {}, "source": [ "" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "3306bd23", + "id": "3f676e71", "metadata": {}, "source": [ "Add traces or update the layout and then watch the output above update in real time." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "687bc8fb", + "id": "6be67714", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87720566", + "id": "48ca4ca8", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7060e091", + "id": "8727a62d", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "bdea2993", + "id": "93097da7", "metadata": {}, "source": [ "" @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "020fbc6a", + "id": "c24b5d87", "metadata": {}, "source": [ "#### Update the Data and the Layout" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3d39b6e", + "id": "0b823164", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "593ad744", + "id": "8d0dcbff", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b3ef88e", + "id": "e88fa98b", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "919d7bc4", + "id": "0e82a237", "metadata": {}, "source": [ "#### Construct a FigureWidget from a Figure graph object" @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "44e64ac7", + "id": "61bcccbc", "metadata": {}, "source": [ "A standard `Figure` object can be passed to the `FigureWidget` constructor." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b4a8042", + "id": "a8b95f54", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "fb20e841", + "id": "bf870dc4", "metadata": {}, "source": [ "#### Reference" @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "a3f2e65e", + "id": "0945b452", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5583a6c2", + "id": "aa0bc04d", "metadata": { "lines_to_next_cell": 2 }, @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "46ac074d", + "id": "429acf42", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-plots.ipynb b/filled-area-plots.ipynb index 303bc0d0f..278dc9b31 100644 --- a/filled-area-plots.ipynb +++ b/filled-area-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8743e5ed", + "id": "e5fb0745", "metadata": {}, "source": [ "This example shows how to fill the area enclosed by traces.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51147c27", + "id": "f41090ed", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "025bba38", + "id": "1c0a1ff0", "metadata": {}, "source": [ "## Filled area plot in Dash\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d81ba03", + "id": "32b7191b", "metadata": { "hide_code": true }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "50fdac60", + "id": "0d407526", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "39ac375c", + "id": "4b949345", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8062b366", + "id": "b0242e7b", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "71fc781e", + "id": "b2b7a5fc", "metadata": {}, "source": [ "### Filled area chart with plotly.graph_objects\n", @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32ebf0f0", + "id": "63ab7569", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "640066af", + "id": "83402ddf", "metadata": {}, "source": [ "#### Overlaid Area Chart Without Boundary Lines" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63d87f45", + "id": "8170aa2f", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "7fbaff3a", + "id": "4df6ecc6", "metadata": {}, "source": [ "#### Interior Filling for Area Chart" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e34a853", + "id": "021fab2a", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "5b0ce9ea", + "id": "e278e1a4", "metadata": {}, "source": [ "#### Gradient Fill\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a3e6694", + "id": "efa8b90f", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "dc4c4e07", + "id": "11883525", "metadata": {}, "source": [ "#### Stacked Area Chart\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1821e71", + "id": "ee0cbd72", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "72c496ce", + "id": "3e323e19", "metadata": {}, "source": [ "### Stacked Area Chart with Normalized Values" @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03939a89", + "id": "0db14651", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "94c338bb", + "id": "2c28d06f", "metadata": {}, "source": [ "#### Select Hover Points" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05af3f2a", + "id": "b541f367", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "8c1f6427", + "id": "741d782c", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "7c75577a", + "id": "0b037963", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-tile-maps.ipynb b/filled-area-tile-maps.ipynb index fe5d43b26..3535cd751 100644 --- a/filled-area-tile-maps.ipynb +++ b/filled-area-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "21ded716", + "id": "6210a61b", "metadata": {}, "source": [ "There are three different ways to show a filled area on a tile-based map:\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9898ce4", + "id": "b42cea96", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "084390a6", + "id": "1f16dac7", "metadata": {}, "source": [ "### Multiple Filled Areas with a `Scattermap` trace\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea08f162", + "id": "dd552b93", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "aece9724", + "id": "0e3828ee", "metadata": {}, "source": [ "### GeoJSON Layers\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75550baf", + "id": "0334a7aa", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "db03ee9b", + "id": "8f61c53b", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "5b95c1ad", + "id": "db97afb8", "metadata": {}, "source": [ "#### Reference\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "7dd09b85", + "id": "a010d7b9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/funnel-charts.ipynb b/funnel-charts.ipynb index 2763aa467..c2a0d7417 100644 --- a/funnel-charts.ipynb +++ b/funnel-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "24d3ea63", + "id": "7664636a", "metadata": {}, "source": [ "### Introduction\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c516f24e", + "id": "ff0de1f0", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "b47ab693", + "id": "f04c9565", "metadata": {}, "source": [ "### Stacked Funnel Plot with plotly.express" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0da5544", + "id": "534288b6", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "c0a17cc1", + "id": "7c0cb2f0", "metadata": {}, "source": [ "### Basic Funnel Chart with graph_objects trace go.Funnel\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17e94d47", + "id": "c88bb8f3", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "ae8bb6c9", + "id": "b05932a1", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5da43ecc", + "id": "1dacd95a", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "895043c5", + "id": "c28ff038", "metadata": {}, "source": [ "### Stacked Funnel Plot with go.Funnel" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cf22c31", + "id": "cd8f8046", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "a642a975", + "id": "0d2cf657", "metadata": {}, "source": [ "### Basic Area Funnel Plot with plotly.express\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b72016bd", + "id": "3122c31d", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "2b168b2c", + "id": "47b4bf1a", "metadata": {}, "source": [ "### Basic Area Funnel Plot with go.Funnelarea\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a45db03", + "id": "38366ae7", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "c7b1a67c", + "id": "98e37e88", "metadata": {}, "source": [ "#### Set Marker Size and Color in Area Funnel Plots" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b930a041", + "id": "a2715f4c", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "2d7305b7", + "id": "466010e4", "metadata": {}, "source": [ "#### Multiple Area Funnels" @@ -246,7 +246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57573f32", + "id": "699cc17e", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "8b4d010f", + "id": "c767cc8c", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35b4aeca", + "id": "d81aed25", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "8b8daa8a", + "id": "54f06f4f", "metadata": {}, "source": [ "#### Reference\n", @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "8ad9905e", + "id": "25c57f2a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gantt.ipynb b/gantt.ipynb index f69aaaf69..cbae1155d 100644 --- a/gantt.ipynb +++ b/gantt.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "180c6260", + "id": "56dbfe81", "metadata": {}, "source": [ "A [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) is a type of bar chart that illustrates a project schedule. The chart lists the tasks to be performed on the vertical axis, and time intervals on the horizontal axis. The width of the horizontal bars in the graph shows the duration of each activity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "83ee6262", + "id": "8316d721", "metadata": {}, "source": [ "### Gantt Charts and Timelines with plotly.express\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74c24cdf", + "id": "d224e45f", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "73b09283", + "id": "76c1e334", "metadata": {}, "source": [ "`px.timeline` supports [discrete color](/python/discrete-color/) as above, or [continuous color](/python/colorscales/) as follows." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e4862e1", + "id": "e250085e", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b83e078", + "id": "9ba30269", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "d2229c6b", + "id": "492e428f", "metadata": {}, "source": [ "It is also possible to have multiple bars on the same horizontal line, say by resource:\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df56a14e", + "id": "a39a6f63", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "4f0d0ce3", + "id": "018081c7", "metadata": {}, "source": [ "#### Deprecated Figure Factory\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6746d01a", + "id": "6179be70", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "872bc255", + "id": "412911df", "metadata": {}, "source": [ "#### Group Tasks Together\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c98a72ba", + "id": "ecf0c92d", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "5c421751", + "id": "5e4da91c", "metadata": {}, "source": [ "#### Color by Numeric Variable\n", @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd29cb47", + "id": "b7e2eb05", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "88c54ead", + "id": "813d3de7", "metadata": {}, "source": [ "#### Reference" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "1538600e", + "id": "5a692eea", "metadata": {}, "source": [ "For more info on `ff.create_gantt()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_gantt.html)\n" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "643ef0e2", + "id": "796296e0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gauge-charts.ipynb b/gauge-charts.ipynb index 6357a9dea..2db3d4a8a 100644 --- a/gauge-charts.ipynb +++ b/gauge-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9876df9f", + "id": "bbb4aa13", "metadata": {}, "source": [ "#### Basic Gauge\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14d9cd23", + "id": "accdba64", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "87d39dee", + "id": "dcb23070", "metadata": {}, "source": [ "#### Add Steps, Threshold, and Delta\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4a7d9a7", + "id": "ffa2851b", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "a253ceef", + "id": "e7c4630b", "metadata": {}, "source": [ "#### Custom Gauge Chart\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "198e8f20", + "id": "b84c66f6", "metadata": { "lines_to_next_cell": 2 }, @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "f01c6ea6", + "id": "e7fa643f", "metadata": {}, "source": [ "#### Reference\n", @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "8bc0e6ba", + "id": "9151df31", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/getting-started.ipynb b/getting-started.ipynb index a54b6d22e..0d02bd8e2 100644 --- a/getting-started.ipynb +++ b/getting-started.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "013cb8c4", + "id": "898229a3", "metadata": {}, "source": [ "\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afc5d19b", + "id": "b17560d0", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "a1d6ee53", + "id": "cc840774", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "e0893d50", + "id": "953eefa0", "metadata": {}, "source": [ "#### JupyterLab Support\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9acd5f4d", + "id": "17aaba89", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "ab4bcb26", + "id": "597c68c0", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89cfefc2", + "id": "505d46fd", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "7ca27443", + "id": "2babd975", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`.\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "2b4a80e1", + "id": "b7767801", "metadata": {}, "source": [ "#### Jupyter Notebook Support\n", @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7acb5c90", + "id": "66297d02", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "f0d089d8", + "id": "3298306e", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0ee4b93", + "id": "7a72cd7b", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "6e86b972", + "id": "af240d9b", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`." @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "19fe8c99", + "id": "3ab2bfd9", "metadata": {}, "source": [ "### Static Image Export\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "a2e16e54", + "id": "7272ee34", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graph-objects.ipynb b/graph-objects.ipynb index 0fe07db3c..4c346a508 100644 --- a/graph-objects.ipynb +++ b/graph-objects.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2a65e904", + "id": "67ac8b01", "metadata": {}, "source": [ "### What Are Graph Objects?\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cb063d8", + "id": "c28b1075", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3f8eaf8", + "id": "32724d1b", "metadata": { "lines_to_next_cell": 2 }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "9e05ee1d", + "id": "8aaa5895", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graphing-multiple-chart-types.ipynb b/graphing-multiple-chart-types.ipynb index d14e32609..22efa4752 100644 --- a/graphing-multiple-chart-types.ipynb +++ b/graphing-multiple-chart-types.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3a83c31a", + "id": "dd1780c7", "metadata": {}, "source": [ "### Chart Types versus Trace Types\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "1f342adf", + "id": "c880bd6c", "metadata": {}, "source": [ "### Multiple Trace Types with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a126f20f", + "id": "85db636c", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "833a5848", + "id": "ddb48e35", "metadata": {}, "source": [ "#### Grouped Bar and Scatter Chart\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed364ddd", + "id": "433036fb", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "240ee615", + "id": "3f31eb75", "metadata": {}, "source": [ "#### Line Chart and a Bar Chart" @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3396c0ae", + "id": "592ffc1b", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "3a9a36d7", + "id": "4c029451", "metadata": {}, "source": [ "#### A Contour and Scatter Plot of the Method of Steepest Descent" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db0442a2", + "id": "73ff4476", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "e1c7dc3f", + "id": "3af5cc10", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd5a132", + "id": "308e0ea6", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "cd0dc311", + "id": "a7fcc444", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "b3b684f2", + "id": "41bdc2b0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/heatmaps.ipynb b/heatmaps.ipynb index 984be4c6b..31d8e3d46 100644 --- a/heatmaps.ipynb +++ b/heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f6439ea3", + "id": "aa0238f7", "metadata": {}, "source": [ "The term \"heatmap\" usually refers to a Cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/tile-density-heatmaps/).\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "8b9c9433", + "id": "45c78c33", "metadata": {}, "source": [ "### Heatmaps with Plotly Express\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "e9093c10", + "id": "a2cceaf3", "metadata": {}, "source": [ "The `px.imshow()` function can be used to display heatmaps (as well as full-color images, as its name suggests). It accepts both array-like objects like lists of lists and `numpy` or `xarray` arrays, as well as supported [DataFrame objects](/python/px-arguments#supported-dataframes).\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdceb8a9", + "id": "dc9db597", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2ce09ba", + "id": "2c871c1c", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "4ed33888", + "id": "4c3d95cb", "metadata": {}, "source": [ "### Displaying Text on Heatmaps\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce441507", + "id": "879f3eff", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "c0c2e12f", + "id": "6f109fb9", "metadata": {}, "source": [ "#### Heatmaps in Dash\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e360da57", + "id": "38414e8a", "metadata": { "hide_code": true }, @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "a5743fb5", + "id": "4e4e7e42", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "6e75ec8c", + "id": "07bfc42c", "metadata": {}, "source": [ "### Controlling Aspect Ratio\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1798ec4e", + "id": "8d188658", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "821924c1", + "id": "3ef2c1a2", "metadata": {}, "source": [ "### Customizing the axes and labels on a heatmap\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "885ad5c3", + "id": "46956cc6", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "1268fb25", + "id": "efaef599", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf0211d", + "id": "b821e7ee", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "cd486f98", + "id": "96ae2a4c", "metadata": {}, "source": [ "### Basic Heatmap with `plotly.graph_objects`\n", @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a4b5620", + "id": "26ad948c", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "b1db0a0d", + "id": "4f100b6c", "metadata": {}, "source": [ "### Heatmap with Categorical Axis Labels\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd6e1b50", + "id": "1f26d390", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "17ec636c", + "id": "15d0753b", "metadata": {}, "source": [ "### Heatmap with Unequal Block Sizes\n" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57c1f30a", + "id": "319dbdc3", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "7b1e1e1b", + "id": "0e5c5e5e", "metadata": {}, "source": [ "### Heatmap with Datetime Axis" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40bc49d3", + "id": "d5fd1ca0", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "f4c11875", + "id": "7ab6bcf2", "metadata": {}, "source": [ "### Text on Heatmap Points\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1571f81b", + "id": "089e1f09", "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "225371b2", + "id": "6e12a897", "metadata": {}, "source": [ "### Heatmap and datashader\n", @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "ad5cf31c", + "id": "b0651e73", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hexbin-mapbox.ipynb b/hexbin-mapbox.ipynb index 89dad3b28..e74e4204e 100644 --- a/hexbin-mapbox.ipynb +++ b/hexbin-mapbox.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ac294138", + "id": "55ac759c", "metadata": {}, "source": [ "#### Simple Count Hexbin\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac278d4b", + "id": "25f81211", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "ca55509b", + "id": "56b87e63", "metadata": {}, "source": [ "#### Count Hexbin with Minimum Count and Opacity" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71d08269", + "id": "5a3876e9", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "02c6e0e8", + "id": "12ea2bda", "metadata": {}, "source": [ "#### Display the Underlying Data" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8df90584", + "id": "d0b74e59", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "73b29c4e", + "id": "f057f04b", "metadata": {}, "source": [ "#### Compute the Mean Value per Hexbin" @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d35123d5", + "id": "da2f78fe", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "5dd81d70", + "id": "f3f05c42", "metadata": {}, "source": [ "#### Compute the Sum Value per Hexbin" @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54b88605", + "id": "d2352902", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "aa37b98e", + "id": "ac9809ef", "metadata": {}, "source": [ "#### Hexbin with Animation" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2240fee", + "id": "b47b2760", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "7770d2e9", + "id": "c20e4d2d", "metadata": {}, "source": [ "#### Reference\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "e0f0e438", + "id": "5f320cec", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/histograms.ipynb b/histograms.ipynb index e7cadbd58..a39e1c83b 100644 --- a/histograms.ipynb +++ b/histograms.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8d4f8186", + "id": "ca04fd40", "metadata": {}, "source": [ "In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in Plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...) which can be used to visualize data on categorical and date axes as well as linear axes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edef8a9c", + "id": "4a91555a", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7afcd569", + "id": "3a6496e5", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "0a423895", + "id": "26f06836", "metadata": {}, "source": [ "#### Choosing the number of bins\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c0b2020", + "id": "a5d66d65", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "ab9b8b5d", + "id": "088b5ea0", "metadata": {}, "source": [ "### Histograms on Date Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fafa2b2", + "id": "19c6f778", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "14ea3f10", + "id": "f869959a", "metadata": {}, "source": [ "### Histograms on Categorical Data\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd75a856", + "id": "8edce311", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "adac56c2", + "id": "6eae8992", "metadata": {}, "source": [ "#### Histograms in Dash\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f659126", + "id": "ef4e6af3", "metadata": { "hide_code": true }, @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "701cc2c3", + "id": "6f7ccf43", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "3c6b6738", + "id": "d935df04", "metadata": {}, "source": [ "#### Accessing the counts (y-axis) values\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5ad351b", + "id": "8860551d", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "1cb10000", + "id": "b29fe8ea", "metadata": {}, "source": [ "#### Type of normalization\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9655cf6", + "id": "538ac443", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "89865204", + "id": "9a90cc61", "metadata": {}, "source": [ "#### Aspect of the histogram plot" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d194a614", + "id": "5e7ea827", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "a833b483", + "id": "a48e954f", "metadata": {}, "source": [ "#### Several histograms for the different values of one column" @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "568938c8", + "id": "0c39ff03", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "4b5d5e15", + "id": "2c8cef0a", "metadata": {}, "source": [ "#### Aggregating with other functions than `count`\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01df1245", + "id": "4a1b1083", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "b9ee1028", + "id": "b9bd4bab", "metadata": {}, "source": [ "The default `histfunc` is `sum` if `y` is given, and works with categorical as well as binned numeric data on the `x` axis:" @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d400a722", + "id": "f2fb78d0", "metadata": { "lines_to_next_cell": 0 }, @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "6d487ed2", + "id": "34d387a5", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d80f1ef4", + "id": "21fb1e47", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "ac838155", + "id": "9223e02e", "metadata": {}, "source": [ "#### Visualizing the distribution\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea3c0ae8", + "id": "923479b9", "metadata": {}, "outputs": [], "source": [ @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "d465d5f8", + "id": "01866ec9", "metadata": {}, "source": [ "### Adding text labels\n", @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86cd5df4", + "id": "455e9a29", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "b9a9d192", + "id": "ed308a8b", "metadata": {}, "source": [ "## Histograms with go.Histogram\n", @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a63d5271", + "id": "2de5065b", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "a62f38bf", + "id": "4d1c5a34", "metadata": {}, "source": [ "### Normalized Histogram" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86e8b31b", + "id": "055b04f6", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "b151c018", + "id": "4277fa80", "metadata": {}, "source": [ "### Horizontal Histogram" @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a18cc205", + "id": "96a7b417", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "a30fb3ca", + "id": "1591c4fa", "metadata": {}, "source": [ "### Overlaid Histogram" @@ -462,7 +462,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e4039e2", + "id": "b06b46ce", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "536b3edb", + "id": "f463f0fb", "metadata": {}, "source": [ "### Stacked Histograms" @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c59ea122", + "id": "72059ba8", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "972e82e0", + "id": "f0a4185b", "metadata": {}, "source": [ "### Styled Histogram" @@ -527,7 +527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec4a9cc4", + "id": "dc5b45c3", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "ca64bf99", + "id": "9a0905bc", "metadata": {}, "source": [ "### Histogram Bar Text\n", @@ -587,7 +587,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1a90abd", + "id": "f312b81d", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ }, { "cell_type": "markdown", - "id": "9894593a", + "id": "a2434b5d", "metadata": {}, "source": [ "### Cumulative Histogram" @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33994521", + "id": "25b08352", "metadata": {}, "outputs": [], "source": [ @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "2814a6a7", + "id": "686bb464", "metadata": {}, "source": [ "### Specify Aggregation Function" @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bac8a6f", + "id": "f11f0b34", "metadata": {}, "outputs": [], "source": [ @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "38629ec4", + "id": "fc822803", "metadata": {}, "source": [ "### Custom Binning\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94c2e18b", + "id": "389dcaa4", "metadata": {}, "outputs": [], "source": [ @@ -715,7 +715,7 @@ }, { "cell_type": "markdown", - "id": "2f8db41c", + "id": "b6e0abfd", "metadata": {}, "source": [ "### See also: Bar Charts\n", @@ -726,7 +726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ead673c6", + "id": "0ad93fdf", "metadata": {}, "outputs": [], "source": [ @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "fbfe88b7", + "id": "1b72b6eb", "metadata": {}, "source": [ "### Share bins between histograms\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7b29a4e", + "id": "1574cc90", "metadata": {}, "outputs": [], "source": [ @@ -777,7 +777,7 @@ }, { "cell_type": "markdown", - "id": "b859be97", + "id": "da3aef0d", "metadata": {}, "source": [ "### Sort Histogram by Category Order\n", @@ -788,7 +788,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ea0ae58", + "id": "77e64f3a", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c6ffd0b", + "id": "775f53d3", "metadata": {}, "outputs": [], "source": [ @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "55407211", + "id": "f2c260ee", "metadata": {}, "source": [ "#### Reference\n", @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "19a72df3", + "id": "d580fbe0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-bar-charts.ipynb b/horizontal-bar-charts.ipynb index ebadf003b..85d9fd5d1 100644 --- a/horizontal-bar-charts.ipynb +++ b/horizontal-bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "49ac73e4", + "id": "d25c41ea", "metadata": {}, "source": [ "See more examples of bar charts (including vertical bar charts) and styling options [here](https://plotly.com/python/bar-charts/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "534e7254", + "id": "bfaa0cf4", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "59bca91f", + "id": "f6afe4b4", "metadata": {}, "source": [ "#### Configure horizontal bar chart\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afedc8a6", + "id": "eda1bd21", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "cc4f94f4", + "id": "fa15528a", "metadata": {}, "source": [ "### Horizontal Bar Chart with go.Bar\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6fb035b", + "id": "9c07c3c2", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "71020f47", + "id": "8fd018ab", "metadata": {}, "source": [ "### Colored Horizontal Bar Chart" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77649cb8", + "id": "64d526d2", "metadata": { "lines_to_next_cell": 0 }, @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "6ed1cde9", + "id": "3a9d187c", "metadata": { "lines_to_next_cell": 0 }, @@ -142,7 +142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f1aec56", + "id": "da00affd", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "5575b67d", + "id": "65a95d2a", "metadata": {}, "source": [ "### Color Palette for Bar Chart\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d90725ca", + "id": "8091448e", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "8a03e002", + "id": "761f1bc9", "metadata": {}, "source": [ "### Diverging Bar (or Butterfly) Chart\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9689966a", + "id": "11c265ca", "metadata": {}, "outputs": [], "source": [ @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "20a01a75", + "id": "67cb1c01", "metadata": {}, "source": [ "### Bar Chart with Line Plot" @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be56292f", + "id": "0c30d53b", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "a2a353cb", + "id": "39862494", "metadata": {}, "source": [ "### Reference\n", @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "4e4c65c9", + "id": "1183e17e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-vertical-shapes.ipynb b/horizontal-vertical-shapes.ipynb index dd59fa6cb..b4acaa84e 100644 --- a/horizontal-vertical-shapes.ipynb +++ b/horizontal-vertical-shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "efaf0f82", + "id": "0ab2bf9e", "metadata": {}, "source": [ "### Horizontal and Vertical Lines and Rectangles\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e4f05ab", + "id": "9bf286d3", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "91e02002", + "id": "5cb890e3", "metadata": {}, "source": [ "These shapes can be styled by passing the same arguments as are accepted by `add_shape`:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d56982f9", + "id": "11d127a1", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "4ef4fe76", + "id": "869b34a6", "metadata": {}, "source": [ "#### Horizontal and vertical lines in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db507c58", + "id": "f00ad663", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "0a031a9f", + "id": "27db4c20", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "801c654d", + "id": "e70d7df8", "metadata": {}, "source": [ "#### Adding Text Annotations\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "019ba4f4", + "id": "4daf39fa", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "6906ade8", + "id": "dfd74c27", "metadata": {}, "source": [ "Extra formatting of the annotation can be done using magic-underscores prefixed by `annotation_` or by passing a `dict` or `go.layout.Annotation` instance to the `annotation` argument:" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fb165d8", + "id": "e13d29b0", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "04702a2f", + "id": "02eecc06", "metadata": { "lines_to_next_cell": 0 }, @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a8f9894", + "id": "791fcd6e", "metadata": { "lines_to_next_cell": 0 }, @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "3a4fd7d4", + "id": "9d35175a", "metadata": {}, "source": [ "#### Text Labels on Shapes\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7c408c7", + "id": "df82a9bc", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "a901f26b", + "id": "8186387b", "metadata": {}, "source": [ "With [text labels on shapes](/python/shapes/#adding-text-labels-to-shapes), you can also add text labels to shapes other than lines and rectangles, and the labels can be added automatically to shapes drawn by the user." @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "794636b7", + "id": "6c365fdd", "metadata": {}, "source": [ "### Reference\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "13303593", + "id": "767b0219", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hover-text-and-formatting.ipynb b/hover-text-and-formatting.ipynb index ee23029b9..474a83bd4 100644 --- a/hover-text-and-formatting.ipynb +++ b/hover-text-and-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c2dd54a6", + "id": "b65ce372", "metadata": {}, "source": [ "### Hover Labels\n", @@ -11,13 +11,13 @@ "\n", "There are three hover modes available in Plotly. The default setting is `layout.hovermode='closest'`, wherein a single hover label appears for the point directly underneath the cursor.\n", "\n", - "#### Hover mode `closest` (default mode)" + "#### Hovermode `closest` (default mode)" ] }, { "cell_type": "code", "execution_count": null, - "id": "76d0a14d", + "id": "cafb46c8", "metadata": {}, "outputs": [], "source": [ @@ -33,10 +33,10 @@ }, { "cell_type": "markdown", - "id": "e83575bc", + "id": "ca25517a", "metadata": {}, "source": [ - "#### Hover mode `x` or `y`\n", + "#### Hovermode `x` or `y`\n", "\n", "If `layout.hovermode='x'` (or `'y'`), a single hover label appears per trace, for points at the same `x` (or `y`) value as the cursor. If multiple points in a given trace exist at the same coordinate, only one will get a hover label. In the line plot below we have forced markers to appear, to make it clearer what can be hovered over, and we have disabled the built-in Plotly Express `hovertemplate` by setting it to `None`, resulting in a more compact hover label per point:" ] @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dba3b75", + "id": "3dbb09f9", "metadata": {}, "outputs": [], "source": [ @@ -61,10 +61,10 @@ }, { "cell_type": "markdown", - "id": "5f68b317", + "id": "fdf26e92", "metadata": {}, "source": [ - "#### Unified hover mode\n", + "#### Unified hovermode\n", "\n", "If `layout.hovermode='x unified'` (or `'y unified'`), a single hover label appear, describing one point per trace, for points at the same `x` (or `y`) value as the cursor. If multiple points in a given trace exist at the same coordinate, only one will get an entry in the hover label. In the line plot below we have forced markers to appear, to make it clearer what can be hovered over, and we have disabled the built-in Plotly Express `hovertemplate` by setting it to `None`, resulting in a more compact entry per point in the hover label:" ] @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fa3ed75", + "id": "a7b54832", "metadata": {}, "outputs": [], "source": [ @@ -89,14 +89,14 @@ }, { "cell_type": "markdown", - "id": "f39677de", + "id": "1d0a20c1", "metadata": {}, "source": [ - "#### Customize Title in Unified Hover Mode\n", + "#### Customize Title in Unified Hovermode\n", "\n", "*New in 6.3*\n", "\n", - "Customize the title shown in unified hover mode, by specifing `unifiedhovertitle.text`.\n", + "Customize the title shown in unified hovermode, by specifing `unifiedhovertitle.text`.\n", "\n", "The unified hover title is a template string that supports using variables from the data. Numbers are formatted using d3-format's syntax `%{variable:d3-format}`, for `example \\\"Price: %{y:$.2f}\\\"`. Dates are formatted using d3-time-format's syntax `%{variable|d3-time-format}`, for example `\\\"Day: %{2019-01-01|%A}\\\"`.\n", "\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b19b7588", + "id": "acd04dae", "metadata": {}, "outputs": [], "source": [ @@ -151,22 +151,22 @@ }, { "cell_type": "markdown", - "id": "f302e74d", + "id": "00771a4b", "metadata": {}, "source": [ - "#### Control Hover Mode with Dash\n", + "#### Control hovermode with Dash\n", "\n", "[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click \"Download\" to get the code and run `python app.py`.\n", "\n", "Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with Dash Enterprise or Plotly Cloud.**\n", "\n", - "Change the hover mode below and try hovering over the points:" + "Change the hovermode below and try hovering over the points:" ] }, { "cell_type": "code", "execution_count": null, - "id": "d3592cae", + "id": "c91b6b69", "metadata": { "hide_code": true }, @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "b75a9e8a", + "id": "6dc92e3d", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -188,18 +188,18 @@ }, { "cell_type": "markdown", - "id": "c40c49f3", + "id": "1b6e1b4f", "metadata": {}, "source": [ - "#### Selecting a hover mode in a figure created with `plotly.graph_objects`\n", + "#### Selecting a hovermode in a figure created with `plotly.graph_objects`\n", "\n", - "The hover mode is a property of the figure layout, so you can select a hover mode no matter how you created the figure, either with `plotly.express` or with `plotly.graph_objects`. Below is an example with a figure created with `plotly.graph_objects`. If you're not familiar with the structure of plotly figures, you can read [the tutorial on creating and updating plotly figures](/python/creating-and-updating-figures/)." + "The hovermode is a property of the figure layout, so you can select a hovermode no matter how you created the figure, either with `plotly.express` or with `plotly.graph_objects`. Below is an example with a figure created with `plotly.graph_objects`. If you're not familiar with the structure of plotly figures, you can read [the tutorial on creating and updating plotly figures](/python/creating-and-updating-figures/)." ] }, { "cell_type": "code", "execution_count": null, - "id": "cee3b8e0", + "id": "87836d40", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "cd2683e4", + "id": "e7b716cc", "metadata": {}, "source": [ "#### Hover on Subplots\n", @@ -228,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d00476e", + "id": "1d5d674b", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "5d7b97ef", + "id": "bdf4dd7b", "metadata": {}, "source": [ "### Customizing Hover Label Appearance\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c343cd6", + "id": "b04c85b2", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "4076ad88", + "id": "ce3f65dc", "metadata": {}, "source": [ "### Customizing Hover text with Plotly Express\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a017150d", + "id": "df8ae18b", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "118290cd", + "id": "9fb14b49", "metadata": {}, "source": [ "### Disabling or customizing hover of columns in plotly express\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29342037", + "id": "e62176f8", "metadata": {}, "outputs": [], "source": [ @@ -363,15 +363,15 @@ }, { "cell_type": "markdown", - "id": "854096a5", + "id": "ebe2fc61", "metadata": {}, "source": [ - "### Customizing hover text with a hover template\n", + "### Customizing hover text with a hovertemplate\n", "\n", "To customize the tooltip on your graph you can use the [hovertemplate](https://plotly.com/python/reference/pie/#pie-hovertemplate) attribute of `graph_objects` traces, which is a template string used for rendering the information that appear on hoverbox.\n", - "This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format). In the example below, the empty `` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `` tag can be used to display other parts of the hover template, it is not reserved for the trace name.\n", + "This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format). In the example below, the empty `` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `` tag can be used to display other parts of the hovertemplate, it is not reserved for the trace name.\n", "\n", - "Note that a hover template customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate) customizes the text that appears on your chart.
\n", + "Note that a hovertemplate customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate) customizes the text that appears on your chart.
\n", "\n", "Set the horizontal alignment of the text within tooltip with [hoverlabel.align](https://plotly.com/python/reference/layout/#layout-hoverlabel-align)." ] @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d1f04be", + "id": "45bf7c30", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ "\n", "fig.update_layout(\n", " hoverlabel_align = 'right',\n", - " title = \"Set hover text with hover template\")\n", + " title = \"Set hover text with hovertemplate\")\n", "\n", "fig.show()" ] @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6284ff3b", + "id": "8fe7e1da", "metadata": {}, "outputs": [], "source": [ @@ -430,18 +430,18 @@ }, { "cell_type": "markdown", - "id": "af5f6039", + "id": "fdab68a9", "metadata": {}, "source": [ - "### Modifying the hover template of a plotly express figure\n", + "### Modifying the hovertemplate of a plotly express figure\n", "\n", - "`plotly.express` automatically sets the hover template but you can modify it using the `update_traces` method of the generated figure. It helps to print the hover template generated by `plotly.express` in order to be able to modify it. One can also revert to the default hover information of traces by setting the hover template to `None`." + "`plotly.express` automatically sets the hovertemplate but you can modify it using the `update_traces` method of the generated figure. It helps to print the hovertemplate generated by `plotly.express` in order to be able to modify it. One can also revert to the default hover information of traces by setting the hovertemplate to `None`." ] }, { "cell_type": "code", "execution_count": null, - "id": "2849df5d", + "id": "379e5ad0", "metadata": {}, "outputs": [], "source": [ @@ -451,19 +451,19 @@ "\n", "fig = px.scatter(df_2007, x=\"gdpPercap\", y=\"lifeExp\", log_x=True, color='continent'\n", " )\n", - "print(\"plotly express hover template:\", fig.data[0].hovertemplate)\n", + "print(\"plotly express hovertemplate:\", fig.data[0].hovertemplate)\n", "fig.update_traces(hovertemplate='GDP: %{x}
Life Expectancy: %{y}') #\n", "fig.update_traces(hovertemplate=None, selector={'name':'Europe'}) # revert to default hover\n", - "print(\"user defined hover template:\", fig.data[0].hovertemplate)\n", + "print(\"user_defined hovertemplate:\", fig.data[0].hovertemplate)\n", "fig.show()" ] }, { "cell_type": "markdown", - "id": "89043c75", + "id": "bbfa44a7", "metadata": {}, "source": [ - "### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hover template\n", + "### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate\n", "\n", "This example adds custom fields to a Plotly Express figure using the `custom_data` parameter and then adds a hover template that applies d3 formats to each element of the `customdata[n]` array and uses HTML to customize the fonts and spacing." ] @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70d3726d", + "id": "bb3434d5", "metadata": { "lines_to_next_cell": 2 }, @@ -495,13 +495,13 @@ " y='Life Expectancy (years)',\n", " color='continent',\n", " size=np.sqrt(df['pop']),\n", - " # Specifying data to make available to the hover template\n", + " # Specifying data to make available to the hovertemplate\n", " # The px custom_data parameter has an underscore, while the analogous graph objects customdata parameter has no underscore.\n", " # The px custom_data parameter is a list of column names in the data frame, while the graph objects customdata parameter expects a data frame or a numpy array.\n", " custom_data=['country', 'continent', 'pop'],\n", ")\n", "\n", - "# Plotly express does not have a hover template parameter in the graph creation function, so we apply the template with update_traces\n", + "# Plotly express does not have a hovertemplate parameter in the graph creation function, so we apply the template with update_traces\n", "fig.update_traces(\n", " hovertemplate =\n", " \"%{customdata[0]}
\" +\n", @@ -525,20 +525,20 @@ }, { "cell_type": "markdown", - "id": "79c6a8c5", + "id": "7fd0c491", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", "\n", "*New in v5.0*\n", "\n", - "When [displaying periodic data](https://plotly.com/python/time-series/#displaying-period-data) with mixed-sized periods (i.e. quarterly and monthly) in conjunction with `x` or `x unified` hover modes and using `hovertemplate`, the `xhoverformat` attribute can be used to control how each period's X value is displayed, and the special `%{xother}` hover-template directive can be used to control how the X value is displayed for points that do not share the exact X coordinate with the point that is being hovered on. `%{xother}` will return an empty string when the X value is the one being hovered on, otherwise it will return `(%{x})`. The special `%{_xother}`, `%{xother_}` and `%{_xother_}` variations will display with spaces before, after or around the parentheses, respectively." + "When [displaying periodic data](https://plotly.com/python/time-series/#displaying-period-data) with mixed-sized periods (i.e. quarterly and monthly) in conjunction with `x` or `x unified` hovermodes and using `hovertemplate`, the `xhoverformat` attribute can be used to control how each period's X value is displayed, and the special `%{xother}` hover-template directive can be used to control how the X value is displayed for points that do not share the exact X coordinate with the point that is being hovered on. `%{xother}` will return an empty string when the X value is the one being hovered on, otherwise it will return `(%{x})`. The special `%{_xother}`, `%{xother_}` and `%{_xother_}` variations will display with spaces before, after or around the parentheses, respectively." ] }, { "cell_type": "code", "execution_count": null, - "id": "5fb52352", + "id": "4e2f9f5a", "metadata": {}, "outputs": [], "source": [ @@ -571,18 +571,18 @@ }, { "cell_type": "markdown", - "id": "2fb5b705", + "id": "24d4a3e1", "metadata": {}, "source": [ "### Advanced Hover Template\n", "\n", - "This produces the same graphic as in \"Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hover template\" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the `customdata` array using the `df[[\"col_i\", \"col_j\"]]` subsetting notation. It then references those variables using e.g. `%{customdata[0]}` in the hover template. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`." + "This produces the same graphic as in \"Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate\" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the `customdata` array using the `df[[\"col_i\", \"col_j\"]]` subsetting notation. It then references those variables using e.g. `%{customdata[0]}` in the hovertemplate. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`." ] }, { "cell_type": "code", "execution_count": null, - "id": "d5dfc17c", + "id": "905881bb", "metadata": {}, "outputs": [], "source": [ @@ -619,7 +619,7 @@ " # The next three parameters specify the hover text\n", " # Text supports just one customized field per trace\n", " # and is implemented here with text=df['continent'],\n", - " # Custom data supports multiple fields through numeric indices in the hover template\n", + " # Custom data supports multiple fields through numeric indices in the hovertemplate\n", " # In we weren't using the text parameter in our example,\n", " # we could instead add continent as a third customdata field.\n", " customdata=df[['country','pop']],\n", @@ -649,10 +649,10 @@ }, { "cell_type": "markdown", - "id": "b4bdf95a", + "id": "82129354", "metadata": {}, "source": [ - "### Adding other data to the hover with customdata and a hover template\n", + "### Adding other data to the hover with customdata and a hovertemplate\n", "\n", "`go` traces have a `customdata` argument in which you can add an array, which outer dimensions should have the same dimensions as the plotted data. You can then use `customdata` inside a `hovertemplate` to display the value of customdata." ] @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bd0f656", + "id": "8fc83184", "metadata": {}, "outputs": [], "source": [ @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "e26763fe", + "id": "3b946462", "metadata": {}, "source": [ "### Setting the Hover Template in Tile Maps" @@ -698,7 +698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0243b38", + "id": "f2caec16", "metadata": {}, "outputs": [], "source": [ @@ -725,7 +725,7 @@ }, { "cell_type": "markdown", - "id": "ad3da01c", + "id": "d5b23e02", "metadata": {}, "source": [ "### Controlling Hover Text with `graph_objects` and `hoverinfo`\n", @@ -736,7 +736,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b05fc62", + "id": "6ce7ca0b", "metadata": {}, "outputs": [], "source": [ @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "21aa5c54", + "id": "4eab9937", "metadata": {}, "source": [ "### Spike lines\n", @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1b4847e", + "id": "f6c098e9", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "d784b691", + "id": "43e07214", "metadata": {}, "source": [ "Spike lines can be styled per axis as well, and the cursor distance setting can be controlled via `layout.spikedistance`." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ab39764", + "id": "10e09beb", "metadata": {}, "outputs": [], "source": [ @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "e34ceb62", + "id": "40dd81cd", "metadata": {}, "source": [ "#### Reference\n", @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "36444a2c", + "id": "6f6cc961", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/icicle-charts.ipynb b/icicle-charts.ipynb index c9af6ece3..26af7a229 100644 --- a/icicle-charts.ipynb +++ b/icicle-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2493efd3", + "id": "157df749", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96029822", + "id": "d09a7a65", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "7b25c4bd", + "id": "d4f87d9b", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with plotly.express\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f309b9b", + "id": "676b83a9", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "70c1785f", + "id": "b3912deb", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with continuous color argument in px.icicle\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3fae2ec", + "id": "83407d29", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "0af2fafa", + "id": "17392727", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with discrete color argument in px.icicle\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2425ff09", + "id": "3ea7ea96", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "849fb08f", + "id": "8a827733", "metadata": {}, "source": [ "In the example below the color of **Saturday** and **Sunday** sectors is the same as **Dinner** because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55545b02", + "id": "5875df6e", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "0e61caec", + "id": "cec77352", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4208258d", + "id": "9f5eea96", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "d36b16c7", + "id": "bb8a180f", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2205809", + "id": "2cada188", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "b7328bd3", + "id": "2e87efe6", "metadata": {}, "source": [ "### Basic Icicle Plot with go.Icicle\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9f6daf8", + "id": "51c1d772", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "d4018133", + "id": "69ce57b6", "metadata": {}, "source": [ "### Icicle with Repeated Labels" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b78070d1", + "id": "05ab6e2b", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ }, { "cell_type": "markdown", - "id": "7d715b17", + "id": "b00e6a55", "metadata": {}, "source": [ "### Branchvalues\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edc5128e", + "id": "56df3351", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "d0222de4", + "id": "a7d32053", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f09ebe41", + "id": "90883a00", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "88e3d148", + "id": "8e11a3ca", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4847a76e", + "id": "f0b6b735", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "19b66b8e", + "id": "5a986b4e", "metadata": {}, "source": [ "### Icicle chart with a continuous colorscale\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bf699a5", + "id": "3b68c801", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "c01a632c", + "id": "a12a7ebc", "metadata": {}, "source": [ "### Set Color of Icicle Sectors" @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cbf0fa4", + "id": "5795b793", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "1a0743ba", + "id": "84610f9d", "metadata": {}, "source": [ "This example uses iciclecolorway attribute, which should be set in layout." @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04f9c2ee", + "id": "ec8ac926", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32be0c3f", + "id": "2976e3ec", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "84abdbb3", + "id": "d958f6df", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81968132", + "id": "2919e620", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "e2703b42", + "id": "dc1bd56f", "metadata": {}, "source": [ "### Set the Direction of Icicle charts\n", @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "082594ec", + "id": "3a380198", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "26d362bd", + "id": "dd7d29e4", "metadata": {}, "source": [ "**Down Direction (Icicle)**" @@ -658,7 +658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c98ef88", + "id": "b8a92635", "metadata": {}, "outputs": [], "source": [ @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "09bded9d", + "id": "e8bf0ce4", "metadata": {}, "source": [ "**Right Direction**" @@ -693,7 +693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2ecb6f1", + "id": "95776f54", "metadata": {}, "outputs": [], "source": [ @@ -719,7 +719,7 @@ }, { "cell_type": "markdown", - "id": "6ab0bb28", + "id": "2062aacf", "metadata": {}, "source": [ "**Left Direction**" @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "029174a6", + "id": "df0f65b7", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "db5efe56", + "id": "08b9a545", "metadata": {}, "source": [ "#### Reference\n", @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "c01b7674", + "id": "ec427a1e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/images.ipynb b/images.ipynb index 32df0a8f5..e31735003 100644 --- a/images.ipynb +++ b/images.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "74a6fa7d", + "id": "51eb5bad", "metadata": {}, "source": [ "#### Add a Background Image\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfca8ebb", + "id": "7910899e", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "71cbc364", + "id": "82e137f0", "metadata": {}, "source": [ "#### Add a Logo\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12697802", + "id": "b82c9109", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "3205c686", + "id": "18420cd3", "metadata": {}, "source": [ "#### Label Spectroscopy Data by Adding Multiple Images" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "465edcbf", + "id": "0e81aa67", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "df2db5a1", + "id": "0ba3ee8a", "metadata": {}, "source": [ "#### Zoom on Static Images" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f023205", + "id": "7838578b", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "824cd883", + "id": "0f9f2dd8", "metadata": {}, "source": [ "### Annotating layout image with shapes\n", @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63a92279", + "id": "614139a7", "metadata": { "lines_to_next_cell": 2 }, @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "0472f01d", + "id": "b5a7cd1f", "metadata": {}, "source": [ "### Images Placed Relative to Axes\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c1b1a19", + "id": "440af8eb", "metadata": {}, "outputs": [], "source": [ @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "1996b690", + "id": "dd7a6678", "metadata": {}, "source": [ "#### Reference\n", @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "8fab8db2", + "id": "10ad52c8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/imshow.ipynb b/imshow.ipynb index 59d484ada..afc6cf00f 100644 --- a/imshow.ipynb +++ b/imshow.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "078c097d", + "id": "d968f7a8", "metadata": {}, "source": [ "This tutorial shows how to display and explore image data. If you would like\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44b2f8dc", + "id": "3a824e50", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "531bd812", + "id": "1b593b4d", "metadata": {}, "source": [ "### Read image arrays from image files\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6cd2f29", + "id": "4c3f1119", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f26d5a80", + "id": "567fc1b9", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "eb086655", + "id": "30659ae9", "metadata": {}, "source": [ "### Display single-channel 2D data as a heatmap\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a025719", + "id": "a500c622", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "a0faad87", + "id": "ec68770e", "metadata": {}, "source": [ "### Choose the colorscale to display a single-channel image\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa17cc9", + "id": "5c3afa39", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "f6d75d22", + "id": "b6ddee77", "metadata": {}, "source": [ "You can use this to make the image grayscale as well:" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f28efb1", + "id": "b9486d58", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "3de9f2cb", + "id": "a8b0443b", "metadata": {}, "source": [ "### Hiding the colorbar and axis labels\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c150660", + "id": "93022a1a", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "9059320c", + "id": "4cbc4187", "metadata": {}, "source": [ "### Customizing the axes and labels on a single-channel image\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8be0ec4", + "id": "9ce2a87a", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "318fa127", + "id": "1b0ca07f", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b7e3266", + "id": "ba9848ca", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "44be09ab", + "id": "fd39c8b2", "metadata": {}, "source": [ "### Display an xarray image with square pixels\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "151128c3", + "id": "1e57ef3b", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "87d32e25", + "id": "beec5570", "metadata": {}, "source": [ "### Display multichannel image data with go.Image\n", @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4526bd4", + "id": "e5c8a416", "metadata": {}, "outputs": [], "source": [ @@ -271,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "0f6f30d4", + "id": "875d60e9", "metadata": {}, "source": [ "### Passing image data as a binary string to `go.Image`\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "816ae9f2", + "id": "893d6236", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "c1136795", + "id": "53feaeab", "metadata": {}, "source": [ "### Defining the data range covered by the color range with zmin and zmax\n", @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "950e445d", + "id": "9f44e999", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69f66029", + "id": "109df0de", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "18903627", + "id": "b0e6c4b3", "metadata": {}, "source": [ "### Automatic contrast rescaling in `px.imshow`\n", @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d934c5e0", + "id": "f398dc70", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "8cd4b312", + "id": "971f706b", "metadata": {}, "source": [ "### Ticks and margins around image data" @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3495fbb4", + "id": "22b68668", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "74d2e107", + "id": "3f2a3a65", "metadata": {}, "source": [ "### Combining image charts and other traces" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1559d61", + "id": "d40e02a3", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "65ee760a", + "id": "527f97a2", "metadata": {}, "source": [ "### Displaying an image and the histogram of color values" @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e21e62a1", + "id": "1af5d3c1", "metadata": {}, "outputs": [], "source": [ @@ -458,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "bb7fa764", + "id": "e4895452", "metadata": {}, "source": [ "### imshow and datashader\n", @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "2037052e", + "id": "f3d4587b", "metadata": {}, "source": [ "### Annotating image traces with shapes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d7df006", + "id": "b01707cf", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "65341e00", + "id": "546c70b3", "metadata": {}, "source": [ "### Passing image data as a binary string\n", @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06168aaf", + "id": "b28d0ecd", "metadata": {}, "outputs": [], "source": [ @@ -555,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "fcc5b170", + "id": "0c983700", "metadata": {}, "source": [ "### Contrast rescaling im imshow with binary string\n", @@ -566,7 +566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15bbfe95", + "id": "309f5dc6", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "db421869", + "id": "8c5b639f", "metadata": {}, "source": [ "You can set `binary_string=False` if you want the intensity value to appear in the hover even for a rescaled image. In the example below we also modify the hovertemplate to display both `z` (the data of the original image array) and `color` (the pixel value displayed in the figure)." @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d90cac4", + "id": "27c8ec21", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "c12d6fac", + "id": "2762c212", "metadata": {}, "source": [ "### Changing the level of compression of the binary string in `px.imshow`\n", @@ -620,7 +620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0d25b20", + "id": "cc0e1379", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "54ada7e5", + "id": "d8b18e9c", "metadata": {}, "source": [ "### Exploring 3-D images, timeseries and sequences of images with `facet_col`\n", @@ -652,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07d95e91", + "id": "3e98c30a", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "83646f57", + "id": "c80ce7bb", "metadata": {}, "source": [ "Facets can also be used to represent several images of equal shape, like in the example below where different values of the blurring parameter of a Gaussian filter are compared." @@ -675,7 +675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c459227", + "id": "44b84b59", "metadata": {}, "outputs": [], "source": [ @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "9d89addc", + "id": "988124b7", "metadata": {}, "source": [ "### Exploring 3-D images and timeseries with `animation_frame`\n", @@ -708,7 +708,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2966bf9", + "id": "d002d277", "metadata": {}, "outputs": [], "source": [ @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "c9828513", + "id": "9a8621aa", "metadata": {}, "source": [ "### Animations of xarray datasets\n", @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a4db5c4", + "id": "0e66921d", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "49914972", + "id": "5803dfc2", "metadata": {}, "source": [ "### Combining animations and facets\n", @@ -760,7 +760,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54c81b3c", + "id": "0199c194", "metadata": {}, "outputs": [], "source": [ @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "8dc4bdb6", + "id": "502c77f3", "metadata": {}, "source": [ "#### Reference\n", @@ -784,7 +784,7 @@ }, { "cell_type": "markdown", - "id": "52e4a7a5", + "id": "16daf5cb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/indicator.ipynb b/indicator.ipynb index e58003814..1db26bfa2 100644 --- a/indicator.ipynb +++ b/indicator.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "71f90c2c", + "id": "b5ea81da", "metadata": {}, "source": [ "#### Overview\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34eafa99", + "id": "dcbf5066", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "2eb8b120", + "id": "537f389c", "metadata": {}, "source": [ "#### A Single Angular Gauge Chart" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "960c2f8f", + "id": "7abf1af5", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "3041f945", + "id": "907da527", "metadata": {}, "source": [ "##### Bullet Gauge\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1309f6b", + "id": "4f9b9e1d", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "2d1fa41f", + "id": "65b4c0fd", "metadata": {}, "source": [ "#### Showing Information above Your Chart\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9793e49a", + "id": "4c0d7f9c", "metadata": { "lines_to_next_cell": 0 }, @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "07395425", + "id": "4f7f0841", "metadata": {}, "source": [ "#### Data Cards / Big Numbers\n", @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b83dc0fc", + "id": "8a2c11bc", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "9e723823", + "id": "c3f59033", "metadata": {}, "source": [ "#### It's possible to display several numbers" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ded16837", + "id": "a31c5800", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "e5554f75", + "id": "043d304b", "metadata": {}, "source": [ "#### Adding a Prefix and Suffix" @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "a993b1b1", + "id": "28827e59", "metadata": {}, "source": [ "On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`. \n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0acab34d", + "id": "f787131f", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "6ef3990f", + "id": "36476487", "metadata": {}, "source": [ "#### Reference\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b3e01ae", + "id": "d7c7a12c", "metadata": { "lines_to_next_cell": 2 }, @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "14880f02", + "id": "b155fc9a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/interactive-html-export.ipynb b/interactive-html-export.ipynb index 2c1538405..614a8e3d6 100644 --- a/interactive-html-export.ipynb +++ b/interactive-html-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d38eb846", + "id": "eadbb153", "metadata": {}, "source": [ "### Interactive vs Static Export\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "a588f844", + "id": "d74192c7", "metadata": {}, "source": [ "### Saving to an HTML file\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "4a3f62ec", + "id": "111d9807", "metadata": {}, "source": [ "### Controlling the size of the HTML file\n", @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "67e45f68", + "id": "f134c7ce", "metadata": {}, "source": [ "\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "c516d866", + "id": "3e06ec9c", "metadata": {}, "source": [ "### HTML export in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa6dc1d", + "id": "f92c305b", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "3027b103", + "id": "b179590e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "978bbc36", + "id": "baf3e41f", "metadata": {}, "source": [ "### Full Parameter Documentation" @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13df7c26", + "id": "0980c805", "metadata": { "lines_to_next_cell": 2 }, @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "13bc20e1", + "id": "e1f2a1b2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ipython-vs-python.ipynb b/ipython-vs-python.ipynb index 566f856f9..c981579b7 100644 --- a/ipython-vs-python.ipynb +++ b/ipython-vs-python.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3db6d245", + "id": "3b9da0fc", "metadata": {}, "source": [ "#### What is the difference between IPython and Python?\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "82717aab", + "id": "d9bf4609", "metadata": {}, "source": [ "![IPython terminal](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/ipython-console.png)" @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "38d02d5f", + "id": "8647d6a2", "metadata": {}, "source": [ "In other words, IPython is a powerful *interface* to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write *scripts*, files with the `.py` extension.
\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "8bcbb7db", + "id": "7a4cf4d3", "metadata": {}, "source": [ "#### Jupyter Notebook" @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "3d7c418a", + "id": "3624fc8a", "metadata": {}, "source": [ "In 2011, IPython introduced a new tool named the **Notebook**. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python." @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "4f5dac78", + "id": "2bf98e87", "metadata": {}, "source": [ "![IPython Notebook](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/notebook.png)" @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "494797da", + "id": "2b2df469", "metadata": {}, "source": [ "Compared to the original IPython terminal, the Notebook offers a more convenient text editor, the possibility to write rich text, and improved graphical capabilities. Also, since it is a web interface, it can integrate many of the existing web libraries for data visualization, including *plotly.js*.
\n", @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "4e8e2eec", + "id": "5a785d74", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/jupyter-lab-tools.ipynb b/jupyter-lab-tools.ipynb index d1fb17e03..e9af4f137 100644 --- a/jupyter-lab-tools.ipynb +++ b/jupyter-lab-tools.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3d47c620", + "id": "6f1e0ed5", "metadata": {}, "source": [ "#### Create a New View for Output" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "c93da513", + "id": "f1efb220", "metadata": {}, "source": [ "Display a FigureWidget and then create a new window to display it in so that you can scroll through your code but still keep an eye on what you're doing." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "6ecb0a34", + "id": "bce3488c", "metadata": {}, "source": [ "\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "49d22ae5", + "id": "83e52301", "metadata": {}, "source": [ "#### Reference" @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "b4810889", + "id": "47707e64", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples.\n" @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "89191b83", + "id": "ba1666e1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/legend.ipynb b/legend.ipynb index 689ee68e3..e57e68636 100644 --- a/legend.ipynb +++ b/legend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "32fa51d7", + "id": "3de19869", "metadata": {}, "source": [ "### Trace Types, Legends and Color Bars\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "5999a09a", + "id": "8cf4c0e7", "metadata": {}, "source": [ "### Legends with Plotly Express\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d17e21", + "id": "7ec624c4", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "b303f0fa", + "id": "0613abf5", "metadata": {}, "source": [ "### Legend Order\n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c631ff76", + "id": "a8d27c8a", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "80371027", + "id": "567376a9", "metadata": {}, "source": [ "When using stacked bars, the bars are stacked from the bottom in the same order as they appear in the legend, so it can make sense to set `layout.legend.traceorder` to `\"reversed\"` to get the legend and stacks to match:" @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b5650df", + "id": "77db709e", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "252a8ec2", + "id": "d6539005", "metadata": {}, "source": [ "When using [`plotly.graph_objects`](/python/graph-objects/) rather than Plotly Express, legend items will appear in the order that traces appear in the `data`:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72854cd6", + "id": "4faa67ba", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "629ac6ce", + "id": "b35f5df4", "metadata": {}, "source": [ "*New in 5.16*\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adac4308", + "id": "cc7150e1", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "14b15d7a", + "id": "8ae4b433", "metadata": {}, "source": [ "The `legendrank` attribute of a trace or shape can be used to control its placement in the legend.\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d74aa447", + "id": "a6ea09ba", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "18e07a0f", + "id": "32cf57b5", "metadata": {}, "source": [ "#### Showing and Hiding the Legend\n", @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba757525", + "id": "d40abeaa", "metadata": { "lines_to_next_cell": 2 }, @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "18386351", + "id": "f4388217", "metadata": {}, "source": [ "### Legend Positioning\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3092422", + "id": "655ac02f", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "7d24d50d", + "id": "8913e7fb", "metadata": {}, "source": [ "#### Legends in Dash\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3154ba16", + "id": "952b23cf", "metadata": { "hide_code": true }, @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "c5ec6857", + "id": "07485249", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "f7abc49a", + "id": "d0b3cb34", "metadata": {}, "source": [ "#### Horizontal Legends\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5b44023", + "id": "72b8240e", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "105bb16e", + "id": "5f895343", "metadata": {}, "source": [ "#### Horizontal Legend Entry Width\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34e0e271", + "id": "573782cb", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "2b27bcd4", + "id": "b9db3520", "metadata": {}, "source": [ "#### Legend Max Height\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "deb87e4f", + "id": "ff393871", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "82a9d907", + "id": "85b00ea9", "metadata": {}, "source": [ "#### Styling Legends\n", @@ -429,7 +429,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1ae9913", + "id": "38307c5d", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "5683c66c", + "id": "55392414", "metadata": {}, "source": [ "### Legends with Graph Objects\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "4abb9327", + "id": "0f11944f", "metadata": {}, "source": [ "#### Legend Item Names\n", @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc930df2", + "id": "11e224cc", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "86977d60", + "id": "8b78b883", "metadata": {}, "source": [ "By default, for shapes, legend items are disabled. Set `showlegend=True` on a shape for it to display a legend item.\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0efad065", + "id": "02973134", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "9281e8eb", + "id": "ba1ef62e", "metadata": {}, "source": [ "#### Legend titles" @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fee2cd51", + "id": "7e0db232", "metadata": {}, "outputs": [], "source": [ @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "1dd0eee2", + "id": "7861a07b", "metadata": {}, "source": [ "### Hiding Legend Items" @@ -596,7 +596,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3edc100f", + "id": "1653596f", "metadata": {}, "outputs": [], "source": [ @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "94fffaec", + "id": "d5dbb45b", "metadata": {}, "source": [ "#### Hiding the Trace Initially\n", @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6148b27d", + "id": "1300c7f5", "metadata": {}, "outputs": [], "source": [ @@ -658,7 +658,7 @@ }, { "cell_type": "markdown", - "id": "a2bdb8e3", + "id": "712fdd97", "metadata": {}, "source": [ "#### Size of Legend Items\n", @@ -669,7 +669,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d702dcef", + "id": "e3aa3ff9", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "ab109028", + "id": "dfe0bb42", "metadata": {}, "source": [ "#### Grouped Legend Items\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28a1efa2", + "id": "7c53fdf7", "metadata": {}, "outputs": [], "source": [ @@ -762,7 +762,7 @@ }, { "cell_type": "markdown", - "id": "6dbaf091", + "id": "24d560a9", "metadata": {}, "source": [ "You can also hide entries in grouped legends, preserving the grouped show/hide behaviour. This is what Plotly Express does with its legends." @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13676ad4", + "id": "39455648", "metadata": {}, "outputs": [], "source": [ @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "3f7331b8", + "id": "c60ad75b", "metadata": {}, "source": [ "#### Indent Legend Entries\n", @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d41ec346", + "id": "11989ea9", "metadata": {}, "outputs": [], "source": [ @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "81651fa3", + "id": "e287b812", "metadata": {}, "source": [ "#### Group click toggle behavior\n", @@ -884,7 +884,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8cf0c45", + "id": "4fb28a33", "metadata": {}, "outputs": [], "source": [ @@ -938,7 +938,7 @@ }, { "cell_type": "markdown", - "id": "fe24e933", + "id": "5d730996", "metadata": {}, "source": [ "### Legend items for continuous fields (2D and 3D)\n", @@ -951,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8adaa2c5", + "id": "d4bf4646", "metadata": {}, "outputs": [], "source": [ @@ -994,7 +994,7 @@ }, { "cell_type": "markdown", - "id": "5ef5f9f0", + "id": "5d08f116", "metadata": {}, "source": [ "### Adding Multiple Legends\n", @@ -1009,7 +1009,7 @@ { "cell_type": "code", "execution_count": null, - "id": "057e675e", + "id": "fce2510c", "metadata": {}, "outputs": [], "source": [ @@ -1079,7 +1079,7 @@ }, { "cell_type": "markdown", - "id": "06ae3b8c", + "id": "7b915ca4", "metadata": {}, "source": [ "### Positioning Legends\n", @@ -1090,7 +1090,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6586d19c", + "id": "ba24b39e", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "f66d1faa", + "id": "4f551fcc", "metadata": {}, "source": [ "### Legend Title Click Behavior\n", @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f95da3e", + "id": "e44e3c39", "metadata": {}, "outputs": [], "source": [ @@ -1182,7 +1182,7 @@ }, { "cell_type": "markdown", - "id": "e0d9adbc", + "id": "ecc57b95", "metadata": {}, "source": [ "To disable title click behavior, set `titleclick` and `titledoubleclick` to `False`:\n", @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "00c54c84", + "id": "109522fa", "metadata": {}, "source": [ "#### Reference\n", @@ -1209,7 +1209,7 @@ }, { "cell_type": "markdown", - "id": "ccc3510d", + "id": "51512bc1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-and-scatter.ipynb b/line-and-scatter.ipynb index 5ddd71b06..ca2bf3825 100644 --- a/line-and-scatter.ipynb +++ b/line-and-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "80879206", + "id": "490eed3f", "metadata": {}, "source": [ "## Scatter plots with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aba1ed81", + "id": "90bfc33e", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f107dfe5", + "id": "7cfb945e", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "1b14fcc9", + "id": "8627d53a", "metadata": {}, "source": [ "#### Setting size and color with column names\n", @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c3bc737", + "id": "45a05947", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "45d00d13", + "id": "df270021", "metadata": {}, "source": [ "Color can be [continuous](https://plotly.com/python/colorscales/) as follows, or [discrete/categorical](https://plotly.com/python/discrete-color/) as above." @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03f1f5f7", + "id": "9f62782e", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "7656d5a8", + "id": "5db8f003", "metadata": {}, "source": [ "The `symbol` argument can be mapped to a column as well. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec2d65b2", + "id": "ac96d485", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "edecfdfc", + "id": "79375a80", "metadata": {}, "source": [ "## Scatter plots in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a89db08", + "id": "1685b9eb", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "91d19794", + "id": "cc89775c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "7244dadf", + "id": "d2f8f248", "metadata": {}, "source": [ "### Scatter plots and Categorical Axes\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4f4de4a", + "id": "2b04275d", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "439b2188", + "id": "56c9045f", "metadata": {}, "source": [ "### Grouped Scatter Points\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b34de3d3", + "id": "9767302d", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "63e9b407", + "id": "d0004808", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cb03bc3", + "id": "424a3eb3", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "08571e9f", + "id": "b6d080b7", "metadata": {}, "source": [ "### Error Bars\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0d443df", + "id": "32efb662", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "41d789d3", + "id": "52c2ffc6", "metadata": {}, "source": [ "### Marginal Distribution Plots\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "783306a5", + "id": "b71d49e7", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "c99b5015", + "id": "13226f8d", "metadata": {}, "source": [ "### Facetting\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d74aac5", + "id": "02057cfc", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "8e6a9c93", + "id": "ab3f9a59", "metadata": {}, "source": [ "### Linear Regression and Other Trendlines\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee504a5a", + "id": "6ad83ac3", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "576299c5", + "id": "b3be3669", "metadata": {}, "source": [ "## Line plots with Plotly Express" @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fca6d82", + "id": "e87fa8ab", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45cf0306", + "id": "b8567b1a", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "ed8e0e4a", + "id": "2ef9fd14", "metadata": {}, "source": [ "The `markers` argument can be set to `True` to show markers on lines." @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ed2c763", + "id": "765769fc", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "6ffe796c", + "id": "3271f589", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa171dab", + "id": "6e997571", "metadata": {}, "outputs": [], "source": [ @@ -399,7 +399,7 @@ }, { "cell_type": "markdown", - "id": "d17de553", + "id": "968d5065", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cedbf53a", + "id": "a6bea7d5", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "343bd325", + "id": "4fdebcef", "metadata": {}, "source": [ "### Data Order in Scatter and Line Charts\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f27b809", + "id": "0c0a0874", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "f039e2b3", + "id": "17ccfeb2", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -470,7 +470,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f1ab43e", + "id": "f0188f13", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "cb3f5565", + "id": "527bf321", "metadata": {}, "source": [ "### Swarm (or Beeswarm) Plots\n", @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adf71a53", + "id": "95ab25a2", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "bdc59f33", + "id": "8d027478", "metadata": {}, "source": [ "## Scatter and line plots with go.Scatter\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19b10d6b", + "id": "cd894e02", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "3c85bd43", + "id": "559cc81b", "metadata": {}, "source": [ "#### Line and Scatter Plots\n", @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4b78d7a", + "id": "ff20c408", "metadata": {}, "outputs": [], "source": [ @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "bb395534", + "id": "57dde237", "metadata": {}, "source": [ "#### Bubble Scatter Plots\n", @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33d86b89", + "id": "f7b91130", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "a72b71bc", + "id": "961d3f1f", "metadata": {}, "source": [ "#### Style Scatter Plots" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d7c0f1f", + "id": "dcd3d3cf", "metadata": {}, "outputs": [], "source": [ @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "7879aa70", + "id": "8c678e58", "metadata": {}, "source": [ "#### Data Labels on Hover" @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b8dd278", + "id": "05add019", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "ae5f53ed", + "id": "a606175b", "metadata": {}, "source": [ "#### Scatter with a Color Dimension" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9aaf417", + "id": "2fddaa62", "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "3e4c936e", + "id": "18fa5161", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "023b74dc", + "id": "9cfae1d6", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "0319b32a", + "id": "6f01f5ea", "metadata": {}, "source": [ "#### Large Data Sets\n", @@ -914,7 +914,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eec36849", + "id": "46567812", "metadata": {}, "outputs": [], "source": [ @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7c4eb64", + "id": "33605d22", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "b8dba7fb", + "id": "f7c6623c", "metadata": {}, "source": [ "### Reference\n", @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "a0d849da", + "id": "97f3997d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-charts.ipynb b/line-charts.ipynb index 28c9ad06b..e700639f5 100644 --- a/line-charts.ipynb +++ b/line-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4374aa64", + "id": "c3d19232", "metadata": {}, "source": [ "### Line Plots with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "975c44f9", + "id": "3ee42e21", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "52b4bb82", + "id": "2c4b221f", "metadata": {}, "source": [ "### Line Plots with column encoding color" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ffa22f1", + "id": "67220bf3", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "5fbbf818", + "id": "dd0809ac", "metadata": {}, "source": [ "### Line charts in Dash\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c1c4b2d", + "id": "23aed938", "metadata": { "hide_code": true, "tags": [] @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "58b06f66", + "id": "139207c4", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "5e271b88", + "id": "8a54bb9f", "metadata": {}, "source": [ "### Data Order in Line Charts\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb8457a3", + "id": "b7417756", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "ce0e45bd", + "id": "35c19da7", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b48607f3", + "id": "8f6806f0", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "3a9deaca", + "id": "df47c552", "metadata": {}, "source": [ "### Line charts with markers\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d244f964", + "id": "02d5b4f6", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "39f287c9", + "id": "2ac7c167", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2200cdf2", + "id": "fa95b07a", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "5aaa2ca2", + "id": "d4d5875c", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d23c9d18", + "id": "6748883f", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "8730f1e8", + "id": "6583238d", "metadata": {}, "source": [ "### Sparklines with Plotly Express\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fc5c084", + "id": "071f4167", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "c6d571a7", + "id": "6c90c4b0", "metadata": {}, "source": [ "### Line Plot with go.Scatter\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a4e1f8d", + "id": "34091d6a", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "cd039a42", + "id": "3b716ff0", "metadata": {}, "source": [ "#### Line Plot Modes" @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ed29a1f", + "id": "6f1226fa", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "6c8ce688", + "id": "c557e14c", "metadata": {}, "source": [ "#### Style Line Plots\n", @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57d49a9f", + "id": "d6597186", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "951651c4", + "id": "60c95515", "metadata": {}, "source": [ "#### Connect Data Gaps\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b898e2f8", + "id": "a4ad3d13", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "baeebc00", + "id": "be2fc104", "metadata": {}, "source": [ "#### Interpolation with Line Plots" @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "086c0e69", + "id": "e56b2661", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "c860ea6f", + "id": "5db6ff05", "metadata": {}, "source": [ "#### Label Lines with Annotations" @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc7d38d2", + "id": "5adba7ff", "metadata": {}, "outputs": [], "source": [ @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "0798d388", + "id": "18f1e8ef", "metadata": {}, "source": [ "#### Filled Lines" @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f637d39", + "id": "4b6aadfe", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "24a9a96e", + "id": "0d56f0c1", "metadata": {}, "source": [ "#### Reference\n", @@ -697,7 +697,7 @@ }, { "cell_type": "markdown", - "id": "3ffc601d", + "id": "03964443", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/linear-fits.ipynb b/linear-fits.ipynb index c09b3b61a..03cb7dedd 100644 --- a/linear-fits.ipynb +++ b/linear-fits.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "19786c20", + "id": "c8870257", "metadata": {}, "source": [ "### Linear fit trendlines with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2628f30e", + "id": "77963752", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "24613b60", + "id": "2cf92b54", "metadata": {}, "source": [ "### Fitting multiple lines and retrieving the model parameters\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08e5e198", + "id": "799d266a", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "cd015334", + "id": "b26fe510", "metadata": {}, "source": [ "### Displaying a single trendline with multiple traces\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5104db5", + "id": "bc56b1bb", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c28d6911", + "id": "f997dee5", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "09d008a4", + "id": "6d1df1a0", "metadata": {}, "source": [ "### OLS Parameters\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c2286cb", + "id": "c33376a8", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33edee36", + "id": "bbac0dae", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "a76e2e3c", + "id": "4d98c165", "metadata": {}, "source": [ "### Locally Weighted Scatterplot Smoothing (LOWESS)\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e187c917", + "id": "22e1c901", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "0f39ad5e", + "id": "f882edd0", "metadata": {}, "source": [ "_new in v5.2_\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a7bbba2", + "id": "5976555a", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "28504271", + "id": "f2d87948", "metadata": {}, "source": [ "### Moving Averages\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d9b5b2d", + "id": "66428d97", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6602c907", + "id": "b3604117", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d28db48e", + "id": "6c6993fd", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "9df478e4", + "id": "20127fe3", "metadata": {}, "source": [ "### Other Functions\n", @@ -257,7 +257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de2d85ef", + "id": "8ec44f9d", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d1c6a2c", + "id": "bbd39d7d", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "0394d2fb", + "id": "94c93da8", "metadata": {}, "source": [ "In some cases, it is necessary to pass options into the underying Pandas function, for example the `std` parameter must be provided if the `win_type` argument to `rolling` is `\"gaussian\"`. This is possible with the `function_args` trendline option." @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a5d629d", + "id": "fa60928f", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "c42737bc", + "id": "d276e5aa", "metadata": {}, "source": [ "### Displaying only the trendlines\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31c52a68", + "id": "309c9f0c", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5c03b5d", + "id": "4a1123fc", "metadata": { "lines_to_next_cell": 2 }, @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "c699bedb", + "id": "45df3237", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-maps.ipynb b/lines-on-maps.ipynb index 6a4218a56..89c265bff 100644 --- a/lines-on-maps.ipynb +++ b/lines-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67e250a5", + "id": "c2928e1e", "metadata": {}, "source": [ "Below we show how to create geographical line plots using either Plotly Express with `px.line_geo` function or the lower-level `go.Scattergeo` object.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f489e243", + "id": "2734583e", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "f23da482", + "id": "54e7ce81", "metadata": {}, "source": [ "### Lines on Maps from GeoPandas\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8fe0c9d", + "id": "eb98e759", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "9a3073f3", + "id": "d7259aa0", "metadata": {}, "source": [ "## Lines on Maps with plotly.graph_objects\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51fd9e30", + "id": "5f2e86dd", "metadata": { "lines_to_next_cell": 0 }, @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "257fc88b", + "id": "9a75b311", "metadata": {}, "source": [ "### Performance improvement: put many lines in the same trace\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41107c59", + "id": "5531415a", "metadata": { "lines_to_next_cell": 2 }, @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "e2024eb2", + "id": "3bb2de13", "metadata": {}, "source": [ "### London to NYC Great Circle" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52b69abf", + "id": "b15eaf6b", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "bd8494d6", + "id": "c1ea6c8c", "metadata": {}, "source": [ "### Contour lines on globe" @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1da59cd6", + "id": "64e91e7c", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "d4a3bdbe", + "id": "b6cd3da7", "metadata": {}, "source": [ "#### Reference\n", @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "d056510b", + "id": "6963d617", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-tile-maps.ipynb b/lines-on-tile-maps.ipynb index eaeeca893..f74f357dd 100644 --- a/lines-on-tile-maps.ipynb +++ b/lines-on-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cf98cd16", + "id": "e2a3341c", "metadata": {}, "source": [ "### Lines on tile maps using Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "253c4714", + "id": "5263f98f", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "b2634988", + "id": "ef7665e6", "metadata": {}, "source": [ "### Lines on maps from GeoPandas\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9a323cc", + "id": "de732e19", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "be73861a", + "id": "e92d35ab", "metadata": {}, "source": [ "### Lines on maps using `Scattermap` traces\n", @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa53afbd", + "id": "810e4e40", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "36e555de", + "id": "1d96c2a8", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f932a2fd", + "id": "d8f9623f", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "3d7373ed", + "id": "2b8490ce", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "d559f16a", + "id": "e9d14689", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/location-mode.ipynb b/location-mode.ipynb index cc25d3ee0..fb362a922 100644 --- a/location-mode.ipynb +++ b/location-mode.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67a4a12e", + "id": "2dbaa13f", "metadata": {}, "source": [ "# Locations for Outline-based Maps\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "925ed79b", + "id": "b8a376cd", "metadata": {}, "source": [ "## locationmode='ISO-3'\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59790039", + "id": "dbc5800c", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "62b043cb", + "id": "63e09d7f", "metadata": {}, "source": [ "## Supported ISO Codes\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "66270077", + "id": "4ed5f415", "metadata": {}, "source": [ "## locationmode='USA-states'\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05d3ab55", + "id": "92c473aa", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "e089aa82", + "id": "0a6b891c", "metadata": {}, "source": [ "## Supported US State Codes\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "ceda887e", + "id": "7403952d", "metadata": {}, "source": [ "## locationmode='country names'\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "101ab8bf", + "id": "307a7179", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "4bd3bb36", + "id": "4d1c5084", "metadata": {}, "source": [ "> How Plotly matches 'country names' will change in a future version. Matching will become stricter and some country names may no longer match. We recommend using `locationmode='ISO-3'` with ISO codes for `locations` to ensure consistent behavior across versions." @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7634bb47", + "id": "7d8e5010", "metadata": {}, "outputs": [], "source": [ @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "dee96fb5", + "id": "5bc2f640", "metadata": {}, "source": [ "## Using Different Data Types with `locations`\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5beae241", + "id": "a4b524cb", "metadata": { "lines_to_next_cell": 2 }, @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "cd9ce496", + "id": "48679bd5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/log-plot.ipynb b/log-plot.ipynb index 36d30d983..25e1a70c9 100644 --- a/log-plot.ipynb +++ b/log-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c141d059", + "id": "6e9e10b7", "metadata": {}, "source": [ "This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots) to follow a logarithmic rather than linear progression. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11f4ea5b", + "id": "123274a0", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "8f20a903", + "id": "523dd6c0", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with Plotly Express works the same was as with linear axes: using the `range_x` and `range_y` keywords. Note that you cannot set the range to include 0 or less." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f829210b", + "id": "fa9c2986", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "ae630603", + "id": "73c492db", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d7efa85", + "id": "c9f2a1b7", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "c38950d2", + "id": "411508bc", "metadata": {}, "source": [ "#### Controlling Minor Log Labels\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea1d7677", + "id": "9283bc53", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "b93fb271", + "id": "f9e63c48", "metadata": {}, "source": [ "### Logarithmic Axes with Graph Objects\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f78211ed", + "id": "81a1df70", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "df026c80", + "id": "a00254bd", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with `plotly.graph_objects` is *very different* than setting the range of linear axes: the range is set using the exponent rather than the actual value:\n" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4a07257", + "id": "6e5ea67c", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "c1624a85", + "id": "d36b6295", "metadata": {}, "source": [ "#### Reference\n", @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "270490f4", + "id": "71c178fe", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-configuration.ipynb b/map-configuration.ipynb index ce625265d..cc9fa6ec9 100644 --- a/map-configuration.ipynb +++ b/map-configuration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dbe13093", + "id": "47e1607c", "metadata": {}, "source": [ "### Tile Maps vs Outline Maps\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4371a18", + "id": "cb1832d4", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "c824b08f", + "id": "84bf29c7", "metadata": {}, "source": [ "Here is a map with all physical features enabled and styled, at a larger-scale 1:50m resolution:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83010c95", + "id": "5f7d618f", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "bc97bc62", + "id": "2caaac91", "metadata": {}, "source": [ "### Disabling Base Maps\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "781ecbc2", + "id": "90dff63f", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "c976bda9", + "id": "46179af3", "metadata": {}, "source": [ "### Cultural Base Maps\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3943eccb", + "id": "1d9b3440", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "469618e0", + "id": "811729a1", "metadata": {}, "source": [ "### Map Projections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c703dd5f", + "id": "aa319cc7", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "321573ef", + "id": "f96a53ba", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "879b4e22", + "id": "ef3848c1", "metadata": {}, "source": [ "Map projections can be rotated using the `layout.geo.projection.rotation` attribute, and maps can be translated using the `layout.geo.center` attributed, as well as truncated to a certain longitude and latitude range using the `layout.geo.lataxis.range` and `layout.geo.lonaxis.range`.\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc2b0bc6", + "id": "0941c3f0", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "f25b8b04", + "id": "9eb76e71", "metadata": {}, "source": [ "### Automatic Zooming or Bounds Fitting\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad7bea46", + "id": "ef8871f9", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "0136e34d", + "id": "708b2805", "metadata": {}, "source": [ "### Named Map Scopes and Country Sub-Units\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc9c1ae9", + "id": "644a28ff", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "5557eccb", + "id": "36fc9579", "metadata": {}, "source": [ "The `\"usa\"` scope contains state boundaries at both resolutions, and uses the special `'albers usa'` projection which moves Alaska and Hawaii closer to the \"lower 48 states\" to reduce projection distortion and produce a more compact map." @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc64cda9", + "id": "3511d27c", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "b88aa180", + "id": "8d329c6b", "metadata": {}, "source": [ "### Graticules (Latitude and Longitude Grid Lines)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffe02358", + "id": "7159b1d7", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "b9cc4d36", + "id": "a9100656", "metadata": {}, "source": [ "### Reference\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "17515412", + "id": "0ca3ea30", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-subplots-and-small-multiples.ipynb b/map-subplots-and-small-multiples.ipynb index 82041d1f4..0693de893 100644 --- a/map-subplots-and-small-multiples.ipynb +++ b/map-subplots-and-small-multiples.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "98333630", + "id": "bbed92e7", "metadata": {}, "source": [ "### US map small multiples" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8818c03", + "id": "fd2f3c60", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "ffaa8b5a", + "id": "6feb7f07", "metadata": {}, "source": [ "#### Reference\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "c290b201", + "id": "aaac32a2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marginal-plots.ipynb b/marginal-plots.ipynb index c0380074a..6bba07578 100644 --- a/marginal-plots.ipynb +++ b/marginal-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f03d45f9", + "id": "63266fc7", "metadata": {}, "source": [ "### Overview\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bf1fc0f", + "id": "972a6d19", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5b1d499", + "id": "20e381a4", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "4453ecbd", + "id": "6e3991ed", "metadata": {}, "source": [ "### Marginal Plots and Color\n", @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23990eb7", + "id": "77d1224a", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "37561b58", + "id": "94b5ca12", "metadata": {}, "source": [ "### Marginal Plots on Histograms\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e4b103f", + "id": "f8701e1d", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "10e2ae83", + "id": "59a06dd3", "metadata": {}, "source": [ "Try hovering over the rug plot points to identify individual country values in the histogram below:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4225f23e", + "id": "c7d359b8", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "740ffc71", + "id": "688a0132", "metadata": {}, "source": [ "### Marginal Plots and Facets\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeb9a397", + "id": "2644af77", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab3f4196", + "id": "8bb9dca4", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f70d8464", + "id": "bb4abb64", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "8171df46", + "id": "ed76e659", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marker-style.ipynb b/marker-style.ipynb index b0ddda5b5..da8bf34cf 100644 --- a/marker-style.ipynb +++ b/marker-style.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "743f8169", + "id": "30ae6394", "metadata": {}, "source": [ "### Add Marker Border\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67ff758e", + "id": "302b4dd9", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "36fb3ff7", + "id": "add7cfbd", "metadata": {}, "source": [ "Here is an example that creates an empty graph object figure, and then adds two scatter traces with a marker border." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4150ae23", + "id": "7c1b6901", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "27af5d3b", + "id": "894d199a", "metadata": {}, "source": [ "Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density.\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b59cca0", + "id": "4049aa1d", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "c9c4c0cc", + "id": "e952bb08", "metadata": {}, "source": [ "You can also pass an array of dash styles to set different styles per marker:" @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "740aa001", + "id": "7586c8c8", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "ca9e4156", + "id": "e03b0b8c", "metadata": {}, "source": [ "The `marker.line.dash` attribute is available on `go.Scatter`, `go.Scatterpolar`, `go.Scattergeo`, `go.Scatterternary`, `go.Scattercarpet`, and `go.Scattersmith` traces.\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7d558f0", + "id": "d49f0362", "metadata": { "hide_code": true }, @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "33458141", + "id": "d9c52ff9", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "651de644", + "id": "3967b8cd", "metadata": {}, "source": [ "### Opacity\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "642cde3e", + "id": "c0964db2", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "a2ba95fe", + "id": "0548a8f8", "metadata": {}, "source": [ "### Marker Opacity\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb68934a", + "id": "fe926e10", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "dff2bab1", + "id": "b36ff6a4", "metadata": {}, "source": [ "### Color Opacity\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8eddfc95", + "id": "30edfd81", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ }, { "cell_type": "markdown", - "id": "f6a62dd3", + "id": "f03c00b9", "metadata": {}, "source": [ "### Custom Marker Symbols\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5975009", + "id": "6fe6dd86", "metadata": { "lines_to_next_cell": 2 }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "c37e1f9c", + "id": "72f7b904", "metadata": {}, "source": [ "### Using a Custom Marker\n", @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30cf1ed7", + "id": "7a122ec1", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "f87b7b9d", + "id": "88d9a8dc", "metadata": {}, "source": [ "#### Open Marker Colors\n", @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e185e98e", + "id": "15c63209", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "e1e73c51", + "id": "d8c5d155", "metadata": {}, "source": [ "### Setting Marker Angles" @@ -560,7 +560,7 @@ }, { "cell_type": "markdown", - "id": "415647d3", + "id": "59085790", "metadata": {}, "source": [ "*New in 5.11*\n", @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b931efd7", + "id": "7c6b0fd8", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "59f40f28", + "id": "682f747f", "metadata": {}, "source": [ "### Setting Angle Reference\n", @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dad1cab", + "id": "41c03707", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "70028634", + "id": "9a272ccb", "metadata": {}, "source": [ "### Using Standoff to Position a Marker\n", @@ -651,7 +651,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eae5bc4c", + "id": "3fb13b27", "metadata": {}, "outputs": [], "source": [ @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "40b68f88", + "id": "8b7d6a22", "metadata": {}, "source": [ "### Reference\n", @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "ba03e292", + "id": "5d6bf9e9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/migrate-to-maplibre.ipynb b/migrate-to-maplibre.ipynb index e546d9fba..a237de658 100644 --- a/migrate-to-maplibre.ipynb +++ b/migrate-to-maplibre.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "da30e9bf", + "id": "4faab1b9", "metadata": {}, "source": [ "## Migrating from Mapbox traces to MapLibre traces\n", @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "96edce77", + "id": "bd1c4cd3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/mixed-subplots.ipynb b/mixed-subplots.ipynb index f950c2563..1a6969449 100644 --- a/mixed-subplots.ipynb +++ b/mixed-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "74f11ec8", + "id": "44b51f14", "metadata": {}, "source": [ "### Mixed Subplots and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "ea632977", + "id": "fe1da30b", "metadata": {}, "source": [ "#### Mixed Subplot" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eac98e10", + "id": "1d7dd9b5", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "894087d3", + "id": "26f66f7c", "metadata": {}, "source": [ "#### Reference\n", @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "2ac656b4", + "id": "1c0958a3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-knn.ipynb b/ml-knn.ipynb index be66c9057..f74ee6dd6 100644 --- a/ml-knn.ipynb +++ b/ml-knn.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "746a64e5", + "id": "bb5c8337", "metadata": {}, "source": [ "## Basic binary classification with kNN\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "7e4b85f3", + "id": "dfaca749", "metadata": {}, "source": [ "### Display training and test splits\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64915ba2", + "id": "529bfe15", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "9c7d68ca", + "id": "fd2d83bd", "metadata": {}, "source": [ "### Visualize predictions on test split with [`plotly.express`](https://plotly.com/python/plotly-express/)" @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "a0c20a59", + "id": "97d5f120", "metadata": {}, "source": [ "Now, we train the kNN model on the same training data displayed in the previous graph. Then, we predict the confidence score of the model for each of the data points in the test set. We will use shapes to denote the true labels, and the color will indicate the confidence of the model for assign that score.\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fe8dbcd", + "id": "31d03500", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "14191034", + "id": "4516d6bf", "metadata": {}, "source": [ "## Probability Estimates with `go.Contour`\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a84d8ad2", + "id": "aad13af2", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "11a856c8", + "id": "7ded2011", "metadata": {}, "source": [ "Now, let's try to combine our `go.Contour` plot with the first scatter plot of our data points, so that we can visually compare the confidence of our model with the true labels." @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d811b65", + "id": "243bac8f", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "0d00ac0f", + "id": "c4360d75", "metadata": {}, "source": [ "## k-NN classification in Dash\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6868a83", + "id": "af767669", "metadata": { "hide_code": true }, @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "239b1988", + "id": "8506bff5", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "812cf351", + "id": "a537240b", "metadata": {}, "source": [ "## Multi-class prediction confidence with [`go.Heatmap`](https://plotly.com/python/heatmaps/)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "075df98a", + "id": "5c92a22e", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "01ab4fb3", + "id": "f0a9d8a8", "metadata": {}, "source": [ "### Reference\n", @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "cf18d325", + "id": "e87462bd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-pca.ipynb b/ml-pca.ipynb index 84e4842cf..b821a0254 100644 --- a/ml-pca.ipynb +++ b/ml-pca.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "963da736", + "id": "5cd43b67", "metadata": {}, "source": [ "This page first shows how to visualize higher dimension data using various Plotly figures combined with dimensionality reduction (aka projection). Then, we dive into the specific details of our projection algorithm.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "21eb9cbc", + "id": "fe8882ac", "metadata": {}, "source": [ "## High-dimensional PCA Analysis with `px.scatter_matrix`\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "cf7fb909", + "id": "5c0b80e0", "metadata": {}, "source": [ "### Visualize all the original dimensions\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eda9a4a", + "id": "9b4a9221", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "858641fe", + "id": "51f88485", "metadata": {}, "source": [ "### Visualize all the principal components\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88ff3111", + "id": "697d7571", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "26bad7eb", + "id": "10d5ee43", "metadata": {}, "source": [ "### Visualize a subset of the principal components\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "501e21ff", + "id": "7ace9f84", "metadata": { "lines_to_next_cell": 2 }, @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "6e84b0ae", + "id": "2f478c87", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "b8a35a21", + "id": "f7107466", "metadata": {}, "source": [ "## 2D PCA Scatter Plot\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7df650be", + "id": "51c99619", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "63efd2f6", + "id": "9ba045a9", "metadata": {}, "source": [ "## Visualize PCA with `px.scatter_3d`\n", @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d6ab269", + "id": "d51fb8c5", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "e7c86f57", + "id": "5bb94f32", "metadata": {}, "source": [ "## Plotting explained variance\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33f754d2", + "id": "a1cdf4f2", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "bb63fd63", + "id": "2bc4a19a", "metadata": {}, "source": [ "## Visualize Loadings\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4ed45a6", + "id": "bdeb91e0", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "eff7cb94", + "id": "1224f153", "metadata": {}, "source": [ "## References\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "dc79ce31", + "id": "c453a85d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-regression.ipynb b/ml-regression.ipynb index 98f5cebc6..9063b8d60 100644 --- a/ml-regression.ipynb +++ b/ml-regression.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5ba476a1", + "id": "9a03cfcc", "metadata": {}, "source": [ "This page shows how to use Plotly charts for displaying various types of regression models, starting from simple models like [Linear Regression](https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html), and progressively move towards models like [Decision Tree][tree] and [Polynomial Features][poly]. We highlight various capabilities of plotly, such as comparative analysis of the same model with different parameters, displaying Latex, [surface plots](https://plotly.com/python/3d-surface-plots/) for 3D data, and enhanced prediction error analysis with [Plotly Express](https://plotly.com/python/plotly-express/).\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "84f33f90", + "id": "c1c25694", "metadata": {}, "source": [ "## Basic linear regression plots\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbd0b22e", + "id": "d607eb0a", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "f381465f", + "id": "29989221", "metadata": {}, "source": [ "### Linear Regression with scikit-learn\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "841acebb", + "id": "5d1dfb9a", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "1dda3dfa", + "id": "f630c89b", "metadata": {}, "source": [ "### ML Regression in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77146fef", + "id": "3c0e0d8a", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "9c6dbdbf", + "id": "846f94de", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "4f0f27ed", + "id": "58630991", "metadata": {}, "source": [ "## Model generalization on unseen data\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d41a49a", + "id": "e7745fee", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "d9038be2", + "id": "931c5af3", "metadata": {}, "source": [ "## Comparing different kNN models parameters\n", @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7afb04d7", + "id": "0fc2e619", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "9336c598", + "id": "dd2da56e", "metadata": {}, "source": [ "## Displaying `PolynomialFeatures` using $\\LaTeX$\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbb19313", + "id": "594ca02d", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "8487b934", + "id": "d403525f", "metadata": {}, "source": [ "## 3D regression surface with `px.scatter_3d` and `go.Surface`\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e4057ae", + "id": "54a45f47", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "086969e7", + "id": "7d6ca420", "metadata": {}, "source": [ "## Visualizing coefficients for multiple linear regression (MLR)\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d37f373", + "id": "9e0f4245", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "b1a49481", + "id": "dd9d6a70", "metadata": {}, "source": [ "## Prediction Error Plots\n", @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "7bb7e9ee", + "id": "4ec8fb57", "metadata": {}, "source": [ "### Simple actual vs predicted plot\n", @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "183b11a6", + "id": "4dfb6c82", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "4fef896b", + "id": "287fc65b", "metadata": {}, "source": [ "### Enhanced prediction error analysis using `plotly.express`\n", @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a477ae7", + "id": "96ed2e2f", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "86cacf4c", + "id": "b02bd157", "metadata": {}, "source": [ "## Residual plots\n", @@ -477,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d6c4498", + "id": "889aa3ca", "metadata": {}, "outputs": [], "source": [ @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "4fa6a920", + "id": "2c4e82fc", "metadata": {}, "source": [ "## Visualize regularization across cross-validation folds" @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "27920d89", + "id": "e2e19159", "metadata": {}, "source": [ "In this example, we show how to plot the results of various $\\alpha$ penalization values from the results of cross-validation using scikit-learn's `LassoCV`. This is useful to see how much the error of the optimal alpha actually varies across CV folds." @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2839c9fe", + "id": "b7d27e64", "metadata": {}, "outputs": [], "source": [ @@ -598,7 +598,7 @@ }, { "cell_type": "markdown", - "id": "96687c3c", + "id": "7def7931", "metadata": {}, "source": [ "## Grid search visualization using `px.density_heatmap` and `px.box`\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "018eec4f", + "id": "2b309736", "metadata": {}, "outputs": [], "source": [ @@ -686,7 +686,7 @@ }, { "cell_type": "markdown", - "id": "0ad8d45e", + "id": "9611e244", "metadata": {}, "source": [ "### Reference\n", @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "15f671e7", + "id": "b2bee45c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-roc-pr.ipynb b/ml-roc-pr.ipynb index 84e3d0c5c..dc9a69fda 100644 --- a/ml-roc-pr.ipynb +++ b/ml-roc-pr.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1d7390a6", + "id": "b73094d1", "metadata": {}, "source": [ "## Preliminary plots\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78b1dd8a", + "id": "adeff62b", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "b01e8072", + "id": "f2ea07b9", "metadata": {}, "source": [ "## Basic binary ROC curve\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b931e7ea", + "id": "085d8ceb", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "b9e8faf3", + "id": "26cf89ea", "metadata": {}, "source": [ "## ROC curve in Dash\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60718ef8", + "id": "0775d8fd", "metadata": { "hide_code": true }, @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "79c80934", + "id": "b67da6f1", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "0f8704ca", + "id": "b2377eab", "metadata": {}, "source": [ "## Multiclass ROC Curve\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cab5a36", + "id": "97df11e1", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "078f3867", + "id": "c6ed318f", "metadata": {}, "source": [ "## Precision-Recall Curves\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48046ca4", + "id": "f81d396c", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "3c0f6540", + "id": "24bf1d14", "metadata": {}, "source": [ "In this example, we use the [average precision](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html) metric, which is an alternative scoring method to the area under the PR curve." @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e349369", + "id": "c3d7e1fe", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "d2311b98", + "id": "ebdcdde1", "metadata": {}, "source": [ "## References\n", @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "221ba1ad", + "id": "37ba1da4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-tsne-umap-projections.ipynb b/ml-tsne-umap-projections.ipynb index ae566e83c..931397c0d 100644 --- a/ml-tsne-umap-projections.ipynb +++ b/ml-tsne-umap-projections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "89a145c7", + "id": "06722431", "metadata": {}, "source": [ "This page presents various ways to visualize two popular dimensionality reduction techniques, namely the [t-distributed stochastic neighbor embedding](https://lvdmaaten.github.io/tsne/) (t-SNE) and [Uniform Manifold Approximation and Projection](https://umap-learn.readthedocs.io/en/latest/index.html) (UMAP). They are needed whenever you want to visualize data with more than two or three features (i.e. dimensions).\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "096d941b", + "id": "1f2da6b6", "metadata": {}, "source": [ "## Basic t-SNE projections\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "92b0ec18", + "id": "ace94622", "metadata": {}, "source": [ "### Visualizing high-dimensional data with `px.scatter_matrix`\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b55f346", + "id": "0d982ef0", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "ffee7b2a", + "id": "e56bcc88", "metadata": {}, "source": [ "### Project data into 2D with t-SNE and `px.scatter`\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70cf16a3", + "id": "ae977783", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "64c98c8d", + "id": "c94f06b6", "metadata": {}, "source": [ "### Project data into 3D with t-SNE and `px.scatter_3d`\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9940388", + "id": "3bdfcc21", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "3f9e37c3", + "id": "9e7b009b", "metadata": {}, "source": [ "## Projections with UMAP\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e63707e0", + "id": "a743b385", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "2a0c441f", + "id": "5d70e213", "metadata": {}, "source": [ "## Visualizing image datasets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ad1bb77", + "id": "772e2d64", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "4ca935e1", + "id": "71c059d2", "metadata": { "lines_to_next_cell": 2 }, @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "21c7f9bc", + "id": "4dcfeab6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml_apps.ipynb b/ml_apps.ipynb index 6ee727952..70558d00b 100644 --- a/ml_apps.ipynb +++ b/ml_apps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8dbbb34c", + "id": "b2696114", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "4dd1a0b2", + "id": "89da2bba", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/multiple-axes.ipynb b/multiple-axes.ipynb index d46ad3880..d2a237bea 100644 --- a/multiple-axes.ipynb +++ b/multiple-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "33bfe68a", + "id": "e16d5b94", "metadata": {}, "source": [ "### Multiple Y Axes and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "0605a6bc", + "id": "22963020", "metadata": {}, "source": [ "#### Two Y Axes" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecdb999a", + "id": "dc81fd7e", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "55531d30", + "id": "fc8ed0ba", "metadata": {}, "source": [ "### Multiple axes in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "670704b1", + "id": "3bd2b7d0", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "67291e2b", + "id": "15f1d4e1", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "2bd961f4", + "id": "db46a912", "metadata": {}, "source": [ "#### Multiple Y-Axes Subplots" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "160eb03d", + "id": "79b10e9a", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "a59f3e11", + "id": "d783d767", "metadata": {}, "source": [ "#### Multiple Axes\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a35e6512", + "id": "6f67b6b7", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "c9785f32", + "id": "9aef4ff0", "metadata": {}, "source": [ "#### Automatically Shifting Axes\n", @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "390d3e73", + "id": "5f7a6a4d", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "32aeaa92", + "id": "6df722a8", "metadata": {}, "source": [ "### Shift Axes by a Specific Number of Pixels\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeb5222f", + "id": "a227ad63", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "1c0152cf", + "id": "83757463", "metadata": {}, "source": [ "### Sync Axes Ticks" @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "b652fe55", + "id": "8860f934", "metadata": {}, "source": [ "*New in 5.13*\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89791c37", + "id": "fa3f74c4", "metadata": {}, "outputs": [], "source": [ @@ -506,7 +506,7 @@ }, { "cell_type": "markdown", - "id": "f5e26098", + "id": "2ae2e59d", "metadata": {}, "source": [ "#### Reference\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "fe8b6e59", + "id": "5cc0140a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/network-graphs.ipynb b/network-graphs.ipynb index 3bd829d6f..6bf914372 100644 --- a/network-graphs.ipynb +++ b/network-graphs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4295591c", + "id": "8163e7ce", "metadata": {}, "source": [ "In this example we show how to visualize a network graph created using `networkx`.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "5d672c8d", + "id": "79a59a64", "metadata": {}, "source": [ "### Create random graph" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2b23574", + "id": "76c03877", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "fa2a3bf9", + "id": "72119742", "metadata": {}, "source": [ "#### Create Edges\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74ae611a", + "id": "4eb295e8", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "756cb695", + "id": "6ce36589", "metadata": {}, "source": [ "#### Color Node Points\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69a2ccc7", + "id": "ba87356f", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "daedfe2e", + "id": "10c82c67", "metadata": {}, "source": [ "#### Create Network Graph" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "904c6df4", + "id": "f111901c", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "8aaf0405", + "id": "ad7654b1", "metadata": {}, "source": [ "### Network graphs in Dash\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41976fdf", + "id": "0df19240", "metadata": { "hide_code": true }, @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "9f2dc7db", + "id": "67fbe583", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "9d6b43d1", + "id": "f1e9386f", "metadata": {}, "source": [ "#### Reference\n", @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "24bdc896", + "id": "b2f6cdb7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ohlc-charts.ipynb b/ohlc-charts.ipynb index 0b4ab46e5..37eca27b2 100644 --- a/ohlc-charts.ipynb +++ b/ohlc-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7a61cce3", + "id": "d4c51239", "metadata": {}, "source": [ "The [OHLC](https://en.wikipedia.org/wiki/Open-high-low-close_chart) chart (for open, high, low and close) is a style of financial chart describing open, high, low and close values for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. 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.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6010561", + "id": "30933eff", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "5fdcb03c", + "id": "fa0a996e", "metadata": {}, "source": [ "#### OHLC Chart without Rangeslider" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3939da0e", + "id": "b9103b00", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "da631e4b", + "id": "5d9bf54c", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90c16d9b", + "id": "88aa6fc5", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "870df3fa", + "id": "b301ca04", "metadata": {}, "source": [ "#### Custom OHLC Colors" @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48f4ef1d", + "id": "ec4daefc", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "6ad95b3b", + "id": "c2c4c5bd", "metadata": {}, "source": [ "#### Simple OHLC with `datetime` Objects" @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ce1e862", + "id": "5b73fa7b", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "6661569d", + "id": "ed630d0a", "metadata": {}, "source": [ "### Custom Hovertext" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f691fb51", + "id": "931c9557", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "b7263c96", + "id": "13714e38", "metadata": {}, "source": [ "#### Reference\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "856ed780", + "id": "c4eb62f8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/orca-management.ipynb b/orca-management.ipynb index 7e9194666..d70dd4beb 100644 --- a/orca-management.ipynb +++ b/orca-management.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f76d64b1", + "id": "82883336", "metadata": { "lines_to_next_cell": 0 }, @@ -28,7 +28,7 @@ }, { "cell_type": "raw", - "id": "c855ff8a", + "id": "e5b99d2a", "metadata": {}, "source": [ "$ conda install -c plotly plotly-orca==1.2.1 psutil requests" @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "e927af69", + "id": "49dea3eb", "metadata": {}, "source": [ "**Note:** Even if you do not want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca==1.2.1` and the orca executable will be available system wide.\n", @@ -47,7 +47,7 @@ }, { "cell_type": "raw", - "id": "77a29943", + "id": "4c85ee56", "metadata": {}, "source": [ "$ npm install -g electron@1.8.4 orca\n", @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "2ff5544c", + "id": "d9af6bcf", "metadata": {}, "source": [ "##### Standalone Binaries + pip\n", @@ -65,7 +65,7 @@ }, { "cell_type": "raw", - "id": "c734073c", + "id": "cc526ab5", "metadata": {}, "source": [ "$ pip install psutil requests" @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "f6859345", + "id": "6d09c673", "metadata": {}, "source": [ "### Install orca on Google Colab\n", @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "d4f67287", + "id": "155fdbe6", "metadata": {}, "source": [ "### Create a Figure\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51ba0f94", + "id": "f5dcab5b", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "5a38fec2", + "id": "76e789fd", "metadata": {}, "source": [ "### config\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4bbdf59", + "id": "8b55bf29", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "00092064", + "id": "98bce523", "metadata": {}, "source": [ "### status\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f080c08", + "id": "4d0c3ffd", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "9d983818", + "id": "fb0238bd", "metadata": {}, "source": [ "Since no image export operations have been performed yet, the orca server is not yet running.\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8a9864a", + "id": "319218b7", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "2351a494", + "id": "ee6eec6c", "metadata": {}, "source": [ "By checking the `status` object again, we see that the orca server is now running" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "680e3cd9", + "id": "4eac986f", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "177b2b15", + "id": "d34b33ad", "metadata": {}, "source": [ "Let's perform this same export operation again, now that the server is already running." @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ed2880a", + "id": "93165764", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "36b858e5", + "id": "fd107f6f", "metadata": {}, "source": [ "The difference in runtime is dramatic. Starting the server and exporting the first image takes a couple seconds, while exporting an image with a running server is much faster." @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "c6fe5e53", + "id": "528fdf87", "metadata": {}, "source": [ "### Shutdown the Server\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a3e2fd5", + "id": "472753ca", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d517ed44", + "id": "137eef59", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77f65873", + "id": "6a5c3051", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "45702265", + "id": "105074ea", "metadata": {}, "source": [ "### Configuring the Executable\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "54392400", + "id": "f4ea69d5", "metadata": {}, "source": [ "### Other Configuration Settings\n", @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "afb5adb7", + "id": "ad08fc15", "metadata": {}, "source": [ "### Saving Configuration Settings\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "e50b58e4", + "id": "fbd4d778", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pandas-backend.ipynb b/pandas-backend.ipynb index 7e1c10696..cd9e21029 100644 --- a/pandas-backend.ipynb +++ b/pandas-backend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a3fbbf2a", + "id": "36b39d74", "metadata": {}, "source": [ "### Introduction\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48c65d17", + "id": "fd30f7d5", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "3fe1e775", + "id": "22c7c1a1", "metadata": {}, "source": [ "This functionality wraps [Plotly Express](/python/plotly-express/) and so you can use any of the [styling options available to Plotly Express methods](/python/styling-plotly-express/). Since what you get back is a regular `Figure` object, you can use any of the update mechanisms supported by these objects to apply [templates](/python/templates/) or further customize [axes](/python/axes/), [colors](/python/colorscales/), [legends](/python/legend/), [fonts](/python/figure-labels/), [hover labels](/python/hover-text-and-formatting/) etc. [Faceting](/python/facet-plots/) is also supported." @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd01dea0", + "id": "34329569", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "73e2dee1", + "id": "06190434", "metadata": {}, "source": [ "### A Note on API Compatibility\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5470b087", + "id": "514b59ec", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "854be9a4", + "id": "1a9ac8c0", "metadata": {}, "source": [ "To achieve a similar effect to `subplots=True`, for example, the [Plotly Express `facet_row` and `facet_col` options](/python/facet-plots/) can be used, the same was as they work when directly calling [Plotly Express with wide-form data](/python/wide-form/):" @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f4d2403", + "id": "da5be69d", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "468c77a3", + "id": "8128dfe1", "metadata": {}, "source": [ "### Supported Methods\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3af58835", + "id": "a78f2374", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "049162f3", + "id": "d543b3af", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d08e94b", + "id": "73bd4f78", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36d83b1f", + "id": "346a2525", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42bfc7d6", + "id": "bb84beae", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bed158d0", + "id": "814e851e", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ebc03862", + "id": "105a5704", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "dfb8e1f5", + "id": "4d1c86be", "metadata": {}, "source": [ "### `Series` and `DataFrame` functions: `hist` and `boxplot`\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84753870", + "id": "e90f4def", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "ada7e63c", + "id": "30d7af4e", "metadata": {}, "source": [ "### What about Cufflinks?\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "77859d8d", + "id": "98eea77d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-categories-diagram.ipynb b/parallel-categories-diagram.ipynb index 3155147ae..fb9cebf23 100644 --- a/parallel-categories-diagram.ipynb +++ b/parallel-categories-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2b51ee30", + "id": "b7362bac", "metadata": {}, "source": [ "#### Parallel Categories Diagram\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0faad004", + "id": "13e6ad38", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "822bed14", + "id": "f91f3a36", "metadata": {}, "source": [ "#### Style Diagram\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c0723a6", + "id": "1a51b448", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "d13642e8", + "id": "db498a39", "metadata": {}, "source": [ "### Basic Parallel Categories Diagram with `graph_objects`\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8fdbe02", + "id": "4c9e4c56", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "34e40a64", + "id": "af04efc5", "metadata": {}, "source": [ "#### Basic Parallel Categories Diagram with Counts\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4efe0ee", + "id": "f7f9d062", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "3e203283", + "id": "ebe8ac15", "metadata": {}, "source": [ "#### Multi-Color Parallel Categories Diagram\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8495ff93", + "id": "e8b129da", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "9364b116", + "id": "156bf3ae", "metadata": {}, "source": [ "#### Parallel Categories Linked Brushing\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcb4fcbe", + "id": "9f40996b", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "5e55db62", + "id": "7a61407c", "metadata": {}, "source": [ "![Single-color brushing](https://user-images.githubusercontent.com/15064365/48087050-4a3eae80-e1cc-11e8-94c9-c0ffcedd3aa9.gif)\n", @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fa4b512", + "id": "47e0aa95", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "925f7be7", + "id": "04f3ecda", "metadata": {}, "source": [ "![Multi-color brushing](https://user-images.githubusercontent.com/15064365/48087055-4e6acc00-e1cc-11e8-8f0c-c8316eb4def2.gif)\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "b6e37dbc", + "id": "1f984713", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-coordinates-plot.ipynb b/parallel-coordinates-plot.ipynb index dadc93512..2017163b3 100644 --- a/parallel-coordinates-plot.ipynb +++ b/parallel-coordinates-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "50ca97a7", + "id": "e6882fa0", "metadata": {}, "source": [ "## Parallel Coordinates plot with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f2e4dfd", + "id": "ed3f4e22", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "1f36c221", + "id": "ea4240e8", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions.\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6f4094e", + "id": "d7c2e0df", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "980d56c0", + "id": "63dee91a", "metadata": {}, "source": [ "## Parallel Coordinates Chart with go.Parcoords" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e66dfc25", + "id": "65eecc7b", "metadata": { "inputHidden": false, "outputHidden": false @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "b94c60ce", + "id": "2cdd78b8", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions and drag the axis names across the plot to rearrange variables.\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4d40080", + "id": "88fc8eb1", "metadata": { "inputHidden": false, "outputHidden": false @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "c4ebd052", + "id": "b674fb7f", "metadata": {}, "source": [ "### Advanced Parallel Coordinates Plot" @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5219fd5", + "id": "c08380d1", "metadata": { "inputHidden": false, "outputHidden": false @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "e6b58729", + "id": "2860e516", "metadata": {}, "source": [ "### Unselected Line Color and Opacity" @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "f1bb2a23", + "id": "596d13ea", "metadata": {}, "source": [ "*New in 5.10*\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c786aea", + "id": "c424e7df", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "6d0931b5", + "id": "341ee70e", "metadata": {}, "source": [ "#### Reference\n", @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "b5fba44a", + "id": "d033f96e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pattern-hatching-texture.ipynb b/pattern-hatching-texture.ipynb index db2db63a0..a268ed57c 100644 --- a/pattern-hatching-texture.ipynb +++ b/pattern-hatching-texture.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "189767cc", + "id": "1d745160", "metadata": {}, "source": [ "*New in 5.0, with support for pie, sunburst, icicle, funnelarea, and treemap charts in 5.15*\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "229ff735", + "id": "d0a32f88", "metadata": {}, "source": [ "### Patterned Charts with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "513a3ebf", + "id": "cd57d33f", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f632b5cd", + "id": "d8f5a24f", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "6aa66cb7", + "id": "3f2671d1", "metadata": {}, "source": [ "In the chart below we use `px.histogram()` instead of `px.bar()` to aggregate multiple values together, and encode one variable (sex) using both color and x-position and another (smoker) using patterns:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cda7c54", + "id": "a3bfd0b2", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "6bab8905", + "id": "a7aed0dc", "metadata": {}, "source": [ "### Controlling Pattern Assignment\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16db51ab", + "id": "3dce1326", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "46aa9e30", + "id": "7153e63d", "metadata": {}, "source": [ "Here we use `pattern_shape_map` to explictly assign a shape to each value of `nation`, regardless of order:" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51e87371", + "id": "a53f79d8", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "a5a5b103", + "id": "c5803420", "metadata": {}, "source": [ "### Black on White Patterns for Print\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f22a24d8", + "id": "7ac0f43d", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "4eea539c", + "id": "1761e330", "metadata": {}, "source": [ "Of course, this setting can be used without making the figure monochrome as well:" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5783afa7", + "id": "3c282946", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "99bd82d7", + "id": "a36308eb", "metadata": {}, "source": [ "### Patterns using Graph Objects\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "994e90f3", + "id": "42ec05fd", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "a2625630", + "id": "98d98205", "metadata": {}, "source": [ "### Patterns Using SVG Paths\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0de2933", + "id": "f2b39327", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "f5ff871f", + "id": "82968514", "metadata": {}, "source": [ "#### Reference\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "be7d1256", + "id": "772222ca", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/peak-finding.ipynb b/peak-finding.ipynb index 13a9945ef..198c7c7b8 100644 --- a/peak-finding.ipynb +++ b/peak-finding.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "241bcb88", + "id": "907fc2b7", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83b2856f", + "id": "a1851455", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "a433a013", + "id": "38b63953", "metadata": {}, "source": [ "#### Import Data\n", @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dacacd6c", + "id": "beca6850", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "c7d241c3", + "id": "ffe07126", "metadata": {}, "source": [ "#### Peak Detection\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d89e56", + "id": "fa73175a", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "d5f9c026", + "id": "6a131cb7", "metadata": {}, "source": [ "#### Only Highest Peaks\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a4a5bba", + "id": "022370bb", "metadata": { "lines_to_next_cell": 2 }, @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "0683df2e", + "id": "2e285d6d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/performance.ipynb b/performance.ipynb index 5927fd256..81174d1ac 100644 --- a/performance.ipynb +++ b/performance.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4cfb64d5", + "id": "e73c74c3", "metadata": {}, "source": [ "## DataFrame Types\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0726dff5", + "id": "bdac6aff", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "eb8b658c", + "id": "dcc7aaf6", "metadata": {}, "source": [ "## WebGL\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "a86ef183", + "id": "e6ecaa92", "metadata": {}, "source": [ "```\n", @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "7775f9ff", + "id": "d7b37e3c", "metadata": {}, "source": [ "### WebGL for Scatter Performance\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3184251", + "id": "757d395f", "metadata": { "lines_to_next_cell": 2 }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "944c6264", + "id": "ba369291", "metadata": {}, "source": [ "#### WebGL with 1,000,000 points with Graph Objects\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e7ef3eb", + "id": "598c0cc2", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "69d90f5c", + "id": "143acab9", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76eea6b1", + "id": "29efa911", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "27f10a1f", + "id": "abd3f3f3", "metadata": {}, "source": [ "### Exploring Correlations of a Large Dataset\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d0852f9", + "id": "a8158a09", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84593954", + "id": "41ae2a71", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "ba1af18f", + "id": "3a3c44d7", "metadata": {}, "source": [ "Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.\n" @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "d7db8a27", + "id": "c9220c2c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pie-charts.ipynb b/pie-charts.ipynb index 218b926c7..24f684c4e 100644 --- a/pie-charts.ipynb +++ b/pie-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d86097be", + "id": "ba711fcd", "metadata": {}, "source": [ "A pie chart is a circular statistical chart, which is divided into sectors to illustrate numerical proportion.\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1c7cfa9", + "id": "be66b8dd", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "d07e432d", + "id": "b2efa9d6", "metadata": {}, "source": [ "### Pie chart with repeated labels\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b2fb902", + "id": "5a0ccc7a", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "43d174f1", + "id": "69dac473", "metadata": {}, "source": [ "### Pie chart in Dash\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dc2b01e", + "id": "8eca124b", "metadata": { "hide_code": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "768260fa", + "id": "a46eae72", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "5181ee41", + "id": "a14b87a8", "metadata": {}, "source": [ "### Setting the color of pie sectors with px.pie" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36353098", + "id": "81ab4c0e", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "f651bd9c", + "id": "5bb61cd6", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfb9e5a9", + "id": "6b40bc86", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "d32dedd3", + "id": "3f068947", "metadata": {}, "source": [ "### Customizing a pie chart created with px.pie\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37f0ee92", + "id": "a233ac66", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "f8814869", + "id": "0545e33d", "metadata": {}, "source": [ "### Basic Pie Chart with go.Pie\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "913ec0c5", + "id": "d9935348", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "9a9f4e15", + "id": "465b26d3", "metadata": {}, "source": [ "### Styled Pie Chart\n", @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba307e38", + "id": "c0ebc38f", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "71a71c72", + "id": "dd3fd392", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3c4ded1", + "id": "14a6815c", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "99352b35", + "id": "cde02a21", "metadata": {}, "source": [ "#### Controlling text orientation inside pie sectors\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ab4b839", + "id": "85c5a479", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "95a92646", + "id": "6cf23197", "metadata": {}, "source": [ "### Donut Chart" @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "344f0802", + "id": "d2eff551", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "11818276", + "id": "9e16c93f", "metadata": {}, "source": [ "### Pulling sectors out from the center\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ff142e9", + "id": "de9f86a6", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "e8c89b72", + "id": "9d0ec7f7", "metadata": {}, "source": [ "### Pie Charts in subplots" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70cd0a7f", + "id": "33dadd39", "metadata": {}, "outputs": [], "source": [ @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "175ba776", + "id": "5d31b71a", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "d147adef", + "id": "343f73c2", "metadata": {}, "source": [ "#### Plot chart with area proportional to total count\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2935b98", + "id": "52922504", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "c0bd9a34", + "id": "22332516", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db237aed", + "id": "6208b967", "metadata": {}, "outputs": [], "source": [ @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "e5ee7faf", + "id": "00e30b10", "metadata": {}, "source": [ "### See Also: Sunburst charts\n", @@ -502,7 +502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b0affee", + "id": "c9b41677", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "829b0b61", + "id": "1ba1a721", "metadata": {}, "source": [ "#### Reference\n", @@ -530,7 +530,7 @@ }, { "cell_type": "markdown", - "id": "16abbdb7", + "id": "0f22681f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plot-data-from-csv.ipynb b/plot-data-from-csv.ipynb index 23dce31f3..39bb5d140 100644 --- a/plot-data-from-csv.ipynb +++ b/plot-data-from-csv.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "921138a1", + "id": "11c99620", "metadata": {}, "source": [ "CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c76ccb13", + "id": "ea1b5d0b", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "f6415633", + "id": "d9c8bf20", "metadata": {}, "source": [ "### Plot from CSV with Plotly Express" @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ced7e00f", + "id": "8cbd8f44", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "f2c41636", + "id": "7ec4064e", "metadata": {}, "source": [ "### Plot from CSV in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62eab90c", + "id": "10cd3283", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "05747e6a", + "id": "39b84a8f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "a6bdcd7c", + "id": "b4c1348b", "metadata": {}, "source": [ "### Plot from CSV with `graph_objects`" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dd0ae8f", + "id": "b9e207ae", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "4b70f328", + "id": "88070451", "metadata": {}, "source": [ "#### Reference\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "2ba3d1a7", + "id": "14ea71f1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plotly-express.ipynb b/plotly-express.ipynb index 20c4443c1..693db92f7 100644 --- a/plotly-express.ipynb +++ b/plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3d89afc9", + "id": "669097f6", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f540410", + "id": "811f23f3", "metadata": { "hide_code": true }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "78202eb6", + "id": "58998946", "metadata": {}, "source": [ "Plotly Express currently includes the following functions:\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "1865367b", + "id": "e8d8c8d4", "metadata": {}, "source": [ "### Plotly Express in Dash\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "703c7d43", + "id": "133fae6e", "metadata": { "hide_code": true }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "7bc93e47", + "id": "11777aa7", "metadata": {}, "source": [ "### Gallery\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6a527ee", + "id": "118d344d", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "f518c2bc", + "id": "f39d97e6", "metadata": {}, "source": [ "**Read more about [trendlines](/python/linear-fits/) and [templates](/python/templates/) and [marginal distribution plots](https://plotly.com/python/marginal-plots/).**" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e17b2a23", + "id": "3fabce6e", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "10748835", + "id": "425ecceb", "metadata": {}, "source": [ "**Read more about [error bars](/python/error-bars/).**" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16e12d31", + "id": "56aecbaf", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "12d864e9", + "id": "002db5a6", "metadata": {}, "source": [ "**Read more about [bar charts](/python/bar-charts/).**" @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc1ab9a6", + "id": "f1d99bd3", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2af0ed3a", + "id": "400cac9a", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "07dc14fd", + "id": "1fe309ae", "metadata": {}, "source": [ "**Read more about [facet plots](/python/facet-plots/).**" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "caaea0c7", + "id": "26cc1b2b", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "280bf57f", + "id": "6755ec91", "metadata": {}, "source": [ "**Read more about [scatterplot matrices (SPLOMs)](/python/splom/).**\n" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c88333d", + "id": "d8a9e9e8", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "2b799331", + "id": "d59ac1d5", "metadata": {}, "source": [ "**Read more about [parallel coordinates](/python/parallel-coordinates-plot/) and [parallel categories](/python/parallel-categories-diagram/), as well as [continuous color](/python/colorscales/).**" @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "350c5c8a", + "id": "391af6a1", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8107412", + "id": "9e3a6240", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "f7057369", + "id": "1f2be591", "metadata": {}, "source": [ "**Read more about [hover labels](/python/hover-text-and-formatting/).**" @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34af16d1", + "id": "07778b20", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "734c5896", + "id": "3c35d811", "metadata": {}, "source": [ "**Read more about [animations](/python/animations/).**" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42423d58", + "id": "828d67df", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "f74903f3", + "id": "950154ce", "metadata": {}, "source": [ "**Read more about [line charts](/python/line-charts/).**" @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf981049", + "id": "9795dc62", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "e5487137", + "id": "483637a4", "metadata": {}, "source": [ "**Read more about [area charts](/python/filled-area-plots/).**" @@ -362,7 +362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95b0e2b9", + "id": "24e63ddc", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "c60b7b9e", + "id": "67753c00", "metadata": {}, "source": [ "**Read more about [timeline/Gantt charts](/python/gantt/).**" @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59196386", + "id": "e78cfdd5", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "41ecaa31", + "id": "83ad8813", "metadata": {}, "source": [ "**Read more about [funnel charts](/python/funnel-charts/).**" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cb89bfc", + "id": "4bebb877", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "416e81ba", + "id": "003c4e4e", "metadata": {}, "source": [ "### Part to Whole Charts\n", @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3026809a", + "id": "4f4d8ee3", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "243c009b", + "id": "30a96c7d", "metadata": {}, "source": [ "**Read more about [sunburst charts](/python/sunburst-charts/).**" @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4736e53d", + "id": "dfe55d41", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "b216f0b1", + "id": "351abe0c", "metadata": {}, "source": [ "**Read more about [treemaps](/python/treemaps/).**" @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccd98a4a", + "id": "3dbbf9e2", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "ea4df6cb", + "id": "8d2f9093", "metadata": {}, "source": [ "**Read more about [icicle charts](/python/icicle-charts/).**" @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "559e62d9", + "id": "80c398f3", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "4996437f", + "id": "144fa72d", "metadata": {}, "source": [ "#### Distributions\n", @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec313755", + "id": "b4c71a70", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "e6bf66dd", + "id": "aca75ae2", "metadata": {}, "source": [ "**Read more about [box plots](/python/box-plots/).**" @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f3e18c9", + "id": "efc1e105", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "f804ec8b", + "id": "00142d02", "metadata": {}, "source": [ "**Read more about [violin plots](/python/violin/).**" @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4873876a", + "id": "7daec3ac", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "851153e1", + "id": "051c233d", "metadata": {}, "source": [ "**Read more about [Empirical Cumulative Distribution Function (ECDF) charts](https://plotly.com/python/ecdf-plots/).**" @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "167991eb", + "id": "0844d81e", "metadata": {}, "outputs": [], "source": [ @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "9dff87ed", + "id": "eb7822d4", "metadata": {}, "source": [ "**Read more about [strip charts](https://plotly.com/python/strip-charts/).**" @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af420bb3", + "id": "a27ddff8", "metadata": {}, "outputs": [], "source": [ @@ -625,7 +625,7 @@ }, { "cell_type": "markdown", - "id": "91e996a1", + "id": "fac0b924", "metadata": {}, "source": [ "**Read more about [density contours, also known as 2D histogram contours](/python/2d-histogram-contour/).**" @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74c9c7da", + "id": "4a5407d0", "metadata": {}, "outputs": [], "source": [ @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "852d9db3", + "id": "f0e0d937", "metadata": {}, "source": [ "**Read more about [density heatmaps, also known as 2D histograms](/python/2D-Histogram/).**" @@ -655,7 +655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec6aa31c", + "id": "5ead3e6e", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "15878460", + "id": "07cdfdd5", "metadata": {}, "source": [ "### Images and Heatmaps\n", @@ -678,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f76f1576", + "id": "43f17778", "metadata": {}, "outputs": [], "source": [ @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "229df49c", + "id": "8e443126", "metadata": {}, "outputs": [], "source": [ @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "d43a451a", + "id": "17d28849", "metadata": {}, "source": [ "#### Tile Maps\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6f1ede7", + "id": "b1b8907d", "metadata": {}, "outputs": [], "source": [ @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "c7915ff0", + "id": "0991e430", "metadata": {}, "source": [ "**Read more about [tile map GeoJSON choropleths](/python/tile-county-choropleth/).**" @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe13fd4f", + "id": "74bbe0d3", "metadata": {}, "outputs": [], "source": [ @@ -761,7 +761,7 @@ }, { "cell_type": "markdown", - "id": "4ec57ac3", + "id": "b31df0d3", "metadata": {}, "source": [ "### Outline Maps\n", @@ -772,7 +772,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8510fb8b", + "id": "aaf7d5eb", "metadata": { "lines_to_next_cell": 2 }, @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "10609a05", + "id": "769d30e3", "metadata": {}, "source": [ "**Read more about [choropleth maps](/python/choropleth-maps/).**" @@ -796,7 +796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ac288a7", + "id": "4447765f", "metadata": { "lines_to_next_cell": 2 }, @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "c271585e", + "id": "4de0c45a", "metadata": {}, "source": [ "#### Polar Coordinates\n", @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7232bdaf", + "id": "bb98d4b5", "metadata": {}, "outputs": [], "source": [ @@ -834,7 +834,7 @@ }, { "cell_type": "markdown", - "id": "ce837b99", + "id": "70711bd7", "metadata": {}, "source": [ "**Read more about [radar charts](https://plotly.com/python/radar-chart/).**" @@ -843,7 +843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56a75640", + "id": "d2a92172", "metadata": {}, "outputs": [], "source": [ @@ -856,7 +856,7 @@ }, { "cell_type": "markdown", - "id": "bea7c362", + "id": "d1d12e5f", "metadata": {}, "source": [ "**Read more about [polar bar charts](/python/wind-rose-charts/).**" @@ -865,7 +865,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe02224f", + "id": "4f132ad2", "metadata": {}, "outputs": [], "source": [ @@ -878,7 +878,7 @@ }, { "cell_type": "markdown", - "id": "ed27cf24", + "id": "66665677", "metadata": {}, "source": [ "#### 3D Coordinates\n", @@ -889,7 +889,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6f5ccab", + "id": "4246ed7f", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "0a03ec69", + "id": "50fbd87f", "metadata": {}, "source": [ "#### Ternary Coordinates\n", @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b674c6ef", + "id": "db4cdec1", "metadata": { "lines_to_next_cell": 2 }, @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "f6c9fd43", + "id": "85752d90", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/polar-chart.ipynb b/polar-chart.ipynb index 5895c5183..c44f2c38a 100644 --- a/polar-chart.ipynb +++ b/polar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4c890662", + "id": "59febe39", "metadata": {}, "source": [ "## Polar chart with Plotly Express\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58a96492", + "id": "6f335d2d", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "63b40288", + "id": "e2231e25", "metadata": {}, "source": [ "The \"strength\" column corresponds to strength categories of the wind, and there is a frequency value for each direction and strength. Below we use the strength column to encode the color, symbol and size of the markers." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ee7e271", + "id": "2c9092d2", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "ae493b3b", + "id": "518e86a9", "metadata": {}, "source": [ "For a line polar plot, use `px.line_polar`:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea3f8fdf", + "id": "21ac1785", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "62511f73", + "id": "f9e9fdc8", "metadata": {}, "source": [ "See also the [wind rose page](https://plotly.com/python/wind-rose-charts/) for more wind rose visualizations in polar coordinates.\n", @@ -88,7 +88,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0bc641c", + "id": "79eb6162", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "06e73e71", + "id": "5ec12abc", "metadata": {}, "source": [ "## Polar Scatter Plot with go.Scatterpolar\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b915dbe", + "id": "2a676285", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "c3797d08", + "id": "7c152491", "metadata": {}, "source": [ "#### Line Polar Chart" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1d6b340", + "id": "faa34377", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "20beedd0", + "id": "04e0a781", "metadata": {}, "source": [ "#### Polar Bar Chart\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e0498fe", + "id": "60bcf811", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "8761a57b", + "id": "4697ac7b", "metadata": {}, "source": [ "#### Categorical Polar Chart" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6164f0d1", + "id": "0ea2592c", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "0136abb6", + "id": "46dd590b", "metadata": {}, "source": [ "#### Polar Chart Sector" @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f99d775b", + "id": "1fa29ca5", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "baac3b4a", + "id": "8ae238c8", "metadata": {}, "source": [ "#### Polar Chart Directions" @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9b606ac", + "id": "dd591f08", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "2cb72bc2", + "id": "cc94ac5b", "metadata": {}, "source": [ "#### Webgl Polar Chart\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "455b1a60", + "id": "c44a9b48", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "a51b0f3b", + "id": "9f48852c", "metadata": {}, "source": [ "#### Polar Chart Subplots" @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c2c9e72", + "id": "be73728e", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "d22e8bd8", + "id": "4f590ea8", "metadata": {}, "source": [ "#### Reference\n", @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "1cc599cf", + "id": "31ab7c77", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/px-arguments.ipynb b/px-arguments.ipynb index 6d4d97005..a1a2fbf8b 100644 --- a/px-arguments.ipynb +++ b/px-arguments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "27ce2452", + "id": "8838b4dd", "metadata": {}, "source": [ "Plotly Express (`px`) is the high-level interface to Plotly and provides functions for generating charts. `px` functions support data provided in a number of different formats (long, wide, and mixed) and as different types of objects, including pandas and Polars dataframes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "333f9396", + "id": "5d9c1665", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "d1faa3ba", + "id": "77847b57", "metadata": {}, "source": [ "By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21b70027", + "id": "deee6172", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "fa1a1102", + "id": "d95c542c", "metadata": {}, "source": [ "## Long, Wide, and Mixed-Form Data\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b22dadb9", + "id": "42baf183", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41253d80", + "id": "92f4da05", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "9650255f", + "id": "44a9fe0d", "metadata": {}, "source": [ "Plotly Express can produce the same plot from either form:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "199dfc16", + "id": "e5acfcef", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdf1138c", + "id": "77f55037", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "5fb31255", + "id": "b3a08a0e", "metadata": {}, "source": [ "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, or [you can use a data frame with named row- and column-indexes](/python/wide-form/). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c38ff43d", + "id": "758c9139", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "027aa52e", + "id": "a403809a", "metadata": {}, "source": [ "Many more examples of wide-form and messy data input can be found in our [detailed wide-form support documentation](/python/wide-form/)." @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "470d3bb8", + "id": "4d9825b1", "metadata": {}, "source": [ "## Dataframe Input\n", @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35f63ae6", + "id": "aac55cf5", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "f44e15c7", + "id": "e7b375d4", "metadata": {}, "source": [ "### Example: Polars DataFrame with `px.bar`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cadac58", + "id": "42128411", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "d3783056", + "id": "365c4e13", "metadata": {}, "source": [ "### Using the Index of a Dataframe\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e8bb0c9", + "id": "3b5590d2", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "16af7a01", + "id": "2c1fbf67", "metadata": {}, "source": [ "### Using Columns from Multiple Dataframes\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63a524af", + "id": "eb491a30", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "13dacad7", + "id": "a7d79586", "metadata": {}, "source": [ "### Using labels to pass names\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fce8d998", + "id": "03770130", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d860849", + "id": "2f677b87", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "facaaff1", + "id": "9842d1ef", "metadata": {}, "source": [ "### Input Data as array-like columns: NumPy arrays, lists...\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca35c385", + "id": "e38a487e", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "9d4fdc58", + "id": "3ac4b4bd", "metadata": {}, "source": [ "List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[].name = \"name\"`." @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7beac960", + "id": "12b7f89f", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "66c139fb", + "id": "3242a499", "metadata": {}, "source": [ "### Passing dictionaries or array-likes as the data_frame argument\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7917a91", + "id": "63326a7b", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "308c0f9c", + "id": "c1009f3f", "metadata": {}, "source": [ "To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13e13dae", + "id": "5863ae6f", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "493aca22", + "id": "dbed2777", "metadata": {}, "source": [ "### Mixing dataframes and other types\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af02d905", + "id": "a98159f1", "metadata": { "lines_to_next_cell": 2 }, @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "f4c1d815", + "id": "fe763e30", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/quiver-plots.ipynb b/quiver-plots.ipynb index 3f1b3f034..43156ea59 100644 --- a/quiver-plots.ipynb +++ b/quiver-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3b45f886", + "id": "9337fbc6", "metadata": {}, "source": [ "Quiver plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8cb89df", + "id": "84a21019", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "158aba05", + "id": "fc1bfe98", "metadata": {}, "source": [ "#### Quiver Plot with Points" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd9c5a88", + "id": "d750dab9", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "aff0903d", + "id": "84dc769e", "metadata": {}, "source": [ "#### See also\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "f7676106", + "id": "6980345c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/radar-chart.ipynb b/radar-chart.ipynb index 921884de1..8e3196728 100644 --- a/radar-chart.ipynb +++ b/radar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5180bfb3", + "id": "dd52fa3a", "metadata": {}, "source": [ "A [Radar Chart](https://en.wikipedia.org/wiki/Radar_chart) (also known as a spider plot or star plot) displays multivariate data in the form of a two-dimensional chart of quantitative variables represented on axes originating from the center. The relative position and angle of the axes is typically uninformative. It is equivalent to a [parallel coordinates plot](/python/parallel-coordinates-plot/) with the axes arranged radially.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e2be1b0", + "id": "4c6f7b50", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "64c068a3", + "id": "fba2661a", "metadata": {}, "source": [ "For a filled line in a Radar Chart, update the figure created with `px.line_polar` with `fig.update_traces`." @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "943bca16", + "id": "c28369cf", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "414f81df", + "id": "a8c09819", "metadata": {}, "source": [ "### Basic Radar Chart with go.Scatterpolar" @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f84375f", + "id": "6b9c7f2e", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "cc4d24b1", + "id": "a77aec3d", "metadata": {}, "source": [ "#### Multiple Trace Radar Chart" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2dde280", + "id": "b38b0338", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "f57087a0", + "id": "83661112", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "dfea1067", + "id": "1b73971f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/random-walk.ipynb b/random-walk.ipynb index 4e3fe6e73..9f09679a4 100644 --- a/random-walk.ipynb +++ b/random-walk.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6df27aaf", + "id": "6bea4a05", "metadata": {}, "source": [ "A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\\mathbb{Z}$), two dimensions ($\\mathbb{Z}^2$) or three dimensions ($\\mathbb{Z}^3$) in Cartesian space, where $\\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plotly.com/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25592327", + "id": "26972f42", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "2a649539", + "id": "574b147c", "metadata": {}, "source": [ "#### Random Walk in 2D" @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8de53287", + "id": "11766fd7", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "add54cd4", + "id": "46f2995d", "metadata": {}, "source": [ "#### Random walk and diffusion\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51fd6a72", + "id": "5ac126f3", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0060840e", + "id": "197a835e", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "ac32a43a", + "id": "b887aeda", "metadata": {}, "source": [ "#### Advanced Tip\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "4279422a", + "id": "93e15285", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/range-slider.ipynb b/range-slider.ipynb index bb67b82fb..4aaa27458 100644 --- a/range-slider.ipynb +++ b/range-slider.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a71598fd", + "id": "5b521072", "metadata": {}, "source": [ "#### Basic Range Slider and Range Selectors" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "344943cd", + "id": "85465666", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "febd539e", + "id": "b74caca0", "metadata": {}, "source": [ "#### Range Slider with Vertically Stacked Subplots" @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4019f284", + "id": "15c23ba6", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "a3c42465", + "id": "5480cb21", "metadata": {}, "source": [ "#### Reference\n", @@ -362,7 +362,7 @@ }, { "cell_type": "markdown", - "id": "115e2bd4", + "id": "2979fa06", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/renderers.ipynb b/renderers.ipynb index d3b06e3df..a1619d2f7 100644 --- a/renderers.ipynb +++ b/renderers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cd34439d", + "id": "1f1e93ef", "metadata": {}, "source": [ "# Displaying Figures\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8feec4e0", + "id": "4b498a5f", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "90ddb41f", + "id": "c50ca3d1", "metadata": {}, "source": [ "In most situations, you can omit the call to `.show()` and allow the figure to display itself." @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c90a9ac8", + "id": "135d209a", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "9e5b2147", + "id": "d4433708", "metadata": {}, "source": [ "> To be precise, figures will display themselves using the current default renderer when the two following conditions are true. First, the last expression in a cell must evaluate to a figure. Second, `plotly.py` must be running from within an `IPython` kernel.\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "59f884e8", + "id": "2a258484", "metadata": {}, "source": [ "#### Setting The Default Renderer\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49a640fd", + "id": "f1d953a7", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "8c6fb81a", + "id": "629098c0", "metadata": {}, "source": [ "The default renderer that you see when you display `pio.renderers` might be different than what is shown here. This is because `plotly.py` attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of an available renderer to the `pio.renderers.default` property. For example, to switch to the `'browser'` renderer, which opens figures in a tab of the default web browser, you would run the following." @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4898bf60", + "id": "26a34954", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "ccb8677f", + "id": "fc20ada6", "metadata": {}, "source": [ "> Note: Default renderers persist for the duration of a single session. For example, if you set a default renderer in an `IPython` kernel, that default won't persist across kernel restarts.\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc401659", + "id": "45bffcd7", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "c5f8e2bb", + "id": "5d31d5d4", "metadata": {}, "source": [ "#### Built-in Renderers\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "01c03cb8", + "id": "ec7a5ce4", "metadata": {}, "source": [ "###### `plotly_mimetype`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dedba3c", + "id": "7d2c0e97", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "80c5ee5b", + "id": "add5414c", "metadata": {}, "source": [ "###### PDF\n", @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4b00bb2", + "id": "0255f84d", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "f820bb4e", + "id": "303eafdb", "metadata": {}, "source": [ "From this output, you can see that the `png` renderer supports 3 properties: `width`, `height`, and `scale`. You can customize these properties by assigning new values to them.\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ad980c5", + "id": "8ff1db7a", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "c0f731d9", + "id": "4b82eb72", "metadata": {}, "source": [ "You can also override the values of renderer parameters temporarily by passing them as keyword arguments to the `show()` method. For example" @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11690457", + "id": "2adfdae8", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "3ab444fc", + "id": "9cf0dcb7", "metadata": {}, "source": [ "### Displaying figures in Plotly Studio\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05a30713", + "id": "0092b41b", "metadata": { "hide_code": true }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "b5a78000", + "id": "addf4b41", "metadata": {}, "source": [ "### Displaying figures in Dash\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64a406d9", + "id": "38b3f2bd", "metadata": { "hide_code": true }, @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "9bfdf266", + "id": "6855442a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "2bd262a0", + "id": "914b8848", "metadata": {}, "source": [ "## Displaying Figures Using `ipywidgets`\n", @@ -388,7 +388,7 @@ }, { "cell_type": "markdown", - "id": "33169703", + "id": "71ec1c8f", "metadata": {}, "source": [ "## Performance\n", @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "f08f8870", + "id": "4532ce59", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sankey-diagram.ipynb b/sankey-diagram.ipynb index c691968ab..6ebffdbbe 100644 --- a/sankey-diagram.ipynb +++ b/sankey-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e28be07a", + "id": "76ef36f8", "metadata": {}, "source": [ "A [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram) is a flow diagram, in which the width of arrows is proportional to the flow quantity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "747488a3", + "id": "9bea02f1", "metadata": {}, "source": [ "### Basic Sankey Diagram\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9c1533d", + "id": "4f9a8fff", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "521c8982", + "id": "c1dfbed3", "metadata": {}, "source": [ "### More complex Sankey diagram with colored links" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3dfa856", + "id": "49348c0d", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "7d5f6301", + "id": "cfe3b4c7", "metadata": {}, "source": [ "### Sankey Diagram in Dash\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de33000c", + "id": "23348140", "metadata": { "hide_code": true }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "e5f8f1d0", + "id": "e9c7e93f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "07111ebb", + "id": "052b01e5", "metadata": {}, "source": [ "### Style Sankey Diagram\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "943cd469", + "id": "9551b5d9", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "2f78f4e1", + "id": "85586b35", "metadata": {}, "source": [ "### Link Hover Color\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cd835ff", + "id": "5462e173", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "ed9f0753", + "id": "d4289e6f", "metadata": {}, "source": [ "### Hovertemplate and customdata of Sankey diagrams\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5463bea", + "id": "d1a1fe55", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "5cdabd7d", + "id": "9c1e6ead", "metadata": {}, "source": [ "### Define Node Position\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89846c12", + "id": "94c20ab8", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "f35fc684", + "id": "70649328", "metadata": {}, "source": [ "### Sankey Diagram with Arrow Links\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c615e3c", + "id": "dd4dc2e4", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "8fbdf6dd", + "id": "1bda259e", "metadata": {}, "source": [ "### Node Alignment\n", @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "537b726f", + "id": "1c8d3599", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73acfd8a", + "id": "4fa75a30", "metadata": {}, "outputs": [], "source": [ @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "585b0782", + "id": "804ed10e", "metadata": {}, "source": [ "### Reference\n", @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "835ef829", + "id": "d3337c23", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/scatter-plots-on-maps.ipynb b/scatter-plots-on-maps.ipynb index 7f6e52ec8..1dfb52fe4 100644 --- a/scatter-plots-on-maps.ipynb +++ b/scatter-plots-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "77257459", + "id": "ff1f61b9", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a62c9e8a", + "id": "13a43486", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "f0f7fa87", + "id": "58982548", "metadata": {}, "source": [ "#### Customize geographical scatter plot" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2d7fe18", + "id": "208fa93e", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "b1927776", + "id": "e4387308", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01630c21", + "id": "8ba9dbdc", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "fe0c44c1", + "id": "6f8cc6ab", "metadata": {}, "source": [ "### U.S. Airports Map\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c00ee75a", + "id": "aa11287b", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "f3581c4b", + "id": "cd66c92a", "metadata": {}, "source": [ "#### Styled U.S. Airports Map" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c42eb9c", + "id": "192222db", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "bba81661", + "id": "be0a076f", "metadata": {}, "source": [ "### North American Precipitation Map" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4564b395", + "id": "bd70562f", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "50e5b8a7", + "id": "f9519fdb", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "d9ff11df", + "id": "819de8f5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/selections.ipynb b/selections.ipynb index 8651de7ec..cbdad0c5c 100644 --- a/selections.ipynb +++ b/selections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "86d74b6b", + "id": "ea9caa11", "metadata": {}, "source": [ "## Adding Selections to Cartesian Subplots\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "ad6cc0d2", + "id": "c6e6add6", "metadata": {}, "source": [ "You can also add selections to a figure that displays when it renders using `fig.add_selection`.\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6712044", + "id": "2052b097", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "a3b63073", + "id": "6b9498c8", "metadata": {}, "source": [ "## Selections Using a Custom SVG" @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "cc3d5dbe", + "id": "2f7a096f", "metadata": {}, "source": [ "In the above example, we added a rectangular selection. You can also render a custom SVG for a selection by defining a `path` that can include single or multiple polygons. Here, we create a selection with a single polygon path \"M2,6.5L4,7.5L4,6Z\".\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39428f18", + "id": "823f372f", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "944e720c", + "id": "b117a16b", "metadata": {}, "source": [ "## Styling Selections" @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "16f81047", + "id": "e7f4e830", "metadata": {}, "source": [ "In the above example, we added a selection to the figure that is displayed when the figure renders.\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "880a39df", + "id": "4a2fc7be", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "ebcaf97d", + "id": "d0625f3c", "metadata": {}, "source": [ "## Styling New Selections\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8549e9d5", + "id": "692359b6", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "bc5f5c56", + "id": "ee307d78", "metadata": {}, "source": [ "## Fill Color for Active Selections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0790bb88", + "id": "ea5db131", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "25295770", + "id": "d355e96b", "metadata": {}, "source": [ "## Selections with Time Series\n", @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8821b89c", + "id": "ffe7e1ce", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "7d6fd189", + "id": "a51506d0", "metadata": {}, "source": [ "## Referencing Selections on Multiple Cartesian Subplots" @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "bdc9f9d1", + "id": "6d9702ed", "metadata": {}, "source": [ "You can add selections to multiple Cartesian subplots by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x` and `y2` and two selections to the the plot with axis ids `x` and `y`." @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca228977", + "id": "611dc54c", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "dc22baeb", + "id": "42a66f23", "metadata": {}, "source": [ "## Referencing Selections on a Scatterplot Matrix" @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "c0ae0493", + "id": "86fe38fd", "metadata": {}, "source": [ "You can add selections to a scatterplot matrix by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x2` and `y2` and another on the plot with ids `x3` and `y`." @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db2feccf", + "id": "d337dc9a", "metadata": { "lines_to_next_cell": 0 }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "e8e74329", + "id": "134067eb", "metadata": {}, "source": [ "\n" @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "7f5ccadf", + "id": "32bb72b5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/setting-graph-size.ipynb b/setting-graph-size.ipynb index d215e2402..7de3ba019 100644 --- a/setting-graph-size.ipynb +++ b/setting-graph-size.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9d07c317", + "id": "38d4fd44", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9f66aab", + "id": "a18a6e5d", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "99316f55", + "id": "b1a51623", "metadata": {}, "source": [ "### Adjusting graph size with Dash\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a9950a1", + "id": "3322615e", "metadata": { "hide_code": true }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "0dfce3dc", + "id": "58b6ed8d", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "989a05eb", + "id": "9f805c25", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins With Graph Objects\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b86cfb19", + "id": "28c6038a", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "f42f5e4b", + "id": "a237d047", "metadata": {}, "source": [ "### Automatically Adjust Margins\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03d2a322", + "id": "62d630a5", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "7492e72e", + "id": "d698121f", "metadata": {}, "source": [ "### Automatically Adjust Specific Margins\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94d5bada", + "id": "1f6d4ada", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "9174ea52", + "id": "3637b9fa", "metadata": {}, "source": [ "### Setting a Minimum Plot Size with Automargins\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccf46773", + "id": "26ecda6f", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "3b7d2be7", + "id": "84a4d13b", "metadata": {}, "source": [ "#### Reference\n", @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "d5c6476e", + "id": "3790ae66", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/shapes.ipynb b/shapes.ipynb index e9f1e5ff1..138ef8bed 100644 --- a/shapes.ipynb +++ b/shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "16efffdf", + "id": "e9ee2fd0", "metadata": {}, "source": [ "### Adding Lines and Polygons to Figures\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "4c903e5c", + "id": "05b4971b", "metadata": {}, "source": [ "### Shape-drawing with Scatter traces\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "151d821f", + "id": "c2bdc86e", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "89b68142", + "id": "dff55ff6", "metadata": {}, "source": [ "You can have more shapes either by adding [more traces](https://plotly.com/python/filled-area-plots/) or interrupting the series with `None`." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4676ad55", + "id": "22ed13b5", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "8a4cd8d4", + "id": "184a72ea", "metadata": {}, "source": [ "#### Shapes in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa153009", + "id": "88e72644", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "5a8127ae", + "id": "53a3ced0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "09dd1b8e", + "id": "710c03dd", "metadata": {}, "source": [ "#### Vertical and Horizontal Lines Positioned Relative to the Axis Data" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f83f08fd", + "id": "83d0a7a2", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "93f47be3", + "id": "97df7c9f", "metadata": {}, "source": [ "#### Lines Positioned Relative to the Plot & to the Axis Data" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b6cd57b", + "id": "d6d5614f", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "2c3534f2", + "id": "ac29b9a1", "metadata": {}, "source": [ "#### Rectangles Positioned Relative to the Axis Data" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6c7f0b2", + "id": "b8aa8fb3", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "6637dfb4", + "id": "2c217eef", "metadata": {}, "source": [ "#### Rectangle Positioned Relative to the Plot & to the Axis Data" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c61ddcb", + "id": "34b209a6", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "98db4d57", + "id": "da4ba0ef", "metadata": {}, "source": [ "#### A Rectangle Placed Relative to the Axis Position and Length\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7ba6fcb", + "id": "9ff3ec7f", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "8b7f3214", + "id": "74144889", "metadata": {}, "source": [ "#### Highlighting Time Series Regions with Rectangle Shapes\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27259967", + "id": "93b3e74e", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "4baf87df", + "id": "129c79c0", "metadata": {}, "source": [ "#### Circles Positioned Relative to the Axis Data" @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c960d7fe", + "id": "8d3d5c9e", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ }, { "cell_type": "markdown", - "id": "629b3640", + "id": "a9e16c3d", "metadata": {}, "source": [ "#### Highlighting Clusters of Scatter Points with Circle Shapes" @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9446da3", + "id": "106ce7af", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "c128a37d", + "id": "d182f054", "metadata": {}, "source": [ "#### Venn Diagram with Circle Shapes" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3684116e", + "id": "7b0a8d8a", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "c8e03f62", + "id": "026cc878", "metadata": {}, "source": [ "#### Adding Shapes to Subplots\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17d65a70", + "id": "6ea8fc14", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "3c76d474", + "id": "93510eb7", "metadata": {}, "source": [ "#### Subplot-Spanning Shapes\n", @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "544a4abe", + "id": "174acba8", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "6e9866de", + "id": "5fa655a9", "metadata": {}, "source": [ "For `path` shapes, the array must have one entry for each coordinate in the path string. Each coordinate in the path maps to the corresponding element in the `xref`/`yref` array, in order." @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8fc2273", + "id": "39028831", "metadata": {}, "outputs": [], "source": [ @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "0f2e7b78", + "id": "e5ce8776", "metadata": {}, "source": [ "**Note:** When using arrays with `xref` and `yref`, `xsizemode=\"pixel\"` and `ysizemode=\"pixel\"` are not supported." @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "9eaed57f", + "id": "1c421e0a", "metadata": { "lines_to_next_cell": 0 }, @@ -723,7 +723,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3aac152", + "id": "8b707a39", "metadata": { "lines_to_next_cell": 2 }, @@ -753,7 +753,7 @@ }, { "cell_type": "markdown", - "id": "ed46706a", + "id": "e6a6d3f6", "metadata": {}, "source": [ "#### SVG Paths" @@ -762,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d549450", + "id": "24d2beb0", "metadata": {}, "outputs": [], "source": [ @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "5daad599", + "id": "bc906d7f", "metadata": {}, "source": [ "#### Shifting Shapes on Categorical Axes\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "648652d3", + "id": "afe0cf7d", "metadata": {}, "outputs": [], "source": [ @@ -916,7 +916,7 @@ }, { "cell_type": "markdown", - "id": "c2dd87fc", + "id": "cd70ff8f", "metadata": {}, "source": [ "### Drawing shapes with a Mouse on Cartesian plots\n", @@ -940,7 +940,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a1f460e", + "id": "dcb9f6c9", "metadata": {}, "outputs": [], "source": [ @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "60b88e93", + "id": "8b53f635", "metadata": {}, "source": [ "### Style of user-drawn shapes\n", @@ -986,7 +986,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed5f24d3", + "id": "6778f378", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ }, { "cell_type": "markdown", - "id": "27549047", + "id": "8f99d436", "metadata": {}, "source": [ "### Adding Text Labels to Shapes\n", @@ -1039,7 +1039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8b0cf6a", + "id": "e39fdbb5", "metadata": {}, "outputs": [], "source": [ @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "0d8f968a", + "id": "2f75e3c4", "metadata": {}, "source": [ "#### Styling Text Labels\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04d704a3", + "id": "a8250ae6", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "3f0c893b", + "id": "af6c3f28", "metadata": {}, "source": [ "#### Setting Label Position\n", @@ -1137,7 +1137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60b4c2f6", + "id": "31d6903f", "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1194,7 @@ }, { "cell_type": "markdown", - "id": "ed2183df", + "id": "384926a1", "metadata": {}, "source": [ "#### Setting Label Angle\n", @@ -1205,7 +1205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce7fb80a", + "id": "d2d9c399", "metadata": {}, "outputs": [], "source": [ @@ -1238,7 +1238,7 @@ }, { "cell_type": "markdown", - "id": "f7924052", + "id": "d465325e", "metadata": {}, "source": [ "#### Setting Label Padding\n", @@ -1249,7 +1249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a7071a3", + "id": "ea75ff04", "metadata": {}, "outputs": [], "source": [ @@ -1284,7 +1284,7 @@ }, { "cell_type": "markdown", - "id": "57d44c50", + "id": "f06427be", "metadata": {}, "source": [ "#### Setting Label Anchors\n", @@ -1298,7 +1298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4d2b31a", + "id": "7b619a33", "metadata": {}, "outputs": [], "source": [ @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "d7415bb8", + "id": "6eb2605a", "metadata": {}, "source": [ "#### Variables in Shape Label Text\n", @@ -1366,7 +1366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8a09d48", + "id": "2431c816", "metadata": {}, "outputs": [], "source": [ @@ -1426,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "772aeb8a", + "id": "557a9dc5", "metadata": {}, "source": [ "#### Variables in Shape Label Text for New Shapes\n", @@ -1441,7 +1441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf9f821b", + "id": "d3070371", "metadata": {}, "outputs": [], "source": [ @@ -1479,7 +1479,7 @@ }, { "cell_type": "markdown", - "id": "958d24cf", + "id": "774b1bfe", "metadata": {}, "source": [ "#### Shapes in the Legend\n", @@ -1492,7 +1492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c275e250", + "id": "cfca580e", "metadata": {}, "outputs": [], "source": [ @@ -1536,7 +1536,7 @@ }, { "cell_type": "markdown", - "id": "ee70a74c", + "id": "17cd4f79", "metadata": {}, "source": [ "`newshape` also supports `showlegend`. In this example, each new line drawn on the graph appears in the legend." @@ -1545,7 +1545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a637724e", + "id": "641cbea3", "metadata": {}, "outputs": [], "source": [ @@ -1584,7 +1584,7 @@ }, { "cell_type": "markdown", - "id": "ed12c4a0", + "id": "17f3fb83", "metadata": {}, "source": [ "#### Shape Layer\n", @@ -1595,7 +1595,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35224a48", + "id": "d3a048d4", "metadata": {}, "outputs": [], "source": [ @@ -1649,7 +1649,7 @@ }, { "cell_type": "markdown", - "id": "4b59814f", + "id": "7ab6a8c9", "metadata": {}, "source": [ "### Reference\n", @@ -1658,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "6692f7f5", + "id": "ec35d088", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sliders.ipynb b/sliders.ipynb index 3d0086100..13a8770d4 100644 --- a/sliders.ipynb +++ b/sliders.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "73fcf0f8", + "id": "f00d4280", "metadata": {}, "source": [ "### Simple Slider Control\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32d9c196", + "id": "c6991f41", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "8efe4f6a", + "id": "28910a80", "metadata": {}, "source": [ "#### Methods\n", @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "f128f8eb", + "id": "13b94d38", "metadata": {}, "source": [ "### Sliders in Plotly Express\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c5aed7c", + "id": "19d1c484", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "643944f2", + "id": "eb315867", "metadata": {}, "source": [ "#### Reference\n", @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "7e95a9eb", + "id": "ea39cda6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smith-charts.ipynb b/smith-charts.ipynb index 27bdd5a3f..24ac6ed7f 100644 --- a/smith-charts.ipynb +++ b/smith-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "228ccc29", + "id": "94b95442", "metadata": {}, "source": [ "*New in v5.4*\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "20768e91", + "id": "2c664b3b", "metadata": {}, "source": [ "### Smith Charts with Plotly Graph Objects" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca54fb0e", + "id": "5c04b57a", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "c0e7edbd", + "id": "430fd8f9", "metadata": {}, "source": [ "### Smith Chart Subplots and Styling" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a65428b0", + "id": "a065ad5e", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "9b0bdb1e", + "id": "2b8d5265", "metadata": {}, "source": [ "#### Reference\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcec238c", + "id": "b92f6e69", "metadata": { "lines_to_next_cell": 2 }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "0d4f4d43", + "id": "11e5884d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smoothing.ipynb b/smoothing.ipynb index a2d68d3d0..0307bfbb4 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e9594d40", + "id": "7fb18fb3", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d2342a", + "id": "3f5f6f32", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "66e9aca3", + "id": "f78a2a8e", "metadata": {}, "source": [ "#### Savitzky-Golay Filter\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "527e0e41", + "id": "87546073", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "6e691087", + "id": "34decb3f", "metadata": {}, "source": [ "#### Triangular Moving Average\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f36850cd", + "id": "5e0b02ba", "metadata": { "lines_to_next_cell": 2 }, @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "d0d1cbcc", + "id": "61a90b7c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/splom.ipynb b/splom.ipynb index 760644a57..154f4c513 100644 --- a/splom.ipynb +++ b/splom.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "da50cb85", + "id": "8bcbe02e", "metadata": {}, "source": [ "### Scatter matrix with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6149395c", + "id": "ccbd5d41", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "5d66b0f0", + "id": "5a662821", "metadata": {}, "source": [ "Specify the columns to be represented with the `dimensions` argument, and set colors using a column of the dataframe:" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca2c03a2", + "id": "51eefc6c", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "2fed135b", + "id": "78a882c5", "metadata": {}, "source": [ "#### Styled Scatter Matrix with Plotly Express\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c601200f", + "id": "37666890", "metadata": { "lines_to_next_cell": 2 }, @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "dfd90399", + "id": "00e442c5", "metadata": {}, "source": [ "### Scatter matrix (splom) with go.Splom\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "13647138", + "id": "6e903f4f", "metadata": {}, "source": [ "#### Splom of the Iris data set" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0b6b855", + "id": "de85573f", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "0031c308", + "id": "18bda896", "metadata": {}, "source": [ "The scatter plots on the principal diagonal can be removed by setting `diagonal_visible=False`:" @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e67b46d5", + "id": "e6055dbb", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "bff4df84", + "id": "6589047c", "metadata": {}, "source": [ "To plot only the lower/upper half of the splom we switch the default `showlowerhalf=True`/`showupperhalf=True` to `False`:" @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db0c5847", + "id": "8b283600", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "c7adf85c", + "id": "69a59001", "metadata": {}, "source": [ "Each dict in the list dimensions has a key, visible, set by default on True. We can choose to remove a variable from splom, by setting `visible=False` in its corresponding dimension. In this case the default grid associated to the scatterplot matrix keeps its number of cells, but the cells in the row and column corresponding to the visible false dimension are empty:" @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2973f98e", + "id": "0b5b83df", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "9c42fc3a", + "id": "a0106ad2", "metadata": {}, "source": [ "#### Splom for the diabetes dataset\n", @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b567828e", + "id": "93f26fd4", "metadata": { "lines_to_next_cell": 0 }, @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "76a1428f", + "id": "6dc537ae", "metadata": {}, "source": [ "#### Hover Effects\n", @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3f373c1", + "id": "724c4d7c", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "f4aaa7e6", + "id": "35d6d17a", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "21ee69c0", + "id": "838a5d43", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-export.ipynb b/static-image-export.ipynb index 10e4c057e..56fb48a7b 100644 --- a/static-image-export.ipynb +++ b/static-image-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e27ca4a0", + "id": "6650e5af", "metadata": {}, "source": [ "This page demonstrates how to export interactive Plotly figures to static image formats like PNG, JPEG, SVG, and PDF. If you want to export Plotly figures to HTML to retain interactivity, see the [Interactive HTML Export page](/python/interactive-html-export/)" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "7a4cdcb8", + "id": "3bed5505", "metadata": {}, "source": [ "## Install Dependencies\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "3a4890ac", + "id": "083229aa", "metadata": {}, "source": [ "## Write Image to a File\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "7a48247f", + "id": "22c4508b", "metadata": {}, "source": [ "### Raster Formats\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "85996906", + "id": "b31adfe7", "metadata": {}, "source": [ "**Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image." @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "53389fa9", + "id": "4d892439", "metadata": {}, "source": [ "### Specify a Format\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "2571e539", + "id": "ab2aa9df", "metadata": {}, "source": [ "### Write Multiple Images\n", @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "a3b0a5ec", + "id": "927e4426", "metadata": {}, "source": [ "## Get Image as Bytes\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "203c2c5c", + "id": "df5f255d", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "f11030b5", + "id": "239901ad", "metadata": {}, "source": [ "Here's the bytes object displayed using `IPython.display.Image`:" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ab4f462", + "id": "08917ee1", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "78ac1c0f", + "id": "6cd650a7", "metadata": {}, "source": [ "## Specify Image Dimensions and Scale\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bace4f7", + "id": "207f5bf9", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "7c703c39", + "id": "0ac9bd29", "metadata": {}, "source": [ "## Specify Image Export Engine\n", @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "ab39183b", + "id": "291b5c7c", "metadata": {}, "source": [ "## plotly.io Functions\n", @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "db55ae3a", + "id": "57b46b2a", "metadata": {}, "source": [ "## Image Export Settings (Kaleido)\n", @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "cbcb1cfd", + "id": "bfc75bda", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-generation-migration.ipynb b/static-image-generation-migration.ipynb index c4aaf772e..1f8daeac7 100644 --- a/static-image-generation-migration.ipynb +++ b/static-image-generation-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4828146d", + "id": "0d8ecf53", "metadata": { "lines_to_next_cell": 2 }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "da29043f", + "id": "8b11538c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamline-plots.ipynb b/streamline-plots.ipynb index d9483b7f0..1434aa1b6 100644 --- a/streamline-plots.ipynb +++ b/streamline-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "865836c4", + "id": "1c7f3389", "metadata": {}, "source": [ "A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to the velocity field. In the case of a stationary velocity field, streamlines coincide with trajectories (see also the [Wikipedia page on streamlines, streaklines and pathlines](https://en.wikipedia.org/wiki/Streamlines,_streaklines,_and_pathlines)).\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cca14a2d", + "id": "af96f331", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "5a5ddbdf", + "id": "7cec4bf6", "metadata": {}, "source": [ "#### Streamline and Source Point Plot" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f1f5032", + "id": "23c9cb32", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "cbab70e2", + "id": "905ee29d", "metadata": {}, "source": [ "#### See also\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "67504c6a", + "id": "94e84729", "metadata": {}, "source": [ "#### Reference\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "e515bc1f", + "id": "b41a8693", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamtube-plot.ipynb b/streamtube-plot.ipynb index 67039b6a0..c1f1a54c0 100644 --- a/streamtube-plot.ipynb +++ b/streamtube-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "838d93b3", + "id": "73503e3c", "metadata": {}, "source": [ "### Introduction" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "6dc1dfbb", + "id": "0a1f7940", "metadata": {}, "source": [ "In streamtube plots, attributes include `x`, `y`, and `z`, which set the coordinates of the vector field, and `u`, `v`, and `w`, which set the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "ca658f14", + "id": "48151534", "metadata": {}, "source": [ "### Basic Streamtube Plot" @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e9af88e", + "id": "82701526", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "50d7da06", + "id": "b910cee7", "metadata": {}, "source": [ "### Starting Position and Segments\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "964d7b60", + "id": "b1642fba", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "20e27609", + "id": "eb951e98", "metadata": {}, "source": [ "### Tube color and diameter\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11886288", + "id": "98103e04", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "c37bb253", + "id": "307199f8", "metadata": {}, "source": [ "#### Reference\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "d5b56aa8", + "id": "01f4645c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/strip-charts.ipynb b/strip-charts.ipynb index ad9e57fe7..8ebbd8704 100644 --- a/strip-charts.ipynb +++ b/strip-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dd4c3670", + "id": "65eaedd8", "metadata": {}, "source": [ "### Strip Charts with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d77e439", + "id": "d5cd2521", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "e0fe640d", + "id": "77b9bf06", "metadata": {}, "source": [ "Strip charts support [faceting](/python/facet-plots/) and [discrete color](/python/discrete-color/):" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ad13d58", + "id": "b1c943f8", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "7906c364", + "id": "7f73fecf", "metadata": {}, "source": [ "#### Reference\n", @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "fc3d1b21", + "id": "c94afa0c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/styling-plotly-express.ipynb b/styling-plotly-express.ipynb index aa90892f7..1fa412436 100644 --- a/styling-plotly-express.ipynb +++ b/styling-plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b2357351", + "id": "a983650e", "metadata": {}, "source": [ "### Styling Figures made with Plotly Express\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9b3e94b", + "id": "31b08ce8", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "67a9790e", + "id": "cbaa15b4", "metadata": {}, "source": [ "Here is the same figure, restyled by adding some extra parameters to the initial Plotly Express call:" @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1daffb8", + "id": "26700e5c", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "1cce6864", + "id": "7c14f70e", "metadata": {}, "source": [ "### Updating or Modifying Figures made with Plotly Express\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "242ecba2", + "id": "43165689", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "edce425f", + "id": "edc1ff84", "metadata": {}, "source": [ "### How Plotly Express Works with Templates\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24cf6102", + "id": "d41cb56b", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "504a8cf0", + "id": "21007d03", "metadata": {}, "source": [ "### Setting Plotly Express Styling Defaults\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fb6c1af", + "id": "63981ec4", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "8ea841c1", + "id": "d85f8977", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/subplots.ipynb b/subplots.ipynb index 55f87b663..ee06b09d8 100644 --- a/subplots.ipynb +++ b/subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a4e0e93f", + "id": "1a4bc7d1", "metadata": {}, "source": [ "### Subplots and Plotly Express\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "43057109", + "id": "92adfec5", "metadata": {}, "source": [ "#### Simple Subplot\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "615afd81", + "id": "9ee8286a", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "8162790c", + "id": "7230ef5a", "metadata": {}, "source": [ "#### Stacked Subplots\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b52c83e4", + "id": "589941bc", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "2fd15b01", + "id": "3ade2968", "metadata": {}, "source": [ "#### Multiple Subplots\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eac20c01", + "id": "b5ffa3b4", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "00f413c9", + "id": "a33e1b61", "metadata": {}, "source": [ "#### Multiple Subplots with Titles\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b348e1f", + "id": "b5192477", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "35056acb", + "id": "31ae5e6e", "metadata": {}, "source": [ "#### Subplots with Annotations" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dce4ab4b", + "id": "74c1235c", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "698b2a35", + "id": "32b1fefa", "metadata": {}, "source": [ "#### Customize Subplot Column Widths and Row Heights\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f99973c", + "id": "e8f4dd8d", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "16afd6c4", + "id": "3cc6bfbc", "metadata": {}, "source": [ "#### Subplots in Dash\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8f8811e", + "id": "a9e7dfbd", "metadata": { "hide_code": true }, @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "2815c6fa", + "id": "3f339647", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "be6f5043", + "id": "d94e05ec", "metadata": {}, "source": [ "#### Customizing Subplot Axes\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98e8d51d", + "id": "2b6ce65a", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "4be59865", + "id": "423f189d", "metadata": {}, "source": [ "#### Subplots with Shared X-Axes\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4d0796f", + "id": "5b164891", "metadata": {}, "outputs": [], "source": [ @@ -379,7 +379,7 @@ }, { "cell_type": "markdown", - "id": "cf27bce0", + "id": "8e83e0f0", "metadata": {}, "source": [ "#### Subplots with Shared Y-Axes\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e4d07d3", + "id": "a3ea5b08", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "8c17474d", + "id": "55abc918", "metadata": {}, "source": [ "### Subplots with Shared Colorscale\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f87f8a4", + "id": "2a6e26aa", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "a3c9468e", + "id": "f84a9ae8", "metadata": {}, "source": [ "#### Custom Sized Subplot with Subplot Titles\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86becd19", + "id": "2214b106", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "e53d4553", + "id": "a0495344", "metadata": {}, "source": [ "#### Multiple Custom Sized Subplots\n", @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b07f00fc", + "id": "7e47554b", "metadata": {}, "outputs": [], "source": [ @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "4962c990", + "id": "7ac24af3", "metadata": {}, "source": [ "#### Subplots Types\n", @@ -555,7 +555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e24f9fd5", + "id": "5b7473bc", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "1a58b7f4", + "id": "8c362729", "metadata": {}, "source": [ "As an alternative to providing the name of a subplot type (e.g. `\"xy\"`, `\"polar\"`, `\"domain\"`, `\"scene\"`, etc), the `type` option may also be set to a string containing the name of a trace type (e.g. `\"bar\"`, `\"barpolar\"`, `\"pie\"`, `\"scatter3d\"`, etc.), which will be used to determine the subplot type that is compatible with that trace.\n", @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2928c52", + "id": "15a5151f", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +632,7 @@ }, { "cell_type": "markdown", - "id": "6853578e", + "id": "93aed7b4", "metadata": {}, "source": [ "#### Side by Side Subplot (low-level API)" @@ -641,7 +641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5a8ca15", + "id": "1d7213e3", "metadata": {}, "outputs": [], "source": [ @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "13b16185", + "id": "ad910322", "metadata": {}, "source": [ "#### Subplots with shared axes (low-level API)" @@ -684,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "073b59f1", + "id": "7c996ac1", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "6bfce533", + "id": "a55a6be4", "metadata": {}, "source": [ "#### Stacked Subplots with a Shared X-Axis (low-level API)" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21efdd4f", + "id": "172cd692", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "8dc2a570", + "id": "1c1ef609", "metadata": {}, "source": [ "#### Setting Subplots on a Figure Directly\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08e787d0", + "id": "6db2a000", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "65ee03e1", + "id": "b8c467e3", "metadata": {}, "source": [ "is equivalent to:" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbac6812", + "id": "652c8d89", "metadata": {}, "outputs": [], "source": [ @@ -835,7 +835,7 @@ }, { "cell_type": "markdown", - "id": "f00b9214", + "id": "5dd790a9", "metadata": {}, "source": [ "#### Reference\n", @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92dbdf0e", + "id": "faa5c075", "metadata": { "lines_to_next_cell": 2 }, @@ -858,7 +858,7 @@ }, { "cell_type": "markdown", - "id": "92543f02", + "id": "99a8d420", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sunburst-charts.ipynb b/sunburst-charts.ipynb index 0464a6f1f..83426ac16 100644 --- a/sunburst-charts.ipynb +++ b/sunburst-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "196fb603", + "id": "bae5caa4", "metadata": {}, "source": [ "Sunburst plots visualize hierarchical data spanning outwards radially from root to leaves. Similar to [Icicle charts](https://plotly.com/python/icicle-charts/) and [Treemaps](https://plotly.com/python/treemaps/), the hierarchy is defined by `labels` (`names` for `px.icicle`) and `parents` attributes. The root starts from the center and children are added to the outer rings.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf75f6c5", + "id": "9822020f", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "7203e916", + "id": "ac19cc4f", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with plotly.express\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05444715", + "id": "3df807f7", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "78488496", + "id": "41d77fee", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with continuous color argument in px.sunburst\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f922afa9", + "id": "810f2348", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "ecbca661", + "id": "d3b6e92b", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with discrete color argument in px.sunburst\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd913f50", + "id": "3e1b9181", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "5d6e6fe3", + "id": "1c72d5bb", "metadata": {}, "source": [ "In the example below the color of `Saturday` and `Sunday` sectors is the same as `Dinner` because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1b6de2e", + "id": "b6fa5a51", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "a3563e60", + "id": "449662d2", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb804273", + "id": "1f87f126", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "9b0b3221", + "id": "5599fb9c", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6892af1a", + "id": "8c7771ac", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "d11d45b7", + "id": "1e0a38f9", "metadata": {}, "source": [ "### Basic Sunburst Plot with go.Sunburst\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86f2b2a9", + "id": "86ea9ee6", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "c2595b32", + "id": "4c3534de", "metadata": {}, "source": [ "### Sunburst with Repeated Labels" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3e0d7d8", + "id": "7ef58888", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "eabf3de1", + "id": "05bfc9d6", "metadata": {}, "source": [ "### Branchvalues\n", @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18400f9b", + "id": "8888f1fb", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "b7f4a6d5", + "id": "3a66ef64", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4b2a167", + "id": "e515de78", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "7aa87236", + "id": "462aa961", "metadata": {}, "source": [ "#### Controlling text orientation inside sunburst sectors\n", @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0eee9953", + "id": "16e4201d", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "f6175ccd", + "id": "fd827dc3", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85046d3a", + "id": "bb93a341", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "e6ae672a", + "id": "f13c31ab", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d48370c4", + "id": "919c22fb", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "6adde393", + "id": "6928c41f", "metadata": {}, "source": [ "### Sunburst chart with a continuous colorscale\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fd05073", + "id": "07c7e6a5", "metadata": {}, "outputs": [], "source": [ @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "140cf88c", + "id": "f184225c", "metadata": {}, "source": [ "#### Reference\n", @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "9e10a862", + "id": "a3ef2226", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/supported-colors.ipynb b/supported-colors.ipynb index 99a2eb42e..3b76bb0ed 100644 --- a/supported-colors.ipynb +++ b/supported-colors.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "09f4cbd5", + "id": "23b7f8f6", "metadata": {}, "source": [ "# Supported CSS Colors\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d53c582", + "id": "f2df9d24", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "6256635d", + "id": "a7381958", "metadata": {}, "source": [ "These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color)." @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc43f84b", + "id": "dd954ab0", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "18b40c53", + "id": "8bdec856", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table-subplots.ipynb b/table-subplots.ipynb index 95d7b73af..2ffea89a4 100644 --- a/table-subplots.ipynb +++ b/table-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "609d53fb", + "id": "20a4d62d", "metadata": {}, "source": [ "#### Import CSV Data" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b1326f7", + "id": "de16bb72", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "1a6c0f2c", + "id": "c6d0af5e", "metadata": {}, "source": [ "#### Reference\n", @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "58eb077e", + "id": "b9f8868e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table.ipynb b/table.ipynb index e25c259df..7ddb3fdc2 100644 --- a/table.ipynb +++ b/table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "14ea95f8", + "id": "446ea192", "metadata": {}, "source": [ "`go.Table` provides a Table object for detailed data viewing. The data are arranged in\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "772b1030", + "id": "36c0c8b1", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "80b0e179", + "id": "3e824399", "metadata": {}, "source": [ "#### Styled Table" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27c6272c", + "id": "c97544c6", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "8ce75479", + "id": "75bfe8aa", "metadata": {}, "source": [ "#### Use a Pandas Dataframe" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9e98a48", + "id": "5044b87c", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "84862d8b", + "id": "40e38497", "metadata": {}, "source": [ "#### Tables in Dash\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "180c4688", + "id": "97807b32", "metadata": { "hide_code": true }, @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "b60758af", + "id": "08723d6b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "e160f344", + "id": "88cb3c00", "metadata": {}, "source": [ "#### Changing Row and Column Size" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42fd08d3", + "id": "ffb5cd4a", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "58612a5d", + "id": "6ae2f03a", "metadata": {}, "source": [ "#### Alternating Row Colors" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97d6ae47", + "id": "6b019f19", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "53e13b63", + "id": "3204d70d", "metadata": {}, "source": [ "#### Row Color Based on Variable" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c5916f4", + "id": "f4587764", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "ddf13851", + "id": "f89e2407", "metadata": {}, "source": [ "#### Cell Color Based on Variable" @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7997a0a7", + "id": "dad3e4ed", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "7e54d18f", + "id": "4c096d98", "metadata": {}, "source": [ "#### Reference\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "636e68d7", + "id": "7aef88b5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/templates.ipynb b/templates.ipynb index c0defb3b7..854f28abe 100644 --- a/templates.ipynb +++ b/templates.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "40f99df3", + "id": "db56dc65", "metadata": {}, "source": [ "### Theming and templates\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c10db1c", + "id": "f3c7a74f", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "41f5ac29", + "id": "2207d270", "metadata": {}, "source": [ "From this, we can see that the default theme is `\"plotly\"`, and we can see the names of several additional themes that we can choose from.\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b70a015", + "id": "8fa2c9b9", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "72fcb07b", + "id": "a0619af4", "metadata": {}, "source": [ "#### Specifying themes in graph object figures\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8dd01ffa", + "id": "b75a2cfb", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "18a9e2fe", + "id": "409d4366", "metadata": {}, "source": [ "#### Specifying a default themes\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a66370e1", + "id": "c26e49bf", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "738bbb06", + "id": "0f7eb42f", "metadata": {}, "source": [ "#### Disable default theming\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02e861ef", + "id": "55d47b66", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "ac922630", + "id": "0ef8d4e4", "metadata": {}, "source": [ "### Creating themes\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "234140fc", + "id": "30a540af", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "f5596c62", + "id": "9bffd5db", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))`\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a62197a4", + "id": "c832369c", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "81af166e", + "id": "dd1a2cfd", "metadata": {}, "source": [ "If a trace type property is set to a list of more than one trace, then the default properties are cycled as more traces are added to the figure. Here is an example that creates a template that cycles the default marker symbol for scatter traces, and then constructs a figure that uses this template." @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "764d5c40", + "id": "39640f20", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "4c41ffb5", + "id": "dcbcbbb1", "metadata": {}, "source": [ "Note that because we built the template with a list of 3 scatter trace [graph objects](/python/graph-objects/) (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45b7c5b3", + "id": "fa921a3c", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "ff1ba1ca", + "id": "33881e55", "metadata": {}, "source": [ "#### Including tuple elements in a theme\n", @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a2038a0", + "id": "1e0d3c40", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "e7b2db04", + "id": "5f1720f7", "metadata": {}, "source": [ "#### Customizing theme tuple elements in a figure\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32462f6a", + "id": "b1c9477f", "metadata": {}, "outputs": [], "source": [ @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "a248319b", + "id": "ca7e40d7", "metadata": {}, "source": [ "#### Registering themes as named templates\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8971f86b", + "id": "8a228dfb", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "5e43d940", + "id": "11ee52bf", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])`\n", @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b3624ff", + "id": "7f370c37", "metadata": {}, "outputs": [], "source": [ @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "bd4cfadd", + "id": "e119d035", "metadata": {}, "source": [ "#### Combining themes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71afcb02", + "id": "a35f66dc", "metadata": {}, "outputs": [], "source": [ @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "253acc1c", + "id": "67625172", "metadata": {}, "source": [ "Combining themes is also supported by Plotly Express" @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e3c6682", + "id": "76d7113e", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "ff5cfd87", + "id": "a5015c3a", "metadata": {}, "source": [ "\n", @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "69cdaedc", + "id": "be148ec5", "metadata": {}, "source": [ "#### Examining built-in themes\n", @@ -630,7 +630,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a57e82d", + "id": "ea0ea088", "metadata": {}, "outputs": [], "source": [ @@ -641,7 +641,7 @@ }, { "cell_type": "markdown", - "id": "e971d01c", + "id": "7a2381d4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-contour.ipynb b/ternary-contour.ipynb index 05867ba79..3fab175c8 100644 --- a/ternary-contour.ipynb +++ b/ternary-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1e791828", + "id": "b6805d01", "metadata": {}, "source": [ "## Ternary contour plots" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "29dd9234", + "id": "289bc8f6", "metadata": {}, "source": [ "A ternary contour plots represents isovalue lines of a quantity defined inside a [ternary diagram](https://en.wikipedia.org/wiki/Ternary_plot), i.e. as a function of three variables which sum is constant. Coordinates of the ternary plot often correspond to concentrations of three species, and the quantity represented as contours is some property (e.g., physical, chemical, thermodynamical) varying with the composition.\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fda89cd", + "id": "fb386829", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "e223dbd4", + "id": "cbc80365", "metadata": {}, "source": [ "#### Customized ternary contour plot" @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b158d2", + "id": "2490f891", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "ca524155", + "id": "7ce468f9", "metadata": {}, "source": [ "#### Ternary contour plot with lines only" @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1be2007", + "id": "16d5736f", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "ad14d639", + "id": "a914db76", "metadata": {}, "source": [ "#### Ternary contour plot with data points\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c20662d", + "id": "cd516b1c", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "6358794d", + "id": "71e1396e", "metadata": {}, "source": [ "#### Interpolation mode\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abb12390", + "id": "698cecad", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85d63f42", + "id": "e95b5bb5", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "6b77eb5f", + "id": "93696083", "metadata": {}, "source": [ "#### Reference\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "e80b5f7d", + "id": "2814c382", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-plots.ipynb b/ternary-plots.ipynb index 4125866c2..feebd37ab 100644 --- a/ternary-plots.ipynb +++ b/ternary-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "150c0123", + "id": "230162ea", "metadata": {}, "source": [ "## Ternary Plots\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b93a166e", + "id": "ced5983b", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "677ea054", + "id": "3375298b", "metadata": {}, "source": [ "We can scale and color the markers to produce a ternary bubble chart." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c34b80bb", + "id": "23d92ec7", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "1bf159f1", + "id": "39285d7d", "metadata": {}, "source": [ "### Ternary scatter plot with Plotly Graph Objects" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4100118", + "id": "763ceab5", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "e3d71244", + "id": "7caf6153", "metadata": {}, "source": [ "#### Reference\n", @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "2aa6b098", + "id": "33325388", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-scatter-contour.ipynb b/ternary-scatter-contour.ipynb index a7b93e3ac..862077386 100644 --- a/ternary-scatter-contour.ipynb +++ b/ternary-scatter-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3d637493", + "id": "e63eb999", "metadata": {}, "source": [ "#### Load and Process Data Files" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f404a44", + "id": "b1e5224e", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "9a1cb5d5", + "id": "6ee270fd", "metadata": {}, "source": [ "#### Create Ternary Scatter Plot:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83ed5ee8", + "id": "6c17303c", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "0237ee58", + "id": "0abbb633", "metadata": {}, "source": [ "#### Create Ternary Contour Plot:" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98233787", + "id": "4ca243f0", "metadata": {}, "outputs": [], "source": [ @@ -155,14 +155,14 @@ { "cell_type": "code", "execution_count": null, - "id": "8489a6e6", + "id": "59138ebb", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "720514ba", + "id": "cbcdc329", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/text-and-annotations.ipynb b/text-and-annotations.ipynb index c2d3c92fb..3c6008104 100644 --- a/text-and-annotations.ipynb +++ b/text-and-annotations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "972b0753", + "id": "8836ed1a", "metadata": {}, "source": [ "### Adding Text to Figures\n", @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "id": "8f00c80e", + "id": "6c4b4906", "metadata": {}, "source": [ "### Text on scatter plots with Plotly Express\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5a96898", + "id": "4b20a70e", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "c9cbfefd", + "id": "58284ce4", "metadata": {}, "source": [ "### Text on scatter plots with Graph Objects" @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc4c37d5", + "id": "c6093e3f", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "1ca2d22a", + "id": "0ee93947", "metadata": {}, "source": [ "### Text positioning in Dash\n", @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "223b59ca", + "id": "6e8486e8", "metadata": { "hide_code": true }, @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "d5cc8fd3", + "id": "669ee899", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "6c0c786b", + "id": "bec9548a", "metadata": {}, "source": [ "### Controlling Text Size with `uniformtext`\n", @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "40c83013", + "id": "9c399300", "metadata": {}, "source": [ "Here is a bar chart with the default behavior which will scale down text to fit." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bb6f54f", + "id": "bf622568", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "8362b417", + "id": "e9d18c83", "metadata": {}, "source": [ "Here is the same figure with uniform text applied: the text for all bars is the same size, with a minimum size of 8. Any text at the minimum size which does not fit in the bar is hidden." @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d4c9084", + "id": "2dea225b", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab521fb6", + "id": "27cf5731", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "03946542", + "id": "4de725cc", "metadata": {}, "source": [ "### Controlling Maximum Text Size\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7747138a", + "id": "aeeb4ca5", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "e0933f40", + "id": "18103789", "metadata": {}, "source": [ "### Text Annotations\n", @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41492f40", + "id": "0f626004", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "1c474280", + "id": "ae6b0414", "metadata": {}, "source": [ "#### Text Annotations with Log Axes\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e01de8c", + "id": "b6f68284", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "ad1fd5c0", + "id": "58e903a5", "metadata": {}, "source": [ "### 3D Annotations" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dd0d8a6", + "id": "7dd3d013", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "46ef8f96", + "id": "2cfa490e", "metadata": {}, "source": [ "### Font Color, Size, and Familiy\n", @@ -418,7 +418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "953b20b3", + "id": "06fb700a", "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ }, { "cell_type": "markdown", - "id": "b7eef9fe", + "id": "1856fb9a", "metadata": {}, "source": [ "### Font Style, Variant, and Weight\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cca7c508", + "id": "dbdbb7f2", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "9ac5d358", + "id": "4ce8475d", "metadata": {}, "source": [ "## Numeric Font Weight\n", @@ -533,7 +533,7 @@ { "cell_type": "code", "execution_count": null, - "id": "508612d3", + "id": "492de68f", "metadata": {}, "outputs": [], "source": [ @@ -577,7 +577,7 @@ }, { "cell_type": "markdown", - "id": "909f9e10", + "id": "53a2a1a0", "metadata": {}, "source": [ "[scattergl](https://plotly.com/python/reference/scattergl) traces do not support all numeric font weights. When you specify a numeric font weight on `scattergl`, weights up to 500 are mapped to the keyword font weight \"normal\", while weights above 500 are mapped to \"bold\"." @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "82217035", + "id": "e56e3997", "metadata": {}, "source": [ "## Text Case\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5caa92b", + "id": "5f30f93c", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "981dc2a1", + "id": "05e6f65f", "metadata": {}, "source": [ "## Text Lines\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "726fb4f4", + "id": "92d49ac4", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "0a7b4272", + "id": "455440db", "metadata": {}, "source": [ "## Text Shadow\n", @@ -694,7 +694,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a4d533e", + "id": "f222ba89", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "06e58499", + "id": "45f7dc06", "metadata": {}, "source": [ "### Styling and Coloring Annotations" @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d774ad7", + "id": "07f51cea", "metadata": {}, "outputs": [], "source": [ @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "3335fdcb", + "id": "9cb3cf9f", "metadata": {}, "source": [ "### Text Font as an Array - Styling Each Text Element" @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22222133", + "id": "deb68aa3", "metadata": {}, "outputs": [], "source": [ @@ -852,7 +852,7 @@ }, { "cell_type": "markdown", - "id": "f19a1a4c", + "id": "c01d0901", "metadata": {}, "source": [ "### HTML Tags in Text\n", @@ -864,7 +864,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1df23796", + "id": "deece94f", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "beddfca3", + "id": "3236ebac", "metadata": {}, "source": [ "### Positioning Text Annotations Absolutely\n", @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "855b216a", + "id": "6fe38ac9", "metadata": {}, "outputs": [], "source": [ @@ -941,7 +941,7 @@ }, { "cell_type": "markdown", - "id": "8e7d0939", + "id": "249a87d1", "metadata": {}, "source": [ "### Adding Annotations Referenced to an Axis\n", @@ -954,7 +954,7 @@ { "cell_type": "code", "execution_count": null, - "id": "941025d5", + "id": "3edb8638", "metadata": {}, "outputs": [], "source": [ @@ -983,7 +983,7 @@ }, { "cell_type": "markdown", - "id": "7a70a525", + "id": "566f80aa", "metadata": {}, "source": [ "### Specifying the Text's Position Absolutely\n", @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab8960bd", + "id": "e7e401cf", "metadata": { "lines_to_next_cell": 0 }, @@ -1031,7 +1031,7 @@ }, { "cell_type": "markdown", - "id": "b6717e45", + "id": "cf7a1cb7", "metadata": {}, "source": [ "### Specifying Source Lines or Figure Notes on the Bottom of a Figure\n", @@ -1042,7 +1042,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52447a02", + "id": "9e17325c", "metadata": { "lines_to_next_cell": 2 }, @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "6ee67d52", + "id": "73ce6aef", "metadata": {}, "source": [ "### Customize Displayed Text with a Text Template\n", @@ -1123,7 +1123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e9f6bb8", + "id": "3f5a9d16", "metadata": {}, "outputs": [], "source": [ @@ -1140,7 +1140,7 @@ }, { "cell_type": "markdown", - "id": "b97af598", + "id": "5ce2dec0", "metadata": {}, "source": [ "### Customize Text Template\n", @@ -1151,7 +1151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b32d429", + "id": "ed4d8f6b", "metadata": {}, "outputs": [], "source": [ @@ -1173,7 +1173,7 @@ }, { "cell_type": "markdown", - "id": "c0bc7e3f", + "id": "89b49229", "metadata": {}, "source": [ "### Set Date in Text Template\n", @@ -1185,7 +1185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "423a694b", + "id": "5a884345", "metadata": {}, "outputs": [], "source": [ @@ -1216,7 +1216,7 @@ }, { "cell_type": "markdown", - "id": "937d1144", + "id": "acc1cd33", "metadata": {}, "source": [ "#### Reference\n", @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "16b1e58d", + "id": "f870b7b5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tick-formatting.ipynb b/tick-formatting.ipynb index e328eb75c..63ef256d8 100644 --- a/tick-formatting.ipynb +++ b/tick-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "325aca83", + "id": "502eeef6", "metadata": {}, "source": [ "#### Tickmode - Linear" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "5e944c7a", + "id": "6d6ea4a6", "metadata": {}, "source": [ "If `\"linear\"`, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`" @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d9509e1", + "id": "639e474f", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "9174d615", + "id": "7cd8e70d", "metadata": {}, "source": [ "#### Tickmode - Array" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "c50ccdcd", + "id": "527381ab", "metadata": {}, "source": [ "If `\"array\"`, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d941043a", + "id": "bac5f06b", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "5e8241c9", + "id": "0dba3555", "metadata": {}, "source": [ "### Dynamic tickmode in Dash\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfcf5a90", + "id": "fa73c075", "metadata": { "hide_code": true }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "23d81130", + "id": "fa9a3a61", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "e9bba9a7", + "id": "542e6909", "metadata": {}, "source": [ "#### Using Tickformat Attribute" @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "ccbf19c6", + "id": "2ed1314b", "metadata": {}, "source": [ "For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8470b950", + "id": "31264810", "metadata": {}, "outputs": [], "source": [ @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "21ce562e", + "id": "cab516eb", "metadata": {}, "source": [ "#### Using Tickformat Attribute - Date/Time" @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "56a445f5", + "id": "ed8c2b06", "metadata": {}, "source": [ "For more date/time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb2dfd1d", + "id": "2bf6112f", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "36fc1bde", + "id": "0b571327", "metadata": {}, "source": [ "#### Using Exponentformat Attribute" @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cdea3af", + "id": "3d764027", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "3c615096", + "id": "5be9895f", "metadata": {}, "source": [ "#### Tickformatstops to customize for different zoom levels" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "867d07f5", + "id": "9a569595", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "c897b661", + "id": "5314fab2", "metadata": {}, "source": [ "#### Placing ticks and gridlines between categories" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5960f21", + "id": "30479dc5", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "c56e2eaf", + "id": "7bf6c166", "metadata": {}, "source": [ "#### Reference\n", @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "e5d59043", + "id": "14ef993a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-county-choropleth.ipynb b/tile-county-choropleth.ipynb index 7f078e8e9..8b07e9f79 100644 --- a/tile-county-choropleth.ipynb +++ b/tile-county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6b8e7f97", + "id": "4fa1a23a", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **tile-map** choropleth maps, but you can also build [**outline** choropleth maps](/python/choropleth-maps).\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8504b243", + "id": "7103c5c7", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "dfbb6a4e", + "id": "83406c5a", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb70a214", + "id": "44e88fbf", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "3e7d7e53", + "id": "21f21910", "metadata": {}, "source": [ "### Choropleth map using plotly.express and carto base map\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a59382bf", + "id": "030aa18e", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "a885359c", + "id": "487cf2bb", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79543dc2", + "id": "7eec644a", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "aabca4a6", + "id": "0dd675dc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "6f3385de", + "id": "014f553e", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06e86383", + "id": "4f8dc7fe", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "f417be92", + "id": "f9978f41", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron." @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2355dfef", + "id": "688a36cc", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "1e971476", + "id": "8461f8a3", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c018281e", + "id": "632b2498", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "8880787f", + "id": "d3ab0e0f", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -239,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22e7c212", + "id": "aaffaa92", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "f3cf889a", + "id": "aea85812", "metadata": {}, "source": [ "### Choropleth map using plotly.graph_objects and carto base map\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48e6ceed", + "id": "6fce96bf", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "d9cd953c", + "id": "b41de31b", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "589097d1", + "id": "68f7d1a1", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "9427c52b", + "id": "a3214ece", "metadata": {}, "source": [ "#### Reference\n", @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "837a5064", + "id": "af23ec8f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-map-layers.ipynb b/tile-map-layers.ipynb index a9c7d72b0..63d2bed31 100644 --- a/tile-map-layers.ipynb +++ b/tile-map-layers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "808f2c1c", + "id": "c8ea616f", "metadata": {}, "source": [ "\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4064d0e", + "id": "888670b1", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "4470b36a", + "id": "1957bc6c", "metadata": {}, "source": [ "#### Using `layout.map.layers` to Specify a Base Map\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "269de45b", + "id": "1f0e8e77", "metadata": { "lines_to_next_cell": 2 }, @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "5037bbe0", + "id": "fdf96fd9", "metadata": {}, "source": [ "#### Base Tiles from the USGS, radar overlay from Environment Canada\n", @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dea5098", + "id": "61d5d435", "metadata": { "lines_to_next_cell": 2 }, @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "d23e306b", + "id": "0dcb759f", "metadata": {}, "source": [ "#### Dark tiles example\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bae996a4", + "id": "a1f236e9", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "246e6adc", + "id": "db7af991", "metadata": {}, "source": [ "#### Stamen Watercolor using a Custom Style URL\n", @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "4e7389b0", + "id": "181407ee", "metadata": {}, "source": [ "### Mapbox\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7b6c7a7", + "id": "83ff65cc", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "39c0a43f", + "id": "81608fc0", "metadata": {}, "source": [ "#### Using `layout.mapbox.layers` to Specify a Base Map\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec3138b6", + "id": "762201f5", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "849a31a6", + "id": "1ebdedaa", "metadata": {}, "source": [ "#### Dark tiles from Mapbox service: free token needed\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bce1fa34", + "id": "e81102ee", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "630cc11f", + "id": "cf08733e", "metadata": {}, "source": [ "## Setting Map Bounds\n", @@ -389,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa02f160", + "id": "409239f8", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "2b5d3f19", + "id": "c363d83d", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "e8547f07", + "id": "5eb4e6d3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-scatter-maps.ipynb b/tile-scatter-maps.ipynb index 235f8f7eb..5bc39e56f 100644 --- a/tile-scatter-maps.ipynb +++ b/tile-scatter-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0a1a8675", + "id": "03bcc332", "metadata": {}, "source": [ "### Basic example with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "977db984", + "id": "13df13b7", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "d171d3e3", + "id": "d5100a3f", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09b34359", + "id": "1d9e5cb0", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "26c288a9", + "id": "9f5becf4", "metadata": {}, "source": [ "#### Basic Example" @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82dafbd5", + "id": "bc6e5d5e", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "e7a52687", + "id": "073a65e9", "metadata": {}, "source": [ "#### Multiple Markers" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02d9f33d", + "id": "841f8cb7", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "3c73c840", + "id": "7ba4a3e5", "metadata": {}, "source": [ "#### Nuclear Waste Sites on Campuses" @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f843f1d3", + "id": "d770b6f4", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "5656cae2", + "id": "0e58734e", "metadata": {}, "source": [ "### Set Marker Symbols\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb32d1de", + "id": "a9dfd676", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "47320202", + "id": "bb2c2d44", "metadata": {}, "source": [ "#### Supported Symbols\n", @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "c7a7b9db", + "id": "39a30fce", "metadata": {}, "source": [ "#### Add Clusters\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "904174d1", + "id": "d84eebf0", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "7c82b9ac", + "id": "b76e7363", "metadata": {}, "source": [ "#### Font Customization\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07bcffc6", + "id": "b85f1a28", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "b274a10f", + "id": "aa2407be", "metadata": {}, "source": [ "`go.Scattermap` supports the following values for `textfont.family`:\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "bddbca66", + "id": "24d59566", "metadata": {}, "source": [ "##### Font Weight\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "480a0b95", + "id": "14f4a796", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "c7fa9960", + "id": "5bb43aa2", "metadata": {}, "source": [ "## Mapbox Maps\n", @@ -422,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d915174", + "id": "5848eac1", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "15ac2031", + "id": "094eb189", "metadata": {}, "source": [ "And here's an example using Graph Objects:" @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "987afc33", + "id": "88efb673", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "243433bd", + "id": "d0b741c6", "metadata": {}, "source": [ "#### Reference\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "b9e88a63", + "id": "d7d0434b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/time-series.ipynb b/time-series.ipynb index 42aa164e9..89d62d135 100644 --- a/time-series.ipynb +++ b/time-series.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67ed5d48", + "id": "c1d8fe60", "metadata": {}, "source": [ "### Time Series using Axes of type `date`\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a39de459", + "id": "fcddd276", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7db72c40", + "id": "5147e13a", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "9df50170", + "id": "c424c9fc", "metadata": {}, "source": [ "### Time Series in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b167a8f2", + "id": "e1e70a02", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "31f052f3", + "id": "8c241572", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "a87b07bd", + "id": "87a6d815", "metadata": {}, "source": [ "### Different Chart Types on Date Axes\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbc6df13", + "id": "6086e31c", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "cf8595d3", + "id": "84203786", "metadata": {}, "source": [ "Or this [facetted](/python/facet-plots/) area plot:" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7ab120e", + "id": "8a27eb34", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "d781aedc", + "id": "d2458448", "metadata": {}, "source": [ "### Configuring Tick Labels\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "992b5803", + "id": "e41e1dca", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "8d936e76", + "id": "617cd988", "metadata": {}, "source": [ "### Moving Tick Labels to the Middle of the Period\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dc70643", + "id": "13a82741", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "a3051560", + "id": "774aae5f", "metadata": {}, "source": [ "### Adding Minor Ticks\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca1ddcbc", + "id": "4f601491", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "66114ee8", + "id": "6ea695ed", "metadata": {}, "source": [ "#### Monthly Period Labels With Weekly Minor Ticks\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56483f52", + "id": "df2d8f83", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "1cd840f3", + "id": "a6869ebb", "metadata": {}, "source": [ "### Summarizing Time-series Data with Histograms\n", @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5476a87", + "id": "c745fb04", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "fad6c8d6", + "id": "f2154219", "metadata": {}, "source": [ "### Displaying Period Data\n", @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7cbc70c", + "id": "799a38c7", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "8705d865", + "id": "d4472744", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9851b728", + "id": "08f82079", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "5c0624eb", + "id": "cf9d8d2a", "metadata": { "tags": [] }, @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f30df76b", + "id": "6349e6d7", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7d94a39", + "id": "7590a6ac", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06b7c879", + "id": "793038cb", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "a8a5a076", + "id": "ebcdb0e4", "metadata": {}, "source": [ "### Time Series With Range Slider\n", @@ -485,7 +485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6821ce11", + "id": "c33b700c", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ }, { "cell_type": "markdown", - "id": "43f085a0", + "id": "9349c85e", "metadata": {}, "source": [ "### Time Series with Range Selector Buttons\n", @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27e309c6", + "id": "ca7e0a47", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "0ac067a5", + "id": "a85e348a", "metadata": {}, "source": [ "### Customizing Tick Label Formatting by Zoom Level\n", @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2a7f193", + "id": "5b995634", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "7fd01012", + "id": "fec7c85e", "metadata": {}, "source": [ "### Hiding Weekends and Holidays\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b6b87c4", + "id": "d5fb6dad", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2630f0b4", + "id": "b1c8c5f6", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "49c17a87", + "id": "6715a3ea", "metadata": {}, "source": [ "### Hiding Non-Business Hours\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12215daa", + "id": "993814ea", "metadata": {}, "outputs": [], "source": [ @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f64b0a47", + "id": "f81eb7b2", "metadata": { "lines_to_next_cell": 2 }, @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "8805d792", + "id": "8635df7a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tree-plots.ipynb b/tree-plots.ipynb index 008db049d..e3f3ac8d7 100644 --- a/tree-plots.ipynb +++ b/tree-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b4f4f374", + "id": "7218d865", "metadata": {}, "source": [ "#### Set Up Tree with [igraph](http://igraph.org/python/)\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55585b9d", + "id": "19fe07f7", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d66d57cf", + "id": "e397b2c7", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "a030793f", + "id": "ccc630e1", "metadata": {}, "source": [ "#### Create Plotly Traces" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7214d2f0", + "id": "203bed6d", "metadata": {}, "outputs": [], "source": [ @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "2d85da20", + "id": "bc7c8c7e", "metadata": {}, "source": [ "#### Create Text Inside the Circle via Annotations" @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df76b4a", + "id": "740963e7", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "a86e2fe1", + "id": "9850f897", "metadata": {}, "source": [ "#### Add Axis Specifications and Create the Layout" @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd3a91d0", + "id": "b9774c47", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "2cfed538", + "id": "9bc3b51d", "metadata": {}, "source": [ "#### Reference\n", @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "c1a70bc2", + "id": "81ba7a18", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/treemaps.ipynb b/treemaps.ipynb index 1278aa8e3..77e690fb4 100644 --- a/treemaps.ipynb +++ b/treemaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "62078fc0", + "id": "b89eb3b7", "metadata": {}, "source": [ "[Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. The input data format is the same as for [Sunburst Charts](https://plotly.com/python/sunburst-charts/) and [Icicle Charts](https://plotly.com/python/icicle-charts/): the hierarchy is defined by [labels](https://plotly.com/python/reference/treemap/#treemap-labels) (`names` for `px.treemap`) and [parents](https://plotly.com/python/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f6012b0", + "id": "23662f0c", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "fedffd13", + "id": "943fe452", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with plotly.express\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e20c4e96", + "id": "762bdaf2", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "be1d6da8", + "id": "ca4f025d", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with continuous color argument in px.treemap\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "639a70e3", + "id": "4fed21a1", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "a495b2f0", + "id": "a27a2d2d", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with discrete color argument in px.treemap\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49baecb6", + "id": "b41bb82d", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "e167bf6a", + "id": "fbf19bf2", "metadata": {}, "source": [ "In the example below the color of Saturday and Sunday sectors is the same as Dinner because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36bcb2b8", + "id": "5c0a783e", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "56c8216d", + "id": "305f983e", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f0efd90", + "id": "a19c30d9", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "6b801d4f", + "id": "93d98d02", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2094b950", + "id": "5c17aead", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "bb137f2a", + "id": "4e450570", "metadata": {}, "source": [ "### Treemap with Rounded Corners" @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "285c95a7", + "id": "baee977e", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb36b6a2", + "id": "b379b588", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "e33b8b51", + "id": "5fce027c", "metadata": {}, "source": [ "### Basic Treemap with go.Treemap\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1df9f0cd", + "id": "1f0c28eb", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "3ea6cf9c", + "id": "26e15d91", "metadata": {}, "source": [ "### Set Different Attributes in Treemap\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cb10627", + "id": "92fde0c1", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "e54d7df3", + "id": "c49ad348", "metadata": {}, "source": [ "### Set Color of Treemap Sectors\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fabcf37", + "id": "f6dc2e6b", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "0db66731", + "id": "178808a7", "metadata": {}, "source": [ "This example uses `treemapcolorway` attribute, which should be set in layout." @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3ae666d", + "id": "22f2525b", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5e3cbcb", + "id": "9ba15522", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "dfa07a99", + "id": "bb1e35af", "metadata": {}, "source": [ "### Treemap chart with a continuous colorscale\n", @@ -428,7 +428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3c1be4e", + "id": "77c8f9e3", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "c15d5e81", + "id": "81bfea48", "metadata": {}, "source": [ "### Nested Layers in Treemap\n", @@ -519,7 +519,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0afbe528", + "id": "44a2f343", "metadata": {}, "outputs": [], "source": [ @@ -546,7 +546,7 @@ }, { "cell_type": "markdown", - "id": "561a4e64", + "id": "2e9414d5", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -559,7 +559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8b0e7e5", + "id": "2cface09", "metadata": {}, "outputs": [], "source": [ @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "580e26cd", + "id": "b10dc8b4", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "675ba177", + "id": "f2717779", "metadata": {}, "outputs": [], "source": [ @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "3e62c5a6", + "id": "25e516f8", "metadata": {}, "source": [ "#### Reference\n", @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "3fae783f", + "id": "792fd093", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/trisurf.ipynb b/trisurf.ipynb index 544ffd1d6..1167b60e6 100644 --- a/trisurf.ipynb +++ b/trisurf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "eb4dc6d8", + "id": "64bb9067", "metadata": {}, "source": [ "Trisurf plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e83fa99", + "id": "0e204ed0", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "fc719e7f", + "id": "5525fc66", "metadata": {}, "source": [ "#### Mobius Band\n" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "400d5312", + "id": "b87d1929", "metadata": { "lines_to_next_cell": 2 }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "fd61d9f7", + "id": "f0499a1a", "metadata": {}, "source": [ "#### Boy's Surface\n" @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec8ebdcc", + "id": "093b13bb", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "d8ba2520", + "id": "fb7fada0", "metadata": {}, "source": [ "#### Reference\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "e730c896", + "id": "3efcca27", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index 627e76ae6..811437d96 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1c522670", + "id": "c705e3af", "metadata": {}, "source": [ "### Version Problems\n", @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cefde0a4", + "id": "791baf02", "metadata": { "hide_code": true }, @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "4bd2a26b", + "id": "3765adb2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "81efac6a", + "id": "506edd27", "metadata": {}, "source": [ "### VSCode Notebook, Nteract and Streamlit Problems\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "ba971a3d", + "id": "14bd6ae9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v4-migration.ipynb b/v4-migration.ipynb index 03e5b9749..f42148635 100644 --- a/v4-migration.ipynb +++ b/v4-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "498bd39c", + "id": "ebd7aad3", "metadata": {}, "source": [ "### Upgrading to Version 4\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "da5fd04e", + "id": "986e773a", "metadata": {}, "source": [ "### Online features (`plotly.plotly`) moved to `chart-studio` package\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "119a0ae6", + "id": "19008902", "metadata": {}, "source": [ "### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export\n", @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "fc0434d3", + "id": "d77f2377", "metadata": {}, "source": [ "### New default theme\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ecdfb49", + "id": "b2b020d3", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "f827b71f", + "id": "4e335447", "metadata": {}, "source": [ "You can revert to the version 3 figure appearance by disabling the default theme as follows:" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3301f85e", + "id": "86207d4a", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e3dd9d7", + "id": "378bf235", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "4b02a38c", + "id": "fc9011f8", "metadata": {}, "source": [ "See [Theming and templates](/python/templates) for more information on theming in plotly.py version 4.\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f008e218", + "id": "05323e90", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "eceb7912", + "id": "341c5dec", "metadata": {}, "source": [ "Code that relied on the `add_*` methods to return a reference to the newly created trace will need to be updated to access the trace from the returned figure. This can be done by appending `.data[-1]` to the add trace expression.\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "a4a84eba", + "id": "85a15b2b", "metadata": {}, "source": [ "### `make_subplots` updates\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adb3b88b", + "id": "06c3998b", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "abf1f3a7", + "id": "1a1ec486", "metadata": {}, "source": [ "And here is the equivalent, version 4 example. Note how the order to the height list is reversed compared to the example above." @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2a190a6", + "id": "f125e022", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "d1d99687", + "id": "aecfe60e", "metadata": {}, "source": [ "#### Implementation of shared axes with `make_subplots`\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b93b57b", + "id": "a7727adc", "metadata": {}, "outputs": [], "source": [ @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "691f3144", + "id": "34568d77", "metadata": {}, "source": [ "### Trace UIDs\n", @@ -339,7 +339,7 @@ }, { "cell_type": "markdown", - "id": "79428e3e", + "id": "abc8d1f1", "metadata": {}, "source": [ "### Headless image export on Linux with Xvfb.\n", @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "9f9d9eaf", + "id": "9e39b8c6", "metadata": {}, "source": [ "### Removals\n", @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "b9bc2942", + "id": "cdd0a716", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v6-changes.ipynb b/v6-changes.ipynb index da9743cc9..3283d32cf 100644 --- a/v6-changes.ipynb +++ b/v6-changes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "13c854e4", + "id": "03f30ee2", "metadata": {}, "source": [ "This page outlines the changes in Plotly.py version 6 and cases where you may need to update your charts or tools that you use for working with Plotly.py." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "c56f832c", + "id": "daf8b584", "metadata": {}, "source": [ "## Jupyter Notebook Support\n", @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "482427c8", + "id": "4adcb150", "metadata": { "lines_to_next_cell": 2 }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "5d269660", + "id": "5ba81203", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/violin.ipynb b/violin.ipynb index ed4fe60d0..c583c12ab 100644 --- a/violin.ipynb +++ b/violin.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "761564a1", + "id": "af0f4cdd", "metadata": {}, "source": [ "## Violin Plot with Plotly Express\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c18fc828", + "id": "68bf9b7a", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "05395eff", + "id": "b00ebc46", "metadata": {}, "source": [ "### Violin plot with box and data points" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcd7b8a4", + "id": "f700c333", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "c4e7b77b", + "id": "f02c24e6", "metadata": {}, "source": [ "### Multiple Violin Plots" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a9bdd3b", + "id": "b64345dd", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ef04247", + "id": "e2c6bf88", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "ba7cc9bc", + "id": "27e9e209", "metadata": {}, "source": [ "## Violin Plot with go.Violin\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "900d55d7", + "id": "06b80c8e", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "7ec3f977", + "id": "ab012f5c", "metadata": {}, "source": [ "#### Multiple Traces" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51620bbd", + "id": "fd7b0a21", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "3c1afbc8", + "id": "d33ee8a9", "metadata": {}, "source": [ "#### Grouped Violin Plot" @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "238b2dac", + "id": "6638ed21", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "b8b1592c", + "id": "b600a6dc", "metadata": {}, "source": [ "#### Split Violin Plot" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a13a64a", + "id": "8722368b", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "090d6798", + "id": "b41e4107", "metadata": {}, "source": [ "#### Advanced Violin Plot" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d852915e", + "id": "8db6010a", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "3624a795", + "id": "d75f6e89", "metadata": {}, "source": [ "#### Ridgeline plot\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4917e6fb", + "id": "454d415e", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "97dca615", + "id": "111c96df", "metadata": {}, "source": [ "### Violin Plot With Only Points\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88c45df7", + "id": "d68b9e30", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "dee1e12e", + "id": "1db9a963", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de38a36c", + "id": "fd5c2338", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "f61c3979", + "id": "f9d9fd16", "metadata": {}, "source": [ "#### Reference\n", @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "7a3010f0", + "id": "d8a95ae0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/waterfall-charts.ipynb b/waterfall-charts.ipynb index 19994fb6e..769d42cc4 100644 --- a/waterfall-charts.ipynb +++ b/waterfall-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "39fc89de", + "id": "5fe656d9", "metadata": {}, "source": [ "### Simple Waterfall Chart" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be1aeca7", + "id": "94093757", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "96a82919", + "id": "2ecc95da", "metadata": {}, "source": [ "### Multi Category Waterfall Chart\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47b25baa", + "id": "b37fa8fb", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "1cae3559", + "id": "b03c6ebf", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "396eae2d", + "id": "00a92a5d", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "8f0d67c3", + "id": "14a095f3", "metadata": {}, "source": [ "### Horizontal Waterfall Chart" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cebd874d", + "id": "359261eb", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "d3a9da44", + "id": "1431c71f", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "d5e4233c", + "id": "567d292e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wide-form.ipynb b/wide-form.ipynb index 7fa84e641..c43a3e52c 100644 --- a/wide-form.ipynb +++ b/wide-form.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "34e2da2a", + "id": "3e6d080a", "metadata": {}, "source": [ "### Plotly Express works with Column-oriented, Matrix or Geographic Data\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ec8d6c1", + "id": "f41137ee", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "840361be", + "id": "da17b8e1", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "fde2db73", + "id": "fd8b621f", "metadata": {}, "source": [ "Plotly Express can produce **the same plot from either form**. For the long-form input, `x` and `y` are set to the respective column names." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f50675a8", + "id": "2d1772b0", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "a9508874", + "id": "3b335e6f", "metadata": {}, "source": [ "For the wide-form input, we **pass in a list of column-names `y`**, which is enough to trigger the wide-form processing mode. Wide-form mode is also the default if neither `x` nor `y` are specified, see section at bottom regarding Wide-Form Defaults." @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ee58f4c", + "id": "d8f7fe5d", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "6368c4c6", + "id": "09f6cad7", "metadata": {}, "source": [ "### Labeling axes, legends and hover text\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2993ec81", + "id": "6a540b34", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "d44b6354", + "id": "cff7797b", "metadata": {}, "source": [ "Plotly Express figures created using wide-form data can be [styled just like any other Plotly Express figure](/python/styling-plotly-express/):" @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "958fe9a3", + "id": "2374dd54", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "f7c5ba91", + "id": "e24606e4", "metadata": {}, "source": [ "### Data Frames with Named Indexes\n", @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92a73864", + "id": "b22a1ab4", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "863539e4", + "id": "1c237947", "metadata": {}, "source": [ "When working with a data frame like the one above, you can pass the index references directly as arguments, to benefit from automatic labelling for everything except the y axis label, which will default to \"values\", but this can be overridden with the `labels` argument as above:" @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "004eb455", + "id": "dd7d9b8c", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "be54132c", + "id": "784957e9", "metadata": {}, "source": [ "If you transpose `x` and `y`, thereby assigning the columns to `x`, the orientation will be switched to horizontal:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00e54ece", + "id": "4115129d", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "9c466877", + "id": "554ae50e", "metadata": {}, "source": [ "### Assigning Inferred Columns to Non-Default Arguments" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "7135374d", + "id": "1832051f", "metadata": {}, "source": [ "In the examples above, the columns of the wide data frame are assigned by default as an \"inferred\" column named `variable` to the `color` argument (see section below for documentation of the default behaviours), but this is not a hard constraint. The `variable` column can be assigned to any Plotly Express argument, for example to accomplish faceting, and `color` can be reassigned to any other value. More generally, when plotting with a data frame without named indexes, you can reassign the inferred column named `variable` and `value` to any argument:" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf2fcb9f", + "id": "fae939c9", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "91b43387", + "id": "aeea3033", "metadata": {}, "source": [ "You can also prevent `color` from getting assigned if you're mapping `variable` to some other argument:" @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43095d44", + "id": "e7efb51d", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "cbfacfac", + "id": "8dbf16a2", "metadata": {}, "source": [ "If using a data frame's named indexes, either explicitly or relying on the defaults, the row-index references (i.e. `df.index`) or column-index names (i.e. the value of `df.columns.name`) must be used:" @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "615d6de4", + "id": "9d8c1ffa", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "ba0025b0", + "id": "595f93df", "metadata": {}, "source": [ "### Mixed-Form Data\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69f939ab", + "id": "6e85acb8", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "836d0918", + "id": "119d9daf", "metadata": {}, "source": [ "We can visualize just the wide-form portion of the data frame easily with a [violin chart](/python/violin/). As a special note, we'll assign the index, which is the participant ID, to the `hover_data`, so that hovering over outlier points will identify their row." @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eeebd767", + "id": "35109b16", "metadata": { "lines_to_next_cell": 0 }, @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "baf00244", + "id": "bea63b6b", "metadata": {}, "source": [ "\n" @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "7e1c3657", + "id": "041f5f73", "metadata": {}, "source": [ "We are not limited to visualizing only the wide-form portion of the data, however. We can also leverage the long-form portion of the data frame, for example to color by participant `gender` and facet by participant `group`, all without having to manipulate the data frame:" @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75f8da83", + "id": "1ccfe629", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "ea0725ea", + "id": "dcbf5e77", "metadata": {}, "source": [ "In the plots above, the column names provided to `y` are internally mapped to long-form column called `variable`, as is apparent in the x-axis labels. We can reassign `variable` to another argument as well, in this case we'll assign it to `facet_col` and reassign `group` to the `x` axis. We'll switch to a [box plot](/python/box-plots/) for variety." @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ee6ee6d", + "id": "93980fd5", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ }, { "cell_type": "markdown", - "id": "8a55687e", + "id": "41111ca4", "metadata": {}, "source": [ "One interesting thing about a mixed-form data frame like this is that it remains easy to plot, say, one experiment against another, which would require some preliminary data wrangling if this was represented as a pure long-form dataset:" @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e86e5923", + "id": "a055110e", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "e6543010", + "id": "9710427f", "metadata": {}, "source": [ "In fact, we can even visualize the results of every experiment against every other, using a [scatterplot matrix](/python/splom/):" @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "722ef7dc", + "id": "05074149", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "c51d6d42", + "id": "7614920d", "metadata": {}, "source": [ "### Wide-Form Defaults\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8695c802", + "id": "2ec4466b", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0b395f8", + "id": "3587e3ab", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "84f26f35", + "id": "ad02f898", "metadata": {}, "source": [ "### Orientation Control When Using Defaults\n", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bc7cd46", + "id": "60dc86f3", "metadata": { "lines_to_next_cell": 2 }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "69a80c9a", + "id": "44b4f0ab", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wind-rose-charts.ipynb b/wind-rose-charts.ipynb index 103eac9bc..bba9f72ff 100644 --- a/wind-rose-charts.ipynb +++ b/wind-rose-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7ec3fa65", + "id": "13994026", "metadata": {}, "source": [ "### Wind Rose Chart with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f5fab58", + "id": "8958549a", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "df1b2420", + "id": "b29cb588", "metadata": {}, "source": [ "#### Basic Wind Rose Chart" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66da5759", + "id": "8d5a195e", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "08535408", + "id": "5edc2342", "metadata": {}, "source": [ "#### Reference\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "e1eb6401", + "id": "730a4439", "metadata": {}, "source": [ "### What About Dash?\n", From 87fb827ecbd09b9510cc2fa44e72fbe8942669d6 Mon Sep 17 00:00:00 2001 From: plotlydocbot Date: Mon, 16 Mar 2026 18:44:17 +0000 Subject: [PATCH 3/5] build of https://github.com/plotly/plotly.py/commit/4e98be7cf198d1b8a6faa099e9fe2892d3f0a21b --- 2D-Histogram.ipynb | 50 +++--- 2d-histogram-contour.ipynb | 40 ++--- 3d-axes.ipynb | 30 ++-- 3d-bubble-charts.ipynb | 20 +-- 3d-camera-controls.ipynb | 44 ++--- 3d-isosurface-plots.ipynb | 36 ++-- 3d-line-plots.ipynb | 14 +- 3d-mesh.ipynb | 32 ++-- 3d-scatter-plots.ipynb | 30 ++-- 3d-subplots.ipynb | 10 +- 3d-surface-plots.ipynb | 32 ++-- 3d-volume.ipynb | 30 ++-- LaTeX.ipynb | 8 +- animations.ipynb | 36 ++-- annotated-heatmap.ipynb | 40 ++--- axes.ipynb | 212 ++++++++++++------------ bar-charts.ipynb | 164 +++++++++--------- bio-alignment-chart.ipynb | 10 +- bio-clustergram.ipynb | 18 +- bio-manhattanplot.ipynb | 14 +- bio-volcano-plot.ipynb | 14 +- box-plots.ipynb | 86 +++++----- bubble-charts.ipynb | 32 ++-- bubble-maps.ipynb | 20 +-- builtin-colorscales.ipynb | 28 ++-- bullet-charts.ipynb | 22 +-- candlestick-charts.ipynb | 30 ++-- carpet-contour.ipynb | 16 +- carpet-plot.ipynb | 32 ++-- carpet-scatter.ipynb | 18 +- categorical-axes.ipynb | 48 +++--- choropleth-maps.ipynb | 62 +++---- click-events.ipynb | 14 +- colorscales.ipynb | 124 +++++++------- cone-plot.ipynb | 24 +-- configuration-options.ipynb | 60 +++---- continuous-error-bars.ipynb | 10 +- contour-plots.ipynb | 60 +++---- county-choropleth.ipynb | 42 ++--- creating-and-updating-figures.ipynb | 128 +++++++------- custom-buttons.ipynb | 24 +-- dash.ipynb | 4 +- dendrogram.ipynb | 20 +-- density-heatmaps.ipynb | 16 +- discrete-color.ipynb | 66 ++++---- distplot.ipynb | 58 +++---- dot-plots.ipynb | 16 +- dropdowns.ipynb | 26 +-- dumbbell-plots.ipynb | 12 +- ecdf-plots.ipynb | 56 +++---- error-bars.ipynb | 40 ++--- facet-plots.ipynb | 52 +++--- figure-factories.ipynb | 4 +- figure-factory-subplots.ipynb | 26 +-- figure-factory-table.ipynb | 42 ++--- figure-introspection.ipynb | 58 +++---- figure-labels.ipynb | 40 ++--- figure-structure.ipynb | 18 +- figurewidget-app.ipynb | 34 ++-- figurewidget.ipynb | 42 ++--- filled-area-plots.ipynb | 46 ++--- filled-area-tile-maps.ipynb | 18 +- funnel-charts.ipynb | 44 ++--- gantt.ipynb | 34 ++-- gauge-charts.ipynb | 16 +- getting-started.ipynb | 30 ++-- graph-objects.ipynb | 8 +- graphing-multiple-chart-types.ipynb | 26 +-- heatmaps.ipynb | 56 +++---- hexbin-mapbox.ipynb | 28 ++-- histograms.ipynb | 118 ++++++------- horizontal-bar-charts.ipynb | 36 ++-- horizontal-vertical-shapes.ipynb | 36 ++-- hover-text-and-formatting.ipynb | 88 +++++----- icicle-charts.ipynb | 86 +++++----- images.ipynb | 28 ++-- imshow.ipynb | 114 ++++++------- indicator.ipynb | 36 ++-- interactive-html-export.ipynb | 20 +-- ipython-vs-python.ipynb | 16 +- jupyter-lab-tools.ipynb | 12 +- legend.ipynb | 120 +++++++------- line-and-scatter.ipynb | 120 +++++++------- line-charts.ipynb | 70 ++++---- linear-fits.ipynb | 54 +++--- lines-on-maps.ipynb | 28 ++-- lines-on-tile-maps.ipynb | 20 +-- location-mode.ipynb | 28 ++-- log-plot.ipynb | 28 ++-- map-configuration.ipynb | 46 ++--- map-subplots-and-small-multiples.ipynb | 8 +- marginal-plots.ipynb | 28 ++-- marker-style.ipynb | 64 +++---- migrate-to-maplibre.ipynb | 4 +- mixed-subplots.ipynb | 10 +- ml-knn.ipynb | 34 ++-- ml-pca.ipynb | 38 ++--- ml-regression.ipynb | 64 +++---- ml-roc-pr.ipynb | 30 ++-- ml-tsne-umap-projections.ipynb | 28 ++-- ml_apps.ipynb | 4 +- multiple-axes.ipynb | 38 ++--- network-graphs.ipynb | 28 ++-- ohlc-charts.ipynb | 28 ++-- orca-management.ipynb | 56 +++---- pandas-backend.ipynb | 40 ++--- parallel-categories-diagram.ipynb | 32 ++-- parallel-coordinates-plot.ipynb | 30 ++-- pattern-hatching-texture.ipynb | 40 ++--- peak-finding.ipynb | 18 +- performance.ipynb | 30 ++-- pie-charts.ipynb | 72 ++++---- plot-data-from-csv.ipynb | 22 +-- plotly-express.ipynb | 154 ++++++++--------- polar-chart.ipynb | 52 +++--- px-arguments.ipynb | 70 ++++---- quiver-plots.ipynb | 12 +- radar-chart.ipynb | 20 +-- random-walk.ipynb | 18 +- range-slider.ipynb | 12 +- renderers.ipynb | 56 +++---- sankey-diagram.ipynb | 46 ++--- scatter-plots-on-maps.ipynb | 28 ++-- selections.ipynb | 46 ++--- setting-graph-size.ipynb | 30 ++-- shapes.ipynb | 134 +++++++-------- sliders.ipynb | 14 +- smith-charts.ipynb | 16 +- smoothing.ipynb | 14 +- splom.ipynb | 42 ++--- static-image-export.ipynb | 34 ++-- static-image-generation-migration.ipynb | 4 +- streamline-plots.ipynb | 14 +- streamtube-plot.ipynb | 20 +-- strip-charts.ipynb | 12 +- styling-plotly-express.ipynb | 22 +-- subplots.ipynb | 90 +++++----- sunburst-charts.ipynb | 64 +++---- supported-colors.ipynb | 10 +- table-subplots.ipynb | 8 +- table.ipynb | 38 ++--- templates.ipynb | 68 ++++---- ternary-contour.ipynb | 28 ++-- ternary-plots.ipynb | 16 +- ternary-scatter-contour.ipynb | 16 +- text-and-annotations.ipynb | 114 ++++++------- tick-formatting.ipynb | 46 ++--- tile-county-choropleth.ipynb | 46 ++--- tile-map-layers.ipynb | 38 ++--- tile-scatter-maps.ipynb | 52 +++--- time-series.ipynb | 82 ++++----- tree-plots.ipynb | 22 +-- treemaps.ipynb | 72 ++++---- trisurf.ipynb | 16 +- troubleshooting.ipynb | 10 +- v4-migration.ipynb | 42 ++--- v6-changes.ipynb | 8 +- violin.ipynb | 50 +++--- waterfall-charts.ipynb | 20 +-- wide-form.ipynb | 86 +++++----- wind-rose-charts.ipynb | 12 +- 161 files changed, 3237 insertions(+), 3237 deletions(-) diff --git a/2D-Histogram.ipynb b/2D-Histogram.ipynb index baa51c6db..73c44d520 100644 --- a/2D-Histogram.ipynb +++ b/2D-Histogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8dc84dc0", + "id": "d9662818", "metadata": {}, "source": [ "## 2D Histograms or Density Heatmaps\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfe5e1c2", + "id": "8aeeab75", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "36d8bba7", + "id": "24279572", "metadata": {}, "source": [ "The number of bins can be controlled with `nbinsx` and `nbinsy` and the [color scale](/python/colorscales/) with `color_continuous_scale`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0756e4e0", + "id": "5ce43d40", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "afcd39e2", + "id": "f4a1f145", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1f30426", + "id": "2c74f195", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "3644c5b0", + "id": "759688e7", "metadata": {}, "source": [ "Density heatmaps can also be [faceted](/python/facet-plots/):" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f225595", + "id": "b0cf28f4", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "5cba3817", + "id": "32dbaa04", "metadata": {}, "source": [ "### Displaying Text\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c8406c7", + "id": "1f9ccf60", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "dd56481d", + "id": "d8790d38", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0227938c", + "id": "4e71f295", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "9ae1c057", + "id": "6d06dec7", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "65677ddc", + "id": "8a06bfc8", "metadata": {}, "source": [ "### 2D Histogram of a Bivariate Normal Distribution ###" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa777ab6", + "id": "7ff9e32b", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "a4fb0de3", + "id": "cd0fb562", "metadata": {}, "source": [ "### 2D Histogram Binning and Styling Options ###" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2bdaed7", + "id": "d648bdb5", "metadata": { "lines_to_next_cell": 0 }, @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "a47087e6", + "id": "e21406de", "metadata": {}, "source": [ "### Sharing bin settings between 2D Histograms\n", @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0808f8cd", + "id": "e27b0791", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "290daf0b", + "id": "85721272", "metadata": {}, "source": [ "### 2D Histogram Overlaid with a Scatter Chart ###" @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "601cf338", + "id": "21637adf", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ }, { "cell_type": "markdown", - "id": "a4b32380", + "id": "1e7fe704", "metadata": {}, "source": [ "### Text on 2D Histogram Points\n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeabff2d", + "id": "5ce447a2", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "d82eb2d7", + "id": "a665e30b", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "48661e41", + "id": "334bf9ec", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/2d-histogram-contour.ipynb b/2d-histogram-contour.ipynb index 7e99a5831..91e10cfe0 100644 --- a/2d-histogram-contour.ipynb +++ b/2d-histogram-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4273cc9c", + "id": "6825575e", "metadata": {}, "source": [ "## 2D Histogram Contours or Density Contours\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ee78e9e", + "id": "42610ab1", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "5e295c95", + "id": "1c9da593", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bde6d7d2", + "id": "b26d79d6", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "29683cd5", + "id": "85da1750", "metadata": {}, "source": [ "Density contours can also be [faceted](/python/facet-plots/) and [discretely colored](/python/discrete-color/):" @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca1937c3", + "id": "0bb5a207", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "17061dc9", + "id": "be715338", "metadata": {}, "source": [ "Plotly Express density contours can be [continuously-colored](/python/colorscales/) and labeled:" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59716818", + "id": "1ea3d080", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "3c6d1d46", + "id": "5bbb92ce", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e41d308", + "id": "5e35a741", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "5b13b078", + "id": "09ced9b3", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ca37cb5", + "id": "031e7f02", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "a01a53ab", + "id": "e74df09c", "metadata": {}, "source": [ "#### 2D Histogram Contour Colorscale" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0890fcd8", + "id": "d66653f9", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "fb337951", + "id": "7431239d", "metadata": {}, "source": [ "#### 2D Histogram Contour Styled" @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e6be156", + "id": "e8d9c52a", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "b04b7237", + "id": "503c867f", "metadata": {}, "source": [ "#### 2D Histogram Contour Subplot" @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f782aee7", + "id": "fe1f2887", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "90783ffa", + "id": "ee80390e", "metadata": {}, "source": [ "#### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "8a506e51", + "id": "eb75bc89", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-axes.ipynb b/3d-axes.ipynb index d167656db..110ef9185 100644 --- a/3d-axes.ipynb +++ b/3d-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "33ddeeec", + "id": "df3b7a74", "metadata": {}, "source": [ "### Range of axes\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bbb0f41", + "id": "1d1a5c68", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "5e2dc448", + "id": "471a7ad8", "metadata": {}, "source": [ "### Setting only a Lower or Upper Bound for Range\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1abb904", + "id": "36d18e94", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "5246c45a", + "id": "2b632731", "metadata": {}, "source": [ "### Fixed Ratio Axes" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0911c371", + "id": "e04184be", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "665afa7c", + "id": "42a619e2", "metadata": {}, "source": [ "### Set Axes Title" @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb94510c", + "id": "c74c8e06", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "9d97885a", + "id": "cc34f350", "metadata": {}, "source": [ "### Ticks Formatting" @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2f81ec2", + "id": "2e8494ec", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "6dc46794", + "id": "20cd3168", "metadata": {}, "source": [ "### Background and Grid Color" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff2944f5", + "id": "86bea75d", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "d4a491a3", + "id": "dc8ad68f", "metadata": {}, "source": [ "### Disabling tooltip spikes\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "920a897f", + "id": "ad10239e", "metadata": { "lines_to_next_cell": 2 }, @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "932451ef", + "id": "00491ad8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-bubble-charts.ipynb b/3d-bubble-charts.ipynb index d7b0c3931..d8730b0fa 100644 --- a/3d-bubble-charts.ipynb +++ b/3d-bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "57ecf3a2", + "id": "9928e3bf", "metadata": {}, "source": [ "### 3d Bubble chart with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c7267dd", + "id": "5f92ca76", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "ab6a15a7", + "id": "a15b648c", "metadata": {}, "source": [ "#### Simple Bubble Chart" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32c112c6", + "id": "7eb6b6fe", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "69110ffc", + "id": "ba967f03", "metadata": {}, "source": [ "#### Bubble Chart Sized by a Variable\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d427507f", + "id": "a955129c", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "bf16dbe2", + "id": "0d3b85ec", "metadata": {}, "source": [ "#### Edit the Colorbar\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abbd8739", + "id": "0d54e1e1", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "9ad71454", + "id": "a40ee5d1", "metadata": {}, "source": [ "#### Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "b7552a8e", + "id": "9db0b825", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-camera-controls.ipynb b/3d-camera-controls.ipynb index 4ae6c0904..aef6804d5 100644 --- a/3d-camera-controls.ipynb +++ b/3d-camera-controls.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "26553a31", + "id": "681d835e", "metadata": {}, "source": [ "### How camera controls work\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "f952b116", + "id": "27486ec3", "metadata": {}, "source": [ "### Default parameters" @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2aa9bf3e", + "id": "8162a4fb", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "05647546", + "id": "50b9bd6c", "metadata": {}, "source": [ "### Changing the camera position by setting the eye parameter\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34658d37", + "id": "82c95e8e", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "1616b0a4", + "id": "4b85863c", "metadata": {}, "source": [ "#### X-Z plane\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4969bc6a", + "id": "c7e1bdc4", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "ac34709b", + "id": "b2a55645", "metadata": {}, "source": [ "#### Y-Z plane" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dce7801", + "id": "c74a950e", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "0cd916ad", + "id": "eb7754a5", "metadata": {}, "source": [ "#### View from Above (X-Y plane)" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25cdfc1a", + "id": "8a7d1b30", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "e7edf960", + "id": "363e8569", "metadata": {}, "source": [ "#### Zooming In\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "621c6465", + "id": "f81f667e", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "74997a15", + "id": "b08b4b3f", "metadata": {}, "source": [ "### Tilting the camera vertical by setting the up parameter\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "140ea857", + "id": "0cdcb84a", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "72129e30", + "id": "79078b06", "metadata": {}, "source": [ "Note when `up` does not correspond to the direction of an axis, you also need to set `layout.scene.dragmode='orbit'`." @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95e0f809", + "id": "2dbc67cb", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "54320ae5", + "id": "74cbb42d", "metadata": {}, "source": [ "### Changing the focal point by setting center\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1c5084a", + "id": "c555b219", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "58bb7805", + "id": "b5329beb", "metadata": {}, "source": [ "#### Reference" @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "297e9794", + "id": "25585e1e", "metadata": {}, "source": [ "See https://plotly.com/python/reference/layout/scene/#layout-scene-camera for more information and chart attribute options!" @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "a108863c", + "id": "89209a76", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-isosurface-plots.ipynb b/3d-isosurface-plots.ipynb index 569c292c2..910554dbb 100644 --- a/3d-isosurface-plots.ipynb +++ b/3d-isosurface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b4218774", + "id": "779b1777", "metadata": {}, "source": [ "With ``go.Isosurface``, you can plot [isosurface contours](https://en.wikipedia.org/wiki/Isosurface) of a scalar field ``value``, which is defined on ``x``, ``y`` and ``z`` coordinates.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "448df02f", + "id": "62f08015", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "5648bf0c", + "id": "b7657d42", "metadata": {}, "source": [ "### Removing caps when visualizing isosurfaces\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a27368f", + "id": "d3a9f81c", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "3067e799", + "id": "1fff0b13", "metadata": {}, "source": [ "### Modifying the number of isosurfaces" @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d9801e4", + "id": "8a714cc0", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "a2698071", + "id": "51d29b6f", "metadata": {}, "source": [ "### Changing the opacity of isosurfaces" @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a23911f", + "id": "ab7a4d8d", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "8b12ed49", + "id": "c52b06a3", "metadata": {}, "source": [ "#### Isosurface with Additional Slices\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f9e3d18", + "id": "14996338", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "5cef91d9", + "id": "4b2661c1", "metadata": {}, "source": [ "#### Multiple Isosurfaces with Caps" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54cb9bd0", + "id": "83789b7a", "metadata": {}, "outputs": [], "source": [ @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "073df59d", + "id": "d71b6a05", "metadata": {}, "source": [ "### Changing the default colorscale of isosurfaces" @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b9786b7", + "id": "d773d509", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "7ba6042c", + "id": "865d66c9", "metadata": {}, "source": [ "### Customizing the layout and appearance of isosurface plots" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7f6265b", + "id": "372e1a06", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "b7f7f9e0", + "id": "68e7aea1", "metadata": {}, "source": [ "#### Reference\n", @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "02a30060", + "id": "5785c341", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-line-plots.ipynb b/3d-line-plots.ipynb index 0dd54f181..e0faa5bb3 100644 --- a/3d-line-plots.ipynb +++ b/3d-line-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3607a5d2", + "id": "68174746", "metadata": {}, "source": [ "### 3D Line plot with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf5975b6", + "id": "0ef33dd3", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bc552b4", + "id": "fafdcb82", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "a0c0309c", + "id": "73251b93", "metadata": {}, "source": [ "#### 3D Line Plot of Brownian Motion\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "304b4ef7", + "id": "932b52d3", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "78079711", + "id": "f366b350", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "5381107a", + "id": "61c74450", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-mesh.ipynb b/3d-mesh.ipynb index 591196289..0c2b87d7e 100644 --- a/3d-mesh.ipynb +++ b/3d-mesh.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "64640c9d", + "id": "72c82be2", "metadata": {}, "source": [ "### Simple 3D Mesh example ###\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d130c0ec", + "id": "15c09ee7", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "179c718d", + "id": "4490dfe8", "metadata": {}, "source": [ "### 3D Mesh example with Alphahull" @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "235aba92", + "id": "3ca67d60", "metadata": {}, "source": [ "The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body)." @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2eb4010", + "id": "ede8a244", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "1224b3b8", + "id": "54beced8", "metadata": {}, "source": [ "### 3D Mesh in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdeb1da2", + "id": "2c91d160", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "2b966616", + "id": "9af84ca0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "8ecc668d", + "id": "f8f2bf86", "metadata": {}, "source": [ "### Mesh Tetrahedron\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f14378e9", + "id": "698a1586", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "a81403e6", + "id": "be2abfce", "metadata": {}, "source": [ "### Mesh Cube" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5103a0f6", + "id": "9b595925", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "44b262a1", + "id": "759317e0", "metadata": {}, "source": [ "### Intensity values defined on vertices or cells\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "569c7277", + "id": "8aba6393", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "907c2fc4", + "id": "d806df13", "metadata": {}, "source": [ "## Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "604c8bff", + "id": "20411988", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-scatter-plots.ipynb b/3d-scatter-plots.ipynb index 30ea7ad96..ac835c2a2 100644 --- a/3d-scatter-plots.ipynb +++ b/3d-scatter-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "19218a41", + "id": "dae83191", "metadata": {}, "source": [ "## 3D scatter plot with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c629cc06", + "id": "1140f4f2", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "ed73e1b9", + "id": "9116bb40", "metadata": {}, "source": [ "A 4th dimension of the data can be represented thanks to the color of the markers. Also, values from the `species` column are used below to assign symbols to markers." @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38446313", + "id": "f4da6650", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "ba6d1371", + "id": "fb49cac0", "metadata": {}, "source": [ "#### Style 3d scatter plot\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd801780", + "id": "d2ce8a72", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "a39bed90", + "id": "733825e3", "metadata": {}, "source": [ "#### 3d scatter plots in Dash\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cd9c38a", + "id": "f3891054", "metadata": { "hide_code": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "8fbb9a5a", + "id": "414ea834", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "a35b07bf", + "id": "0150bc2d", "metadata": {}, "source": [ "### 3D Scatter Plot with go.Scatter3d\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90fefb71", + "id": "2cda20ba", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "42e0b157", + "id": "f71a6fe6", "metadata": {}, "source": [ "#### 3D Scatter Plot with Colorscaling and Marker Styling" @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f8b0769", + "id": "c520ff6a", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "d56d9ab2", + "id": "c5aaf369", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "301d1dd4", + "id": "b60ea58d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-subplots.ipynb b/3d-subplots.ipynb index 4ce2d9369..a5303dd7d 100644 --- a/3d-subplots.ipynb +++ b/3d-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3c0e141a", + "id": "402dec48", "metadata": {}, "source": [ "#### 3D Surface Subplots" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "823fb48b", + "id": "8ca63b0d", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "d67a66b9", + "id": "fba67ddb", "metadata": {}, "source": [ "#### Reference" @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "cd733457", + "id": "264cd1bb", "metadata": {}, "source": [ "See https://plotly.com/python/subplots/ for more information regarding subplots!" @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "b288cdc4", + "id": "3fa1f3d8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-surface-plots.ipynb b/3d-surface-plots.ipynb index f3727df2a..babebaf66 100644 --- a/3d-surface-plots.ipynb +++ b/3d-surface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2eee3f8c", + "id": "5342b37a", "metadata": {}, "source": [ "#### Topographical 3D Surface Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e979bc8f", + "id": "bf884f6f", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "1d7d0545", + "id": "e37301a5", "metadata": {}, "source": [ "### Passing x and y data to 3D Surface Plot\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b0774dc", + "id": "cb9f2df4", "metadata": { "lines_to_next_cell": 2 }, @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "b73008d9", + "id": "3bfff2ff", "metadata": {}, "source": [ "#### Surface Plot With Contours" @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "b251ea1b", + "id": "1d8f9980", "metadata": {}, "source": [ "Display and customize contour data for each axis using the `contours` attribute ([reference](https://plotly.com/python/reference/surface/#surface-contours))." @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69312444", + "id": "697d2802", "metadata": { "lines_to_next_cell": 0 }, @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "64685c4a", + "id": "b0519b93", "metadata": {}, "source": [ "#### Configure Surface Contour Levels\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44d0fc6a", + "id": "3c643bd9", "metadata": { "lines_to_next_cell": 0 }, @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "c38c11b4", + "id": "24a0e0ed", "metadata": {}, "source": [ "#### Multiple 3D Surface Plots" @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d01b733", + "id": "510e94ab", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "2cd4d31a", + "id": "973d1039", "metadata": {}, "source": [ "### Setting the Surface Color\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae39b431", + "id": "4bf8fe0b", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "ae3b3470", + "id": "722f288b", "metadata": {}, "source": [ "#### Reference" @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "ba6b63dc", + "id": "700e4265", "metadata": {}, "source": [ "See https://plotly.com/python/reference/surface/ for more information!\n" @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "2d4b5862", + "id": "6eede161", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-volume.ipynb b/3d-volume.ipynb index c170cf2b3..8ecaf3826 100644 --- a/3d-volume.ipynb +++ b/3d-volume.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7a26351b", + "id": "4b034130", "metadata": {}, "source": [ "A volume plot with `go.Volume` shows several partially transparent isosurfaces for volume rendering. The API of `go.Volume` is close to the one of `go.Isosurface`. However, whereas [isosurface plots](/python/3d-isosurface-plots/) show all surfaces with the same opacity, tweaking the `opacityscale` parameter of `go.Volume` results in a depth effect and better volume rendering.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c267fc55", + "id": "fb1580cc", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2351e21", + "id": "7f0f2a5a", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26164806", + "id": "c3430e04", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "4bde799c", + "id": "6b1c6bd6", "metadata": {}, "source": [ "### Defining the opacity scale of volume plots\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afc3c292", + "id": "082378c4", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "5bcc0c1d", + "id": "280cbdbf", "metadata": {}, "source": [ "### Defining a custom opacity scale\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31feff01", + "id": "f4a58a93", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "b97f6e69", + "id": "8f069409", "metadata": {}, "source": [ "### Adding caps to a volume plot\n", @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "124788db", + "id": "e564af97", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38c76161", + "id": "11e52cfc", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "88f743c2", + "id": "33b3d611", "metadata": {}, "source": [ "### Adding slices to a volume plot\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2aa62af9", + "id": "0df3335b", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "a68ef2bb", + "id": "384a2db7", "metadata": {}, "source": [ "#### Reference\n", @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "18238b22", + "id": "923cbcbf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/LaTeX.ipynb b/LaTeX.ipynb index 617575488..6c645e902 100644 --- a/LaTeX.ipynb +++ b/LaTeX.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "319bc510", + "id": "37a30826", "metadata": {}, "source": [ "#### LaTeX Typesetting\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08456004", + "id": "f51e9e9d", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "223394e3", + "id": "da50d94c", "metadata": { "lines_to_next_cell": 2 }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "0d3f67cb", + "id": "8910e431", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/animations.ipynb b/animations.ipynb index c2faddb71..7fbf9c944 100644 --- a/animations.ipynb +++ b/animations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5b4c9ded", + "id": "70d0b3fe", "metadata": {}, "source": [ "#### Animated figures with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6360c2d7", + "id": "503f6f6c", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "2ca4c38a", + "id": "69b95262", "metadata": {}, "source": [ "#### Animated figures in Dash\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f66b3862", + "id": "7d83a23a", "metadata": { "hide_code": true }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "13af89aa", + "id": "cac9321a", "metadata": {}, "source": [ "#### Animated Bar Charts with Plotly Express\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7c2f137", + "id": "1228b878", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "df2d2670", + "id": "94a4e2c1", "metadata": {}, "source": [ "### Current Animation Limitations and Caveats\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "d3d9e442", + "id": "23633264", "metadata": {}, "source": [ "\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "921e0d28", + "id": "36c7cdcd", "metadata": {}, "source": [ "#### Defining Button Arguments\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9e8ec15", + "id": "3d0c07bc", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "56d0fada", + "id": "56121bf6", "metadata": {}, "source": [ "#### Moving Point on a Curve" @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39e32316", + "id": "f9711cbb", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "9f429125", + "id": "c6a97f51", "metadata": {}, "source": [ "#### Moving Frenet Frame Along a Planar Curve" @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65d167bd", + "id": "9f2263d3", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "1701f156", + "id": "39ceba3e", "metadata": {}, "source": [ "#### Using a Slider and Buttons\n", @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c452de4", + "id": "aebd331d", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "0e779ae8", + "id": "b7603a95", "metadata": {}, "source": [ "#### Important Notes\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "9398f7a0", + "id": "a179c884", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/annotated-heatmap.ipynb b/annotated-heatmap.ipynb index d85910fb0..c607a9590 100644 --- a/annotated-heatmap.ipynb +++ b/annotated-heatmap.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9264da9c", + "id": "c6eece07", "metadata": {}, "source": [ "### Annotated Heatmaps with Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "5e7ce647", + "id": "2fcb4eb7", "metadata": {}, "source": [ "#### Basic Annotated Heatmap for z-annotations\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b9eddc1", + "id": "ff02e445", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "a1b218cb", + "id": "84f57b4d", "metadata": {}, "source": [ "### Deprecated Figure Factory\n", @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "f01b7538", + "id": "5538f1af", "metadata": {}, "source": [ "#### Simple Annotated Heatmap" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a1b8971", + "id": "b0f6e250", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "aa45f7b2", + "id": "9113b4b1", "metadata": {}, "source": [ "#### Custom Text and X & Y Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5fe25c0", + "id": "98122382", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "1042667b", + "id": "1cad5251", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe9918e4", + "id": "45abe9df", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "e5888252", + "id": "c8612f1c", "metadata": {}, "source": [ "#### Annotated Heatmap with numpy" @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f1eafd1", + "id": "ca090d68", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "ca9185fa", + "id": "6e90433e", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56dbe878", + "id": "d0477d35", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "50cb43da", + "id": "fbdbe80d", "metadata": {}, "source": [ "Here is a fairly contrived example showing how one can display a periodic table with custom text and hover using `ff.create_annotated_heatmap()` (scroll below to see the `px.imshow()` equivalent)." @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21d9a8ab", + "id": "486abb77", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "9f9c9be7", + "id": "1a6ef23f", "metadata": {}, "source": [ "Here is the same output using `px.imshow()` with much less array manipulation:" @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a32aa99", + "id": "b5367ade", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "080cf408", + "id": "2ed5fe6a", "metadata": {}, "source": [ "#### Reference\n", @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "39a8ab79", + "id": "14eab73f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/axes.ipynb b/axes.ipynb index e56d2e2e9..b94b05814 100644 --- a/axes.ipynb +++ b/axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e887ad35", + "id": "85f520cd", "metadata": {}, "source": [ "This tutorial explains how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/yaxis/).\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "ee69ae05", + "id": "560f05c5", "metadata": {}, "source": [ "### Forcing an axis to be categorical\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80fa3e78", + "id": "6a83a81e", "metadata": { "lines_to_next_cell": 2 }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "dfe8d33f", + "id": "1a1ca41a", "metadata": {}, "source": [ "#### General Axis properties\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "9ebfc1ca", + "id": "46ffd3a5", "metadata": {}, "source": [ "#### Set and Style Axes Title Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "120b10f1", + "id": "fddda020", "metadata": {}, "outputs": [], "source": [ @@ -106,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "8dfd2ca0", + "id": "8e17b75f", "metadata": {}, "source": [ "Axis titles (and [legend titles](/python/legend/)) can also be overridden using the `labels` argument of Plotly Express functions:" @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fef31960", + "id": "ef4c55f8", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "b6ba6d5a", + "id": "243a939e", "metadata": {}, "source": [ "The PX `labels` argument can also be used without a data frame argument:\n" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04533c46", + "id": "6828eabd", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "56b288bc", + "id": "b6a8ca2d", "metadata": {}, "source": [ "##### Rotating tick labels in Dash\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac7e9a5b", + "id": "fa2b3efa", "metadata": { "hide_code": true }, @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "7a891523", + "id": "bb1cd2c8", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "92e79c3d", + "id": "65d44d54", "metadata": {}, "source": [ "#### Moving Tick Labels Inside the Plot\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67b70acd", + "id": "7937735d", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "0c6737db", + "id": "be830bcd", "metadata": {}, "source": [ "#### Specifying Label Aliases\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb6512c7", + "id": "5016d6fb", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "0a8f6771", + "id": "30d67ea4", "metadata": {}, "source": [ "##### Set axis title text with Graph Objects\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b2e446d", + "id": "95f48603", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "85be7c9e", + "id": "eaf301c1", "metadata": {}, "source": [ "### Set axis title position\n", @@ -280,7 +280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ebef35d2", + "id": "8f371ff0", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "9037434c", + "id": "e68e0097", "metadata": {}, "source": [ "##### Set axis title font\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a06fe45f", + "id": "bdba7ac8", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "22b1c806", + "id": "eee2de49", "metadata": {}, "source": [ "#### Tick Placement, Color, and Style\n", @@ -348,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaecc6ed", + "id": "868ea83c", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "ffb4d10a", + "id": "cceca3ce", "metadata": {}, "source": [ "##### Set number of tick marks (and grid lines)\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bddbbb9a", + "id": "5c750ef7", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "ba660806", + "id": "a79d6bda", "metadata": {}, "source": [ "##### Set start position and distance between ticks\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e67b3b94", + "id": "d3b926c2", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "1ee4fd60", + "id": "c3143552", "metadata": {}, "source": [ "##### Set exact location of axis ticks\n", @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57e6ff42", + "id": "7c19c38c", "metadata": {}, "outputs": [], "source": [ @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "e9048c37", + "id": "8c04e098", "metadata": {}, "source": [ "##### Style tick marks\n", @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7212f623", + "id": "92463036", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "150fc91e", + "id": "012cdf32", "metadata": {}, "source": [ "##### Step for tick labels\n", @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d659a61", + "id": "a5a400c9", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "79f84a2a", + "id": "0bb67670", "metadata": {}, "source": [ "##### Toggling axis labels\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61be9d10", + "id": "481f7133", "metadata": {}, "outputs": [], "source": [ @@ -536,7 +536,7 @@ }, { "cell_type": "markdown", - "id": "0d5026af", + "id": "a125f852", "metadata": {}, "source": [ "##### Set axis label rotation and font\n", @@ -549,7 +549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fefadc6e", + "id": "815377c1", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "8563c281", + "id": "4b93bb9c", "metadata": {}, "source": [ "##### Auto Tick Angle Options\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "119db8f5", + "id": "0d58c40f", "metadata": {}, "outputs": [], "source": [ @@ -593,7 +593,7 @@ }, { "cell_type": "markdown", - "id": "6271aeab", + "id": "ea051c0e", "metadata": {}, "source": [ "#### Enumerated Ticks with Tickvals and Ticktext\n", @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78783fae", + "id": "71774626", "metadata": {}, "outputs": [], "source": [ @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "cc2cd17a", + "id": "08971130", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea106db6", + "id": "72ef0231", "metadata": {}, "outputs": [], "source": [ @@ -685,7 +685,7 @@ }, { "cell_type": "markdown", - "id": "48f1ee45", + "id": "39af8288", "metadata": {}, "source": [ "#### Adjust Tick Label Positions\n", @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36af67c0", + "id": "569cf341", "metadata": {}, "outputs": [], "source": [ @@ -727,7 +727,7 @@ }, { "cell_type": "markdown", - "id": "848b841d", + "id": "1674417e", "metadata": {}, "source": [ "#### Use Minor Tick for Label\n", @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4d75e50", + "id": "21cc53ea", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "6ec2450f", + "id": "310ea594", "metadata": {}, "source": [ "### Axis lines: grid and zerolines\n", @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ae70809", + "id": "7552c30c", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "a3c6d551", + "id": "c017a397", "metadata": {}, "source": [ "##### Toggling Axis zero lines\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "439f8c6e", + "id": "ccc71297", "metadata": {}, "outputs": [], "source": [ @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "aa872e2a", + "id": "9220fced", "metadata": {}, "source": [ "#### Styling and Coloring Axes and the Zero-Line\n", @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51cba33f", + "id": "62af0a78", "metadata": {}, "outputs": [], "source": [ @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "fb750e63", + "id": "d66c2faf", "metadata": {}, "source": [ "##### Mirroring axis lines\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15d92ba1", + "id": "a01d33a9", "metadata": {}, "outputs": [], "source": [ @@ -882,7 +882,7 @@ }, { "cell_type": "markdown", - "id": "2aa0b1a2", + "id": "823091d2", "metadata": {}, "source": [ "##### Styling grid lines\n", @@ -895,7 +895,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b684da50", + "id": "0dc3dd7c", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "58942ba7", + "id": "9f7e2d9f", "metadata": {}, "source": [ "_new in 5.8_\n", @@ -922,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "693310cb", + "id": "3f3ef6d0", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "45be420d", + "id": "c5f35e99", "metadata": {}, "source": [ "##### Styling zero lines\n", @@ -950,7 +950,7 @@ { "cell_type": "code", "execution_count": null, - "id": "887a770f", + "id": "ac565d11", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "d8d9066b", + "id": "b533247a", "metadata": {}, "source": [ "##### Controlling Zero Line Layer\n", @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "127f6aaa", + "id": "5d58a7d9", "metadata": {}, "outputs": [], "source": [ @@ -1010,7 +1010,7 @@ }, { "cell_type": "markdown", - "id": "7f979e76", + "id": "b9ff1f63", "metadata": {}, "source": [ "#### Setting the Range of Axes Manually\n", @@ -1023,7 +1023,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12446377", + "id": "b4a14bff", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "a668bfde", + "id": "2fdfc086", "metadata": {}, "source": [ "#### Exclude Inside Tick Labels from Range\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bfb84f2", + "id": "2b946b4d", "metadata": {}, "outputs": [], "source": [ @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "56ca29b6", + "id": "f35a85e6", "metadata": {}, "source": [ "#### Setting only a Lower or Upper Bound for Range\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49d6041e", + "id": "050607da", "metadata": {}, "outputs": [], "source": [ @@ -1099,7 +1099,7 @@ }, { "cell_type": "markdown", - "id": "13dcdaba", + "id": "90038aa9", "metadata": {}, "source": [ "#### Setting a Maximum and Minimum Allowed Axis Value\n", @@ -1112,7 +1112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17fd6b41", + "id": "ac1668b6", "metadata": {}, "outputs": [], "source": [ @@ -1129,7 +1129,7 @@ }, { "cell_type": "markdown", - "id": "ed78c6ac", + "id": "c64340ad", "metadata": {}, "source": [ "#### Disabling Pan/Zoom on Axes (Fixed Range)\n", @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b013798", + "id": "0e93740a", "metadata": {}, "outputs": [], "source": [ @@ -1155,7 +1155,7 @@ }, { "cell_type": "markdown", - "id": "2e33cf24", + "id": "fa64d62a", "metadata": {}, "source": [ "### Fixed Ratio Axes\n", @@ -1168,7 +1168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28c7f061", + "id": "dba9eddb", "metadata": {}, "outputs": [], "source": [ @@ -1196,7 +1196,7 @@ }, { "cell_type": "markdown", - "id": "da856997", + "id": "3a9f00b4", "metadata": {}, "source": [ "### Fixed Ratio Axes with Compressed domain\n", @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5d293f6", + "id": "0cd5afa7", "metadata": {}, "outputs": [], "source": [ @@ -1235,7 +1235,7 @@ }, { "cell_type": "markdown", - "id": "f0a9fed7", + "id": "1adba07b", "metadata": {}, "source": [ "##### Decreasing the domain spanned by an axis\n", @@ -1246,7 +1246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea82e5c9", + "id": "7ede0aae", "metadata": {}, "outputs": [], "source": [ @@ -1279,7 +1279,7 @@ }, { "cell_type": "markdown", - "id": "687d1904", + "id": "1b66d1af", "metadata": {}, "source": [ "#### Reversed Axes\n", @@ -1292,7 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab89be52", + "id": "9bb249aa", "metadata": {}, "outputs": [], "source": [ @@ -1307,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "4094bbc5", + "id": "b5bc45cc", "metadata": {}, "source": [ "#### Reversed Axes with Range ( Min/Max ) Specified\n", @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3c5dcbb", + "id": "0ab161d2", "metadata": {}, "outputs": [], "source": [ @@ -1335,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "1da0b7be", + "id": "dcb0e809", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1346,7 +1346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30543289", + "id": "75fa845f", "metadata": {}, "outputs": [], "source": [ @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "0a7bfe1e", + "id": "a7b5326a", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1373,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c681d2d6", + "id": "93c20656", "metadata": {}, "outputs": [], "source": [ @@ -1389,7 +1389,7 @@ }, { "cell_type": "markdown", - "id": "cbcb7189", + "id": "124ab20c", "metadata": {}, "source": [ "### Axis range for log axis type\n", @@ -1400,7 +1400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "216a6ac3", + "id": "9b01a098", "metadata": {}, "outputs": [], "source": [ @@ -1415,7 +1415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04aef08f", + "id": "dafa2feb", "metadata": {}, "outputs": [], "source": [ @@ -1431,7 +1431,7 @@ }, { "cell_type": "markdown", - "id": "fd37530e", + "id": "52d91f95", "metadata": {}, "source": [ "#### Setting the domain of the axis" @@ -1440,7 +1440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab6ee697", + "id": "99c46092", "metadata": {}, "outputs": [], "source": [ @@ -1459,7 +1459,7 @@ }, { "cell_type": "markdown", - "id": "c3970061", + "id": "d68f954c", "metadata": {}, "source": [ "#### Synchronizing axes in subplots with `matches`\n", @@ -1472,7 +1472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e73ed38", + "id": "0c00c20f", "metadata": {}, "outputs": [], "source": [ @@ -1492,7 +1492,7 @@ }, { "cell_type": "markdown", - "id": "9e58af58", + "id": "8fadc7ef", "metadata": {}, "source": [ "#### nonnegative, tozero, and normal Rangemode\n", @@ -1509,7 +1509,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d541de4", + "id": "f77616b6", "metadata": {}, "outputs": [], "source": [ @@ -1525,7 +1525,7 @@ }, { "cell_type": "markdown", - "id": "37ba484e", + "id": "e574e5c6", "metadata": {}, "source": [ "#### Autorange Options\n", @@ -1542,7 +1542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19c57b0d", + "id": "6f695cba", "metadata": {}, "outputs": [], "source": [ @@ -1559,7 +1559,7 @@ }, { "cell_type": "markdown", - "id": "03b4e33e", + "id": "9dd50377", "metadata": {}, "source": [ "##### Clip Minimum and Maximum\n", @@ -1570,7 +1570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2aa1c46d", + "id": "7a7a2bcc", "metadata": {}, "outputs": [], "source": [ @@ -1587,7 +1587,7 @@ }, { "cell_type": "markdown", - "id": "8e520eb9", + "id": "e97ac333", "metadata": {}, "source": [ "##### Specify Values to be Included\n", @@ -1598,7 +1598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "310b6625", + "id": "6a112893", "metadata": {}, "outputs": [], "source": [ @@ -1614,7 +1614,7 @@ }, { "cell_type": "markdown", - "id": "037550b8", + "id": "fb069f90", "metadata": {}, "source": [ "#### Reference\n", @@ -1624,7 +1624,7 @@ }, { "cell_type": "markdown", - "id": "974fdc0d", + "id": "9cc238bd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bar-charts.ipynb b/bar-charts.ipynb index 9660b1758..c9e36445c 100644 --- a/bar-charts.ipynb +++ b/bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "786fa8cc", + "id": "3a1ffc79", "metadata": {}, "source": [ "### Bar chart with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66f18235", + "id": "9e58b3d1", "metadata": { "lines_to_next_cell": 2 }, @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "6abf7bbb", + "id": "655d2f36", "metadata": {}, "source": [ "#### Bar charts with Long Format Data\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9140d3e1", + "id": "c54336aa", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2161e71", + "id": "9e65b55e", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "3c531809", + "id": "bd2c009a", "metadata": {}, "source": [ "#### Bar charts with Wide Format Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d91f0ef", + "id": "c7d6719b", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a67549b", + "id": "559fcf8d", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "11854d3f", + "id": "73e233cc", "metadata": {}, "source": [ "### Bar charts in Dash\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f103a4e", + "id": "944afcb5", "metadata": { "hide_code": true }, @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "7d5d1d15", + "id": "cfeb5983", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "07bd2166", + "id": "300a4a4e", "metadata": {}, "source": [ "### Colored Bars\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c12de409", + "id": "ecf49e4d", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8c3c0c8", + "id": "23b71485", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "42bba1e2", + "id": "fe12711d", "metadata": {}, "source": [ "### Stacked vs Grouped Bars\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c10e9af7", + "id": "cdc85c59", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "ade58bae", + "id": "90823b70", "metadata": {}, "source": [ "The default stacked bar chart behavior can be changed to grouped (also known as clustered) using the `barmode` argument:" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7001e378", + "id": "64f16e73", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "0291bf2c", + "id": "332c73d4", "metadata": {}, "source": [ "### Aggregating into Single Colored Bars\n", @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6506b1e6", + "id": "8d95b0fd", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "caa11bfb", + "id": "435b58ec", "metadata": {}, "source": [ "`px.histogram()` will aggregate `y` values by summing them by default, but the `histfunc` argument can be used to set this to `avg` to create what is sometimes called a \"barplot\" which summarizes the central tendency of a dataset, rather than visually representing the totality of the dataset.\n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfeb735f", + "id": "1aa46b69", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "9d813469", + "id": "2f0d7cb0", "metadata": {}, "source": [ "### Bar Charts with Text\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce3dea0e", + "id": "02e1f629", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "18889a9a", + "id": "2dc73ffb", "metadata": {}, "source": [ "The `text` argument can be used to display arbitrary text on the bars:" @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d80eeb3", + "id": "d198a2e0", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "9deeb782", + "id": "9eaf8175", "metadata": {}, "source": [ "By default, Plotly will scale and rotate text labels to maximize the number of visible labels, which can result in a variety of text angles and sizes and positions in the same figure. The `textfont`, `textposition` and `textangle` trace attributes can be used to control these.\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa76f47a", + "id": "4907d635", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "367a09c7", + "id": "168e05d2", "metadata": {}, "source": [ "Here is the same data with less variation in text formatting. Note that `textfont_size` will set the *maximum* size. The `layout.uniformtext` attribute can be used to guarantee that all text labels are the same size. See the [documentation on text and annotations](/python/text-and-annotations/) for details.\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bb97bd4", + "id": "dbc9721c", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "ef29221c", + "id": "0b971720", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "45d60daf", + "id": "70d108dc", "metadata": {}, "source": [ "Bar charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:" @@ -399,7 +399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c09714a3", + "id": "9f50ec70", "metadata": {}, "outputs": [], "source": [ @@ -413,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "c90262a5", + "id": "6cf95887", "metadata": {}, "source": [ "### Facetted subplots\n", @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "561f9b27", + "id": "fb3ee040", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "525d1119", + "id": "cb3a3b30", "metadata": {}, "source": [ "#### Basic Bar Charts with plotly.graph_objects\n", @@ -450,7 +450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b693356a", + "id": "647ab45a", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "0edcc1e4", + "id": "1f16b55f", "metadata": {}, "source": [ "#### Grouped Bar Chart\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16bcb632", + "id": "6930783a", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "6af4a01c", + "id": "c5b97fa1", "metadata": {}, "source": [ "### Stacked Bar Chart" @@ -501,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0ed60d7", + "id": "44f3af49", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "37db9a52", + "id": "3d096439", "metadata": {}, "source": [ "### Bar Chart with Relative Barmode\n", @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbc42b0d", + "id": "10232ee2", "metadata": {}, "outputs": [], "source": [ @@ -550,7 +550,7 @@ }, { "cell_type": "markdown", - "id": "9c76245a", + "id": "12c77f73", "metadata": {}, "source": [ "### Grouped Stacked Bar Chart\n", @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb23bff4", + "id": "dc9657f9", "metadata": {}, "outputs": [], "source": [ @@ -620,7 +620,7 @@ }, { "cell_type": "markdown", - "id": "3bfedff9", + "id": "72049eb8", "metadata": {}, "source": [ "### Stacked Bar Chart From Aggregating a DataFrame\n", @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f61b8af", + "id": "b64e509e", "metadata": { "lines_to_next_cell": 2 }, @@ -683,7 +683,7 @@ }, { "cell_type": "markdown", - "id": "efffc5d8", + "id": "21615124", "metadata": {}, "source": [ "### Bar Chart with Hover Text" @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "feff484a", + "id": "532378c5", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "462966f1", + "id": "8ed23b4a", "metadata": {}, "source": [ "### Bar Chart with Direct Labels" @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d6049f0", + "id": "bbadf171", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "37a2e84b", + "id": "5b4d0463", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -754,7 +754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99ef12cb", + "id": "bea4977d", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "8f3b629c", + "id": "90cebaf8", "metadata": {}, "source": [ "### Rotated Bar Chart Labels" @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72108c11", + "id": "d7ad728c", "metadata": {}, "outputs": [], "source": [ @@ -808,7 +808,7 @@ }, { "cell_type": "markdown", - "id": "f28366c3", + "id": "c37b66ac", "metadata": {}, "source": [ "### Customizing Individual Bar Colors" @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "219b0f7e", + "id": "8e893bfd", "metadata": {}, "outputs": [], "source": [ @@ -837,7 +837,7 @@ }, { "cell_type": "markdown", - "id": "f44ddded", + "id": "37c4b511", "metadata": {}, "source": [ "### Customizing Individual Bar Widths" @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2b4a17a", + "id": "82c15b81", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "aee39c33", + "id": "a3013230", "metadata": {}, "source": [ "Bar charts with custom widths can be used to make mekko charts (also known as marimekko charts, mosaic plots, or variwide charts)." @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4201fa1", + "id": "952641ce", "metadata": {}, "outputs": [], "source": [ @@ -925,7 +925,7 @@ }, { "cell_type": "markdown", - "id": "7699a0c7", + "id": "c8685a79", "metadata": {}, "source": [ "### Using a scatterplot to wrap long bars into multiple columns\n", @@ -936,7 +936,7 @@ { "cell_type": "code", "execution_count": null, - "id": "994eed47", + "id": "751a0855", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "ebacf404", + "id": "cfb49c09", "metadata": {}, "source": [ "### Customizing Individual Bar Base" @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "516446a9", + "id": "c086dd65", "metadata": {}, "outputs": [], "source": [ @@ -1072,7 +1072,7 @@ }, { "cell_type": "markdown", - "id": "4f3f2870", + "id": "4ababa67", "metadata": {}, "source": [ "### Rounded Bars\n", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0dbaa31", + "id": "d179f06a", "metadata": {}, "outputs": [], "source": [ @@ -1112,7 +1112,7 @@ }, { "cell_type": "markdown", - "id": "4a7c732c", + "id": "29fc6340", "metadata": {}, "source": [ "When you don't want all bar traces in a figure to have the same rounded corners, you can instead configure rounded corners on each trace using `marker.cornerradius`. In this example, which uses subplots, the first trace has a corner radius of 30 pixels, the second trace has a bar corner radius of 30% of the bar width, and the third trace has no rounded corners set." @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8debfef", + "id": "3ec9aecf", "metadata": {}, "outputs": [], "source": [ @@ -1154,7 +1154,7 @@ }, { "cell_type": "markdown", - "id": "92df771c", + "id": "10527d06", "metadata": {}, "source": [ "### Colored and Styled Bar Chart\n", @@ -1165,7 +1165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dfaf989", + "id": "925eb9a9", "metadata": {}, "outputs": [], "source": [ @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "2236c5fc", + "id": "3e59f628", "metadata": {}, "source": [ "### Bar Chart with Sorted or Ordered Categories\n", @@ -1227,7 +1227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "493e0281", + "id": "98b27bb1", "metadata": {}, "outputs": [], "source": [ @@ -1244,7 +1244,7 @@ }, { "cell_type": "markdown", - "id": "abfe0449", + "id": "aa4216b2", "metadata": {}, "source": [ "This example shows how to customise sort ordering by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -1253,7 +1253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5037f1e5", + "id": "3745eefd", "metadata": {}, "outputs": [], "source": [ @@ -1270,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "d64bfa93", + "id": "6c24e5f8", "metadata": {}, "source": [ "This example orders the bar chart by descending value with `categoryorder: 'total descending'`" @@ -1279,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f399ef2", + "id": "5446085d", "metadata": {}, "outputs": [], "source": [ @@ -1296,7 +1296,7 @@ }, { "cell_type": "markdown", - "id": "284250c2", + "id": "2b418976", "metadata": {}, "source": [ "### Horizontal Bar Charts\n", @@ -1311,7 +1311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16c5529c", + "id": "7542cb68", "metadata": { "lines_to_next_cell": 0 }, @@ -1331,7 +1331,7 @@ }, { "cell_type": "markdown", - "id": "f0a43e4c", + "id": "37dac038", "metadata": {}, "source": [ "\n" @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "24d8b128", + "id": "9802d074", "metadata": {}, "source": [ "### Reference\n", @@ -1349,7 +1349,7 @@ }, { "cell_type": "markdown", - "id": "df659838", + "id": "ea2b3204", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-alignment-chart.ipynb b/bio-alignment-chart.ipynb index e1099f09d..cfdc8708b 100644 --- a/bio-alignment-chart.ipynb +++ b/bio-alignment-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c155e344", + "id": "a4acfbd7", "metadata": {}, "source": [ "## Alignment Viewer\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78076e8c", + "id": "e19280b2", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "50a93bd6", + "id": "30628e38", "metadata": {}, "source": [ "## Alignment Chart in dash_bio" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "518e9580", + "id": "afc0f5d0", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "59a3f8cf", + "id": "8218ecd4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-clustergram.ipynb b/bio-clustergram.ipynb index bf8425f84..3ed9273c8 100644 --- a/bio-clustergram.ipynb +++ b/bio-clustergram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "eeeedb9b", + "id": "9b95356e", "metadata": {}, "source": [ "## Default Clustergram\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10b0374f", + "id": "6c29ecdd", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "504645b3", + "id": "3d5c7653", "metadata": {}, "source": [ "## Dendrogram Cluster Colors/Line Widths\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80141cb3", + "id": "82cc1d29", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "70216c08", + "id": "390e77c9", "metadata": {}, "source": [ "## Relative Dendrogram Size\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce3d86ad", + "id": "baa8f4c1", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "7b8a233d", + "id": "ca416c07", "metadata": {}, "source": [ "## Clustergram with Dash" @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca1c408a", + "id": "46bcb82e", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "5970a5f1", + "id": "0c2ea449", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-manhattanplot.ipynb b/bio-manhattanplot.ipynb index 81b78cd00..1d85d276c 100644 --- a/bio-manhattanplot.ipynb +++ b/bio-manhattanplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dac78c6d", + "id": "09d47b36", "metadata": {}, "source": [ "## Manhattan Plot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a31efb51", + "id": "f9290d46", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "e9d65a0b", + "id": "6341ee93", "metadata": {}, "source": [ "## Highlighted points color, and colors of the suggestive line and the genome-wide line\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e38c3ab4", + "id": "3fada527", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "60080d4b", + "id": "4064ebd5", "metadata": {}, "source": [ "## ManhattanPlot with Dash" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b6726e2", + "id": "fbd1f1d6", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "af65624f", + "id": "cac1d172", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-volcano-plot.ipynb b/bio-volcano-plot.ipynb index 420e8d9ee..a97c0d205 100644 --- a/bio-volcano-plot.ipynb +++ b/bio-volcano-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bb5c5df7", + "id": "51424214", "metadata": {}, "source": [ "## VolcanoPlot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1b3935c", + "id": "ae1a4940", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "6d6261e8", + "id": "c2d4b9c7", "metadata": {}, "source": [ "## Point Sizes And Line Widths\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8f04446", + "id": "67698d33", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "6955fad5", + "id": "5e8f421e", "metadata": {}, "source": [ "## VolcanoPlot with Dash" @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c72048dc", + "id": "21d6432e", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "2c666d26", + "id": "3446d41a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/box-plots.ipynb b/box-plots.ipynb index 334ffaf27..60bbbe0b8 100644 --- a/box-plots.ipynb +++ b/box-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "298eb4dc", + "id": "74ba785e", "metadata": {}, "source": [ "A [box plot](https://en.wikipedia.org/wiki/Box_plot) is a statistical representation of the distribution of a variable through its quartiles. The ends of the box represent the lower and upper quartiles, while the median (second quartile) is marked by a line inside the box. For other statistical representations of numerical data, see [other statistical charts](https://plotly.com/python/statistical-charts/).\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7a336fb", + "id": "fba1b923", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "880c9033", + "id": "1c479297", "metadata": {}, "source": [ "If a column name is given as `x` argument, a box plot is drawn for each value of `x`." @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1463d0f6", + "id": "76a77190", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "9e010cca", + "id": "55eb2af2", "metadata": {}, "source": [ "### Box Plots in Dash\n", @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b61dc8e9", + "id": "c65065ce", "metadata": { "hide_code": true }, @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "39307d09", + "id": "aa4238c6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "e1b615a2", + "id": "b04f8fce", "metadata": {}, "source": [ "### Display the underlying data\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bce3810", + "id": "7db385bc", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "bbfaf40c", + "id": "be8a2d85", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e04ba72", + "id": "5ff61062", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "8b315e8f", + "id": "774b5682", "metadata": {}, "source": [ "#### Difference Between Quartile Algorithms\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6d85a86", + "id": "2512be75", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "df37fc92", + "id": "9b894eaa", "metadata": {}, "source": [ "#### Styled box plot\n", @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4f41d2a", + "id": "3a3297f4", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "fa57cdbc", + "id": "5f103eb1", "metadata": {}, "source": [ "## Box plot with go.Box\n", @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "086b1e5a", + "id": "8d935cdc", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "a22b0d71", + "id": "312a7d50", "metadata": {}, "source": [ "### Basic Horizontal Box Plot" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18949396", + "id": "086649e6", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "e97301c7", + "id": "bdd3c6a5", "metadata": {}, "source": [ "### Box Plot That Displays The Underlying Data" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79116fae", + "id": "5d7fd4f8", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "fdcf645e", + "id": "aedfafba", "metadata": {}, "source": [ "### Modifying The Algorithm For Computing Quartiles\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5af48db", + "id": "17b821f6", "metadata": {}, "outputs": [], "source": [ @@ -325,7 +325,7 @@ }, { "cell_type": "markdown", - "id": "7c02b42e", + "id": "371272b9", "metadata": {}, "source": [ "### Box Plot With Precomputed Quartiles\n", @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "306d695e", + "id": "4c47b0a7", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "c3b6e43e", + "id": "f1891613", "metadata": {}, "source": [ "### Colored Box Plot" @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e96dd403", + "id": "c98b101d", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "8a5d4edc", + "id": "52421fdb", "metadata": {}, "source": [ "### Box Plot Styling Mean & Standard Deviation" @@ -395,7 +395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8310a629", + "id": "8fad766c", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "f9810dfc", + "id": "788ec664", "metadata": {}, "source": [ "### Styling Outliers\n", @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f7dc616", + "id": "7d50c9b2", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ }, { "cell_type": "markdown", - "id": "a65bf875", + "id": "00d20269", "metadata": {}, "source": [ "### Grouped Box Plots" @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80409bf2", + "id": "5920a63c", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "92d09499", + "id": "ac9c8473", "metadata": {}, "source": [ "### Grouped Horizontal Box Plot" @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "228317a8", + "id": "2a3c39b6", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "23f7a6dc", + "id": "ce1a0883", "metadata": {}, "source": [ "### Rainbow Box Plots" @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f2bfaa1", + "id": "ed027535", "metadata": {}, "outputs": [], "source": [ @@ -631,7 +631,7 @@ }, { "cell_type": "markdown", - "id": "5947d49b", + "id": "c82ab14c", "metadata": {}, "source": [ "### Fully Styled Box Plots" @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b7d6456", + "id": "ba354c1d", "metadata": {}, "outputs": [], "source": [ @@ -707,7 +707,7 @@ }, { "cell_type": "markdown", - "id": "326cfb43", + "id": "7d2372ee", "metadata": {}, "source": [ "### Box Plot With Only Points\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac082ba4", + "id": "626b0fee", "metadata": {}, "outputs": [], "source": [ @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "1ee10ba0", + "id": "65455d1f", "metadata": {}, "source": [ "#### Reference\n", @@ -740,7 +740,7 @@ }, { "cell_type": "markdown", - "id": "1a85876c", + "id": "ecd80372", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-charts.ipynb b/bubble-charts.ipynb index 5935c8e05..3caf66c67 100644 --- a/bubble-charts.ipynb +++ b/bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b65df19f", + "id": "798e6a79", "metadata": {}, "source": [ "## Bubble chart with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b1b3d5c", + "id": "7205c2c2", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "2aeb77cb", + "id": "eec4bf86", "metadata": {}, "source": [ "## Bubble Chart with plotly.graph_objects\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "580475da", + "id": "6decced9", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "a6b90ee9", + "id": "eb9ba282", "metadata": {}, "source": [ "### Setting Marker Size and Color" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c61187c5", + "id": "2884c67f", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "6df0637d", + "id": "abfa4ca0", "metadata": {}, "source": [ "### Scaling the Size of Bubble Charts\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b61c567", + "id": "36b053fa", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "42d39b82", + "id": "1bf07da7", "metadata": {}, "source": [ "### Hover Text with Bubble Charts" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d14ce27", + "id": "221b133d", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "f8ce23c4", + "id": "6b8ea124", "metadata": {}, "source": [ "### Bubble Charts with Colorscale" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcc14b25", + "id": "6bf5a5f2", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "d9f9e2b4", + "id": "c6b752ca", "metadata": {}, "source": [ "### Categorical Bubble Charts" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99dcb53b", + "id": "1c36e8e4", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "dfc1fd46", + "id": "8ac6cd15", "metadata": {}, "source": [ "### Reference\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "71046ec5", + "id": "10564528", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-maps.ipynb b/bubble-maps.ipynb index ffe4f2e30..ed14e4837 100644 --- a/bubble-maps.ipynb +++ b/bubble-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "058d2e77", + "id": "595d1214", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "710812cc", + "id": "9767f1e9", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "0828ef97", + "id": "fad3c5db", "metadata": {}, "source": [ "### Bubble Map with animation" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08e1444f", + "id": "b77f4b90", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "9dd7b445", + "id": "5d82980b", "metadata": {}, "source": [ "### Bubble Map with go.Scattergeo\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af912262", + "id": "60a56abb", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "91e6039a", + "id": "c0dbac8f", "metadata": {}, "source": [ "#### Ebola Cases in West Africa" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d46953e4", + "id": "a7f6956d", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "a49e4aaa", + "id": "097e97ee", "metadata": {}, "source": [ "#### Reference\n", @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "43b0b659", + "id": "f193e624", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/builtin-colorscales.ipynb b/builtin-colorscales.ipynb index e0ee58635..25b83f80f 100644 --- a/builtin-colorscales.ipynb +++ b/builtin-colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "76b5643e", + "id": "6830359d", "metadata": {}, "source": [ "### Using Built-In Continuous Color Scales\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d2cb13c", + "id": "d3b394c5", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "fc12ec6c", + "id": "80361fb9", "metadata": {}, "source": [ "Built-in color scales are stored as lists of CSS colors:" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "445fb332", + "id": "a30f9fc0", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "c89cb03a", + "id": "8cc8a0da", "metadata": {}, "source": [ "### Continuous Color Scales in Dash\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ed6e8e6", + "id": "b88983ac", "metadata": { "hide_code": true }, @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "aed3d173", + "id": "91aaa184", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "cebedbc3", + "id": "67724cce", "metadata": {}, "source": [ "### Built-In Sequential Color scales\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fcd8901", + "id": "53183fd2", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "0ea84d1a", + "id": "7cdd9e83", "metadata": {}, "source": [ "Note: `RdBu` was included in the `sequential` module by mistake, even though it is a diverging color scale.\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d910e059", + "id": "4ba05cc4", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "9c094413", + "id": "a3086949", "metadata": {}, "source": [ "### Built-In Cyclical Color scales\n", @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27b4f5d", + "id": "8a16d682", "metadata": { "lines_to_next_cell": 2 }, @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "d34cca79", + "id": "fd4857f6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bullet-charts.ipynb b/bullet-charts.ipynb index 029b64770..6ee6f5d8a 100644 --- a/bullet-charts.ipynb +++ b/bullet-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1ab01fed", + "id": "d537cd2f", "metadata": {}, "source": [ "#### Basic Bullet Charts\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09344a80", + "id": "7a9288e1", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "48ce3678", + "id": "0e2c97ae", "metadata": {}, "source": [ "#### Add Steps, and Threshold\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25790209", + "id": "707ba56b", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "e633422f", + "id": "6d6015c0", "metadata": {}, "source": [ "#### Custom Bullet\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4bfe721", + "id": "bc89650a", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "12f84348", + "id": "dcdbc4ba", "metadata": {}, "source": [ "#### Multi Bullet\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b24bdb8", + "id": "4f57b20e", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "fc7de636", + "id": "bdcca7bb", "metadata": {}, "source": [ "#### Reference\n", @@ -193,14 +193,14 @@ { "cell_type": "code", "execution_count": null, - "id": "81a448e6", + "id": "d33a661f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "d6668e13", + "id": "98aca9eb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/candlestick-charts.ipynb b/candlestick-charts.ipynb index bdcaacde4..60210f103 100644 --- a/candlestick-charts.ipynb +++ b/candlestick-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3dee2e43", + "id": "dee2023e", "metadata": {}, "source": [ "The [candlestick chart](https://en.wikipedia.org/wiki/Candlestick_chart) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e8a1611", + "id": "4c5bc625", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "c8d71ba9", + "id": "a0e6086d", "metadata": {}, "source": [ "#### Candlestick without Rangeslider" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7ef7bff", + "id": "4a20d525", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "6d157156", + "id": "6b9160e5", "metadata": {}, "source": [ "#### Candlestick in Dash\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4c066bf", + "id": "cea8a1f0", "metadata": { "hide_code": true }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "dcc49a31", + "id": "49aed1d3", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "41734327", + "id": "f1d31eea", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac4c22b6", + "id": "8abf94b0", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "9a815388", + "id": "1076a598", "metadata": {}, "source": [ "#### Custom Candlestick Colors" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8a3224e", + "id": "57712cf5", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ }, { "cell_type": "markdown", - "id": "d9f0b466", + "id": "2f8894c4", "metadata": {}, "source": [ "#### Simple Example with `datetime` Objects" @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a35809a", + "id": "32684ad1", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "167a58be", + "id": "910db492", "metadata": {}, "source": [ "#### Reference\n", @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "4362ed81", + "id": "007885ad", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-contour.ipynb b/carpet-contour.ipynb index e85f5d451..490c31faf 100644 --- a/carpet-contour.ipynb +++ b/carpet-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "56d75171", + "id": "11074353", "metadata": {}, "source": [ "### Basic Carpet Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eccd16c", + "id": "7e72108c", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "76cb9d8c", + "id": "ddb77686", "metadata": {}, "source": [ "### Add Contours" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09db86ca", + "id": "0f3c6193", "metadata": { "inputHidden": false, "outputHidden": false @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "b1856883", + "id": "9236c5d5", "metadata": {}, "source": [ "### Add Multiple Traces" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf34e336", + "id": "643be63b", "metadata": { "inputHidden": false, "outputHidden": false @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "f8528d49", + "id": "b7ba94db", "metadata": {}, "source": [ "### Reference\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "5b6eb04e", + "id": "350277b3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-plot.ipynb b/carpet-plot.ipynb index e1115ffcb..434817091 100644 --- a/carpet-plot.ipynb +++ b/carpet-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6e1fa11d", + "id": "e49e8bf9", "metadata": {}, "source": [ "### Set X and Y Coordinates\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bd80070", + "id": "a4eddd08", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "edfef313", + "id": "75ee0516", "metadata": {}, "source": [ "### Add Parameter Values\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72c9f7e5", + "id": "925add01", "metadata": { "inputHidden": false, "outputHidden": false @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "44687d7c", + "id": "f36e28a2", "metadata": {}, "source": [ "### Add A and B axis\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acad180b", + "id": "43b2b05a", "metadata": { "inputHidden": false, "outputHidden": false @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "35059347", + "id": "886a9970", "metadata": {}, "source": [ "### Alternate input format\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd2e2658", + "id": "ccb34d18", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "78a8dc31", + "id": "3fa26e2f", "metadata": {}, "source": [ "### Cheater plot layout" @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "a92352f2", + "id": "bb08cbf5", "metadata": {}, "source": [ "The layout of cheater plots is not unique and depends upon the `cheaterslope` and axis `cheatertype` parameters. If `x` is not specified, each row of the `x` array is constructed based on the the formula `a + cheaterslope * b`, where `a` and `b` are either the value or the integer index of `a` and `b` respectively, depending on the corresponding axis `cheatertype`. Although the layout of the axis below is different than the plots above, it represents the same data as the axes above." @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c82003c", + "id": "a06b162b", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "d8a50ff4", + "id": "d2df3019", "metadata": {}, "source": [ "### Style A and B axis" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a1435c7", + "id": "e561b670", "metadata": { "inputHidden": false, "outputHidden": false @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "caf2eb7e", + "id": "c60d870b", "metadata": {}, "source": [ "### Add Points and Contours\n", @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "24000ae7", + "id": "6f07fcc9", "metadata": {}, "source": [ "### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "4928a32f", + "id": "ca2cb22d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-scatter.ipynb b/carpet-scatter.ipynb index a589309bc..0cafc0f92 100644 --- a/carpet-scatter.ipynb +++ b/carpet-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1aa8a846", + "id": "ebe6c806", "metadata": {}, "source": [ "### Basic Carpet Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a413c31", + "id": "2e10f090", "metadata": { "inputHidden": false, "outputHidden": false @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "38eb1e82", + "id": "b6e8f5f3", "metadata": {}, "source": [ "### Add Carpet Scatter Trace" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61725285", + "id": "1b7c6ca2", "metadata": { "inputHidden": false, "outputHidden": false @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "07cf0e51", + "id": "183999ea", "metadata": {}, "source": [ "### Add Multiple Scatter Traces" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15175242", + "id": "65c5e157", "metadata": { "inputHidden": false, "outputHidden": false @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "c3e7be2f", + "id": "3442d50a", "metadata": {}, "source": [ "### Reference" @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "74272b7e", + "id": "c73d6200", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattercarpet/ for more information and chart attribute options!" @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "776fec57", + "id": "57f6e7ce", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/categorical-axes.ipynb b/categorical-axes.ipynb index d4ee68127..857f6363c 100644 --- a/categorical-axes.ipynb +++ b/categorical-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5ad71365", + "id": "2cbab585", "metadata": {}, "source": [ "\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "634a9623", + "id": "3b7208cc", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "89289171", + "id": "9933093e", "metadata": {}, "source": [ "### Categorical Axes and Trace Types\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02c56f2a", + "id": "86fc06fb", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "c84bfb04", + "id": "3c05dd79", "metadata": {}, "source": [ "[Box plots]() and [violin plots]() are often shown with one categorical and one continuous axis." @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1d9ff33", + "id": "f65aceba", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17e1b586", + "id": "ccc6e017", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "56ab286b", + "id": "f90ae7bc", "metadata": {}, "source": [ "### Controlling the Category Order with Plotly Express\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9adae12d", + "id": "696078ca", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "e9f4318d", + "id": "b1bfaae1", "metadata": {}, "source": [ "### Automatically Sorting Categories by Name or Total Value\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bdae531", + "id": "2253cc84", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "ebedba9a", + "id": "3fdbed50", "metadata": {}, "source": [ "This example orders the categories **by total value** with `categoryorder: 'total descending'`" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1acd0ba2", + "id": "b87e34dc", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "49b5db06", + "id": "42770cae", "metadata": {}, "source": [ "This example shows how to control category order when using `plotly.graph_objects` by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d1b03b4", + "id": "1cb5f0f9", "metadata": { "lines_to_next_cell": 0 }, @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "20fe42b3", + "id": "1c67236a", "metadata": {}, "source": [ "### Gridlines, Ticks and Tick Labels" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "0225639e", + "id": "b7ea6779", "metadata": {}, "source": [ "By default, gridlines and ticks are not shown on categorical axes but they can be activated:" @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f548955", + "id": "0f22bf6f", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "8c972bfc", + "id": "8b2222f6", "metadata": {}, "source": [ "By default, ticks and gridlines appear on the categories but the `tickson` attribute can be used to move them to the category boundaries:" @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72126705", + "id": "a0308f97", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "714fad23", + "id": "29450e9b", "metadata": {}, "source": [ "### Multi-categorical Axes\n", @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c86381cb", + "id": "d7b40796", "metadata": { "lines_to_next_cell": 0 }, @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "10b53369", + "id": "8f57cd48", "metadata": {}, "source": [ "### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "461aee4c", + "id": "1a71beb2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/choropleth-maps.ipynb b/choropleth-maps.ipynb index 20ec67eb8..c0f860af1 100644 --- a/choropleth-maps.ipynb +++ b/choropleth-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "401c3f2f", + "id": "36b44e22", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).\n", @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9057f0b8", + "id": "6f9e778b", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "29f69b48", + "id": "78e7d69a", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42e02299", + "id": "e6599a20", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "78da014c", + "id": "be7e9a2d", "metadata": {}, "source": [ "### Choropleth map using GeoJSON\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41e62ec2", + "id": "ba133a57", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "18793cb9", + "id": "b1ad74a7", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4688c167", + "id": "671fca3b", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "009b3d83", + "id": "3c903134", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron.\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3558167e", + "id": "7884d8f3", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "380f3a14", + "id": "8c5506c5", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b6fd7b4", + "id": "f0301481", "metadata": { "hide_code": true }, @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "712adcbc", + "id": "8a9627a0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "a250b381", + "id": "2f3741be", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67546675", + "id": "fb2b7279", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "5d977348", + "id": "485a3df1", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "113a1d31", + "id": "bf31baab", "metadata": { "lines_to_next_cell": 2 }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "15e36506", + "id": "a16bbc0e", "metadata": {}, "source": [ "### Using Built-in Country and State Geometries\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19f2635c", + "id": "4c29b2a1", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "0aa7a449", + "id": "4114c5fb", "metadata": {}, "source": [ "To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes):" @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af59f7d7", + "id": "6ae2e1e2", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "b6d42858", + "id": "9912b0ad", "metadata": {}, "source": [ "### Choropleth Maps with go.Choropleth\n", @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c7091ac", + "id": "fe961af6", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "e8a716b9", + "id": "021cec65", "metadata": {}, "source": [ "#### Customize choropleth chart" @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78304fda", + "id": "6a45bff2", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "f6172cce", + "id": "a9fa820a", "metadata": {}, "source": [ "#### World Choropleth Map" @@ -437,7 +437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5218ebc1", + "id": "ff82da15", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "a71f810e", + "id": "a0f7dc3b", "metadata": {}, "source": [ "#### County Choropleth Figure Factory\n", @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70747301", + "id": "93605730", "metadata": {}, "outputs": [], "source": [ @@ -531,7 +531,7 @@ }, { "cell_type": "markdown", - "id": "65715c4a", + "id": "af5d2194", "metadata": {}, "source": [ "#### Reference\n", @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "d3e79b77", + "id": "02979cdc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/click-events.ipynb b/click-events.ipynb index f8ec41bd7..d064bdd0f 100644 --- a/click-events.ipynb +++ b/click-events.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9a4958a3", + "id": "09c429db", "metadata": {}, "source": [ "#### Update Points Using a Click Callback" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3dd25ee", + "id": "e8328641", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "ecd85548", + "id": "1b71f423", "metadata": {}, "source": [ "" @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "c3da6751", + "id": "fc228315", "metadata": {}, "source": [ "#### Reference" @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "4643a7f0", + "id": "b3ccdade", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "634ebdc6", + "id": "aebb8722", "metadata": { "lines_to_next_cell": 2 }, @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "e9e92796", + "id": "fa520b34", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/colorscales.ipynb b/colorscales.ipynb index 95b8aa69c..1efa0bd90 100644 --- a/colorscales.ipynb +++ b/colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5b3a7e60", + "id": "7b31f89a", "metadata": {}, "source": [ "### Continuous vs Discrete Color\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "047d9732", + "id": "61802ea8", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "bb5d7433", + "id": "fde49a93", "metadata": {}, "source": [ "Converting this column to strings is very straightforward:" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ecfcbba", + "id": "fe526645", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "6d5908ad", + "id": "b3a64db3", "metadata": {}, "source": [ "If you have stringified numbers you can convert back just as easily:" @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c31b703e", + "id": "118fb1bf", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "9e828136", + "id": "cb454200", "metadata": {}, "source": [ "### Colorscales in Dash\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be1b908d", + "id": "3acebbcd", "metadata": { "hide_code": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "8626d217", + "id": "76fbbda2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "a7d98411", + "id": "ebcdda0d", "metadata": {}, "source": [ "### Color Scales in Plotly Express\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0e9bb94", + "id": "7860041a", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "821751a8", + "id": "9bd31064", "metadata": {}, "source": [ "It is also possible to specify color scales by name. Here is an example that specifies the `Inferno` color scale by name, as a string" @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9852fc0b", + "id": "d57179c2", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "326c2cdf", + "id": "ac5b22fc", "metadata": {}, "source": [ "### Reversing a built-in color scale\n", @@ -187,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4901a20", + "id": "b10e2d37", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "057ccd0f", + "id": "0d09e161", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "95710cdf", + "id": "8a38cf23", "metadata": {}, "source": [ "### Explicitly Constructing a Color scale\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43fb938e", + "id": "98fe02ec", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "112cbfaf", + "id": "616e64d4", "metadata": {}, "source": [ "The example above provided a list of CSS colors to construct a scale, which inferred the reference points to be evenly spaced, but specific reference points can be provided as well. The following example has the same result:" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2405359", + "id": "170b7e52", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "bb8c7831", + "id": "5b8c7cf1", "metadata": {}, "source": [ "### Constructing a Discrete or Discontinuous Color Scale\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d77fdbf1", + "id": "3a517b9c", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "96f0ee8c", + "id": "52465039", "metadata": {}, "source": [ "### Explicitly setting a Color Range\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6602bb9a", + "id": "07fe97f2", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "b067fc5b", + "id": "3d5af2d6", "metadata": {}, "source": [ "### Setting the Midpoint of a Color Range for a Diverging Color scale\n", @@ -327,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f516a58", + "id": "05523f8a", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "7c20d738", + "id": "58435425", "metadata": {}, "source": [ "### Hiding or Customizing the Plotly Express Color Bar\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c2578e9", + "id": "1751ac56", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "79df68a6", + "id": "726981a4", "metadata": {}, "source": [ "You can also configure the title, size, placement and tick marks and labels on a color bar:" @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34e5e105", + "id": "e4650971", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "50f709d3", + "id": "243118c5", "metadata": {}, "source": [ "### Customizing Tick Text on Discrete Color Bars\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af8a6be1", + "id": "0d1febfb", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "149f1c34", + "id": "6338bee6", "metadata": {}, "source": [ "### Customizing Tick Text on Logarithmic Color Bars\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80bb4b5e", + "id": "cda492d8", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "df292fc0", + "id": "d066044e", "metadata": {}, "source": [ "### Using Label Aliases on Colorbars\n", @@ -480,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7af2105", + "id": "bcbd4318", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "7378195b", + "id": "cea61493", "metadata": {}, "source": [ "### Custom Discretized Heatmap Color scale with Graph Objects" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad6e54bf", + "id": "649dde50", "metadata": {}, "outputs": [], "source": [ @@ -582,7 +582,7 @@ }, { "cell_type": "markdown", - "id": "0b884575", + "id": "13f0ee88", "metadata": {}, "source": [ "### Color scale for Scatter Plots with Graph Objects" @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb54f4c1", + "id": "a40303c2", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "cabcf06f", + "id": "d18a880e", "metadata": {}, "source": [ "### Color scale for Contour Plot with Graph Objects" @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a41b3e0", + "id": "797a8e16", "metadata": {}, "outputs": [], "source": [ @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "30233690", + "id": "4cf9b792", "metadata": {}, "source": [ "### Custom Heatmap Color scale with Graph Objects" @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "506eb037", + "id": "f9ac6ed3", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "1370c4ce", + "id": "53f4c46a", "metadata": {}, "source": [ "### Setting the Midpoint of a Diverging Color scale with Graph Objects\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0715db62", + "id": "624ff4e8", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "a4a3598a", + "id": "cf5c87fa", "metadata": {}, "source": [ "The heatmap chart uses [marker.zmid](https://plotly.com/python/reference/scatter/#scatter-marker-zmid) attribute to set the mid-point of the color domain." @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20831c14", + "id": "f2781515", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "fd94e151", + "id": "76a019cd", "metadata": {}, "source": [ "### Custom Contour Plot Color scale with Graph Objects" @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43a4680e", + "id": "67717f8f", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "bb04a263", + "id": "b4dcc70e", "metadata": {}, "source": [ "### Custom Color bar Title, Labels, and Ticks with Graph Objects\n", @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8ec7bbd", + "id": "18e32c6d", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "1f63c161", + "id": "57452513", "metadata": {}, "source": [ "### Color Bar Displayed Horizontally\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3570fe9b", + "id": "f285017c", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "19dbee39", + "id": "52bce164", "metadata": {}, "source": [ "### Sharing a Color Axis with Graph Objects\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6f2f546", + "id": "a3339247", "metadata": {}, "outputs": [], "source": [ @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "14ef9a64", + "id": "15ac7c5e", "metadata": {}, "source": [ "### Logarithmic Color scale with Graph Objects" @@ -916,7 +916,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfb056f0", + "id": "b58fb9ee", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "c484d1d7", + "id": "0894ffd8", "metadata": {}, "source": [ "### Positioning Colorbars\n", @@ -962,7 +962,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c070215", + "id": "4ef9bc7d", "metadata": {}, "outputs": [], "source": [ @@ -991,7 +991,7 @@ }, { "cell_type": "markdown", - "id": "2f020325", + "id": "1797db63", "metadata": {}, "source": [ "### Reference\n", @@ -1001,7 +1001,7 @@ }, { "cell_type": "markdown", - "id": "40a7d03a", + "id": "b74ffe93", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/cone-plot.ipynb b/cone-plot.ipynb index 516ff9ff1..e5e404b5e 100644 --- a/cone-plot.ipynb +++ b/cone-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0d823ef7", + "id": "5823344a", "metadata": {}, "source": [ "A cone plot is the 3D equivalent of a 2D [quiver plot](/python/quiver-plots/), i.e., it represents a 3D vector field using cones to represent the direction and norm of the vectors. 3-D coordinates are given by `x`, `y` and `z`, and the coordinates of the vector field by `u`, `v` and `w`.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "956250dd", + "id": "eeadc7e6", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "d1bf4067", + "id": "78ea1121", "metadata": {}, "source": [ "### Multiple 3D Cones" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4f5cea5", + "id": "bf45e774", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "fc3dcb27", + "id": "2b23888b", "metadata": {}, "source": [ "### 3D Cone Lighting" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9625741", + "id": "9777dac9", "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "8773156e", + "id": "6862a65b", "metadata": {}, "source": [ "### 3D Cone Vortex" @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d94d32a0", + "id": "3254f247", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "9b1840f1", + "id": "a6bb3771", "metadata": {}, "source": [ "### Sizemode\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b8c9816", + "id": "763879cc", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "bd49e9e7", + "id": "3b3184b0", "metadata": {}, "source": [ "#### Reference\n", @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "dcd058f4", + "id": "b2aa07d0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/configuration-options.ipynb b/configuration-options.ipynb index a403771df..567579894 100644 --- a/configuration-options.ipynb +++ b/configuration-options.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f5f486a5", + "id": "2ea647e9", "metadata": {}, "source": [ "## Configuration Options\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b1a1002", + "id": "78942ea8", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "8bca747a", + "id": "449ee202", "metadata": {}, "source": [ "### Turning Off Responsiveness\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1e10fb6", + "id": "31ff70e9", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "e18533d7", + "id": "dbfbccee", "metadata": {}, "source": [ "### Making A Static Chart" @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efaf7aa4", + "id": "f3da1784", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "80fc0f08", + "id": "1b875785", "metadata": {}, "source": [ "### Forcing The Modebar to Always Be Visible\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88b86c0f", + "id": "a051502f", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "f4cf3d8c", + "id": "52558d73", "metadata": {}, "source": [ "### Preventing the Modebar from Appearing\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8858dfe", + "id": "575de043", "metadata": { "lines_to_next_cell": 2 }, @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "a7c3f52e", + "id": "96918d32", "metadata": {}, "source": [ "### Hiding the Plotly Logo on the Modebar" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ccf2210", + "id": "c2e177b8", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "6391d8ac", + "id": "111f116d", "metadata": {}, "source": [ "### Customizing Modebar \"Download Plot\" Button\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "754ad461", + "id": "a45bcc3f", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "ba6d9496", + "id": "1e00889d", "metadata": {}, "source": [ "Figures can be set to download at the currently-rendered size by setting `height` and `width` to `None`:\n" @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8244a749", + "id": "9a4d1eb2", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "696fbce7", + "id": "05b6b62f", "metadata": {}, "source": [ "### Removing Modebar Buttons\n", @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "060a4d7a", + "id": "357edeb7", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "7ce4e0b5", + "id": "aa27c76c", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9117432", + "id": "74883aca", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "cb63eeaf", + "id": "a860df15", "metadata": {}, "source": [ "### Add optional shape-drawing buttons to modebar\n", @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44f05675", + "id": "3cfdfe8c", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "0c0cf88c", + "id": "0a1d585b", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62588322", + "id": "02475121", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "577bc9bf", + "id": "54ff0066", "metadata": {}, "source": [ "### Double-Click Delay\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec7165cb", + "id": "da11a151", "metadata": {}, "outputs": [], "source": [ @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "2d844ecf", + "id": "cb37f7a2", "metadata": {}, "source": [ "### Disabling Buttons for Specific Axes\n", @@ -460,7 +460,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdfb69b0", + "id": "d9bbaed8", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "e82a7390", + "id": "c52a26ca", "metadata": {}, "source": [ "### Configuring Figures in Dash Apps\n", @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "7e25fe03", + "id": "96182202", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/continuous-error-bars.ipynb b/continuous-error-bars.ipynb index 9a044cd73..d1326e9c3 100644 --- a/continuous-error-bars.ipynb +++ b/continuous-error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "401448e0", + "id": "a8d688d8", "metadata": {}, "source": [ "Continuous error bands are a graphical representation of error or uncertainty as a shaded region around a main trace, rather than as discrete whisker-like error bars. They can be implemented in a manner similar to [filled area plots](/python/filled-area-plots/) using `scatter` traces with the `fill` attribute.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "014f34f7", + "id": "51ff4989", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "c7e8670b", + "id": "b52a1c38", "metadata": {}, "source": [ "#### Filling between two traces\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6b7328f", + "id": "00f17c4d", "metadata": { "lines_to_next_cell": 2 }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "7c545993", + "id": "cdf85a20", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/contour-plots.ipynb b/contour-plots.ipynb index 7262dcf1c..258117b62 100644 --- a/contour-plots.ipynb +++ b/contour-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4ca30f5f", + "id": "dd3b9619", "metadata": {}, "source": [ "### Basic Contour Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc65d83e", + "id": "eb0b4cb9", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "29872596", + "id": "4f930cd1", "metadata": {}, "source": [ "### Setting X and Y Coordinates in a Contour Plot ###" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524277ff", + "id": "0e0c0f9e", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "416ac002", + "id": "18b53b1f", "metadata": {}, "source": [ "### Colorscale for Contour Plot ###" @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b938c0e", + "id": "c9f5a63e", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "e197edae", + "id": "f2773720", "metadata": {}, "source": [ "### Customizing Size and Range of a Contour Plot's Contours ###" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f8db8f2", + "id": "d915d90b", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "ad34d8ba", + "id": "ab7356ee", "metadata": {}, "source": [ "### Customizing Spacing Between X and Y Axis Ticks ###" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af4f9004", + "id": "f5e7ad91", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "e55ee4a1", + "id": "76a818fd", "metadata": {}, "source": [ "### Connect the Gaps Between None Values in the Z Matrix ###" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22c07c1b", + "id": "65edb9ae", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "a7f986d6", + "id": "c64b888b", "metadata": {}, "source": [ "### Smoothing the Contour lines ###" @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d897167", + "id": "e885efd9", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "375a48c6", + "id": "aff9206e", "metadata": {}, "source": [ "### Smooth Contour Coloring ###" @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e9e6f7e", + "id": "1402eda6", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "7ee23cb9", + "id": "0df04433", "metadata": {}, "source": [ "### Contour Line Labels ###" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a3a089a", + "id": "0f032b7a", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "c0bad35f", + "id": "216da087", "metadata": {}, "source": [ "### Contour Lines ###" @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6a334f8", + "id": "94e9bb80", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "b965d0a5", + "id": "35e05b3c", "metadata": {}, "source": [ "### Custom Contour Plot Colorscale ###" @@ -344,7 +344,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f391962", + "id": "d615cccc", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "2c3169cd", + "id": "5efd2cdc", "metadata": {}, "source": [ "### Color Bar Title ###" @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f868724b", + "id": "f3e51fbf", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "8b499be6", + "id": "23a1c884", "metadata": {}, "source": [ "### Color Bar Size for Contour Plots\n", @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bf3a60a", + "id": "4d0ede0b", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ }, { "cell_type": "markdown", - "id": "c1758630", + "id": "f6a77bf7", "metadata": {}, "source": [ "### Styling Color Bar Ticks for Contour Plots" @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f17ccb26", + "id": "3c9bbfce", "metadata": {}, "outputs": [], "source": [ @@ -477,7 +477,7 @@ }, { "cell_type": "markdown", - "id": "923efdfd", + "id": "9994365a", "metadata": {}, "source": [ "#### Reference\n", @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "61fa7fc1", + "id": "400eecb3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/county-choropleth.ipynb b/county-choropleth.ipynb index 50a883aa2..a2dac0713 100644 --- a/county-choropleth.ipynb +++ b/county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2805becd", + "id": "a985c6a8", "metadata": {}, "source": [ "### Deprecation warning" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "b9a8fd21", + "id": "a5fc2b9a", "metadata": {}, "source": [ "This page describes a [legacy \"figure factory\" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth)." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "c907af04", + "id": "336ec61f", "metadata": {}, "source": [ "#### Required Packages\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64ab03e5", + "id": "6fe51f1c", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "b4e6bc7a", + "id": "587be7f7", "metadata": {}, "source": [ "If you are using Windows, follow this post to properly install geopandas and dependencies: http://geoffboeing.com/2014/09/using-geopandas-windows/. If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:" @@ -50,7 +50,7 @@ }, { "cell_type": "raw", - "id": "bde8b27d", + "id": "2e5f5f49", "metadata": {}, "source": [ "conda install plotly\n", @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "55c0b8c9", + "id": "4df5149a", "metadata": {}, "source": [ "#### FIPS and Values\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "2965c8c7", + "id": "3b15629a", "metadata": {}, "source": [ "#### Simple Example\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e53c4f9f", + "id": "eb3ce336", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "d50aa828", + "id": "fe427c56", "metadata": {}, "source": [ "#### Change the Scope\n", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe3287fa", + "id": "9e37da1b", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "556c3ea6", + "id": "57bd2cf9", "metadata": {}, "source": [ "#### Single State" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f93ac33", + "id": "f18bec3f", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "64ed881b", + "id": "9cc946d8", "metadata": {}, "source": [ "#### Multiple States" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4922504b", + "id": "1286757b", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "90bb7563", + "id": "57bca5c1", "metadata": {}, "source": [ "#### Simplify County, State Lines\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3379508b", + "id": "3709ddd5", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "b150aaac", + "id": "a62c21d3", "metadata": {}, "source": [ "#### The Entire USA" @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c1c2867", + "id": "520f1405", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "0b87396e", + "id": "f881ebbe", "metadata": {}, "source": [ "Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)\n", @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "9777221e", + "id": "7fab306d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/creating-and-updating-figures.ipynb b/creating-and-updating-figures.ipynb index 3c6830dd1..31d1d7eb3 100644 --- a/creating-and-updating-figures.ipynb +++ b/creating-and-updating-figures.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3c6c2f57", + "id": "db61beba", "metadata": {}, "source": [ "The `plotly` Python package exists to create, manipulate and [render](/python/renderers/) graphical figures (i.e. charts, plots, maps and diagrams) represented by [data structures also referred to as figures](/python/figure-structure/). The rendering process uses the [Plotly.js JavaScript library](https://plotly.com/javascript/) under the hood although Python developers using this module very rarely need to interact with the Javascript library directly, if ever. Figures can be represented in Python either as dicts or as instances of the `plotly.graph_objects.Figure` class, and are serialized as text in [JavaScript Object Notation (JSON)](https://json.org/) before being passed to Plotly.js.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbc5663e", + "id": "fcfb3227", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "3708ee84", + "id": "199465f2", "metadata": {}, "source": [ "### Figures as Graph Objects\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "27fca4e1", + "id": "91487c5e", "metadata": {}, "source": [ "Below you can find an example of one way that the figure in the example above could be specified using a graph object instead of a dictionary." @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70c88ce0", + "id": "13655ebf", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "b418b98b", + "id": "524883d5", "metadata": {}, "source": [ "You can also create a graph object figure from a dictionary representation by passing the dictionary to the `go.Figure` constructor." @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68454713", + "id": "a6bbe73a", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "ac5422da", + "id": "210dba3f", "metadata": {}, "source": [ "##### Converting Graph Objects To Dictionaries and JSON\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f65a18c9", + "id": "e9b3f7b8", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "c7e9138b", + "id": "ef0288ca", "metadata": {}, "source": [ "### Representing Figures in Dash\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d73029af", + "id": "fa92c3dc", "metadata": { "hide_code": true }, @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "4935299c", + "id": "fb6bb5f3", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "21555856", + "id": "f9dd12dc", "metadata": {}, "source": [ "### Creating Figures\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "5d72cce0", + "id": "f239f3fb", "metadata": {}, "source": [ "#### Plotly Express\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ab4d2ed", + "id": "9b7ec921", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "1117fcff", + "id": "3d3f638a", "metadata": {}, "source": [ "#### Graph Objects `Figure` Constructor\n", @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d14933c", + "id": "d0c50b03", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "124e74a3", + "id": "735f2889", "metadata": {}, "source": [ "#### Figure Factories\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "173fd67a", + "id": "992c188a", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "9dff24b5", + "id": "3659fc69", "metadata": {}, "source": [ "#### Make Subplots\n", @@ -289,7 +289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90c6af01", + "id": "66478b20", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "da094a1b", + "id": "84adec5a", "metadata": {}, "source": [ "### Updating Figures\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce78e8e7", + "id": "4d0dd6d6", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "4f66fb2e", + "id": "8656ca07", "metadata": {}, "source": [ "You can also add traces to a figure produced by a figure factory or Plotly Express." @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d37860c", + "id": "31d3bf70", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "ce2e5ed8", + "id": "a57e81dd", "metadata": {}, "source": [ "#### Adding Traces To Subplots\n", @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c5e2f1b", + "id": "b9f8c93d", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "c534d293", + "id": "554e88d0", "metadata": {}, "source": [ "This also works for figures created by Plotly Express using the `facet_row` and or `facet_col` arguments." @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5695b71", + "id": "8e28e127", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "d9deced3", + "id": "4456d6a3", "metadata": {}, "source": [ "#### Add Trace Convenience Methods\n", @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c742d42", + "id": "44046a3d", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "62f8160e", + "id": "4ce9ab43", "metadata": {}, "source": [ "#### Magic Underscore Notation\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99d722f5", + "id": "4d7ac326", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "57c89522", + "id": "fb89051a", "metadata": {}, "source": [ "With magic underscore notation, you can accomplish the same thing by passing the figure constructor a keyword argument named `layout_title_text`, and by passing the `go.Scatter` constructor a keyword argument named `line_color`." @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ab83135", + "id": "de65ad1d", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "550b321f", + "id": "58e95515", "metadata": {}, "source": [ "Magic underscore notation is supported throughout the graph objects API, and it can often significantly simplify operations involving deeply nested properties.\n", @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "345ed6a0", + "id": "ec5a1148", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +553,7 @@ }, { "cell_type": "markdown", - "id": "a19b32cc", + "id": "826de3be", "metadata": {}, "source": [ "Note that the following `update_layout()` operations are equivalent:" @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70014bbb", + "id": "049d575c", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "f038fd28", + "id": "c4202dd6", "metadata": {}, "source": [ "#### Updating Traces\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67c7435b", + "id": "36e7a63d", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "df347c68", + "id": "535f0d12", "metadata": {}, "source": [ "Note that both `scatter` and `bar` traces have a `marker.color` property to control their coloring. Here is an example of using `update_traces()` to modify the color of all traces." @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19d35bc0", + "id": "9d95471e", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "52081a87", + "id": "72bcafa4", "metadata": {}, "source": [ "The `update_traces()` method supports a `selector` argument to control which traces should be updated. Only traces with properties that match the selector will be updated. Here is an example of using a selector to only update the color of the `bar` traces." @@ -676,7 +676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12f5d966", + "id": "d007810a", "metadata": {}, "outputs": [], "source": [ @@ -708,7 +708,7 @@ }, { "cell_type": "markdown", - "id": "c55fb8da", + "id": "65a8a9d8", "metadata": {}, "source": [ "Magic underscore notation can be used in the selector to match nested properties. Here is an example of updating the color of all traces that were formally colored `\"MediumPurple\"`." @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c231e2c", + "id": "27a9c3b9", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "34ef6178", + "id": "5e3925da", "metadata": {}, "source": [ "For figures with subplots, the `update_traces()` method also supports `row` and `col` arguments to control which traces should be updated. Only traces in the specified subplot row and column will be updated. Here is an example of updating the color of all traces in the second subplot column." @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59920487", + "id": "1f1dbf61", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "4bc262ab", + "id": "df70a378", "metadata": {}, "source": [ "The `update_traces()` method can also be used on figures produced by figure factories or Plotly Express. Here's an example of updating the regression lines produced by Plotly Express to be dotted." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08dd824f", + "id": "8b4c0c63", "metadata": {}, "outputs": [], "source": [ @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "e7f71cf9", + "id": "926213ef", "metadata": {}, "source": [ "### Overwrite Existing Properties When Using Update Methods\n", @@ -833,7 +833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73b17fd4", + "id": "2856eaa3", "metadata": {}, "outputs": [], "source": [ @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "5cc730c7", + "id": "7dc67be3", "metadata": {}, "source": [ "#### Conditionally Updating Traces\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f1cf0d2", + "id": "a3c1f733", "metadata": {}, "outputs": [], "source": [ @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "68f95f01", + "id": "6731e3df", "metadata": {}, "source": [ "#### Updating Figure Axes\n", @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b3dc11e", + "id": "181f36e1", "metadata": {}, "outputs": [], "source": [ @@ -917,7 +917,7 @@ }, { "cell_type": "markdown", - "id": "c1dee38a", + "id": "ae1064c3", "metadata": {}, "source": [ "There are also `for_each_xaxis()` and `for_each_yaxis()` methods that are analogous to the `for_each_trace()` method described above. For non-cartesian subplot types (e.g. polar), there are additional `update_{type}` and `for_each_{type}` methods (e.g. `update_polar()`, `for_each_polar()`).\n", @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "232bee33", + "id": "9b9f5540", "metadata": {}, "outputs": [], "source": [ @@ -967,7 +967,7 @@ }, { "cell_type": "markdown", - "id": "8b475c94", + "id": "d94c1a46", "metadata": {}, "source": [ "#### Property Assignment\n", @@ -978,7 +978,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7921c890", + "id": "284aaee6", "metadata": {}, "outputs": [], "source": [ @@ -990,7 +990,7 @@ }, { "cell_type": "markdown", - "id": "d8c82b67", + "id": "5a9c22d5", "metadata": {}, "source": [ "And here is an example of updating the bar outline using property assignment." @@ -999,7 +999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9130eba9", + "id": "57289aea", "metadata": { "lines_to_next_cell": 2 }, @@ -1017,7 +1017,7 @@ }, { "cell_type": "markdown", - "id": "60b25822", + "id": "057715c7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/custom-buttons.ipynb b/custom-buttons.ipynb index 7b39510c4..32e253c62 100644 --- a/custom-buttons.ipynb +++ b/custom-buttons.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c5fb67ff", + "id": "c1715d22", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "5236b526", + "id": "94afa515", "metadata": {}, "source": [ "#### Restyle Button\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15c85000", + "id": "596cc0e8", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "93b43247", + "id": "908c11ac", "metadata": {}, "source": [ "**Update Several Data Attributes**
\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b574eb26", + "id": "33ff560d", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "ad7271ea", + "id": "f70fbed5", "metadata": {}, "source": [ "#### Relayout Button\n", @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b19646e7", + "id": "9fc466b0", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "57846991", + "id": "ce71f21f", "metadata": {}, "source": [ "#### Update Button\n", @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c82e89e", + "id": "00f8ddb1", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "cd94033c", + "id": "04dccdb7", "metadata": {}, "source": [ "#### Animate Button\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "60750435", + "id": "7b623db3", "metadata": {}, "source": [ "#### Reference\n", @@ -503,7 +503,7 @@ }, { "cell_type": "markdown", - "id": "9b2ac148", + "id": "c042aa56", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dash.ipynb b/dash.ipynb index 112d69d2a..57cbc95db 100644 --- a/dash.ipynb +++ b/dash.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "49dee383", + "id": "b049cd6f", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "b1ea5b79", + "id": "fc87bdaf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dendrogram.ipynb b/dendrogram.ipynb index b1bcd6aa8..9b8c7d846 100644 --- a/dendrogram.ipynb +++ b/dendrogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1119b869", + "id": "b0939163", "metadata": {}, "source": [ "#### Basic Dendrogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca5c3c62", + "id": "74076f75", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "1cd9a25b", + "id": "a649967f", "metadata": {}, "source": [ "#### Set Color Threshold" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7bf7c34", + "id": "189e4ab1", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "69262b3f", + "id": "01e3da9f", "metadata": {}, "source": [ "#### Set Orientation and Add Labels" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef9bab4b", + "id": "6fe59dcc", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "d34d22ef", + "id": "e3f7a26d", "metadata": {}, "source": [ "#### Plot a Dendrogram with a Heatmap\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a206ab63", + "id": "35f9b37d", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "0a016352", + "id": "0fd287dd", "metadata": {}, "source": [ "### Reference\n", @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "21a9a72b", + "id": "98224dfb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/density-heatmaps.ipynb b/density-heatmaps.ipynb index 4a43f42b5..1f07fbd7c 100644 --- a/density-heatmaps.ipynb +++ b/density-heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b867eb40", + "id": "a2981303", "metadata": {}, "source": [ "### Density map with `plotly.express`\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14d635e5", + "id": "1dbe083f", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "318dce45", + "id": "104d2d5f", "metadata": {}, "source": [ "### Density map with `plotly.graph_objects`\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdf1c8cd", + "id": "3bfd3624", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "9222fd52", + "id": "437b8e7f", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "086a6391", + "id": "661b335a", "metadata": {}, "source": [ "#### Stamen Terrain base map with Mapbox (Stadia Maps token needed): density heatmap with `plotly.express`\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "4e11608c", + "id": "5d838be9", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "0cc0fae9", + "id": "b2e75c7f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/discrete-color.ipynb b/discrete-color.ipynb index a7a066de9..f48883a17 100644 --- a/discrete-color.ipynb +++ b/discrete-color.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "60a79dc1", + "id": "c4182a49", "metadata": {}, "source": [ "### Discrete vs Continuous Color\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1921b0a5", + "id": "6f999e0b", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "36b446da", + "id": "1fa910c5", "metadata": {}, "source": [ "The `size` column, however, contains numbers:" @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71c286d6", + "id": "8f688934", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "a4c70874", + "id": "1d11be3b", "metadata": {}, "source": [ "Converting this column to strings is very straightforward, but note that the ordering in the legend is not sequential by default (see below for how to control discrete order):" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f44a09ca", + "id": "2249ffa5", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "a8a489c5", + "id": "a0e63929", "metadata": {}, "source": [ "Converting a string column to a numeric one is also quite straightforward:" @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70611031", + "id": "a285faf3", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "3f1a004d", + "id": "1384647f", "metadata": {}, "source": [ "### Discrete Colors in Dash\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36dcb7b2", + "id": "d4862229", "metadata": { "hide_code": true }, @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "9f39cd3f", + "id": "630f47df", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "c7b8f291", + "id": "8580c878", "metadata": {}, "source": [ "### Color Sequences in Plotly Express\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7afc4319", + "id": "2c3539f9", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "2e182f4b", + "id": "a626113a", "metadata": {}, "source": [ "Color sequences in the `px.colors.qualitative` module are stored as lists of CSS colors:" @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1aad475", + "id": "e3bdb44a", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "6ce7fe76", + "id": "26798951", "metadata": {}, "source": [ "Here is an example that creates a scatter plot using Plotly Express, with points colored using the built-in qualitative `G10` color sequence." @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f5454ed", + "id": "4b799b16", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "b759228a", + "id": "c4fdf521", "metadata": {}, "source": [ "### Explicitly Constructing a Color Sequence\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a1384b8", + "id": "457becf6", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "98988cbd", + "id": "73ead8b6", "metadata": {}, "source": [ "**_Warning_**: If your color sequence has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:" @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad22d52f", + "id": "1e33f165", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "f33f14d0", + "id": "9286b1dc", "metadata": {}, "source": [ "### Directly Mapping Colors to Data Values\n", @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5bcc85f", + "id": "0f7b4de5", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "ff6c8468", + "id": "0c43ff8e", "metadata": {}, "source": [ "If your data set already contains valid CSS colors which you wish to use directly, you can pass the special value `\"identity\"` to `color_discrete_map`, in which case the legend is hidden by default, and the color does not appear in the hover label:" @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93ff45bc", + "id": "fc1f604c", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "e650b81c", + "id": "43b245c7", "metadata": {}, "source": [ "### Controlling Discrete Color Order\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efd25c99", + "id": "bd14e82b", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bf38e3d", + "id": "091cdcf9", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "f3adc6fd", + "id": "943b11de", "metadata": {}, "source": [ "### Using Sequential Scales as Discrete Sequences\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e51767e1", + "id": "b87b3549", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "36234238", + "id": "099d593b", "metadata": {}, "source": [ "This works because just like in `px.colors.qualitative`, all [built-in continuous color scales](/python/builtin-colorscales/) are stored as lists of CSS colors:" @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d31ca5a2", + "id": "bd144b02", "metadata": { "lines_to_next_cell": 2 }, @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "bf23be0e", + "id": "f2e025bf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/distplot.ipynb b/distplot.ipynb index 7558893d3..9663db8c2 100644 --- a/distplot.ipynb +++ b/distplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f715e554", + "id": "3a757f8d", "metadata": {}, "source": [ "## Combined statistical representations with px.histogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "548b9231", + "id": "3aa20b48", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20665ce8", + "id": "453bc4de", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "684271ea", + "id": "46987908", "metadata": {}, "source": [ "### Combined statistical representations in Dash\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d9f59d6", + "id": "2bbc31ea", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "14122ea3", + "id": "f4665d81", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "808c6cae", + "id": "b28c8534", "metadata": {}, "source": [ "## Combined statistical representations with distplot figure factory\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcf3b3c7", + "id": "8b3b03e8", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "e9468e68", + "id": "1187cbec", "metadata": {}, "source": [ "#### Plot Multiple Datasets" @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12398b9b", + "id": "6fcb7b97", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "9ad59d18", + "id": "00c61740", "metadata": {}, "source": [ "#### Use Multiple Bin Sizes\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbbcac12", + "id": "32967348", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "78f08115", + "id": "93e18585", "metadata": {}, "source": [ "#### Customize Rug Text, Colors & Title" @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fd41c83", + "id": "48501f08", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "f511f6d2", + "id": "74c0e492", "metadata": {}, "source": [ "#### Plot Normal Curve" @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a9ce46b", + "id": "ae0cb734", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "c67a0b84", + "id": "91740616", "metadata": {}, "source": [ "#### Plot Only Curve and Rug" @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf2d30c8", + "id": "6a709490", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "ee7045f0", + "id": "f86849c0", "metadata": {}, "source": [ "#### Plot Only Hist and Rug" @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5522019", + "id": "a68a56d3", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "68833c9a", + "id": "508dfd80", "metadata": {}, "source": [ "#### Plot Hist and Rug with Different Bin Sizes" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b8c1ff1", + "id": "d2c1ab3e", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "b944c110", + "id": "b6fe9434", "metadata": {}, "source": [ "#### Plot Only Hist and Curve" @@ -374,7 +374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "50d348a8", + "id": "eb50a8a5", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "a29bae90", + "id": "203dcee8", "metadata": {}, "source": [ "#### Distplot with Pandas" @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae03063a", + "id": "b652a05d", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "e5193f9d", + "id": "ffea00ef", "metadata": {}, "source": [ "#### Reference" @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "99f5d9cc", + "id": "f078e052", "metadata": {}, "source": [ "For more info on `ff.create_distplot()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_distplot.html)\n" @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "5a1d05c4", + "id": "2319fd44", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dot-plots.ipynb b/dot-plots.ipynb index 1728a4ce0..adf399467 100644 --- a/dot-plots.ipynb +++ b/dot-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d1a913b7", + "id": "3fbc8d64", "metadata": {}, "source": [ "#### Basic Dot Plot\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7605c2", + "id": "fd8fc9f3", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a794c68", + "id": "cc371776", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbba11b5", + "id": "7a960b28", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "4fe23f5f", + "id": "7975c5bb", "metadata": {}, "source": [ "#### Styled Categorical Dot Plot" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e2148ee", + "id": "739de96a", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "3ff16847", + "id": "91f98a1e", "metadata": {}, "source": [ "### Reference\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "aa50bd72", + "id": "6e619a85", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dropdowns.ipynb b/dropdowns.ipynb index 88cfb09b3..798143e16 100644 --- a/dropdowns.ipynb +++ b/dropdowns.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "733eee97", + "id": "2a39cc5f", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "582432bc", + "id": "329249df", "metadata": {}, "source": [ "## Restyle Dropdown\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fd00fd6", + "id": "7da238c5", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "ca981c00", + "id": "f44ed665", "metadata": {}, "source": [ "### Update Several Data Attributes\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b89f2da", + "id": "9bbec841", "metadata": {}, "outputs": [], "source": [ @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "4fc1c170", + "id": "7f9b7efb", "metadata": {}, "source": [ "## Relayout Dropdown\n", @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fabbdc10", + "id": "e0d69328", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "ec4ceab5", + "id": "2ed54529", "metadata": {}, "source": [ "### Update Dropdown\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0cc6e29", + "id": "a8ffa951", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "ce670c08", + "id": "95e676d2", "metadata": {}, "source": [ "### Graph Selection Dropdowns in Jinja\n", @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "d9c784ce", + "id": "19860f13", "metadata": {}, "source": [ "\n", @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "7ec707fa", + "id": "4bb406f7", "metadata": {}, "source": [ "#### Reference\n", @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "d1b442c7", + "id": "ca37ba95", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dumbbell-plots.ipynb b/dumbbell-plots.ipynb index 1375f97c4..69aab47dd 100644 --- a/dumbbell-plots.ipynb +++ b/dumbbell-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "748b82d0", + "id": "38d74bd5", "metadata": {}, "source": [ "## Basic Dumbbell Plot" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "0854308e", + "id": "fedcecdb", "metadata": {}, "source": [ "Dumbbell plots are useful for demonstrating change between two sets of data points, for example, the population change for a selection of countries for two different years.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d0fb228", + "id": "a1623c6e", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "d465050e", + "id": "fd71b56b", "metadata": {}, "source": [ "## Dumbbell Plot with Arrow Markers\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4922b79", + "id": "5c502740", "metadata": { "lines_to_next_cell": 2 }, @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "e8d31333", + "id": "b9ddabb1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ecdf-plots.ipynb b/ecdf-plots.ipynb index 23e92bc28..a5ed808fe 100644 --- a/ecdf-plots.ipynb +++ b/ecdf-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "92fbb984", + "id": "1fc55485", "metadata": {}, "source": [ "### Overview\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ff5fdf1", + "id": "de84d85e", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "4bf4586d", + "id": "56829cdb", "metadata": {}, "source": [ "Providing multiple columns leverage's Plotly Express' [wide-form data support](https://plotly.com/python/wide-form/) to show multiple variables on the same plot." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c33deed", + "id": "6a905d87", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "63a4ed44", + "id": "64dd6274", "metadata": {}, "source": [ "It is also possible to map another variable to the color dimension of a plot." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7c9d01f", + "id": "6320a0f1", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "7424ae00", + "id": "40f26039", "metadata": {}, "source": [ "### Configuring the Y axis\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fab90e7", + "id": "ed0adf24", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "ce40d490", + "id": "f5cd0739", "metadata": {}, "source": [ "If a `y` value is provided, the Y axis is set to the sum of `y` rather than counts." @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fd062df", + "id": "6ac7f9f3", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "6a16886b", + "id": "ff798621", "metadata": {}, "source": [ "### Reversed and Complementary CDF plots\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26ac447c", + "id": "818882ce", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "095ddacf", + "id": "ca7e2619", "metadata": {}, "source": [ "In `reversed` mode, the right-most point is at 1 (or the total count/sum, depending on `ecdfnorm`) and the left-most point is above 0." @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4656a065", + "id": "5a1d3b31", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "a7e15e80", + "id": "6909f89e", "metadata": {}, "source": [ "In `complementary` mode, the right-most point is at 0 and no points are at 1 (or the total count/sum) per the definition of the CCDF as 1-ECDF, which has no point at 0." @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e70ae16d", + "id": "14a13f17", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "3819f3c1", + "id": "10cf8d9f", "metadata": {}, "source": [ "### Orientation\n", @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30a7ee1f", + "id": "6d61089d", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "1228f1a7", + "id": "925eb187", "metadata": {}, "source": [ "### Markers and/or Lines\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc19d48d", + "id": "eedc5576", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2272199", + "id": "63bcdb58", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "e4ccb748", + "id": "07574163", "metadata": {}, "source": [ "### Marginal Plots\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45c0eb66", + "id": "3bf5c49e", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bafe5823", + "id": "3eabddfc", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "b5ba5ce9", + "id": "df54431f", "metadata": {}, "source": [ "### Facets\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c9432d7", + "id": "d5a19548", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4fbd3d2", + "id": "6af47acf", "metadata": { "lines_to_next_cell": 2 }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "cbb6227c", + "id": "e812b62e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/error-bars.ipynb b/error-bars.ipynb index 67143fea7..50ee996fe 100644 --- a/error-bars.ipynb +++ b/error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d0a5afaf", + "id": "9acc74c3", "metadata": {}, "source": [ "### Error Bars with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d485a7bc", + "id": "c4e892fb", "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "221551b3", + "id": "613ed8d0", "metadata": {}, "source": [ "#### Asymmetric Error Bars with Plotly Express" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c929b7f", + "id": "45d1fe29", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "5a04250d", + "id": "f2b76808", "metadata": {}, "source": [ "### Error Bars with graph_objects\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e402fd8", + "id": "5dc9782f", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "b0e2fc82", + "id": "ee353ab5", "metadata": {}, "source": [ "#### Asymmetric Error Bars" @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ee1bf26", + "id": "11d2618e", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "aeaa1928", + "id": "cd93dbe5", "metadata": {}, "source": [ "#### Error Bars as a Percentage of the y Value" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44c6d357", + "id": "13558b00", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "241a8f75", + "id": "57381eeb", "metadata": {}, "source": [ "#### Asymmetric Error Bars with a Constant Offset" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7714458d", + "id": "ec86b91b", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "fd43558d", + "id": "8bd22990", "metadata": {}, "source": [ "#### Horizontal Error Bars" @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6c1eb6c", + "id": "1bb04583", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "bf790ed2", + "id": "81fbd68d", "metadata": {}, "source": [ "#### Bar Chart with Error Bars" @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b782b94", + "id": "e40ea855", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "068c55f2", + "id": "1d4860db", "metadata": {}, "source": [ "#### Colored and Styled Error Bars" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16d47b1f", + "id": "bbb62bf9", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "52967c83", + "id": "0e8a7ddf", "metadata": {}, "source": [ "#### Reference\n", @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "18101c92", + "id": "1e9ba202", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/facet-plots.ipynb b/facet-plots.ipynb index fe2de4500..404a0ee55 100644 --- a/facet-plots.ipynb +++ b/facet-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c2842462", + "id": "5e0b6899", "metadata": {}, "source": [ "### Facet and Trellis Plots\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5917124f", + "id": "fb3081b4", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "da322f7a", + "id": "4361412f", "metadata": {}, "source": [ "### Bar Chart Row Facets\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eaa093d", + "id": "8a900cf6", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "6a544154", + "id": "185ccb8e", "metadata": {}, "source": [ "### Wrapping Column Facets\n", @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c10abb1f", + "id": "635e7309", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "b5fc45a1", + "id": "72fb91ce", "metadata": {}, "source": [ "### Histogram Facet Grids" @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b04c863", + "id": "c2590151", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "0330b274", + "id": "452ce2cd", "metadata": {}, "source": [ "### Choropleth Column Facets\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc46734d", + "id": "4492cd4c", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "6cb747d5", + "id": "570522c0", "metadata": {}, "source": [ "### Adding Lines and Rectangles to Facet Plots\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "427a4913", + "id": "5fda7070", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "3f419932", + "id": "af610b12", "metadata": {}, "source": [ "### Adding the Same Trace to All Facets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b647423", + "id": "d99554ee", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "8b9ecd18", + "id": "759993f6", "metadata": {}, "source": [ "### Facets With Independent Axes\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "623e4514", + "id": "33fd0dc3", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeb1c25d", + "id": "52c5268f", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "4c1d4aa9", + "id": "ab12d564", "metadata": {}, "source": [ "### Customizing Subplot Figure Titles\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "438e095a", + "id": "d1a2926a", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "ceeb052a", + "id": "f461b0e1", "metadata": {}, "source": [ "### Controlling Facet Ordering\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f12cc6ba", + "id": "04bd400d", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "b95d6d18", + "id": "99858c2c", "metadata": {}, "source": [ "### Controlling Facet Spacing\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ba409ea", + "id": "f870b5c4", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "e46d6e61", + "id": "014bc68d", "metadata": {}, "source": [ "### Synchronizing axes in subplots with `matches`\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a8157d4", + "id": "21480563", "metadata": { "lines_to_next_cell": 2 }, @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "c4494a38", + "id": "4252dbd8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factories.ipynb b/figure-factories.ipynb index 024e2a1cc..324ad853d 100644 --- a/figure-factories.ipynb +++ b/figure-factories.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e515d417", + "id": "653ece8b", "metadata": {}, "source": [ "#### `plotly.figure_factory`\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "60be1744", + "id": "8976e664", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-subplots.ipynb b/figure-factory-subplots.ipynb index 414af21f2..6f9b8da85 100644 --- a/figure-factory-subplots.ipynb +++ b/figure-factory-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "53aa995f", + "id": "52517fd3", "metadata": {}, "source": [ "#### Plotly's Figure Factory Module\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "d15089fb", + "id": "d7348cb1", "metadata": {}, "source": [ "#### Vertical Figure Factory Charts\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62427ff7", + "id": "665ec7d5", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "d9deba2c", + "id": "2dbd7568", "metadata": {}, "source": [ "Edit the figures' x and y axes attributes to create subplots:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22ab6874", + "id": "a5fb6222", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "d5468052", + "id": "dd01deaa", "metadata": {}, "source": [ "Combine the data and layout objects to create a figure" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7130754e", + "id": "73d5cdfc", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "16ccde54", + "id": "0680e117", "metadata": {}, "source": [ "#### Horizontal Table and Chart" @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f324e936", + "id": "3742daf0", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "b152887f", + "id": "255f5101", "metadata": {}, "source": [ "#### Vertical Table and Chart" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00b695c3", + "id": "26c56e0c", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "579a8bbe", + "id": "9eb66bdd", "metadata": {}, "source": [ "#### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "08b7d533", + "id": "27e3fced", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-table.ipynb b/figure-factory-table.ipynb index fe0f892c3..2b01f4ca6 100644 --- a/figure-factory-table.ipynb +++ b/figure-factory-table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "37a3a753", + "id": "e56fc589", "metadata": {}, "source": [ "Tables can be created using a [`table` trace type](/python/table/), or by using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7326bba3", + "id": "2d62ea71", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "3d1ea959", + "id": "3d088abb", "metadata": {}, "source": [ "#### Add Links" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff568268", + "id": "413dd854", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "5abeb873", + "id": "9ecccfc6", "metadata": {}, "source": [ "### Use LaTeX" @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4409e303", + "id": "4d2c5175", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "bea6a6ee", + "id": "47a000cf", "metadata": {}, "source": [ "### Use a Pandas Dataframe" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cad9d66", + "id": "a081efd2", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "49b65a67", + "id": "79a16aae", "metadata": {}, "source": [ "### Modify Row Height\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14935158", + "id": "54a9afb5", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "ca185a33", + "id": "b1d74a46", "metadata": {}, "source": [ "### Custom Table Colors\n" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "145275d8", + "id": "c59c69fa", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "091c4d21", + "id": "2ae17a67", "metadata": {}, "source": [ "### Custom Font Colors" @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbb8d3bb", + "id": "5fa11a9b", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "4e06fd51", + "id": "96dccec5", "metadata": {}, "source": [ "### Change Font Size" @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5daed1cb", + "id": "f0978718", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "bc41acd1", + "id": "0666fef1", "metadata": {}, "source": [ "#### Tables with Graphs" @@ -259,7 +259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f208bf2e", + "id": "2e4a5390", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "178b4cc6", + "id": "7411fc54", "metadata": { "lines_to_next_cell": 2 }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "a69da82e", + "id": "87c940ce", "metadata": {}, "source": [ "#### Reference\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "7488a830", + "id": "1fe7814b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-introspection.ipynb b/figure-introspection.ipynb index 93756477f..8c450d51e 100644 --- a/figure-introspection.ipynb +++ b/figure-introspection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b75cee1c", + "id": "d3f4427c", "metadata": {}, "source": [ "### The Figure Lifecycle\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "91caee8c", + "id": "81cd0127", "metadata": {}, "source": [ "### Introspecting Plotly Express Figures\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ebc7ad6", + "id": "34248807", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "8712c164", + "id": "1e97593d", "metadata": {}, "source": [ "We can learn more about the attributes Plotly Express has set for us with the Python `help()` function:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "609e1c4d", + "id": "35b7ccb5", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "ebd5d0e1", + "id": "0c15d73b", "metadata": {}, "source": [ "### Accessing Javascript-Computed Defaults\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c0e4b32", + "id": "5baf47a5", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "5a1a68e7", + "id": "84c4cc2f", "metadata": {}, "source": [ "Let's print this figure to see the very small JSON object that is passed to Plotly.js as input:" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "796a9ac3", + "id": "70d30a74", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "6e252fa3", + "id": "12256649", "metadata": {}, "source": [ "Now let's look at the \"full\" figure after Plotly.js has computed the default values for every necessary attribute.\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "026eb874", + "id": "244dc89a", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "4d3a9767", + "id": "0c8e6a9c", "metadata": {}, "source": [ "As you can see, Plotly.js does a lot of work filling things in for us! Let's look at the examples described at the top of the page of static and dynamic defaults. If we look just at `layout.font` and `layout.xaxis.range` we can see that the static default font size is 12 and that the dynamic default range is computed to be a bit beyond the data range which was 10-20:" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f7ad99d", + "id": "f54c7986", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "b447d47a", + "id": "35ac88b8", "metadata": {}, "source": [ "### Learning About Attributes" @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "c7ee93b5", + "id": "f7823ce6", "metadata": {}, "source": [ "What else can we use this `full_fig` for? Let's start by looking at the first entry of the `data`" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06d22ff9", + "id": "2db2f527", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "acd94582", + "id": "ca796132", "metadata": {}, "source": [ "We see that this is an instance of `go.Scatter` (as expected, given the input) and that it has an attribute we've maybe never heard of called `cliponaxis` which by default seems to be set to `True` in this case. Let's find out more about this attribute using the built-in Python `help()` function" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0ed70bb", + "id": "f65b7f1e", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "3c93b223", + "id": "5a3ce096", "metadata": {}, "source": [ "Aha! This explains why in our original figure above, the text was cut off by the edge of the plotting area! Let's try forcing that to `False`, and let's also use the attribute `textposition` which we see in the full figure is by default set to `\"middle center\"` to get our text off of our markers:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cee147a2", + "id": "ab72a8bc", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "61df182c", + "id": "a031e296", "metadata": {}, "source": [ "We can use this technique (of making a figure, and querying Plotly.js for the \"full\" version of that figure, and then exploring the attributes that are automatically set for us) to learn more about the range of possibilities that the figure schema makes available. We can drill down into `layout` attributes also:" @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64e598b8", + "id": "8d366b9f", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "666b0fd9", + "id": "e2bdcede", "metadata": {}, "source": [ "### More about Layout\n", @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d64df934", + "id": "26377867", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "630fa4c9", + "id": "13a6bfff", "metadata": {}, "source": [ "If I then set `showrivers=True` and re-query the full figure, I see that new keys have appeared in the `layout.geo` object for `rivercolor` and `riverwidth`, showing the dynamic nature of these defaults." @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ffdc9e1", + "id": "59978447", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "ec7aeb9c", + "id": "3347858e", "metadata": {}, "source": [ "### Reference\n", @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdbd3ece", + "id": "b518ab17", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "269652c1", + "id": "192dc216", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-labels.ipynb b/figure-labels.ipynb index 823dc4218..bc005fc3a 100644 --- a/figure-labels.ipynb +++ b/figure-labels.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6011ddec", + "id": "d121a1bb", "metadata": {}, "source": [ "### Automatic Labelling with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0e89b7d", + "id": "1a8ad247", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f77c97a9", + "id": "99be3b8c", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "cce0a92e", + "id": "0f0abaa8", "metadata": {}, "source": [ "### Global and Local Font Specification\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a70fa60f", + "id": "cd6b1d63", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "4106d2b0", + "id": "89fd0373", "metadata": {}, "source": [ "### Set Automargin on the Plot Title\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7c3c05f", + "id": "3d6eab92", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "a17b679b", + "id": "05e09036", "metadata": {}, "source": [ "### Fonts and Labels in Dash\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ec6c778", + "id": "302c6e26", "metadata": { "hide_code": true }, @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "a23899cd", + "id": "52b7852f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "73c50b01", + "id": "94f5319c", "metadata": {}, "source": [ "### Manual Labelling with Graph Objects\n", @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da3d6849", + "id": "9012f4a6", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "b055a092", + "id": "cf586691", "metadata": {}, "source": [ "### Configuring Font Variant, Style, and Weight\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d23291f3", + "id": "0695c8dd", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "a362bd2d", + "id": "07e2956e", "metadata": {}, "source": [ "The configuration of the legend is discussed in detail in the [Legends](/python/legend/) page.\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "489a62cd", + "id": "99eded9f", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "1f6c4b90", + "id": "3f45de7a", "metadata": {}, "source": [ "### Adding a Plot Subtitle\n", @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e620e3ae", + "id": "a29f9e40", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "165e9f2c", + "id": "e2517c83", "metadata": {}, "source": [ "#### Reference\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "27140fe4", + "id": "6131ad56", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-structure.ipynb b/figure-structure.ipynb index b1e79b774..21b112e8d 100644 --- a/figure-structure.ipynb +++ b/figure-structure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4aed708b", + "id": "33a44a28", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3af80dc2", + "id": "fed3684d", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "0fab77f4", + "id": "dbe70e35", "metadata": {}, "source": [ "### Accessing figure structures in Dash\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17f981ed", + "id": "7c1e0ea8", "metadata": { "hide_code": true }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "8c173441", + "id": "d9eda6e7", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "b1a59f9b", + "id": "ba9f278a", "metadata": {}, "source": [ "### Figures as Trees of Attributes\n", @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "cce47ebc", + "id": "1f744ac6", "metadata": {}, "source": [ "### The Top-Level `layout` Attribute\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10bcce41", + "id": "3206d75c", "metadata": { "lines_to_next_cell": 2 }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "37eef76b", + "id": "32d6d83a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget-app.ipynb b/figurewidget-app.ipynb index d4b45d166..1cbf0c723 100644 --- a/figurewidget-app.ipynb +++ b/figurewidget-app.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "68b405ac", + "id": "f1ab762b", "metadata": {}, "source": [ "#### NYC Flights Database" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2df5f6ec", + "id": "9665c29b", "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "406f29de", + "id": "dc8f7319", "metadata": {}, "source": [ "We'll be making an application to take a look at delays from all flights out of NYC in the year 2013." @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "511b3edf", + "id": "c8eb076f", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f68eb8ba", + "id": "ce66beeb", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "7f531e63", + "id": "880bf768", "metadata": {}, "source": [ "Let's get the set of all the `airlines`, so that we can type the right things into the search box later." @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d63c9e2b", + "id": "8635572d", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "504ad59f", + "id": "56151648", "metadata": {}, "source": [ "Let's assign the widgets that we're going to be using in our app. In general all these widgets will be used to filter the data set, and thus what we visualize." @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "086186a4", + "id": "75e2da70", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "7059c55c", + "id": "f8f31649", "metadata": {}, "source": [ "Let now write a function that will handle the input from the widgets, and alter the state of the graph." @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4247bb3d", + "id": "ca5a1a3a", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "36f68f31", + "id": "35d14681", "metadata": {}, "source": [ "Time to try the app out!!" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2eebb87c", + "id": "518a0830", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7739216", + "id": "3254f19f", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "0dbdabef", + "id": "35c07ca5", "metadata": {}, "source": [ "#### Reference" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f2d38f0", + "id": "e5f995ab", "metadata": { "lines_to_next_cell": 2 }, @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "7af7c124", + "id": "5cbe83a1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget.ipynb b/figurewidget.ipynb index 84eac826d..6724347f6 100644 --- a/figurewidget.ipynb +++ b/figurewidget.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cca67938", + "id": "d0828831", "metadata": {}, "source": [ "The Plotly FigureWidget allows you to add Plotly charts as interactive widgets in Jupyter and other compatible notebooks. To use the FigureWidget, you'll need to install `anywidget`: " @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "251af1e5", + "id": "0338ddce", "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "49b73c6d", + "id": "30e7b0fc", "metadata": {}, "source": [ "#### Create a Simple FigureWidget\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85e33410", + "id": "2b026ffc", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "d1edc8a6", + "id": "2bc4f275", "metadata": {}, "source": [ "" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "3f676e71", + "id": "168e2980", "metadata": {}, "source": [ "Add traces or update the layout and then watch the output above update in real time." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6be67714", + "id": "ceb6239c", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48ca4ca8", + "id": "3cf810e9", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8727a62d", + "id": "7fa3a207", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "93097da7", + "id": "b881bbbb", "metadata": {}, "source": [ "" @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "c24b5d87", + "id": "0c81c8ae", "metadata": {}, "source": [ "#### Update the Data and the Layout" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b823164", + "id": "13250fab", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d0dcbff", + "id": "33ffaef6", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e88fa98b", + "id": "8561c32d", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "0e82a237", + "id": "d52c08d2", "metadata": {}, "source": [ "#### Construct a FigureWidget from a Figure graph object" @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "61bcccbc", + "id": "6248415c", "metadata": {}, "source": [ "A standard `Figure` object can be passed to the `FigureWidget` constructor." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8b95f54", + "id": "f5af8df6", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "bf870dc4", + "id": "0391fcd7", "metadata": {}, "source": [ "#### Reference" @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "0945b452", + "id": "bba1040f", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa0bc04d", + "id": "b72eb9a1", "metadata": { "lines_to_next_cell": 2 }, @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "429acf42", + "id": "8bf034cb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-plots.ipynb b/filled-area-plots.ipynb index 278dc9b31..6ed2ead2e 100644 --- a/filled-area-plots.ipynb +++ b/filled-area-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e5fb0745", + "id": "c9f8b7bf", "metadata": {}, "source": [ "This example shows how to fill the area enclosed by traces.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f41090ed", + "id": "67d360b2", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "1c0a1ff0", + "id": "b5668e00", "metadata": {}, "source": [ "## Filled area plot in Dash\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32b7191b", + "id": "9e453c68", "metadata": { "hide_code": true }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "0d407526", + "id": "4a16195c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "4b949345", + "id": "590beedd", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0242e7b", + "id": "34e6b5b9", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "b2b7a5fc", + "id": "724d42dc", "metadata": {}, "source": [ "### Filled area chart with plotly.graph_objects\n", @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63ab7569", + "id": "ef29ddc3", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "83402ddf", + "id": "5be1bf2a", "metadata": {}, "source": [ "#### Overlaid Area Chart Without Boundary Lines" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8170aa2f", + "id": "2dc0b797", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "4df6ecc6", + "id": "a5e4fb1a", "metadata": {}, "source": [ "#### Interior Filling for Area Chart" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "021fab2a", + "id": "428df4ff", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "e278e1a4", + "id": "2de0fdd9", "metadata": {}, "source": [ "#### Gradient Fill\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efa8b90f", + "id": "1a535cc9", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "11883525", + "id": "b227bb08", "metadata": {}, "source": [ "#### Stacked Area Chart\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee0cbd72", + "id": "7266f404", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "3e323e19", + "id": "e01d554b", "metadata": {}, "source": [ "### Stacked Area Chart with Normalized Values" @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0db14651", + "id": "75aafdd2", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "2c28d06f", + "id": "6208514e", "metadata": {}, "source": [ "#### Select Hover Points" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b541f367", + "id": "fd1e8645", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "741d782c", + "id": "6bd55adb", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "0b037963", + "id": "782c6d85", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-tile-maps.ipynb b/filled-area-tile-maps.ipynb index 3535cd751..7e8bac34d 100644 --- a/filled-area-tile-maps.ipynb +++ b/filled-area-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6210a61b", + "id": "b40af500", "metadata": {}, "source": [ "There are three different ways to show a filled area on a tile-based map:\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b42cea96", + "id": "2e66410e", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "1f16dac7", + "id": "c90b1258", "metadata": {}, "source": [ "### Multiple Filled Areas with a `Scattermap` trace\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd552b93", + "id": "37e3210c", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "0e3828ee", + "id": "0880bf04", "metadata": {}, "source": [ "### GeoJSON Layers\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0334a7aa", + "id": "5d08e115", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "8f61c53b", + "id": "1e5ea344", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "db97afb8", + "id": "5e43338f", "metadata": {}, "source": [ "#### Reference\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "a010d7b9", + "id": "37638a6a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/funnel-charts.ipynb b/funnel-charts.ipynb index c2a0d7417..3efba60c3 100644 --- a/funnel-charts.ipynb +++ b/funnel-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7664636a", + "id": "74bca530", "metadata": {}, "source": [ "### Introduction\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff0de1f0", + "id": "04c617df", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "f04c9565", + "id": "79bc0af9", "metadata": {}, "source": [ "### Stacked Funnel Plot with plotly.express" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "534288b6", + "id": "4fda7484", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "7c0cb2f0", + "id": "bed411b7", "metadata": {}, "source": [ "### Basic Funnel Chart with graph_objects trace go.Funnel\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c88bb8f3", + "id": "f55883ee", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "b05932a1", + "id": "ec6b1d7b", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dacd95a", + "id": "39d55b25", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "c28ff038", + "id": "6ec6e98b", "metadata": {}, "source": [ "### Stacked Funnel Plot with go.Funnel" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd8f8046", + "id": "a46af008", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "0d2cf657", + "id": "1bcdff23", "metadata": {}, "source": [ "### Basic Area Funnel Plot with plotly.express\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3122c31d", + "id": "cf6954ca", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "47b4bf1a", + "id": "2c6c2adb", "metadata": {}, "source": [ "### Basic Area Funnel Plot with go.Funnelarea\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38366ae7", + "id": "8fd0f26f", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "98e37e88", + "id": "6c1a22b1", "metadata": {}, "source": [ "#### Set Marker Size and Color in Area Funnel Plots" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2715f4c", + "id": "7b92998d", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "466010e4", + "id": "363a0418", "metadata": {}, "source": [ "#### Multiple Area Funnels" @@ -246,7 +246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "699cc17e", + "id": "d726e7cb", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "c767cc8c", + "id": "b4c3de0c", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d81aed25", + "id": "aa132992", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "54f06f4f", + "id": "aab74134", "metadata": {}, "source": [ "#### Reference\n", @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "25c57f2a", + "id": "134b7a90", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gantt.ipynb b/gantt.ipynb index cbae1155d..d15761b36 100644 --- a/gantt.ipynb +++ b/gantt.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "56dbfe81", + "id": "90831616", "metadata": {}, "source": [ "A [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) is a type of bar chart that illustrates a project schedule. The chart lists the tasks to be performed on the vertical axis, and time intervals on the horizontal axis. The width of the horizontal bars in the graph shows the duration of each activity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "8316d721", + "id": "984badcb", "metadata": {}, "source": [ "### Gantt Charts and Timelines with plotly.express\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d224e45f", + "id": "54c2aa7b", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "76c1e334", + "id": "e8e9fcf6", "metadata": {}, "source": [ "`px.timeline` supports [discrete color](/python/discrete-color/) as above, or [continuous color](/python/colorscales/) as follows." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e250085e", + "id": "36828d0d", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ba30269", + "id": "308b2eb3", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "492e428f", + "id": "8689c17f", "metadata": {}, "source": [ "It is also possible to have multiple bars on the same horizontal line, say by resource:\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a39a6f63", + "id": "78a7bdc7", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "018081c7", + "id": "763dee21", "metadata": {}, "source": [ "#### Deprecated Figure Factory\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6179be70", + "id": "7a0457c1", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "412911df", + "id": "da69a739", "metadata": {}, "source": [ "#### Group Tasks Together\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecf0c92d", + "id": "93c4e04c", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "5e4da91c", + "id": "2b581287", "metadata": {}, "source": [ "#### Color by Numeric Variable\n", @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7e2eb05", + "id": "231c8f39", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "813d3de7", + "id": "8e312878", "metadata": {}, "source": [ "#### Reference" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "5a692eea", + "id": "f0e45aa8", "metadata": {}, "source": [ "For more info on `ff.create_gantt()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_gantt.html)\n" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "796296e0", + "id": "75d0883b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gauge-charts.ipynb b/gauge-charts.ipynb index 2db3d4a8a..4297cc14c 100644 --- a/gauge-charts.ipynb +++ b/gauge-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bbb4aa13", + "id": "6f033966", "metadata": {}, "source": [ "#### Basic Gauge\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "accdba64", + "id": "c4454876", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "dcb23070", + "id": "a264d7c2", "metadata": {}, "source": [ "#### Add Steps, Threshold, and Delta\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffa2851b", + "id": "bc81c490", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "e7c4630b", + "id": "d9082810", "metadata": {}, "source": [ "#### Custom Gauge Chart\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b84c66f6", + "id": "46508ae7", "metadata": { "lines_to_next_cell": 2 }, @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "e7fa643f", + "id": "08222262", "metadata": {}, "source": [ "#### Reference\n", @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "9151df31", + "id": "3b55816b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/getting-started.ipynb b/getting-started.ipynb index 0d02bd8e2..223938558 100644 --- a/getting-started.ipynb +++ b/getting-started.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "898229a3", + "id": "8f514d91", "metadata": {}, "source": [ "\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b17560d0", + "id": "6fd06c47", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "cc840774", + "id": "5588987e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "953eefa0", + "id": "c753dc3d", "metadata": {}, "source": [ "#### JupyterLab Support\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17aaba89", + "id": "2d94ca61", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "597c68c0", + "id": "ec87f445", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "505d46fd", + "id": "ef7a7fc0", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "2babd975", + "id": "b272c5b6", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`.\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "b7767801", + "id": "2fcffc97", "metadata": {}, "source": [ "#### Jupyter Notebook Support\n", @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66297d02", + "id": "2ec10a50", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "3298306e", + "id": "de855b82", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a72cd7b", + "id": "d0e3927b", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "af240d9b", + "id": "cadb4e98", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`." @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "3ab2bfd9", + "id": "95170a8a", "metadata": {}, "source": [ "### Static Image Export\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "7272ee34", + "id": "250a72a0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graph-objects.ipynb b/graph-objects.ipynb index 4c346a508..3950afdfb 100644 --- a/graph-objects.ipynb +++ b/graph-objects.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67ac8b01", + "id": "d4733a66", "metadata": {}, "source": [ "### What Are Graph Objects?\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c28b1075", + "id": "2409d108", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32724d1b", + "id": "aca485c8", "metadata": { "lines_to_next_cell": 2 }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "8aaa5895", + "id": "8eb3befb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graphing-multiple-chart-types.ipynb b/graphing-multiple-chart-types.ipynb index 22efa4752..288186c7b 100644 --- a/graphing-multiple-chart-types.ipynb +++ b/graphing-multiple-chart-types.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dd1780c7", + "id": "9656fb10", "metadata": {}, "source": [ "### Chart Types versus Trace Types\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "c880bd6c", + "id": "d41506fc", "metadata": {}, "source": [ "### Multiple Trace Types with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85db636c", + "id": "678bedf2", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "ddb48e35", + "id": "468d8798", "metadata": {}, "source": [ "#### Grouped Bar and Scatter Chart\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "433036fb", + "id": "522e9f49", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "3f31eb75", + "id": "28916b6b", "metadata": {}, "source": [ "#### Line Chart and a Bar Chart" @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "592ffc1b", + "id": "13f3c58d", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "4c029451", + "id": "cde2b720", "metadata": {}, "source": [ "#### A Contour and Scatter Plot of the Method of Steepest Descent" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73ff4476", + "id": "6b08873b", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "3af5cc10", + "id": "05abaa44", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "308e0ea6", + "id": "8d6e4086", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "a7fcc444", + "id": "13ee33cc", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "41bdc2b0", + "id": "c6579f3d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/heatmaps.ipynb b/heatmaps.ipynb index 31d8e3d46..b7bd421ce 100644 --- a/heatmaps.ipynb +++ b/heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "aa0238f7", + "id": "ca9b7aac", "metadata": {}, "source": [ "The term \"heatmap\" usually refers to a Cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/tile-density-heatmaps/).\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "45c78c33", + "id": "482ffa1c", "metadata": {}, "source": [ "### Heatmaps with Plotly Express\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "a2cceaf3", + "id": "51572df6", "metadata": {}, "source": [ "The `px.imshow()` function can be used to display heatmaps (as well as full-color images, as its name suggests). It accepts both array-like objects like lists of lists and `numpy` or `xarray` arrays, as well as supported [DataFrame objects](/python/px-arguments#supported-dataframes).\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc9db597", + "id": "0ba166b7", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c871c1c", + "id": "3988fe98", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "4c3d95cb", + "id": "10c5eec4", "metadata": {}, "source": [ "### Displaying Text on Heatmaps\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "879f3eff", + "id": "665c376a", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "6f109fb9", + "id": "5d3cc4fb", "metadata": {}, "source": [ "#### Heatmaps in Dash\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38414e8a", + "id": "728b405f", "metadata": { "hide_code": true }, @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "4e4e7e42", + "id": "ba453839", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "07bfc42c", + "id": "8ebfc8a4", "metadata": {}, "source": [ "### Controlling Aspect Ratio\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d188658", + "id": "5969f2a7", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "3ef2c1a2", + "id": "6897bbee", "metadata": {}, "source": [ "### Customizing the axes and labels on a heatmap\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46956cc6", + "id": "7fef39b4", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "efaef599", + "id": "168d3327", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b821e7ee", + "id": "79f5b879", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "96ae2a4c", + "id": "f9265fc6", "metadata": {}, "source": [ "### Basic Heatmap with `plotly.graph_objects`\n", @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26ad948c", + "id": "5122bfd3", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "4f100b6c", + "id": "348be9ed", "metadata": {}, "source": [ "### Heatmap with Categorical Axis Labels\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f26d390", + "id": "bdd3c743", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "15d0753b", + "id": "b29c28c6", "metadata": {}, "source": [ "### Heatmap with Unequal Block Sizes\n" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "319dbdc3", + "id": "defd17b5", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "0e5c5e5e", + "id": "1ff46c52", "metadata": {}, "source": [ "### Heatmap with Datetime Axis" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5fd1ca0", + "id": "665e9707", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "7ab6bcf2", + "id": "0f0696aa", "metadata": {}, "source": [ "### Text on Heatmap Points\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "089e1f09", + "id": "f07fe02d", "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "6e12a897", + "id": "e6d75380", "metadata": {}, "source": [ "### Heatmap and datashader\n", @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "b0651e73", + "id": "0496a331", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hexbin-mapbox.ipynb b/hexbin-mapbox.ipynb index e74e4204e..fe26ba9c5 100644 --- a/hexbin-mapbox.ipynb +++ b/hexbin-mapbox.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "55ac759c", + "id": "bc002cc3", "metadata": {}, "source": [ "#### Simple Count Hexbin\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25f81211", + "id": "3718f00d", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "56b87e63", + "id": "13f92fe5", "metadata": {}, "source": [ "#### Count Hexbin with Minimum Count and Opacity" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a3876e9", + "id": "c08ae142", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "12ea2bda", + "id": "58da6616", "metadata": {}, "source": [ "#### Display the Underlying Data" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0b74e59", + "id": "d85ab3cd", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "f057f04b", + "id": "3f038228", "metadata": {}, "source": [ "#### Compute the Mean Value per Hexbin" @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da2f78fe", + "id": "fde3b9e9", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "f3f05c42", + "id": "9ed30f8f", "metadata": {}, "source": [ "#### Compute the Sum Value per Hexbin" @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2352902", + "id": "35916210", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "ac9809ef", + "id": "69ff1372", "metadata": {}, "source": [ "#### Hexbin with Animation" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b47b2760", + "id": "ceae351b", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "c20e4d2d", + "id": "acfd021f", "metadata": {}, "source": [ "#### Reference\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "5f320cec", + "id": "2595a634", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/histograms.ipynb b/histograms.ipynb index a39e1c83b..8a26cace1 100644 --- a/histograms.ipynb +++ b/histograms.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ca04fd40", + "id": "0436cc03", "metadata": {}, "source": [ "In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in Plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...) which can be used to visualize data on categorical and date axes as well as linear axes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a91555a", + "id": "55dd36ec", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a6496e5", + "id": "e74fc69e", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "26f06836", + "id": "5b6565ab", "metadata": {}, "source": [ "#### Choosing the number of bins\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5d66d65", + "id": "3bc41b69", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "088b5ea0", + "id": "668e77dc", "metadata": {}, "source": [ "### Histograms on Date Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19c6f778", + "id": "10314fc8", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "f869959a", + "id": "80e45862", "metadata": {}, "source": [ "### Histograms on Categorical Data\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8edce311", + "id": "d93641fd", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "6eae8992", + "id": "7de81d29", "metadata": {}, "source": [ "#### Histograms in Dash\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef4e6af3", + "id": "12ce386a", "metadata": { "hide_code": true }, @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "6f7ccf43", + "id": "3d5632d0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "d935df04", + "id": "f024ca09", "metadata": {}, "source": [ "#### Accessing the counts (y-axis) values\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8860551d", + "id": "1d5e4677", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "b29fe8ea", + "id": "df1803a3", "metadata": {}, "source": [ "#### Type of normalization\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "538ac443", + "id": "c74be586", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "9a90cc61", + "id": "0b04c26d", "metadata": {}, "source": [ "#### Aspect of the histogram plot" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e7ea827", + "id": "1d419a9b", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "a48e954f", + "id": "9fd52129", "metadata": {}, "source": [ "#### Several histograms for the different values of one column" @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c39ff03", + "id": "6d70183f", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "2c8cef0a", + "id": "2a9d0e88", "metadata": {}, "source": [ "#### Aggregating with other functions than `count`\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a1b1083", + "id": "024934b5", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "b9bd4bab", + "id": "9cffbba3", "metadata": {}, "source": [ "The default `histfunc` is `sum` if `y` is given, and works with categorical as well as binned numeric data on the `x` axis:" @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2fb78d0", + "id": "0d968261", "metadata": { "lines_to_next_cell": 0 }, @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "34d387a5", + "id": "4a5a5d5c", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21fb1e47", + "id": "e7c6bc6d", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "9223e02e", + "id": "fbec1dcd", "metadata": {}, "source": [ "#### Visualizing the distribution\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "923479b9", + "id": "0b15fc92", "metadata": {}, "outputs": [], "source": [ @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "01866ec9", + "id": "9f375b00", "metadata": {}, "source": [ "### Adding text labels\n", @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "455e9a29", + "id": "a3ec96dd", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "ed308a8b", + "id": "7d5ef127", "metadata": {}, "source": [ "## Histograms with go.Histogram\n", @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2de5065b", + "id": "c29b9d3f", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "4d1c5a34", + "id": "7fb9e61f", "metadata": {}, "source": [ "### Normalized Histogram" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "055b04f6", + "id": "1acec2ae", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "4277fa80", + "id": "21c4f629", "metadata": {}, "source": [ "### Horizontal Histogram" @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96a7b417", + "id": "d1a0478a", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "1591c4fa", + "id": "e8e5b25c", "metadata": {}, "source": [ "### Overlaid Histogram" @@ -462,7 +462,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b06b46ce", + "id": "f89d79f9", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "f463f0fb", + "id": "f79d2964", "metadata": {}, "source": [ "### Stacked Histograms" @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72059ba8", + "id": "1053d8c9", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "f0a4185b", + "id": "0bec29d2", "metadata": {}, "source": [ "### Styled Histogram" @@ -527,7 +527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc5b45c3", + "id": "ddfd548e", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "9a0905bc", + "id": "e1d976b2", "metadata": {}, "source": [ "### Histogram Bar Text\n", @@ -587,7 +587,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f312b81d", + "id": "82b0308d", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ }, { "cell_type": "markdown", - "id": "a2434b5d", + "id": "8c67e905", "metadata": {}, "source": [ "### Cumulative Histogram" @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25b08352", + "id": "3fc1afb2", "metadata": {}, "outputs": [], "source": [ @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "686bb464", + "id": "4a506828", "metadata": {}, "source": [ "### Specify Aggregation Function" @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f11f0b34", + "id": "b8af342b", "metadata": {}, "outputs": [], "source": [ @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "fc822803", + "id": "25da5993", "metadata": {}, "source": [ "### Custom Binning\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "389dcaa4", + "id": "e24e6239", "metadata": {}, "outputs": [], "source": [ @@ -715,7 +715,7 @@ }, { "cell_type": "markdown", - "id": "b6e0abfd", + "id": "3d7da393", "metadata": {}, "source": [ "### See also: Bar Charts\n", @@ -726,7 +726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ad93fdf", + "id": "3b6410e2", "metadata": {}, "outputs": [], "source": [ @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "1b72b6eb", + "id": "b7c5f7fa", "metadata": {}, "source": [ "### Share bins between histograms\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1574cc90", + "id": "ad4236c7", "metadata": {}, "outputs": [], "source": [ @@ -777,7 +777,7 @@ }, { "cell_type": "markdown", - "id": "da3aef0d", + "id": "0b405dea", "metadata": {}, "source": [ "### Sort Histogram by Category Order\n", @@ -788,7 +788,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77e64f3a", + "id": "e3df1e72", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "775f53d3", + "id": "6a3d9d07", "metadata": {}, "outputs": [], "source": [ @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "f2c260ee", + "id": "cb16d4eb", "metadata": {}, "source": [ "#### Reference\n", @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "d580fbe0", + "id": "3a870e71", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-bar-charts.ipynb b/horizontal-bar-charts.ipynb index 85d9fd5d1..79dbcb038 100644 --- a/horizontal-bar-charts.ipynb +++ b/horizontal-bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d25c41ea", + "id": "badef594", "metadata": {}, "source": [ "See more examples of bar charts (including vertical bar charts) and styling options [here](https://plotly.com/python/bar-charts/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfaa0cf4", + "id": "4316e0ec", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "f6afe4b4", + "id": "5d17c115", "metadata": {}, "source": [ "#### Configure horizontal bar chart\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eda1bd21", + "id": "248aab69", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "fa15528a", + "id": "d0da53fa", "metadata": {}, "source": [ "### Horizontal Bar Chart with go.Bar\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c07c3c2", + "id": "216be147", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "8fd018ab", + "id": "7ad4f280", "metadata": {}, "source": [ "### Colored Horizontal Bar Chart" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64d526d2", + "id": "7c542448", "metadata": { "lines_to_next_cell": 0 }, @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "3a9d187c", + "id": "756e76ba", "metadata": { "lines_to_next_cell": 0 }, @@ -142,7 +142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da00affd", + "id": "590e9d78", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "65a95d2a", + "id": "bbf1a5ed", "metadata": {}, "source": [ "### Color Palette for Bar Chart\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8091448e", + "id": "ec792615", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "761f1bc9", + "id": "25c07972", "metadata": {}, "source": [ "### Diverging Bar (or Butterfly) Chart\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11c265ca", + "id": "e846e1f7", "metadata": {}, "outputs": [], "source": [ @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "67cb1c01", + "id": "5153ae65", "metadata": {}, "source": [ "### Bar Chart with Line Plot" @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c30d53b", + "id": "95c0cbbe", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "39862494", + "id": "7acb329b", "metadata": {}, "source": [ "### Reference\n", @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "1183e17e", + "id": "62cf7c2e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-vertical-shapes.ipynb b/horizontal-vertical-shapes.ipynb index b4acaa84e..2bcddc687 100644 --- a/horizontal-vertical-shapes.ipynb +++ b/horizontal-vertical-shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0ab2bf9e", + "id": "e722a794", "metadata": {}, "source": [ "### Horizontal and Vertical Lines and Rectangles\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bf286d3", + "id": "ced40f9e", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "5cb890e3", + "id": "08fd21f5", "metadata": {}, "source": [ "These shapes can be styled by passing the same arguments as are accepted by `add_shape`:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11d127a1", + "id": "91f5e8a0", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "869b34a6", + "id": "90bf3ac2", "metadata": {}, "source": [ "#### Horizontal and vertical lines in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f00ad663", + "id": "92475217", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "27db4c20", + "id": "44a452a5", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "e70d7df8", + "id": "ee9615bd", "metadata": {}, "source": [ "#### Adding Text Annotations\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4daf39fa", + "id": "c7946655", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "dfd74c27", + "id": "5d4499c2", "metadata": {}, "source": [ "Extra formatting of the annotation can be done using magic-underscores prefixed by `annotation_` or by passing a `dict` or `go.layout.Annotation` instance to the `annotation` argument:" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e13d29b0", + "id": "35254392", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "02eecc06", + "id": "472b03b9", "metadata": { "lines_to_next_cell": 0 }, @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "791fcd6e", + "id": "9262380e", "metadata": { "lines_to_next_cell": 0 }, @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "9d35175a", + "id": "0ac18e8a", "metadata": {}, "source": [ "#### Text Labels on Shapes\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df82a9bc", + "id": "20220c59", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "8186387b", + "id": "d42b84ab", "metadata": {}, "source": [ "With [text labels on shapes](/python/shapes/#adding-text-labels-to-shapes), you can also add text labels to shapes other than lines and rectangles, and the labels can be added automatically to shapes drawn by the user." @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "6c365fdd", + "id": "58c6969a", "metadata": {}, "source": [ "### Reference\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "767b0219", + "id": "2048e682", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hover-text-and-formatting.ipynb b/hover-text-and-formatting.ipynb index 474a83bd4..f2b265ee1 100644 --- a/hover-text-and-formatting.ipynb +++ b/hover-text-and-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b65ce372", + "id": "e453b452", "metadata": {}, "source": [ "### Hover Labels\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cafb46c8", + "id": "a99fd26f", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "ca25517a", + "id": "4f429256", "metadata": {}, "source": [ "#### Hovermode `x` or `y`\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dbb09f9", + "id": "afa02a42", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "fdf26e92", + "id": "c188290d", "metadata": {}, "source": [ "#### Unified hovermode\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7b54832", + "id": "4ed034f3", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "1d0a20c1", + "id": "4babb00a", "metadata": {}, "source": [ "#### Customize Title in Unified Hovermode\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acd04dae", + "id": "360d2706", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "00771a4b", + "id": "6a685d01", "metadata": {}, "source": [ "#### Control hovermode with Dash\n", @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c91b6b69", + "id": "c7d317f8", "metadata": { "hide_code": true }, @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "6dc92e3d", + "id": "99c59002", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "1b6e1b4f", + "id": "fd1da1f4", "metadata": {}, "source": [ "#### Selecting a hovermode in a figure created with `plotly.graph_objects`\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87836d40", + "id": "825b1a0b", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "e7b716cc", + "id": "d029454f", "metadata": {}, "source": [ "#### Hover on Subplots\n", @@ -228,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d5d674b", + "id": "0275d290", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "bdf4dd7b", + "id": "df057dd4", "metadata": {}, "source": [ "### Customizing Hover Label Appearance\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b04c85b2", + "id": "6623e11f", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "ce3f65dc", + "id": "b8b8f656", "metadata": {}, "source": [ "### Customizing Hover text with Plotly Express\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df8ae18b", + "id": "3ff06343", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "9fb14b49", + "id": "c374258c", "metadata": {}, "source": [ "### Disabling or customizing hover of columns in plotly express\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e62176f8", + "id": "f2fc592f", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "ebe2fc61", + "id": "02dd8b5d", "metadata": {}, "source": [ "### Customizing hover text with a hovertemplate\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45bf7c30", + "id": "28ae153f", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fe7e1da", + "id": "f3414937", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "fdab68a9", + "id": "2f42919b", "metadata": {}, "source": [ "### Modifying the hovertemplate of a plotly express figure\n", @@ -441,7 +441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "379e5ad0", + "id": "3753c983", "metadata": {}, "outputs": [], "source": [ @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "bbfa44a7", + "id": "d44d906c", "metadata": {}, "source": [ "### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate\n", @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb3434d5", + "id": "d48c3de2", "metadata": { "lines_to_next_cell": 2 }, @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "7fd0c491", + "id": "35f9e392", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e2f9f5a", + "id": "a1331ceb", "metadata": {}, "outputs": [], "source": [ @@ -571,7 +571,7 @@ }, { "cell_type": "markdown", - "id": "24d4a3e1", + "id": "11d3e987", "metadata": {}, "source": [ "### Advanced Hover Template\n", @@ -582,7 +582,7 @@ { "cell_type": "code", "execution_count": null, - "id": "905881bb", + "id": "acf8652c", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "82129354", + "id": "74411289", "metadata": {}, "source": [ "### Adding other data to the hover with customdata and a hovertemplate\n", @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fc83184", + "id": "90b0e1eb", "metadata": {}, "outputs": [], "source": [ @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "3b946462", + "id": "34fa772b", "metadata": {}, "source": [ "### Setting the Hover Template in Tile Maps" @@ -698,7 +698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2caec16", + "id": "054c03cd", "metadata": {}, "outputs": [], "source": [ @@ -725,7 +725,7 @@ }, { "cell_type": "markdown", - "id": "d5b23e02", + "id": "5bd9fbf2", "metadata": {}, "source": [ "### Controlling Hover Text with `graph_objects` and `hoverinfo`\n", @@ -736,7 +736,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ce7ca0b", + "id": "258d43d6", "metadata": {}, "outputs": [], "source": [ @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "4eab9937", + "id": "38aeae49", "metadata": {}, "source": [ "### Spike lines\n", @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6c098e9", + "id": "f8e3c874", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "43e07214", + "id": "75b4c21f", "metadata": {}, "source": [ "Spike lines can be styled per axis as well, and the cursor distance setting can be controlled via `layout.spikedistance`." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10e09beb", + "id": "0697bc98", "metadata": {}, "outputs": [], "source": [ @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "40dd81cd", + "id": "32d291b1", "metadata": {}, "source": [ "#### Reference\n", @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "6f6cc961", + "id": "913914d4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/icicle-charts.ipynb b/icicle-charts.ipynb index 26af7a229..fa7b7ee3d 100644 --- a/icicle-charts.ipynb +++ b/icicle-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "157df749", + "id": "8a5aead3", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d09a7a65", + "id": "d8e8e866", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "d4f87d9b", + "id": "aeb8fd74", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with plotly.express\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "676b83a9", + "id": "e81776cf", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "b3912deb", + "id": "0f80c3ac", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with continuous color argument in px.icicle\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83407d29", + "id": "a4bf5747", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "17392727", + "id": "c4d0018a", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with discrete color argument in px.icicle\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ea7ea96", + "id": "b983783c", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "8a827733", + "id": "af5394e9", "metadata": {}, "source": [ "In the example below the color of **Saturday** and **Sunday** sectors is the same as **Dinner** because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5875df6e", + "id": "9b77f66e", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "cec77352", + "id": "eee90eeb", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f5eea96", + "id": "baeeac2d", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "bb8a180f", + "id": "18052661", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cada188", + "id": "e6e3d33e", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "2e87efe6", + "id": "80de48de", "metadata": {}, "source": [ "### Basic Icicle Plot with go.Icicle\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51c1d772", + "id": "fb1aa16d", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "69ce57b6", + "id": "3a9da495", "metadata": {}, "source": [ "### Icicle with Repeated Labels" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05ab6e2b", + "id": "356bf963", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ }, { "cell_type": "markdown", - "id": "b00e6a55", + "id": "027f56ff", "metadata": {}, "source": [ "### Branchvalues\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56df3351", + "id": "d251407c", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "a7d32053", + "id": "c09ab137", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90883a00", + "id": "91553456", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "8e11a3ca", + "id": "1f04a96c", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0b6b735", + "id": "55ebedaa", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "5a986b4e", + "id": "1d3ad615", "metadata": {}, "source": [ "### Icicle chart with a continuous colorscale\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b68c801", + "id": "ea8f27a6", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "a12a7ebc", + "id": "bca8a76e", "metadata": {}, "source": [ "### Set Color of Icicle Sectors" @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5795b793", + "id": "28137959", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "84610f9d", + "id": "b6afb0c3", "metadata": {}, "source": [ "This example uses iciclecolorway attribute, which should be set in layout." @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec8ac926", + "id": "217b31e8", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2976e3ec", + "id": "685e28fc", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "d958f6df", + "id": "73a3ca4a", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2919e620", + "id": "f79ea5f7", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "dc1bd56f", + "id": "87471223", "metadata": {}, "source": [ "### Set the Direction of Icicle charts\n", @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a380198", + "id": "2c554089", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "dd7d29e4", + "id": "99ad5364", "metadata": {}, "source": [ "**Down Direction (Icicle)**" @@ -658,7 +658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8a92635", + "id": "f651b9f1", "metadata": {}, "outputs": [], "source": [ @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "e8bf0ce4", + "id": "75f52d6b", "metadata": {}, "source": [ "**Right Direction**" @@ -693,7 +693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95776f54", + "id": "fd9a93d4", "metadata": {}, "outputs": [], "source": [ @@ -719,7 +719,7 @@ }, { "cell_type": "markdown", - "id": "2062aacf", + "id": "f08f01f3", "metadata": {}, "source": [ "**Left Direction**" @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df0f65b7", + "id": "ea03a596", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "08b9a545", + "id": "7e33c3e8", "metadata": {}, "source": [ "#### Reference\n", @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "ec427a1e", + "id": "2eb2980d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/images.ipynb b/images.ipynb index e31735003..b614ce8ac 100644 --- a/images.ipynb +++ b/images.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "51eb5bad", + "id": "00f812ce", "metadata": {}, "source": [ "#### Add a Background Image\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7910899e", + "id": "714cf1a0", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "82e137f0", + "id": "107cbb58", "metadata": {}, "source": [ "#### Add a Logo\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b82c9109", + "id": "12c9cd97", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "18420cd3", + "id": "b9ad6272", "metadata": {}, "source": [ "#### Label Spectroscopy Data by Adding Multiple Images" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e81aa67", + "id": "0615303a", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "0ba3ee8a", + "id": "d98d1764", "metadata": {}, "source": [ "#### Zoom on Static Images" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7838578b", + "id": "e28c9ae8", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "0f9f2dd8", + "id": "8780771e", "metadata": {}, "source": [ "### Annotating layout image with shapes\n", @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "614139a7", + "id": "cc363e3f", "metadata": { "lines_to_next_cell": 2 }, @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "b5a7cd1f", + "id": "852292dd", "metadata": {}, "source": [ "### Images Placed Relative to Axes\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "440af8eb", + "id": "dc2fa228", "metadata": {}, "outputs": [], "source": [ @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "dd7a6678", + "id": "34425369", "metadata": {}, "source": [ "#### Reference\n", @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "10ad52c8", + "id": "03829ed0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/imshow.ipynb b/imshow.ipynb index afc6cf00f..6089a6897 100644 --- a/imshow.ipynb +++ b/imshow.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d968f7a8", + "id": "cba44a20", "metadata": {}, "source": [ "This tutorial shows how to display and explore image data. If you would like\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a824e50", + "id": "d1b2a39d", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "1b593b4d", + "id": "cb2be7c8", "metadata": {}, "source": [ "### Read image arrays from image files\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c3f1119", + "id": "39c50c47", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "567fc1b9", + "id": "a31f7885", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "30659ae9", + "id": "c4f141db", "metadata": {}, "source": [ "### Display single-channel 2D data as a heatmap\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a500c622", + "id": "d3ce3395", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "ec68770e", + "id": "8a2c6f01", "metadata": {}, "source": [ "### Choose the colorscale to display a single-channel image\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c3afa39", + "id": "c8d7053a", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "b6ddee77", + "id": "21666135", "metadata": {}, "source": [ "You can use this to make the image grayscale as well:" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9486d58", + "id": "57f446a4", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "a8b0443b", + "id": "2e122a38", "metadata": {}, "source": [ "### Hiding the colorbar and axis labels\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93022a1a", + "id": "e89b1c3c", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "4cbc4187", + "id": "adb4ef82", "metadata": {}, "source": [ "### Customizing the axes and labels on a single-channel image\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ce2a87a", + "id": "a2c04c5b", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "1b0ca07f", + "id": "0352ae27", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba9848ca", + "id": "73a35e1b", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "fd39c8b2", + "id": "e7d4dad7", "metadata": {}, "source": [ "### Display an xarray image with square pixels\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e57ef3b", + "id": "2ed8414b", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "beec5570", + "id": "12ce7ead", "metadata": {}, "source": [ "### Display multichannel image data with go.Image\n", @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5c8a416", + "id": "5cf3997e", "metadata": {}, "outputs": [], "source": [ @@ -271,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "875d60e9", + "id": "18bf5a7b", "metadata": {}, "source": [ "### Passing image data as a binary string to `go.Image`\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "893d6236", + "id": "0e62028f", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "53feaeab", + "id": "716431da", "metadata": {}, "source": [ "### Defining the data range covered by the color range with zmin and zmax\n", @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f44e999", + "id": "c2834c79", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "109df0de", + "id": "5ce9b8ad", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "b0e6c4b3", + "id": "eba146a4", "metadata": {}, "source": [ "### Automatic contrast rescaling in `px.imshow`\n", @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f398dc70", + "id": "e4f0cf90", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "971f706b", + "id": "ba0b52dc", "metadata": {}, "source": [ "### Ticks and margins around image data" @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22b68668", + "id": "4e8dbc32", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "3f2a3a65", + "id": "ace54f0f", "metadata": {}, "source": [ "### Combining image charts and other traces" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d40e02a3", + "id": "7cc8122f", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "527f97a2", + "id": "586585f7", "metadata": {}, "source": [ "### Displaying an image and the histogram of color values" @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1af5d3c1", + "id": "223c5668", "metadata": {}, "outputs": [], "source": [ @@ -458,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "e4895452", + "id": "eb9d7251", "metadata": {}, "source": [ "### imshow and datashader\n", @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "f3d4587b", + "id": "1cfb33fa", "metadata": {}, "source": [ "### Annotating image traces with shapes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b01707cf", + "id": "5a2ff30c", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "546c70b3", + "id": "839b6df1", "metadata": {}, "source": [ "### Passing image data as a binary string\n", @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b28d0ecd", + "id": "fdc9ab5b", "metadata": {}, "outputs": [], "source": [ @@ -555,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "0c983700", + "id": "a8f2ac06", "metadata": {}, "source": [ "### Contrast rescaling im imshow with binary string\n", @@ -566,7 +566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "309f5dc6", + "id": "88c8056a", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "8c5b639f", + "id": "83ea60ca", "metadata": {}, "source": [ "You can set `binary_string=False` if you want the intensity value to appear in the hover even for a rescaled image. In the example below we also modify the hovertemplate to display both `z` (the data of the original image array) and `color` (the pixel value displayed in the figure)." @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27c8ec21", + "id": "dc2a9337", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "2762c212", + "id": "b5d7fdab", "metadata": {}, "source": [ "### Changing the level of compression of the binary string in `px.imshow`\n", @@ -620,7 +620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc0e1379", + "id": "59a07957", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "d8b18e9c", + "id": "bfbadf48", "metadata": {}, "source": [ "### Exploring 3-D images, timeseries and sequences of images with `facet_col`\n", @@ -652,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e98c30a", + "id": "2457e7bb", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "c80ce7bb", + "id": "76a63a5e", "metadata": {}, "source": [ "Facets can also be used to represent several images of equal shape, like in the example below where different values of the blurring parameter of a Gaussian filter are compared." @@ -675,7 +675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44b84b59", + "id": "8f8130c1", "metadata": {}, "outputs": [], "source": [ @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "988124b7", + "id": "7c692b64", "metadata": {}, "source": [ "### Exploring 3-D images and timeseries with `animation_frame`\n", @@ -708,7 +708,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d002d277", + "id": "dc8cd517", "metadata": {}, "outputs": [], "source": [ @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "9a8621aa", + "id": "586c7618", "metadata": {}, "source": [ "### Animations of xarray datasets\n", @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e66921d", + "id": "01b660f1", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "5803dfc2", + "id": "933de5b0", "metadata": {}, "source": [ "### Combining animations and facets\n", @@ -760,7 +760,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0199c194", + "id": "ae9adcf6", "metadata": {}, "outputs": [], "source": [ @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "502c77f3", + "id": "7e707e9d", "metadata": {}, "source": [ "#### Reference\n", @@ -784,7 +784,7 @@ }, { "cell_type": "markdown", - "id": "16daf5cb", + "id": "a1835ee8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/indicator.ipynb b/indicator.ipynb index 1db26bfa2..23b9166c9 100644 --- a/indicator.ipynb +++ b/indicator.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b5ea81da", + "id": "dfb48779", "metadata": {}, "source": [ "#### Overview\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcbf5066", + "id": "5acdb016", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "537f389c", + "id": "aa6847c2", "metadata": {}, "source": [ "#### A Single Angular Gauge Chart" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7abf1af5", + "id": "ab8d72be", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "907da527", + "id": "f340dcfe", "metadata": {}, "source": [ "##### Bullet Gauge\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f9b9e1d", + "id": "8cee1a7d", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "65b4c0fd", + "id": "c35beac6", "metadata": {}, "source": [ "#### Showing Information above Your Chart\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c0d7f9c", + "id": "40ca1031", "metadata": { "lines_to_next_cell": 0 }, @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "4f7f0841", + "id": "961a963a", "metadata": {}, "source": [ "#### Data Cards / Big Numbers\n", @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a2c11bc", + "id": "779a0eae", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "c3f59033", + "id": "010dcd07", "metadata": {}, "source": [ "#### It's possible to display several numbers" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a31c5800", + "id": "17629db6", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "043d304b", + "id": "3abdd910", "metadata": {}, "source": [ "#### Adding a Prefix and Suffix" @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "28827e59", + "id": "1120e6bc", "metadata": {}, "source": [ "On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`. \n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f787131f", + "id": "48b4319c", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "36476487", + "id": "5f3d67e1", "metadata": {}, "source": [ "#### Reference\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7c7a12c", + "id": "250a1dc2", "metadata": { "lines_to_next_cell": 2 }, @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "b155fc9a", + "id": "a8063080", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/interactive-html-export.ipynb b/interactive-html-export.ipynb index 614a8e3d6..fc9f7ca8e 100644 --- a/interactive-html-export.ipynb +++ b/interactive-html-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "eadbb153", + "id": "bb1e83d9", "metadata": {}, "source": [ "### Interactive vs Static Export\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "d74192c7", + "id": "2e263f49", "metadata": {}, "source": [ "### Saving to an HTML file\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "111d9807", + "id": "10a51da7", "metadata": {}, "source": [ "### Controlling the size of the HTML file\n", @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "f134c7ce", + "id": "ad51f443", "metadata": {}, "source": [ "\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "3e06ec9c", + "id": "45316e2a", "metadata": {}, "source": [ "### HTML export in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f92c305b", + "id": "fdba2eb3", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "b179590e", + "id": "454c7b6a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "baf3e41f", + "id": "f5d538d6", "metadata": {}, "source": [ "### Full Parameter Documentation" @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0980c805", + "id": "832a1abc", "metadata": { "lines_to_next_cell": 2 }, @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "e1f2a1b2", + "id": "96409e31", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ipython-vs-python.ipynb b/ipython-vs-python.ipynb index c981579b7..4e4ecb68a 100644 --- a/ipython-vs-python.ipynb +++ b/ipython-vs-python.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3b9da0fc", + "id": "24293d7a", "metadata": {}, "source": [ "#### What is the difference between IPython and Python?\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "d9bf4609", + "id": "2974527e", "metadata": {}, "source": [ "![IPython terminal](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/ipython-console.png)" @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "8647d6a2", + "id": "cc422019", "metadata": {}, "source": [ "In other words, IPython is a powerful *interface* to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write *scripts*, files with the `.py` extension.
\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "7a4cf4d3", + "id": "624409bd", "metadata": {}, "source": [ "#### Jupyter Notebook" @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "3624fc8a", + "id": "43e33062", "metadata": {}, "source": [ "In 2011, IPython introduced a new tool named the **Notebook**. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python." @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "2bf98e87", + "id": "cfa2af36", "metadata": {}, "source": [ "![IPython Notebook](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/notebook.png)" @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "2b2df469", + "id": "0a03a0dc", "metadata": {}, "source": [ "Compared to the original IPython terminal, the Notebook offers a more convenient text editor, the possibility to write rich text, and improved graphical capabilities. Also, since it is a web interface, it can integrate many of the existing web libraries for data visualization, including *plotly.js*.
\n", @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "5a785d74", + "id": "1276a0a1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/jupyter-lab-tools.ipynb b/jupyter-lab-tools.ipynb index e9af4f137..c19823a5c 100644 --- a/jupyter-lab-tools.ipynb +++ b/jupyter-lab-tools.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6f1e0ed5", + "id": "330edb95", "metadata": {}, "source": [ "#### Create a New View for Output" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "f1efb220", + "id": "1d29a6ac", "metadata": {}, "source": [ "Display a FigureWidget and then create a new window to display it in so that you can scroll through your code but still keep an eye on what you're doing." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "bce3488c", + "id": "abd40291", "metadata": {}, "source": [ "\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "83e52301", + "id": "32f62452", "metadata": {}, "source": [ "#### Reference" @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "47707e64", + "id": "02c8c04f", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples.\n" @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "ba1666e1", + "id": "16f930e6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/legend.ipynb b/legend.ipynb index e57e68636..ac10dd6d5 100644 --- a/legend.ipynb +++ b/legend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3de19869", + "id": "71da38f4", "metadata": {}, "source": [ "### Trace Types, Legends and Color Bars\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "8cf4c0e7", + "id": "e8c4c79c", "metadata": {}, "source": [ "### Legends with Plotly Express\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ec624c4", + "id": "a8bf3c70", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "0613abf5", + "id": "0abce5c1", "metadata": {}, "source": [ "### Legend Order\n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8d27c8a", + "id": "24f9e896", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "567376a9", + "id": "351016ad", "metadata": {}, "source": [ "When using stacked bars, the bars are stacked from the bottom in the same order as they appear in the legend, so it can make sense to set `layout.legend.traceorder` to `\"reversed\"` to get the legend and stacks to match:" @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77db709e", + "id": "4e17590a", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "d6539005", + "id": "683b752e", "metadata": {}, "source": [ "When using [`plotly.graph_objects`](/python/graph-objects/) rather than Plotly Express, legend items will appear in the order that traces appear in the `data`:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4faa67ba", + "id": "17082044", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "b35f5df4", + "id": "8d957123", "metadata": {}, "source": [ "*New in 5.16*\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc7150e1", + "id": "d2b106d8", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "8ae4b433", + "id": "1e55199d", "metadata": {}, "source": [ "The `legendrank` attribute of a trace or shape can be used to control its placement in the legend.\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6ea09ba", + "id": "cdc1d692", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "32cf57b5", + "id": "840ac668", "metadata": {}, "source": [ "#### Showing and Hiding the Legend\n", @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d40abeaa", + "id": "6dca9c05", "metadata": { "lines_to_next_cell": 2 }, @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "f4388217", + "id": "f8ba4120", "metadata": {}, "source": [ "### Legend Positioning\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "655ac02f", + "id": "79f1f9cb", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "8913e7fb", + "id": "3584520d", "metadata": {}, "source": [ "#### Legends in Dash\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "952b23cf", + "id": "aee160d3", "metadata": { "hide_code": true }, @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "07485249", + "id": "f07e7861", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "d0b3cb34", + "id": "47f37a79", "metadata": {}, "source": [ "#### Horizontal Legends\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72b8240e", + "id": "c41f7895", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "5f895343", + "id": "7b4100b5", "metadata": {}, "source": [ "#### Horizontal Legend Entry Width\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "573782cb", + "id": "0d710608", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "b9db3520", + "id": "65a4955f", "metadata": {}, "source": [ "#### Legend Max Height\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff393871", + "id": "bcd4c102", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "85b00ea9", + "id": "cf08ab9c", "metadata": {}, "source": [ "#### Styling Legends\n", @@ -429,7 +429,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38307c5d", + "id": "b0a70b2f", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "55392414", + "id": "d77887a8", "metadata": {}, "source": [ "### Legends with Graph Objects\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "0f11944f", + "id": "2e9c0f06", "metadata": {}, "source": [ "#### Legend Item Names\n", @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11e224cc", + "id": "ea7d9119", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "8b78b883", + "id": "15b40638", "metadata": {}, "source": [ "By default, for shapes, legend items are disabled. Set `showlegend=True` on a shape for it to display a legend item.\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02973134", + "id": "4599b73c", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "ba1ef62e", + "id": "bf5a89a5", "metadata": {}, "source": [ "#### Legend titles" @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e0db232", + "id": "d6c3e8ae", "metadata": {}, "outputs": [], "source": [ @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "7861a07b", + "id": "0bd2d9f4", "metadata": {}, "source": [ "### Hiding Legend Items" @@ -596,7 +596,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1653596f", + "id": "bf12212b", "metadata": {}, "outputs": [], "source": [ @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "d5dbb45b", + "id": "a8c90c44", "metadata": {}, "source": [ "#### Hiding the Trace Initially\n", @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1300c7f5", + "id": "f5567913", "metadata": {}, "outputs": [], "source": [ @@ -658,7 +658,7 @@ }, { "cell_type": "markdown", - "id": "712fdd97", + "id": "753347d7", "metadata": {}, "source": [ "#### Size of Legend Items\n", @@ -669,7 +669,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3aa3ff9", + "id": "bd7b45d7", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "dfe0bb42", + "id": "4c9af772", "metadata": {}, "source": [ "#### Grouped Legend Items\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c53fdf7", + "id": "9f574748", "metadata": {}, "outputs": [], "source": [ @@ -762,7 +762,7 @@ }, { "cell_type": "markdown", - "id": "24d560a9", + "id": "1c84f619", "metadata": {}, "source": [ "You can also hide entries in grouped legends, preserving the grouped show/hide behaviour. This is what Plotly Express does with its legends." @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39455648", + "id": "1dca0996", "metadata": {}, "outputs": [], "source": [ @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "c60ad75b", + "id": "cc4fc4dc", "metadata": {}, "source": [ "#### Indent Legend Entries\n", @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11989ea9", + "id": "bc22d52a", "metadata": {}, "outputs": [], "source": [ @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "e287b812", + "id": "c877a5f7", "metadata": {}, "source": [ "#### Group click toggle behavior\n", @@ -884,7 +884,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fb28a33", + "id": "cfa63bed", "metadata": {}, "outputs": [], "source": [ @@ -938,7 +938,7 @@ }, { "cell_type": "markdown", - "id": "5d730996", + "id": "1899706e", "metadata": {}, "source": [ "### Legend items for continuous fields (2D and 3D)\n", @@ -951,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4bf4646", + "id": "5094cb14", "metadata": {}, "outputs": [], "source": [ @@ -994,7 +994,7 @@ }, { "cell_type": "markdown", - "id": "5d08f116", + "id": "1443d9de", "metadata": {}, "source": [ "### Adding Multiple Legends\n", @@ -1009,7 +1009,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fce2510c", + "id": "f1aff8ad", "metadata": {}, "outputs": [], "source": [ @@ -1079,7 +1079,7 @@ }, { "cell_type": "markdown", - "id": "7b915ca4", + "id": "be82bc03", "metadata": {}, "source": [ "### Positioning Legends\n", @@ -1090,7 +1090,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba24b39e", + "id": "0cd32f11", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "4f551fcc", + "id": "bdb22456", "metadata": {}, "source": [ "### Legend Title Click Behavior\n", @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e44e3c39", + "id": "45927aa1", "metadata": {}, "outputs": [], "source": [ @@ -1182,7 +1182,7 @@ }, { "cell_type": "markdown", - "id": "ecc57b95", + "id": "3fbecaf8", "metadata": {}, "source": [ "To disable title click behavior, set `titleclick` and `titledoubleclick` to `False`:\n", @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "109522fa", + "id": "2bedc48a", "metadata": {}, "source": [ "#### Reference\n", @@ -1209,7 +1209,7 @@ }, { "cell_type": "markdown", - "id": "51512bc1", + "id": "4ae7897d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-and-scatter.ipynb b/line-and-scatter.ipynb index ca2bf3825..3c1ee7f3a 100644 --- a/line-and-scatter.ipynb +++ b/line-and-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "490eed3f", + "id": "67bc5476", "metadata": {}, "source": [ "## Scatter plots with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90bfc33e", + "id": "417e0cfa", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cfb945e", + "id": "52837d2f", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "8627d53a", + "id": "6165023c", "metadata": {}, "source": [ "#### Setting size and color with column names\n", @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45a05947", + "id": "80b61e25", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "df270021", + "id": "1f4b97b1", "metadata": {}, "source": [ "Color can be [continuous](https://plotly.com/python/colorscales/) as follows, or [discrete/categorical](https://plotly.com/python/discrete-color/) as above." @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f62782e", + "id": "e136ed86", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "5db8f003", + "id": "2337481e", "metadata": {}, "source": [ "The `symbol` argument can be mapped to a column as well. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac96d485", + "id": "62e5d114", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "79375a80", + "id": "94ca12a4", "metadata": {}, "source": [ "## Scatter plots in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1685b9eb", + "id": "64a29245", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "cc89775c", + "id": "3dd96b9c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "d2f8f248", + "id": "b8cb70c5", "metadata": {}, "source": [ "### Scatter plots and Categorical Axes\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b04275d", + "id": "0bc26b45", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "56c9045f", + "id": "80462fe6", "metadata": {}, "source": [ "### Grouped Scatter Points\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9767302d", + "id": "28c74f31", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "d0004808", + "id": "e898b440", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "424a3eb3", + "id": "afcba777", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "b6d080b7", + "id": "cbd9eb55", "metadata": {}, "source": [ "### Error Bars\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32efb662", + "id": "05564770", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "52c2ffc6", + "id": "7a8e7fe0", "metadata": {}, "source": [ "### Marginal Distribution Plots\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b71d49e7", + "id": "72e8e237", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "13226f8d", + "id": "ccd48a54", "metadata": {}, "source": [ "### Facetting\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02057cfc", + "id": "ac7d195d", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "ab3f9a59", + "id": "f2b251bd", "metadata": {}, "source": [ "### Linear Regression and Other Trendlines\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ad83ac3", + "id": "13be5907", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "b3be3669", + "id": "39042191", "metadata": {}, "source": [ "## Line plots with Plotly Express" @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e87fa8ab", + "id": "1aa0db69", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8567b1a", + "id": "5cc8013d", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "2ef9fd14", + "id": "203bf82d", "metadata": {}, "source": [ "The `markers` argument can be set to `True` to show markers on lines." @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "765769fc", + "id": "cc1dbe0c", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "3271f589", + "id": "1a67ef85", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e997571", + "id": "bf48edaf", "metadata": {}, "outputs": [], "source": [ @@ -399,7 +399,7 @@ }, { "cell_type": "markdown", - "id": "968d5065", + "id": "5e165493", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6bea7d5", + "id": "537b5f20", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "4fdebcef", + "id": "788e0bc4", "metadata": {}, "source": [ "### Data Order in Scatter and Line Charts\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c0a0874", + "id": "85e6da01", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "17ccfeb2", + "id": "7ee11c5c", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -470,7 +470,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0188f13", + "id": "fc05d504", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "527bf321", + "id": "a9f46ad0", "metadata": {}, "source": [ "### Swarm (or Beeswarm) Plots\n", @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95ab25a2", + "id": "dadbf2e8", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "8d027478", + "id": "fefc6276", "metadata": {}, "source": [ "## Scatter and line plots with go.Scatter\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd894e02", + "id": "a9fcff64", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "559cc81b", + "id": "9c3d7356", "metadata": {}, "source": [ "#### Line and Scatter Plots\n", @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff20c408", + "id": "d4b8f39a", "metadata": {}, "outputs": [], "source": [ @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "57dde237", + "id": "d1ea7310", "metadata": {}, "source": [ "#### Bubble Scatter Plots\n", @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7b91130", + "id": "aad065e4", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "961d3f1f", + "id": "dda65824", "metadata": {}, "source": [ "#### Style Scatter Plots" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcd3d3cf", + "id": "7e478750", "metadata": {}, "outputs": [], "source": [ @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "8c678e58", + "id": "6a1fac1f", "metadata": {}, "source": [ "#### Data Labels on Hover" @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05add019", + "id": "24ca09b2", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "a606175b", + "id": "793a741b", "metadata": {}, "source": [ "#### Scatter with a Color Dimension" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fddaa62", + "id": "aeccf090", "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "18fa5161", + "id": "b6bdd089", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9cfae1d6", + "id": "7c1413de", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "6f01f5ea", + "id": "2182d436", "metadata": {}, "source": [ "#### Large Data Sets\n", @@ -914,7 +914,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46567812", + "id": "5060810d", "metadata": {}, "outputs": [], "source": [ @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33605d22", + "id": "5f2d4a31", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "f7c6623c", + "id": "10ca788a", "metadata": {}, "source": [ "### Reference\n", @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "97f3997d", + "id": "8e45a3ff", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-charts.ipynb b/line-charts.ipynb index e700639f5..629245b47 100644 --- a/line-charts.ipynb +++ b/line-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c3d19232", + "id": "2f544399", "metadata": {}, "source": [ "### Line Plots with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ee42e21", + "id": "beb6455d", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "2c4b221f", + "id": "0205cc62", "metadata": {}, "source": [ "### Line Plots with column encoding color" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67220bf3", + "id": "8dfc93aa", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "dd0809ac", + "id": "1faf7c6e", "metadata": {}, "source": [ "### Line charts in Dash\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23aed938", + "id": "702693aa", "metadata": { "hide_code": true, "tags": [] @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "139207c4", + "id": "ce80161d", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "8a54bb9f", + "id": "bd466715", "metadata": {}, "source": [ "### Data Order in Line Charts\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7417756", + "id": "e0c93333", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "35c19da7", + "id": "1f07b425", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f6806f0", + "id": "2b2dca54", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "df47c552", + "id": "de5e3080", "metadata": {}, "source": [ "### Line charts with markers\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02d5b4f6", + "id": "c9e6fbe5", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "2ac7c167", + "id": "ecc8d957", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa95b07a", + "id": "1c861408", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "d4d5875c", + "id": "d114f124", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6748883f", + "id": "ab6f6c29", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "6583238d", + "id": "75c97e25", "metadata": {}, "source": [ "### Sparklines with Plotly Express\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "071f4167", + "id": "5d011851", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "6c90c4b0", + "id": "9088b2d6", "metadata": {}, "source": [ "### Line Plot with go.Scatter\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34091d6a", + "id": "22ab7f40", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "3b716ff0", + "id": "1f4fde4f", "metadata": {}, "source": [ "#### Line Plot Modes" @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f1226fa", + "id": "b143fc67", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "c557e14c", + "id": "e85a9401", "metadata": {}, "source": [ "#### Style Line Plots\n", @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6597186", + "id": "b33b9f3e", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "60c95515", + "id": "5e980ab7", "metadata": {}, "source": [ "#### Connect Data Gaps\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4ad3d13", + "id": "144bdfb8", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "be2fc104", + "id": "62584567", "metadata": {}, "source": [ "#### Interpolation with Line Plots" @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e56b2661", + "id": "ae3c477e", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "5db6ff05", + "id": "ba4af821", "metadata": {}, "source": [ "#### Label Lines with Annotations" @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5adba7ff", + "id": "b4f8385e", "metadata": {}, "outputs": [], "source": [ @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "18f1e8ef", + "id": "d64e79b0", "metadata": {}, "source": [ "#### Filled Lines" @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b6aadfe", + "id": "fcef9614", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "0d56f0c1", + "id": "e3950fbf", "metadata": {}, "source": [ "#### Reference\n", @@ -697,7 +697,7 @@ }, { "cell_type": "markdown", - "id": "03964443", + "id": "096a1bf3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/linear-fits.ipynb b/linear-fits.ipynb index 03cb7dedd..13847ca91 100644 --- a/linear-fits.ipynb +++ b/linear-fits.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c8870257", + "id": "94bb6acf", "metadata": {}, "source": [ "### Linear fit trendlines with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77963752", + "id": "13236a1c", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "2cf92b54", + "id": "6c85a63a", "metadata": {}, "source": [ "### Fitting multiple lines and retrieving the model parameters\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "799d266a", + "id": "99cc876c", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "b26fe510", + "id": "077f2a80", "metadata": {}, "source": [ "### Displaying a single trendline with multiple traces\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc56b1bb", + "id": "5e11a6e4", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f997dee5", + "id": "09fcd974", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "6d1df1a0", + "id": "1f988af5", "metadata": {}, "source": [ "### OLS Parameters\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c33376a8", + "id": "b25db612", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbac0dae", + "id": "c50b5538", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "4d98c165", + "id": "2e801a27", "metadata": {}, "source": [ "### Locally Weighted Scatterplot Smoothing (LOWESS)\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22e1c901", + "id": "7df0f5c7", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "f882edd0", + "id": "6c6e2f9b", "metadata": {}, "source": [ "_new in v5.2_\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5976555a", + "id": "de279a4b", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "f2d87948", + "id": "ebfe2a59", "metadata": {}, "source": [ "### Moving Averages\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66428d97", + "id": "bd968304", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3604117", + "id": "711ebcaf", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c6993fd", + "id": "12bb05f0", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "20127fe3", + "id": "b62b0674", "metadata": {}, "source": [ "### Other Functions\n", @@ -257,7 +257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ec44f9d", + "id": "e600ef32", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbd39d7d", + "id": "92d471bd", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "94c93da8", + "id": "c50f0d85", "metadata": {}, "source": [ "In some cases, it is necessary to pass options into the underying Pandas function, for example the `std` parameter must be provided if the `win_type` argument to `rolling` is `\"gaussian\"`. This is possible with the `function_args` trendline option." @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa60928f", + "id": "1d3bd23c", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "d276e5aa", + "id": "cb92079f", "metadata": {}, "source": [ "### Displaying only the trendlines\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "309c9f0c", + "id": "5ad6ebf8", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a1123fc", + "id": "2004ea9a", "metadata": { "lines_to_next_cell": 2 }, @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "45df3237", + "id": "fb333b2a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-maps.ipynb b/lines-on-maps.ipynb index 89c265bff..2a59158ec 100644 --- a/lines-on-maps.ipynb +++ b/lines-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c2928e1e", + "id": "01afb4c0", "metadata": {}, "source": [ "Below we show how to create geographical line plots using either Plotly Express with `px.line_geo` function or the lower-level `go.Scattergeo` object.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2734583e", + "id": "bf6c5bf4", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "54e7ce81", + "id": "be0565c6", "metadata": {}, "source": [ "### Lines on Maps from GeoPandas\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb98e759", + "id": "b03ab330", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "d7259aa0", + "id": "8756c158", "metadata": {}, "source": [ "## Lines on Maps with plotly.graph_objects\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f2e86dd", + "id": "7ebe782e", "metadata": { "lines_to_next_cell": 0 }, @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "9a75b311", + "id": "80e7135f", "metadata": {}, "source": [ "### Performance improvement: put many lines in the same trace\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5531415a", + "id": "7ef7462f", "metadata": { "lines_to_next_cell": 2 }, @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "3bb2de13", + "id": "1b2e9f6d", "metadata": {}, "source": [ "### London to NYC Great Circle" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b15eaf6b", + "id": "e94f9bf8", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "c1ea6c8c", + "id": "25d30a83", "metadata": {}, "source": [ "### Contour lines on globe" @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64e91e7c", + "id": "f952c4f8", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "b6cd3da7", + "id": "8fffc4e3", "metadata": {}, "source": [ "#### Reference\n", @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "6963d617", + "id": "7b31af1b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-tile-maps.ipynb b/lines-on-tile-maps.ipynb index f74f357dd..8b822465d 100644 --- a/lines-on-tile-maps.ipynb +++ b/lines-on-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e2a3341c", + "id": "1c50e070", "metadata": {}, "source": [ "### Lines on tile maps using Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5263f98f", + "id": "2329c577", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "ef7665e6", + "id": "e3d3c74a", "metadata": {}, "source": [ "### Lines on maps from GeoPandas\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de732e19", + "id": "235cdaaa", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "e92d35ab", + "id": "2b6c3e6f", "metadata": {}, "source": [ "### Lines on maps using `Scattermap` traces\n", @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "810e4e40", + "id": "1c79abbd", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "1d96c2a8", + "id": "195a3d05", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8f9623f", + "id": "781c034e", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "2b8490ce", + "id": "419f7086", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "e9d14689", + "id": "db264ce4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/location-mode.ipynb b/location-mode.ipynb index fb362a922..e8893f70e 100644 --- a/location-mode.ipynb +++ b/location-mode.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2dbaa13f", + "id": "9b9a86f9", "metadata": {}, "source": [ "# Locations for Outline-based Maps\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "b8a376cd", + "id": "31c90591", "metadata": {}, "source": [ "## locationmode='ISO-3'\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbc5800c", + "id": "e278ebe0", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "63e09d7f", + "id": "c733d605", "metadata": {}, "source": [ "## Supported ISO Codes\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "4ed5f415", + "id": "f6f98543", "metadata": {}, "source": [ "## locationmode='USA-states'\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92c473aa", + "id": "26bbfc06", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "0a6b891c", + "id": "d3a75d48", "metadata": {}, "source": [ "## Supported US State Codes\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "7403952d", + "id": "0c68e043", "metadata": {}, "source": [ "## locationmode='country names'\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "307a7179", + "id": "419265e2", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "4d1c5084", + "id": "aeecefc9", "metadata": {}, "source": [ "> How Plotly matches 'country names' will change in a future version. Matching will become stricter and some country names may no longer match. We recommend using `locationmode='ISO-3'` with ISO codes for `locations` to ensure consistent behavior across versions." @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d8e5010", + "id": "8bfd33a2", "metadata": {}, "outputs": [], "source": [ @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "5bc2f640", + "id": "4343c190", "metadata": {}, "source": [ "## Using Different Data Types with `locations`\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4b524cb", + "id": "25efe3a7", "metadata": { "lines_to_next_cell": 2 }, @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "48679bd5", + "id": "7a5cc691", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/log-plot.ipynb b/log-plot.ipynb index 25e1a70c9..d284b2e8f 100644 --- a/log-plot.ipynb +++ b/log-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6e9e10b7", + "id": "f0828fa3", "metadata": {}, "source": [ "This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots) to follow a logarithmic rather than linear progression. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "123274a0", + "id": "bbdc560e", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "523dd6c0", + "id": "d2ff2da4", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with Plotly Express works the same was as with linear axes: using the `range_x` and `range_y` keywords. Note that you cannot set the range to include 0 or less." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa9c2986", + "id": "d8c2b221", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "73c492db", + "id": "3eecab29", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9f2a1b7", + "id": "a0ff293c", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "411508bc", + "id": "6a7424e4", "metadata": {}, "source": [ "#### Controlling Minor Log Labels\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9283bc53", + "id": "02a57531", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "f9e63c48", + "id": "4f72ff06", "metadata": {}, "source": [ "### Logarithmic Axes with Graph Objects\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81a1df70", + "id": "d631176e", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "a00254bd", + "id": "2651c2fe", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with `plotly.graph_objects` is *very different* than setting the range of linear axes: the range is set using the exponent rather than the actual value:\n" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e5ea67c", + "id": "cc1d872d", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "d36b6295", + "id": "e3eba581", "metadata": {}, "source": [ "#### Reference\n", @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "71c178fe", + "id": "8f4e7573", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-configuration.ipynb b/map-configuration.ipynb index cc9fa6ec9..fb990fe9f 100644 --- a/map-configuration.ipynb +++ b/map-configuration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "47e1607c", + "id": "663d1493", "metadata": {}, "source": [ "### Tile Maps vs Outline Maps\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb1832d4", + "id": "60e18c25", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "84bf29c7", + "id": "e374578a", "metadata": {}, "source": [ "Here is a map with all physical features enabled and styled, at a larger-scale 1:50m resolution:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f7d618f", + "id": "f9257c5b", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "2caaac91", + "id": "9dcaffa7", "metadata": {}, "source": [ "### Disabling Base Maps\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90dff63f", + "id": "971244ed", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "46179af3", + "id": "cb7a03ce", "metadata": {}, "source": [ "### Cultural Base Maps\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d9b3440", + "id": "461f1a8b", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "811729a1", + "id": "763159ea", "metadata": {}, "source": [ "### Map Projections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa319cc7", + "id": "7eec1847", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f96a53ba", + "id": "576f88de", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "ef3848c1", + "id": "120b4aa8", "metadata": {}, "source": [ "Map projections can be rotated using the `layout.geo.projection.rotation` attribute, and maps can be translated using the `layout.geo.center` attributed, as well as truncated to a certain longitude and latitude range using the `layout.geo.lataxis.range` and `layout.geo.lonaxis.range`.\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0941c3f0", + "id": "360cafe0", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "9eb76e71", + "id": "820de590", "metadata": {}, "source": [ "### Automatic Zooming or Bounds Fitting\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef8871f9", + "id": "2fb07f2d", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "708b2805", + "id": "c323b928", "metadata": {}, "source": [ "### Named Map Scopes and Country Sub-Units\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "644a28ff", + "id": "e9e2bf20", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "36fc9579", + "id": "678e55bb", "metadata": {}, "source": [ "The `\"usa\"` scope contains state boundaries at both resolutions, and uses the special `'albers usa'` projection which moves Alaska and Hawaii closer to the \"lower 48 states\" to reduce projection distortion and produce a more compact map." @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3511d27c", + "id": "03a0c34e", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "8d329c6b", + "id": "de259415", "metadata": {}, "source": [ "### Graticules (Latitude and Longitude Grid Lines)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7159b1d7", + "id": "5c8afd54", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "a9100656", + "id": "3a353e18", "metadata": {}, "source": [ "### Reference\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "0ca3ea30", + "id": "3984c2a0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-subplots-and-small-multiples.ipynb b/map-subplots-and-small-multiples.ipynb index 0693de893..203b0be1e 100644 --- a/map-subplots-and-small-multiples.ipynb +++ b/map-subplots-and-small-multiples.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bbed92e7", + "id": "e871011e", "metadata": {}, "source": [ "### US map small multiples" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd2f3c60", + "id": "a036b8f3", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "6feb7f07", + "id": "cdb4d81d", "metadata": {}, "source": [ "#### Reference\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "aaac32a2", + "id": "0e76b930", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marginal-plots.ipynb b/marginal-plots.ipynb index 6bba07578..9e946de6e 100644 --- a/marginal-plots.ipynb +++ b/marginal-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "63266fc7", + "id": "c2652d04", "metadata": {}, "source": [ "### Overview\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "972a6d19", + "id": "a886513d", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20e381a4", + "id": "980c3022", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "6e3991ed", + "id": "111e557a", "metadata": {}, "source": [ "### Marginal Plots and Color\n", @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77d1224a", + "id": "3d4b74de", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "94b5ca12", + "id": "5e24d842", "metadata": {}, "source": [ "### Marginal Plots on Histograms\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8701e1d", + "id": "9be67988", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "59a06dd3", + "id": "260b843b", "metadata": {}, "source": [ "Try hovering over the rug plot points to identify individual country values in the histogram below:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7d359b8", + "id": "41936304", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "688a0132", + "id": "f3afe810", "metadata": {}, "source": [ "### Marginal Plots and Facets\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2644af77", + "id": "e95a8113", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bb9dca4", + "id": "fdd0d57b", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb4abb64", + "id": "9da9f4c7", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "ed76e659", + "id": "7ad6e443", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marker-style.ipynb b/marker-style.ipynb index da8bf34cf..81ad94443 100644 --- a/marker-style.ipynb +++ b/marker-style.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "30ae6394", + "id": "64885b95", "metadata": {}, "source": [ "### Add Marker Border\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "302b4dd9", + "id": "c07a28e0", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "add7cfbd", + "id": "bcb9fd64", "metadata": {}, "source": [ "Here is an example that creates an empty graph object figure, and then adds two scatter traces with a marker border." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c1b6901", + "id": "e2e87ccb", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "894d199a", + "id": "e384bc56", "metadata": {}, "source": [ "Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density.\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4049aa1d", + "id": "86959562", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "e952bb08", + "id": "fc395251", "metadata": {}, "source": [ "You can also pass an array of dash styles to set different styles per marker:" @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7586c8c8", + "id": "90e170f5", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "e03b0b8c", + "id": "857e84b6", "metadata": {}, "source": [ "The `marker.line.dash` attribute is available on `go.Scatter`, `go.Scatterpolar`, `go.Scattergeo`, `go.Scatterternary`, `go.Scattercarpet`, and `go.Scattersmith` traces.\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d49f0362", + "id": "998ed164", "metadata": { "hide_code": true }, @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "d9c52ff9", + "id": "0f6c3f0d", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "3967b8cd", + "id": "502e4682", "metadata": {}, "source": [ "### Opacity\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0964db2", + "id": "0b582000", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "0548a8f8", + "id": "21b63b8c", "metadata": {}, "source": [ "### Marker Opacity\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe926e10", + "id": "bfc8df6a", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "b36ff6a4", + "id": "1e5cfd5f", "metadata": {}, "source": [ "### Color Opacity\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30edfd81", + "id": "774b1b74", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ }, { "cell_type": "markdown", - "id": "f03c00b9", + "id": "89c998b5", "metadata": {}, "source": [ "### Custom Marker Symbols\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fe6dd86", + "id": "caf60bf8", "metadata": { "lines_to_next_cell": 2 }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "72f7b904", + "id": "2382534a", "metadata": {}, "source": [ "### Using a Custom Marker\n", @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a122ec1", + "id": "71defd06", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "88d9a8dc", + "id": "995ec146", "metadata": {}, "source": [ "#### Open Marker Colors\n", @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15c63209", + "id": "7ef6b525", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "d8c5d155", + "id": "d9dbff45", "metadata": {}, "source": [ "### Setting Marker Angles" @@ -560,7 +560,7 @@ }, { "cell_type": "markdown", - "id": "59085790", + "id": "c14c1dbc", "metadata": {}, "source": [ "*New in 5.11*\n", @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c6b0fd8", + "id": "5f6b225d", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "682f747f", + "id": "f654d6d6", "metadata": {}, "source": [ "### Setting Angle Reference\n", @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41c03707", + "id": "b7f6696f", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "9a272ccb", + "id": "ed23527d", "metadata": {}, "source": [ "### Using Standoff to Position a Marker\n", @@ -651,7 +651,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fb13b27", + "id": "1681d0a4", "metadata": {}, "outputs": [], "source": [ @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "8b7d6a22", + "id": "40852608", "metadata": {}, "source": [ "### Reference\n", @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "5d6bf9e9", + "id": "d65ede70", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/migrate-to-maplibre.ipynb b/migrate-to-maplibre.ipynb index a237de658..786231d34 100644 --- a/migrate-to-maplibre.ipynb +++ b/migrate-to-maplibre.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4faab1b9", + "id": "2ba63428", "metadata": {}, "source": [ "## Migrating from Mapbox traces to MapLibre traces\n", @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "bd1c4cd3", + "id": "1433c1ac", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/mixed-subplots.ipynb b/mixed-subplots.ipynb index 1a6969449..3cab6c3e5 100644 --- a/mixed-subplots.ipynb +++ b/mixed-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "44b51f14", + "id": "1e21d87c", "metadata": {}, "source": [ "### Mixed Subplots and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "fe1da30b", + "id": "870e5764", "metadata": {}, "source": [ "#### Mixed Subplot" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d7dd9b5", + "id": "4a951fb8", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "26f66f7c", + "id": "9b40d24c", "metadata": {}, "source": [ "#### Reference\n", @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "1c0958a3", + "id": "dba2c182", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-knn.ipynb b/ml-knn.ipynb index f74ee6dd6..bcd906147 100644 --- a/ml-knn.ipynb +++ b/ml-knn.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bb5c8337", + "id": "a0796c4e", "metadata": {}, "source": [ "## Basic binary classification with kNN\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "dfaca749", + "id": "772d8741", "metadata": {}, "source": [ "### Display training and test splits\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "529bfe15", + "id": "af8a5de8", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "fd2d83bd", + "id": "0885221c", "metadata": {}, "source": [ "### Visualize predictions on test split with [`plotly.express`](https://plotly.com/python/plotly-express/)" @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "97d5f120", + "id": "1820f1b3", "metadata": {}, "source": [ "Now, we train the kNN model on the same training data displayed in the previous graph. Then, we predict the confidence score of the model for each of the data points in the test set. We will use shapes to denote the true labels, and the color will indicate the confidence of the model for assign that score.\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31d03500", + "id": "4c9bd786", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "4516d6bf", + "id": "78355f73", "metadata": {}, "source": [ "## Probability Estimates with `go.Contour`\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aad13af2", + "id": "a8602b22", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "7ded2011", + "id": "7e80789c", "metadata": {}, "source": [ "Now, let's try to combine our `go.Contour` plot with the first scatter plot of our data points, so that we can visually compare the confidence of our model with the true labels." @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "243bac8f", + "id": "efe5be8b", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "c4360d75", + "id": "f682eb46", "metadata": {}, "source": [ "## k-NN classification in Dash\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af767669", + "id": "11eaddd0", "metadata": { "hide_code": true }, @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "8506bff5", + "id": "3b871c3a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "a537240b", + "id": "4253aa73", "metadata": {}, "source": [ "## Multi-class prediction confidence with [`go.Heatmap`](https://plotly.com/python/heatmaps/)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c92a22e", + "id": "d06c7630", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "f0a9d8a8", + "id": "757c870a", "metadata": {}, "source": [ "### Reference\n", @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "e87462bd", + "id": "ef6e77d3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-pca.ipynb b/ml-pca.ipynb index b821a0254..ac7a75592 100644 --- a/ml-pca.ipynb +++ b/ml-pca.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5cd43b67", + "id": "e25822c7", "metadata": {}, "source": [ "This page first shows how to visualize higher dimension data using various Plotly figures combined with dimensionality reduction (aka projection). Then, we dive into the specific details of our projection algorithm.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "fe8882ac", + "id": "efb23ea8", "metadata": {}, "source": [ "## High-dimensional PCA Analysis with `px.scatter_matrix`\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "5c0b80e0", + "id": "ddb7468e", "metadata": {}, "source": [ "### Visualize all the original dimensions\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b4a9221", + "id": "f3f69df9", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "51f88485", + "id": "c079f2a4", "metadata": {}, "source": [ "### Visualize all the principal components\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "697d7571", + "id": "d5570281", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "10d5ee43", + "id": "aabb85d8", "metadata": {}, "source": [ "### Visualize a subset of the principal components\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ace9f84", + "id": "97f3d4ce", "metadata": { "lines_to_next_cell": 2 }, @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "2f478c87", + "id": "609084b9", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "f7107466", + "id": "80d185ee", "metadata": {}, "source": [ "## 2D PCA Scatter Plot\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51c99619", + "id": "b6ea4332", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "9ba045a9", + "id": "0c2355c7", "metadata": {}, "source": [ "## Visualize PCA with `px.scatter_3d`\n", @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d51fb8c5", + "id": "b3db5cce", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "5bb94f32", + "id": "7d00bf7d", "metadata": {}, "source": [ "## Plotting explained variance\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1cdf4f2", + "id": "5076074c", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "2bc4a19a", + "id": "20bb0834", "metadata": {}, "source": [ "## Visualize Loadings\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdeb91e0", + "id": "f502ac62", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "1224f153", + "id": "c431d435", "metadata": {}, "source": [ "## References\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "c453a85d", + "id": "e3f6b751", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-regression.ipynb b/ml-regression.ipynb index 9063b8d60..1f4303ccf 100644 --- a/ml-regression.ipynb +++ b/ml-regression.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9a03cfcc", + "id": "0e4c5426", "metadata": {}, "source": [ "This page shows how to use Plotly charts for displaying various types of regression models, starting from simple models like [Linear Regression](https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html), and progressively move towards models like [Decision Tree][tree] and [Polynomial Features][poly]. We highlight various capabilities of plotly, such as comparative analysis of the same model with different parameters, displaying Latex, [surface plots](https://plotly.com/python/3d-surface-plots/) for 3D data, and enhanced prediction error analysis with [Plotly Express](https://plotly.com/python/plotly-express/).\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "c1c25694", + "id": "3483066c", "metadata": {}, "source": [ "## Basic linear regression plots\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d607eb0a", + "id": "91337dd7", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "29989221", + "id": "a52f67fe", "metadata": {}, "source": [ "### Linear Regression with scikit-learn\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d1dfb9a", + "id": "d5ee490f", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "f630c89b", + "id": "e4d526da", "metadata": {}, "source": [ "### ML Regression in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c0e0d8a", + "id": "d9b38ddb", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "846f94de", + "id": "167a2ff4", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "58630991", + "id": "90917856", "metadata": {}, "source": [ "## Model generalization on unseen data\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7745fee", + "id": "b357cacb", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "931c5af3", + "id": "c6413231", "metadata": {}, "source": [ "## Comparing different kNN models parameters\n", @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fc2e619", + "id": "ea6a9656", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "dd2da56e", + "id": "34b9eb4c", "metadata": {}, "source": [ "## Displaying `PolynomialFeatures` using $\\LaTeX$\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "594ca02d", + "id": "054a4e85", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "d403525f", + "id": "263d5e3a", "metadata": {}, "source": [ "## 3D regression surface with `px.scatter_3d` and `go.Surface`\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54a45f47", + "id": "f0e3d697", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "7d6ca420", + "id": "8a374108", "metadata": {}, "source": [ "## Visualizing coefficients for multiple linear regression (MLR)\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e0f4245", + "id": "59607c26", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "dd9d6a70", + "id": "ee09278c", "metadata": {}, "source": [ "## Prediction Error Plots\n", @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "4ec8fb57", + "id": "2cf3aa3b", "metadata": {}, "source": [ "### Simple actual vs predicted plot\n", @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4dfb6c82", + "id": "e0421ba9", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "287fc65b", + "id": "08afa079", "metadata": {}, "source": [ "### Enhanced prediction error analysis using `plotly.express`\n", @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96ed2e2f", + "id": "abcc5338", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "b02bd157", + "id": "6feb1123", "metadata": {}, "source": [ "## Residual plots\n", @@ -477,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "889aa3ca", + "id": "242e4dfb", "metadata": {}, "outputs": [], "source": [ @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "2c4e82fc", + "id": "9bceaf23", "metadata": {}, "source": [ "## Visualize regularization across cross-validation folds" @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "e2e19159", + "id": "61c366ea", "metadata": {}, "source": [ "In this example, we show how to plot the results of various $\\alpha$ penalization values from the results of cross-validation using scikit-learn's `LassoCV`. This is useful to see how much the error of the optimal alpha actually varies across CV folds." @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7d27e64", + "id": "e3a9d0e2", "metadata": {}, "outputs": [], "source": [ @@ -598,7 +598,7 @@ }, { "cell_type": "markdown", - "id": "7def7931", + "id": "35ef6555", "metadata": {}, "source": [ "## Grid search visualization using `px.density_heatmap` and `px.box`\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b309736", + "id": "2bfe29c6", "metadata": {}, "outputs": [], "source": [ @@ -686,7 +686,7 @@ }, { "cell_type": "markdown", - "id": "9611e244", + "id": "adeb4051", "metadata": {}, "source": [ "### Reference\n", @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "b2bee45c", + "id": "e0065129", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-roc-pr.ipynb b/ml-roc-pr.ipynb index dc9a69fda..2428fe86a 100644 --- a/ml-roc-pr.ipynb +++ b/ml-roc-pr.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b73094d1", + "id": "39291c26", "metadata": {}, "source": [ "## Preliminary plots\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adeff62b", + "id": "9bf4ecc9", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "f2ea07b9", + "id": "efaa39d8", "metadata": {}, "source": [ "## Basic binary ROC curve\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "085d8ceb", + "id": "c1677aa3", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "26cf89ea", + "id": "322e62df", "metadata": {}, "source": [ "## ROC curve in Dash\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0775d8fd", + "id": "4c4ecfa9", "metadata": { "hide_code": true }, @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "b67da6f1", + "id": "58541079", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "b2377eab", + "id": "38722788", "metadata": {}, "source": [ "## Multiclass ROC Curve\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97df11e1", + "id": "8ba882d8", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "c6ed318f", + "id": "8770c7b4", "metadata": {}, "source": [ "## Precision-Recall Curves\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f81d396c", + "id": "dd3774d0", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "24bf1d14", + "id": "7cdbfc69", "metadata": {}, "source": [ "In this example, we use the [average precision](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html) metric, which is an alternative scoring method to the area under the PR curve." @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3d7e1fe", + "id": "944264f8", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "ebdcdde1", + "id": "e2f3342c", "metadata": {}, "source": [ "## References\n", @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "37ba1da4", + "id": "125439e1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-tsne-umap-projections.ipynb b/ml-tsne-umap-projections.ipynb index 931397c0d..4b4c71b65 100644 --- a/ml-tsne-umap-projections.ipynb +++ b/ml-tsne-umap-projections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "06722431", + "id": "c875b8e9", "metadata": {}, "source": [ "This page presents various ways to visualize two popular dimensionality reduction techniques, namely the [t-distributed stochastic neighbor embedding](https://lvdmaaten.github.io/tsne/) (t-SNE) and [Uniform Manifold Approximation and Projection](https://umap-learn.readthedocs.io/en/latest/index.html) (UMAP). They are needed whenever you want to visualize data with more than two or three features (i.e. dimensions).\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "1f2da6b6", + "id": "92c2e69e", "metadata": {}, "source": [ "## Basic t-SNE projections\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "ace94622", + "id": "8e295884", "metadata": {}, "source": [ "### Visualizing high-dimensional data with `px.scatter_matrix`\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d982ef0", + "id": "73d98ea4", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "e56bcc88", + "id": "06609b27", "metadata": {}, "source": [ "### Project data into 2D with t-SNE and `px.scatter`\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae977783", + "id": "c9c01ce3", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "c94f06b6", + "id": "4395c227", "metadata": {}, "source": [ "### Project data into 3D with t-SNE and `px.scatter_3d`\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bdfcc21", + "id": "b4711cdc", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "9e7b009b", + "id": "a55fb5ad", "metadata": {}, "source": [ "## Projections with UMAP\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a743b385", + "id": "1302200f", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "5d70e213", + "id": "9d030a8b", "metadata": {}, "source": [ "## Visualizing image datasets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "772e2d64", + "id": "ec932185", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "71c059d2", + "id": "a658a413", "metadata": { "lines_to_next_cell": 2 }, @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "4dcfeab6", + "id": "d3ed9065", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml_apps.ipynb b/ml_apps.ipynb index 70558d00b..983e3f6ed 100644 --- a/ml_apps.ipynb +++ b/ml_apps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b2696114", + "id": "0dab6570", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "89da2bba", + "id": "235bcfd6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/multiple-axes.ipynb b/multiple-axes.ipynb index d2a237bea..19b9598e2 100644 --- a/multiple-axes.ipynb +++ b/multiple-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e16d5b94", + "id": "009ca527", "metadata": {}, "source": [ "### Multiple Y Axes and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "22963020", + "id": "594ec34c", "metadata": {}, "source": [ "#### Two Y Axes" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc81fd7e", + "id": "f4b5d232", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "fc8ed0ba", + "id": "18169642", "metadata": {}, "source": [ "### Multiple axes in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bd2b7d0", + "id": "0052866d", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "15f1d4e1", + "id": "248fbb1c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "db46a912", + "id": "e4aaec40", "metadata": {}, "source": [ "#### Multiple Y-Axes Subplots" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79b10e9a", + "id": "c1fad045", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "d783d767", + "id": "1c0c7719", "metadata": {}, "source": [ "#### Multiple Axes\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f67b6b7", + "id": "e4c939f6", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "9aef4ff0", + "id": "bd5f50ce", "metadata": {}, "source": [ "#### Automatically Shifting Axes\n", @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f7a6a4d", + "id": "5d436e3c", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "6df722a8", + "id": "50c76f90", "metadata": {}, "source": [ "### Shift Axes by a Specific Number of Pixels\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a227ad63", + "id": "7c532bfc", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "83757463", + "id": "5a08ffb2", "metadata": {}, "source": [ "### Sync Axes Ticks" @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "8860f934", + "id": "31be87b8", "metadata": {}, "source": [ "*New in 5.13*\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa3f74c4", + "id": "c2e3febb", "metadata": {}, "outputs": [], "source": [ @@ -506,7 +506,7 @@ }, { "cell_type": "markdown", - "id": "2ae2e59d", + "id": "c773f574", "metadata": {}, "source": [ "#### Reference\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "5cc0140a", + "id": "668cb894", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/network-graphs.ipynb b/network-graphs.ipynb index 6bf914372..8e6e8504d 100644 --- a/network-graphs.ipynb +++ b/network-graphs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8163e7ce", + "id": "d9263591", "metadata": {}, "source": [ "In this example we show how to visualize a network graph created using `networkx`.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "79a59a64", + "id": "8e011958", "metadata": {}, "source": [ "### Create random graph" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76c03877", + "id": "b15a6724", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "72119742", + "id": "454e48d2", "metadata": {}, "source": [ "#### Create Edges\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4eb295e8", + "id": "80f273d6", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "6ce36589", + "id": "979baff9", "metadata": {}, "source": [ "#### Color Node Points\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba87356f", + "id": "162598e7", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "10c82c67", + "id": "b50105c3", "metadata": {}, "source": [ "#### Create Network Graph" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f111901c", + "id": "f97485f7", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "ad7654b1", + "id": "0d9bceab", "metadata": {}, "source": [ "### Network graphs in Dash\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0df19240", + "id": "564ec394", "metadata": { "hide_code": true }, @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "67fbe583", + "id": "20f8dbee", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "f1e9386f", + "id": "a5d1e075", "metadata": {}, "source": [ "#### Reference\n", @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "b2f6cdb7", + "id": "746615bd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ohlc-charts.ipynb b/ohlc-charts.ipynb index 37eca27b2..f57d2d93a 100644 --- a/ohlc-charts.ipynb +++ b/ohlc-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d4c51239", + "id": "1a5c5a07", "metadata": {}, "source": [ "The [OHLC](https://en.wikipedia.org/wiki/Open-high-low-close_chart) chart (for open, high, low and close) is a style of financial chart describing open, high, low and close values for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. 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.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30933eff", + "id": "306c5c52", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "fa0a996e", + "id": "82d07c65", "metadata": {}, "source": [ "#### OHLC Chart without Rangeslider" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9103b00", + "id": "a7b6baae", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "5d9bf54c", + "id": "0b26b48a", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88aa6fc5", + "id": "38960264", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "b301ca04", + "id": "3366ebb3", "metadata": {}, "source": [ "#### Custom OHLC Colors" @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec4daefc", + "id": "7002e11a", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "c2c4c5bd", + "id": "21616628", "metadata": {}, "source": [ "#### Simple OHLC with `datetime` Objects" @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b73fa7b", + "id": "d2f575d4", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "ed630d0a", + "id": "bb34b54e", "metadata": {}, "source": [ "### Custom Hovertext" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "931c9557", + "id": "84cd39e8", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "13714e38", + "id": "610c23dd", "metadata": {}, "source": [ "#### Reference\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "c4eb62f8", + "id": "7a02a0ef", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/orca-management.ipynb b/orca-management.ipynb index d70dd4beb..d5d0fa633 100644 --- a/orca-management.ipynb +++ b/orca-management.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "82883336", + "id": "f2f1fe32", "metadata": { "lines_to_next_cell": 0 }, @@ -28,7 +28,7 @@ }, { "cell_type": "raw", - "id": "e5b99d2a", + "id": "faf93a0b", "metadata": {}, "source": [ "$ conda install -c plotly plotly-orca==1.2.1 psutil requests" @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "49dea3eb", + "id": "cd851868", "metadata": {}, "source": [ "**Note:** Even if you do not want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca==1.2.1` and the orca executable will be available system wide.\n", @@ -47,7 +47,7 @@ }, { "cell_type": "raw", - "id": "4c85ee56", + "id": "db0f93df", "metadata": {}, "source": [ "$ npm install -g electron@1.8.4 orca\n", @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "d9af6bcf", + "id": "9d37dd93", "metadata": {}, "source": [ "##### Standalone Binaries + pip\n", @@ -65,7 +65,7 @@ }, { "cell_type": "raw", - "id": "cc526ab5", + "id": "55e75101", "metadata": {}, "source": [ "$ pip install psutil requests" @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "6d09c673", + "id": "10324834", "metadata": {}, "source": [ "### Install orca on Google Colab\n", @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "155fdbe6", + "id": "7cc5cc35", "metadata": {}, "source": [ "### Create a Figure\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5dcab5b", + "id": "a3bcf2c2", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "76e789fd", + "id": "a1136c4d", "metadata": {}, "source": [ "### config\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b55bf29", + "id": "02ecf017", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "98bce523", + "id": "46e8ad73", "metadata": {}, "source": [ "### status\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d0c3ffd", + "id": "0c5c5511", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "fb0238bd", + "id": "1b4d5eac", "metadata": {}, "source": [ "Since no image export operations have been performed yet, the orca server is not yet running.\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "319218b7", + "id": "2239ee28", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "ee6eec6c", + "id": "e57b2564", "metadata": {}, "source": [ "By checking the `status` object again, we see that the orca server is now running" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4eac986f", + "id": "a2f1508d", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "d34b33ad", + "id": "4455f48a", "metadata": {}, "source": [ "Let's perform this same export operation again, now that the server is already running." @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93165764", + "id": "7beb3bd8", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "fd107f6f", + "id": "f46c6eda", "metadata": {}, "source": [ "The difference in runtime is dramatic. Starting the server and exporting the first image takes a couple seconds, while exporting an image with a running server is much faster." @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "528fdf87", + "id": "168a2fdb", "metadata": {}, "source": [ "### Shutdown the Server\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "472753ca", + "id": "ca5e7b7b", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "137eef59", + "id": "c2f93347", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a5c3051", + "id": "990ea1ec", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "105074ea", + "id": "8478592b", "metadata": {}, "source": [ "### Configuring the Executable\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "f4ea69d5", + "id": "27d91179", "metadata": {}, "source": [ "### Other Configuration Settings\n", @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "ad08fc15", + "id": "f2e72277", "metadata": {}, "source": [ "### Saving Configuration Settings\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "fbd4d778", + "id": "fd3f5802", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pandas-backend.ipynb b/pandas-backend.ipynb index cd9e21029..8f8f22cfa 100644 --- a/pandas-backend.ipynb +++ b/pandas-backend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "36b39d74", + "id": "7adb9dcf", "metadata": {}, "source": [ "### Introduction\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd30f7d5", + "id": "9315ac2b", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "22c7c1a1", + "id": "8eba62a7", "metadata": {}, "source": [ "This functionality wraps [Plotly Express](/python/plotly-express/) and so you can use any of the [styling options available to Plotly Express methods](/python/styling-plotly-express/). Since what you get back is a regular `Figure` object, you can use any of the update mechanisms supported by these objects to apply [templates](/python/templates/) or further customize [axes](/python/axes/), [colors](/python/colorscales/), [legends](/python/legend/), [fonts](/python/figure-labels/), [hover labels](/python/hover-text-and-formatting/) etc. [Faceting](/python/facet-plots/) is also supported." @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34329569", + "id": "f8e77852", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "06190434", + "id": "c8d79b01", "metadata": {}, "source": [ "### A Note on API Compatibility\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "514b59ec", + "id": "e7117d0e", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "1a9ac8c0", + "id": "0fb5545a", "metadata": {}, "source": [ "To achieve a similar effect to `subplots=True`, for example, the [Plotly Express `facet_row` and `facet_col` options](/python/facet-plots/) can be used, the same was as they work when directly calling [Plotly Express with wide-form data](/python/wide-form/):" @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da5be69d", + "id": "69b529cb", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "8128dfe1", + "id": "13ee87b3", "metadata": {}, "source": [ "### Supported Methods\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a78f2374", + "id": "a8a49d2e", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d543b3af", + "id": "968e486e", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73bd4f78", + "id": "30e5a1bf", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "346a2525", + "id": "329f0b03", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb84beae", + "id": "398563ea", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "814e851e", + "id": "2b5b15a7", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "105a5704", + "id": "62199904", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "4d1c86be", + "id": "9cd02f60", "metadata": {}, "source": [ "### `Series` and `DataFrame` functions: `hist` and `boxplot`\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e90f4def", + "id": "2d2a2c5b", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "30d7af4e", + "id": "0f29d8ab", "metadata": {}, "source": [ "### What about Cufflinks?\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "98eea77d", + "id": "20f29557", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-categories-diagram.ipynb b/parallel-categories-diagram.ipynb index fb9cebf23..c815d59a7 100644 --- a/parallel-categories-diagram.ipynb +++ b/parallel-categories-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b7362bac", + "id": "dc2aaf64", "metadata": {}, "source": [ "#### Parallel Categories Diagram\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13e6ad38", + "id": "6a547733", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "f91f3a36", + "id": "b5391a43", "metadata": {}, "source": [ "#### Style Diagram\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a51b448", + "id": "0ec09d5b", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "db498a39", + "id": "66ffdce1", "metadata": {}, "source": [ "### Basic Parallel Categories Diagram with `graph_objects`\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c9e4c56", + "id": "039e8a8c", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "af04efc5", + "id": "5b84c204", "metadata": {}, "source": [ "#### Basic Parallel Categories Diagram with Counts\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7f9d062", + "id": "18fe278e", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "ebe8ac15", + "id": "1bbd1fb7", "metadata": {}, "source": [ "#### Multi-Color Parallel Categories Diagram\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8b129da", + "id": "3dee9034", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "156bf3ae", + "id": "bbeeb187", "metadata": {}, "source": [ "#### Parallel Categories Linked Brushing\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f40996b", + "id": "6e7208ac", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "7a61407c", + "id": "27cb4f9f", "metadata": {}, "source": [ "![Single-color brushing](https://user-images.githubusercontent.com/15064365/48087050-4a3eae80-e1cc-11e8-94c9-c0ffcedd3aa9.gif)\n", @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47e0aa95", + "id": "f160a856", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "04f3ecda", + "id": "d6001afb", "metadata": {}, "source": [ "![Multi-color brushing](https://user-images.githubusercontent.com/15064365/48087055-4e6acc00-e1cc-11e8-8f0c-c8316eb4def2.gif)\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "1f984713", + "id": "c98427b5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-coordinates-plot.ipynb b/parallel-coordinates-plot.ipynb index 2017163b3..c2a80cac6 100644 --- a/parallel-coordinates-plot.ipynb +++ b/parallel-coordinates-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e6882fa0", + "id": "f72f5844", "metadata": {}, "source": [ "## Parallel Coordinates plot with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed3f4e22", + "id": "7213d6bf", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "ea4240e8", + "id": "bfd121d2", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions.\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7c2e0df", + "id": "9af363a3", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "63dee91a", + "id": "63a13e6c", "metadata": {}, "source": [ "## Parallel Coordinates Chart with go.Parcoords" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65eecc7b", + "id": "0dea57d8", "metadata": { "inputHidden": false, "outputHidden": false @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "2cdd78b8", + "id": "15bbac6b", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions and drag the axis names across the plot to rearrange variables.\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88fc8eb1", + "id": "2591f963", "metadata": { "inputHidden": false, "outputHidden": false @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "b674fb7f", + "id": "50ac15b7", "metadata": {}, "source": [ "### Advanced Parallel Coordinates Plot" @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c08380d1", + "id": "72b5ac67", "metadata": { "inputHidden": false, "outputHidden": false @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "2860e516", + "id": "18a8f7b8", "metadata": {}, "source": [ "### Unselected Line Color and Opacity" @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "596d13ea", + "id": "011acc9a", "metadata": {}, "source": [ "*New in 5.10*\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c424e7df", + "id": "71e14b46", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "341ee70e", + "id": "366d80a9", "metadata": {}, "source": [ "#### Reference\n", @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "d033f96e", + "id": "27b687af", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pattern-hatching-texture.ipynb b/pattern-hatching-texture.ipynb index a268ed57c..82bf6e5aa 100644 --- a/pattern-hatching-texture.ipynb +++ b/pattern-hatching-texture.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1d745160", + "id": "91521559", "metadata": {}, "source": [ "*New in 5.0, with support for pie, sunburst, icicle, funnelarea, and treemap charts in 5.15*\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "d0a32f88", + "id": "a7f4c205", "metadata": {}, "source": [ "### Patterned Charts with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd57d33f", + "id": "cfd7ca6c", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8f5a24f", + "id": "cbc5709c", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "3f2671d1", + "id": "74781993", "metadata": {}, "source": [ "In the chart below we use `px.histogram()` instead of `px.bar()` to aggregate multiple values together, and encode one variable (sex) using both color and x-position and another (smoker) using patterns:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3bfd0b2", + "id": "41bbf691", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "a7aed0dc", + "id": "aaa7d90d", "metadata": {}, "source": [ "### Controlling Pattern Assignment\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dce1326", + "id": "8fb22d62", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "7153e63d", + "id": "12d45084", "metadata": {}, "source": [ "Here we use `pattern_shape_map` to explictly assign a shape to each value of `nation`, regardless of order:" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a53f79d8", + "id": "62fdae82", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "c5803420", + "id": "a0741d16", "metadata": {}, "source": [ "### Black on White Patterns for Print\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ac0f43d", + "id": "471eba4b", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "1761e330", + "id": "2df6bd5e", "metadata": {}, "source": [ "Of course, this setting can be used without making the figure monochrome as well:" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c282946", + "id": "248bf388", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "a36308eb", + "id": "27144208", "metadata": {}, "source": [ "### Patterns using Graph Objects\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42ec05fd", + "id": "3b546b4a", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "98d98205", + "id": "d577ef73", "metadata": {}, "source": [ "### Patterns Using SVG Paths\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2b39327", + "id": "23a21670", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "82968514", + "id": "03ffd41b", "metadata": {}, "source": [ "#### Reference\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "772222ca", + "id": "7d75bd7b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/peak-finding.ipynb b/peak-finding.ipynb index 198c7c7b8..e48fc7273 100644 --- a/peak-finding.ipynb +++ b/peak-finding.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "907fc2b7", + "id": "19091b56", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1851455", + "id": "292e22e5", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "38b63953", + "id": "fdb88cae", "metadata": {}, "source": [ "#### Import Data\n", @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beca6850", + "id": "a81379ed", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "ffe07126", + "id": "7d9f9d23", "metadata": {}, "source": [ "#### Peak Detection\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa73175a", + "id": "203f6f7a", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "6a131cb7", + "id": "461a7a20", "metadata": {}, "source": [ "#### Only Highest Peaks\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022370bb", + "id": "d99ebb02", "metadata": { "lines_to_next_cell": 2 }, @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "2e285d6d", + "id": "43b3cc87", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/performance.ipynb b/performance.ipynb index 81174d1ac..5db5a79e3 100644 --- a/performance.ipynb +++ b/performance.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e73c74c3", + "id": "bac5bc86", "metadata": {}, "source": [ "## DataFrame Types\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdac6aff", + "id": "d19d8a91", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "dcc7aaf6", + "id": "43deaf97", "metadata": {}, "source": [ "## WebGL\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "e6ecaa92", + "id": "3348e332", "metadata": {}, "source": [ "```\n", @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "d7b37e3c", + "id": "6f60cd8b", "metadata": {}, "source": [ "### WebGL for Scatter Performance\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "757d395f", + "id": "e40fb07f", "metadata": { "lines_to_next_cell": 2 }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "ba369291", + "id": "2d97bef1", "metadata": {}, "source": [ "#### WebGL with 1,000,000 points with Graph Objects\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "598c0cc2", + "id": "dc6183f6", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "143acab9", + "id": "1a07a8b7", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29efa911", + "id": "c5596536", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "abd3f3f3", + "id": "3799254e", "metadata": {}, "source": [ "### Exploring Correlations of a Large Dataset\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8158a09", + "id": "444da5a6", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41ae2a71", + "id": "139ac282", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "3a3c44d7", + "id": "0f815ff4", "metadata": {}, "source": [ "Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.\n" @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "c9220c2c", + "id": "d513704b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pie-charts.ipynb b/pie-charts.ipynb index 24f684c4e..7927166f5 100644 --- a/pie-charts.ipynb +++ b/pie-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ba711fcd", + "id": "07438ac2", "metadata": {}, "source": [ "A pie chart is a circular statistical chart, which is divided into sectors to illustrate numerical proportion.\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be66b8dd", + "id": "9c18ae94", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "b2efa9d6", + "id": "8885d214", "metadata": {}, "source": [ "### Pie chart with repeated labels\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a0ccc7a", + "id": "92c5783d", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "69dac473", + "id": "c3b53501", "metadata": {}, "source": [ "### Pie chart in Dash\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8eca124b", + "id": "f9c6077c", "metadata": { "hide_code": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "a46eae72", + "id": "db647d27", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "a14b87a8", + "id": "615dff54", "metadata": {}, "source": [ "### Setting the color of pie sectors with px.pie" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81ab4c0e", + "id": "7d4d5b0b", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "5bb61cd6", + "id": "100233cd", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b40bc86", + "id": "00fd13db", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "3f068947", + "id": "752c74bd", "metadata": {}, "source": [ "### Customizing a pie chart created with px.pie\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a233ac66", + "id": "69dd4d99", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "0545e33d", + "id": "ea00eced", "metadata": {}, "source": [ "### Basic Pie Chart with go.Pie\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9935348", + "id": "89abc202", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "465b26d3", + "id": "7b52ca20", "metadata": {}, "source": [ "### Styled Pie Chart\n", @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0ebc38f", + "id": "2d7e8aff", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "dd3fd392", + "id": "96601aba", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14a6815c", + "id": "cc8489ba", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "cde02a21", + "id": "3e268864", "metadata": {}, "source": [ "#### Controlling text orientation inside pie sectors\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85c5a479", + "id": "0e47b0de", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "6cf23197", + "id": "7b47ef48", "metadata": {}, "source": [ "### Donut Chart" @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2eff551", + "id": "2b4940d4", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "9e16c93f", + "id": "19e5d761", "metadata": {}, "source": [ "### Pulling sectors out from the center\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de9f86a6", + "id": "ec3d1cbd", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "9d0ec7f7", + "id": "039e79e0", "metadata": {}, "source": [ "### Pie Charts in subplots" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33dadd39", + "id": "6de4924a", "metadata": {}, "outputs": [], "source": [ @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d31b71a", + "id": "f7637d37", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "343f73c2", + "id": "154d0715", "metadata": {}, "source": [ "#### Plot chart with area proportional to total count\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52922504", + "id": "d2a35c23", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "22332516", + "id": "5b5f11b5", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6208b967", + "id": "31439681", "metadata": {}, "outputs": [], "source": [ @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "00e30b10", + "id": "d10e8f30", "metadata": {}, "source": [ "### See Also: Sunburst charts\n", @@ -502,7 +502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9b41677", + "id": "e1dfc70c", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "1ba1a721", + "id": "5bb52af3", "metadata": {}, "source": [ "#### Reference\n", @@ -530,7 +530,7 @@ }, { "cell_type": "markdown", - "id": "0f22681f", + "id": "45cfaed4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plot-data-from-csv.ipynb b/plot-data-from-csv.ipynb index 39bb5d140..a571c4e72 100644 --- a/plot-data-from-csv.ipynb +++ b/plot-data-from-csv.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "11c99620", + "id": "49ccd615", "metadata": {}, "source": [ "CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea1b5d0b", + "id": "9b11c3e0", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "d9c8bf20", + "id": "b2efca1b", "metadata": {}, "source": [ "### Plot from CSV with Plotly Express" @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cbd8f44", + "id": "b5925592", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "7ec4064e", + "id": "29233b79", "metadata": {}, "source": [ "### Plot from CSV in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10cd3283", + "id": "2167ec76", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "39b84a8f", + "id": "119f8acc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "b4c1348b", + "id": "8bd436d3", "metadata": {}, "source": [ "### Plot from CSV with `graph_objects`" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9e207ae", + "id": "9aa42da3", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "88070451", + "id": "0dd88afb", "metadata": {}, "source": [ "#### Reference\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "14ea71f1", + "id": "b4bed7f4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plotly-express.ipynb b/plotly-express.ipynb index 693db92f7..f3a61f09c 100644 --- a/plotly-express.ipynb +++ b/plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "669097f6", + "id": "5e2f710e", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "811f23f3", + "id": "2b36d4d5", "metadata": { "hide_code": true }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "58998946", + "id": "9da10d33", "metadata": {}, "source": [ "Plotly Express currently includes the following functions:\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "e8d8c8d4", + "id": "877f9c6e", "metadata": {}, "source": [ "### Plotly Express in Dash\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "133fae6e", + "id": "24b845f5", "metadata": { "hide_code": true }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "11777aa7", + "id": "1e890316", "metadata": {}, "source": [ "### Gallery\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "118d344d", + "id": "f21852af", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "f39d97e6", + "id": "6f84cd48", "metadata": {}, "source": [ "**Read more about [trendlines](/python/linear-fits/) and [templates](/python/templates/) and [marginal distribution plots](https://plotly.com/python/marginal-plots/).**" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fabce6e", + "id": "917afc8b", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "425ecceb", + "id": "fb79d6e5", "metadata": {}, "source": [ "**Read more about [error bars](/python/error-bars/).**" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56aecbaf", + "id": "1ad123b2", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "002db5a6", + "id": "3c8b7bd8", "metadata": {}, "source": [ "**Read more about [bar charts](/python/bar-charts/).**" @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1d99bd3", + "id": "b58105f5", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "400cac9a", + "id": "8c2f1487", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "1fe309ae", + "id": "84971979", "metadata": {}, "source": [ "**Read more about [facet plots](/python/facet-plots/).**" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26cc1b2b", + "id": "84aec322", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "6755ec91", + "id": "471ab27f", "metadata": {}, "source": [ "**Read more about [scatterplot matrices (SPLOMs)](/python/splom/).**\n" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8a9e9e8", + "id": "a29b4f9e", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "d59ac1d5", + "id": "e4b05fee", "metadata": {}, "source": [ "**Read more about [parallel coordinates](/python/parallel-coordinates-plot/) and [parallel categories](/python/parallel-categories-diagram/), as well as [continuous color](/python/colorscales/).**" @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "391af6a1", + "id": "e2c51a98", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e3a6240", + "id": "7a759bca", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "1f2be591", + "id": "d142c860", "metadata": {}, "source": [ "**Read more about [hover labels](/python/hover-text-and-formatting/).**" @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07778b20", + "id": "971c9331", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "3c35d811", + "id": "e852f2fc", "metadata": {}, "source": [ "**Read more about [animations](/python/animations/).**" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "828d67df", + "id": "1dc4c10b", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "950154ce", + "id": "13dca4b5", "metadata": {}, "source": [ "**Read more about [line charts](/python/line-charts/).**" @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9795dc62", + "id": "a2a4dcb3", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "483637a4", + "id": "76184994", "metadata": {}, "source": [ "**Read more about [area charts](/python/filled-area-plots/).**" @@ -362,7 +362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24e63ddc", + "id": "7cc17304", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "67753c00", + "id": "cdb342bd", "metadata": {}, "source": [ "**Read more about [timeline/Gantt charts](/python/gantt/).**" @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e78cfdd5", + "id": "c1e3b2aa", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "83ad8813", + "id": "e6b1fe80", "metadata": {}, "source": [ "**Read more about [funnel charts](/python/funnel-charts/).**" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bebb877", + "id": "b4be80c7", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "003c4e4e", + "id": "76425f39", "metadata": {}, "source": [ "### Part to Whole Charts\n", @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f4d8ee3", + "id": "fc1572c8", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "30a96c7d", + "id": "71177069", "metadata": {}, "source": [ "**Read more about [sunburst charts](/python/sunburst-charts/).**" @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfe55d41", + "id": "adc66c94", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "351abe0c", + "id": "011c1269", "metadata": {}, "source": [ "**Read more about [treemaps](/python/treemaps/).**" @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dbbf9e2", + "id": "c9dc3933", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "8d2f9093", + "id": "9b417b19", "metadata": {}, "source": [ "**Read more about [icicle charts](/python/icicle-charts/).**" @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80c398f3", + "id": "c35adb57", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "144fa72d", + "id": "0116297d", "metadata": {}, "source": [ "#### Distributions\n", @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4c71a70", + "id": "80d33511", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "aca75ae2", + "id": "369d8a0e", "metadata": {}, "source": [ "**Read more about [box plots](/python/box-plots/).**" @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efc1e105", + "id": "46de9ced", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "00142d02", + "id": "069c663f", "metadata": {}, "source": [ "**Read more about [violin plots](/python/violin/).**" @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7daec3ac", + "id": "5d5b686c", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "051c233d", + "id": "05434881", "metadata": {}, "source": [ "**Read more about [Empirical Cumulative Distribution Function (ECDF) charts](https://plotly.com/python/ecdf-plots/).**" @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0844d81e", + "id": "9b6e89d4", "metadata": {}, "outputs": [], "source": [ @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "eb7822d4", + "id": "61ce38cb", "metadata": {}, "source": [ "**Read more about [strip charts](https://plotly.com/python/strip-charts/).**" @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27ddff8", + "id": "ccd1cfbb", "metadata": {}, "outputs": [], "source": [ @@ -625,7 +625,7 @@ }, { "cell_type": "markdown", - "id": "fac0b924", + "id": "f3d14a2d", "metadata": {}, "source": [ "**Read more about [density contours, also known as 2D histogram contours](/python/2d-histogram-contour/).**" @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a5407d0", + "id": "72f55019", "metadata": {}, "outputs": [], "source": [ @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "f0e0d937", + "id": "9c028f5d", "metadata": {}, "source": [ "**Read more about [density heatmaps, also known as 2D histograms](/python/2D-Histogram/).**" @@ -655,7 +655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ead3e6e", + "id": "704f9b47", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "07cdfdd5", + "id": "78ab0fe6", "metadata": {}, "source": [ "### Images and Heatmaps\n", @@ -678,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43f17778", + "id": "f843c11d", "metadata": {}, "outputs": [], "source": [ @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e443126", + "id": "323832e1", "metadata": {}, "outputs": [], "source": [ @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "17d28849", + "id": "fff4c754", "metadata": {}, "source": [ "#### Tile Maps\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1b8907d", + "id": "4de9ecae", "metadata": {}, "outputs": [], "source": [ @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "0991e430", + "id": "dc56412b", "metadata": {}, "source": [ "**Read more about [tile map GeoJSON choropleths](/python/tile-county-choropleth/).**" @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74bbe0d3", + "id": "d017c772", "metadata": {}, "outputs": [], "source": [ @@ -761,7 +761,7 @@ }, { "cell_type": "markdown", - "id": "b31df0d3", + "id": "e1f89964", "metadata": {}, "source": [ "### Outline Maps\n", @@ -772,7 +772,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaf7d5eb", + "id": "c2fcbd8c", "metadata": { "lines_to_next_cell": 2 }, @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "769d30e3", + "id": "03424b6c", "metadata": {}, "source": [ "**Read more about [choropleth maps](/python/choropleth-maps/).**" @@ -796,7 +796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4447765f", + "id": "225db29f", "metadata": { "lines_to_next_cell": 2 }, @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "4de0c45a", + "id": "b8d27499", "metadata": {}, "source": [ "#### Polar Coordinates\n", @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb98d4b5", + "id": "3b2be5fb", "metadata": {}, "outputs": [], "source": [ @@ -834,7 +834,7 @@ }, { "cell_type": "markdown", - "id": "70711bd7", + "id": "30787adf", "metadata": {}, "source": [ "**Read more about [radar charts](https://plotly.com/python/radar-chart/).**" @@ -843,7 +843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2a92172", + "id": "b17748e8", "metadata": {}, "outputs": [], "source": [ @@ -856,7 +856,7 @@ }, { "cell_type": "markdown", - "id": "d1d12e5f", + "id": "1d002312", "metadata": {}, "source": [ "**Read more about [polar bar charts](/python/wind-rose-charts/).**" @@ -865,7 +865,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f132ad2", + "id": "41c2439a", "metadata": {}, "outputs": [], "source": [ @@ -878,7 +878,7 @@ }, { "cell_type": "markdown", - "id": "66665677", + "id": "19402eac", "metadata": {}, "source": [ "#### 3D Coordinates\n", @@ -889,7 +889,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4246ed7f", + "id": "9d1494af", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "50fbd87f", + "id": "23fd6eef", "metadata": {}, "source": [ "#### Ternary Coordinates\n", @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db4cdec1", + "id": "6d654f41", "metadata": { "lines_to_next_cell": 2 }, @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "85752d90", + "id": "ad8db519", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/polar-chart.ipynb b/polar-chart.ipynb index c44f2c38a..fd0e5c930 100644 --- a/polar-chart.ipynb +++ b/polar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "59febe39", + "id": "e8a6db2a", "metadata": {}, "source": [ "## Polar chart with Plotly Express\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f335d2d", + "id": "bf7cd6bb", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "e2231e25", + "id": "04ea6664", "metadata": {}, "source": [ "The \"strength\" column corresponds to strength categories of the wind, and there is a frequency value for each direction and strength. Below we use the strength column to encode the color, symbol and size of the markers." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c9092d2", + "id": "289bb7fc", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "518e86a9", + "id": "b2ea3185", "metadata": {}, "source": [ "For a line polar plot, use `px.line_polar`:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21ac1785", + "id": "c0729cd9", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "f9e9fdc8", + "id": "8d77fc84", "metadata": {}, "source": [ "See also the [wind rose page](https://plotly.com/python/wind-rose-charts/) for more wind rose visualizations in polar coordinates.\n", @@ -88,7 +88,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79eb6162", + "id": "33258c28", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "5ec12abc", + "id": "29903149", "metadata": {}, "source": [ "## Polar Scatter Plot with go.Scatterpolar\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a676285", + "id": "4835395a", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "7c152491", + "id": "618d4e62", "metadata": {}, "source": [ "#### Line Polar Chart" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faa34377", + "id": "b05bc16f", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "04e0a781", + "id": "059c8efc", "metadata": {}, "source": [ "#### Polar Bar Chart\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60bcf811", + "id": "d3106188", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "4697ac7b", + "id": "728573b0", "metadata": {}, "source": [ "#### Categorical Polar Chart" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ea2592c", + "id": "092e718d", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "46dd590b", + "id": "7f7fd2de", "metadata": {}, "source": [ "#### Polar Chart Sector" @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fa29ca5", + "id": "22f0ca4c", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "8ae238c8", + "id": "6d2f74ff", "metadata": {}, "source": [ "#### Polar Chart Directions" @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd591f08", + "id": "2f2dfbea", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "cc94ac5b", + "id": "5c24eaf3", "metadata": {}, "source": [ "#### Webgl Polar Chart\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c44a9b48", + "id": "c8c1f6fb", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "9f48852c", + "id": "ee47836b", "metadata": {}, "source": [ "#### Polar Chart Subplots" @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be73728e", + "id": "b7f18c18", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "4f590ea8", + "id": "d6f9dff1", "metadata": {}, "source": [ "#### Reference\n", @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "31ab7c77", + "id": "424de551", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/px-arguments.ipynb b/px-arguments.ipynb index a1a2fbf8b..04852bd56 100644 --- a/px-arguments.ipynb +++ b/px-arguments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8838b4dd", + "id": "6e10424e", "metadata": {}, "source": [ "Plotly Express (`px`) is the high-level interface to Plotly and provides functions for generating charts. `px` functions support data provided in a number of different formats (long, wide, and mixed) and as different types of objects, including pandas and Polars dataframes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d9c1665", + "id": "7c4a66e5", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "77847b57", + "id": "49a4f19a", "metadata": {}, "source": [ "By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "deee6172", + "id": "1a65d210", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "d95c542c", + "id": "54eb15b1", "metadata": {}, "source": [ "## Long, Wide, and Mixed-Form Data\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42baf183", + "id": "013a3f49", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92f4da05", + "id": "5d7f7e2e", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "44a9fe0d", + "id": "be5628e5", "metadata": {}, "source": [ "Plotly Express can produce the same plot from either form:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5acfcef", + "id": "14f1c19a", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77f55037", + "id": "04425227", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "b3a08a0e", + "id": "68134cad", "metadata": {}, "source": [ "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, or [you can use a data frame with named row- and column-indexes](/python/wide-form/). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "758c9139", + "id": "b2f1bfad", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "a403809a", + "id": "f4ab5174", "metadata": {}, "source": [ "Many more examples of wide-form and messy data input can be found in our [detailed wide-form support documentation](/python/wide-form/)." @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "4d9825b1", + "id": "2225c499", "metadata": {}, "source": [ "## Dataframe Input\n", @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aac55cf5", + "id": "1e2197e8", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "e7b375d4", + "id": "cb6730ea", "metadata": {}, "source": [ "### Example: Polars DataFrame with `px.bar`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42128411", + "id": "8fc49474", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "365c4e13", + "id": "6d66e37e", "metadata": {}, "source": [ "### Using the Index of a Dataframe\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b5590d2", + "id": "3474664c", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "2c1fbf67", + "id": "2a5f63b4", "metadata": {}, "source": [ "### Using Columns from Multiple Dataframes\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb491a30", + "id": "359d2985", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "a7d79586", + "id": "68027a2d", "metadata": {}, "source": [ "### Using labels to pass names\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03770130", + "id": "f2a6c4d4", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f677b87", + "id": "72622693", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "9842d1ef", + "id": "b7ba538f", "metadata": {}, "source": [ "### Input Data as array-like columns: NumPy arrays, lists...\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e38a487e", + "id": "fa189690", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "3ac4b4bd", + "id": "5784b67b", "metadata": {}, "source": [ "List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[].name = \"name\"`." @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12b7f89f", + "id": "ff2c0d2e", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "3242a499", + "id": "eb486a04", "metadata": {}, "source": [ "### Passing dictionaries or array-likes as the data_frame argument\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63326a7b", + "id": "1b4290c3", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "c1009f3f", + "id": "72ac3d95", "metadata": {}, "source": [ "To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5863ae6f", + "id": "90c3c1b6", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "dbed2777", + "id": "22d85e3b", "metadata": {}, "source": [ "### Mixing dataframes and other types\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a98159f1", + "id": "59e56d14", "metadata": { "lines_to_next_cell": 2 }, @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "fe763e30", + "id": "52f345a9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/quiver-plots.ipynb b/quiver-plots.ipynb index 43156ea59..9d6e82551 100644 --- a/quiver-plots.ipynb +++ b/quiver-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9337fbc6", + "id": "72a07b85", "metadata": {}, "source": [ "Quiver plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84a21019", + "id": "cb2f85bd", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "fc1bfe98", + "id": "92143919", "metadata": {}, "source": [ "#### Quiver Plot with Points" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d750dab9", + "id": "a170c1fd", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "84dc769e", + "id": "ed80a50e", "metadata": {}, "source": [ "#### See also\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "6980345c", + "id": "3bb6c33b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/radar-chart.ipynb b/radar-chart.ipynb index 8e3196728..5e5a7ee03 100644 --- a/radar-chart.ipynb +++ b/radar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dd52fa3a", + "id": "532508c1", "metadata": {}, "source": [ "A [Radar Chart](https://en.wikipedia.org/wiki/Radar_chart) (also known as a spider plot or star plot) displays multivariate data in the form of a two-dimensional chart of quantitative variables represented on axes originating from the center. The relative position and angle of the axes is typically uninformative. It is equivalent to a [parallel coordinates plot](/python/parallel-coordinates-plot/) with the axes arranged radially.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c6f7b50", + "id": "d85d326a", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "fba2661a", + "id": "007ff66b", "metadata": {}, "source": [ "For a filled line in a Radar Chart, update the figure created with `px.line_polar` with `fig.update_traces`." @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c28369cf", + "id": "5fcb0e84", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "a8c09819", + "id": "64e8a690", "metadata": {}, "source": [ "### Basic Radar Chart with go.Scatterpolar" @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b9c7f2e", + "id": "2509372c", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "a77aec3d", + "id": "5ea6e02a", "metadata": {}, "source": [ "#### Multiple Trace Radar Chart" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b38b0338", + "id": "2d6af1d7", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "83661112", + "id": "d49f9abf", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "1b73971f", + "id": "198c5ee4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/random-walk.ipynb b/random-walk.ipynb index 9f09679a4..bc744c504 100644 --- a/random-walk.ipynb +++ b/random-walk.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6bea4a05", + "id": "6b74b018", "metadata": {}, "source": [ "A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\\mathbb{Z}$), two dimensions ($\\mathbb{Z}^2$) or three dimensions ($\\mathbb{Z}^3$) in Cartesian space, where $\\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plotly.com/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26972f42", + "id": "33ff57eb", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "574b147c", + "id": "2c4cc420", "metadata": {}, "source": [ "#### Random Walk in 2D" @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11766fd7", + "id": "0cf0136d", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "46f2995d", + "id": "4899c92a", "metadata": {}, "source": [ "#### Random walk and diffusion\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ac126f3", + "id": "b0545a48", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "197a835e", + "id": "6f307ff5", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "b887aeda", + "id": "16743e01", "metadata": {}, "source": [ "#### Advanced Tip\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "93e15285", + "id": "61316655", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/range-slider.ipynb b/range-slider.ipynb index 4aaa27458..7407c7f1d 100644 --- a/range-slider.ipynb +++ b/range-slider.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5b521072", + "id": "106cc18c", "metadata": {}, "source": [ "#### Basic Range Slider and Range Selectors" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85465666", + "id": "e8b197ac", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "b74caca0", + "id": "02d7d8ed", "metadata": {}, "source": [ "#### Range Slider with Vertically Stacked Subplots" @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15c23ba6", + "id": "11b9fcfe", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "5480cb21", + "id": "f92bd750", "metadata": {}, "source": [ "#### Reference\n", @@ -362,7 +362,7 @@ }, { "cell_type": "markdown", - "id": "2979fa06", + "id": "c4b0e046", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/renderers.ipynb b/renderers.ipynb index a1619d2f7..3161f2b1a 100644 --- a/renderers.ipynb +++ b/renderers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1f1e93ef", + "id": "9f188ac3", "metadata": {}, "source": [ "# Displaying Figures\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b498a5f", + "id": "2f27117e", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "c50ca3d1", + "id": "04a03385", "metadata": {}, "source": [ "In most situations, you can omit the call to `.show()` and allow the figure to display itself." @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "135d209a", + "id": "67c84411", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "d4433708", + "id": "c7ba486e", "metadata": {}, "source": [ "> To be precise, figures will display themselves using the current default renderer when the two following conditions are true. First, the last expression in a cell must evaluate to a figure. Second, `plotly.py` must be running from within an `IPython` kernel.\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "2a258484", + "id": "43b83b1e", "metadata": {}, "source": [ "#### Setting The Default Renderer\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1d953a7", + "id": "c7fcaeea", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "629098c0", + "id": "c6942e8d", "metadata": {}, "source": [ "The default renderer that you see when you display `pio.renderers` might be different than what is shown here. This is because `plotly.py` attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of an available renderer to the `pio.renderers.default` property. For example, to switch to the `'browser'` renderer, which opens figures in a tab of the default web browser, you would run the following." @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26a34954", + "id": "bf8641d9", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "fc20ada6", + "id": "8b78bdd8", "metadata": {}, "source": [ "> Note: Default renderers persist for the duration of a single session. For example, if you set a default renderer in an `IPython` kernel, that default won't persist across kernel restarts.\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45bffcd7", + "id": "7b44ee0a", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "5d31d5d4", + "id": "c94dafe7", "metadata": {}, "source": [ "#### Built-in Renderers\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "ec7a5ce4", + "id": "5c95d28d", "metadata": {}, "source": [ "###### `plotly_mimetype`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d2c0e97", + "id": "3448b31f", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "add5414c", + "id": "daeabc81", "metadata": {}, "source": [ "###### PDF\n", @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0255f84d", + "id": "b73047ab", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "303eafdb", + "id": "3a7bd7bc", "metadata": {}, "source": [ "From this output, you can see that the `png` renderer supports 3 properties: `width`, `height`, and `scale`. You can customize these properties by assigning new values to them.\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ff1db7a", + "id": "8e150d7f", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "4b82eb72", + "id": "42006333", "metadata": {}, "source": [ "You can also override the values of renderer parameters temporarily by passing them as keyword arguments to the `show()` method. For example" @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2adfdae8", + "id": "bd9155ca", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "9cf0dcb7", + "id": "772407da", "metadata": {}, "source": [ "### Displaying figures in Plotly Studio\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0092b41b", + "id": "13f3290a", "metadata": { "hide_code": true }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "addf4b41", + "id": "626b17cb", "metadata": {}, "source": [ "### Displaying figures in Dash\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38b3f2bd", + "id": "793e3d48", "metadata": { "hide_code": true }, @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "6855442a", + "id": "d86798cc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "914b8848", + "id": "e257b158", "metadata": {}, "source": [ "## Displaying Figures Using `ipywidgets`\n", @@ -388,7 +388,7 @@ }, { "cell_type": "markdown", - "id": "71ec1c8f", + "id": "3a83dab8", "metadata": {}, "source": [ "## Performance\n", @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "4532ce59", + "id": "9414de34", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sankey-diagram.ipynb b/sankey-diagram.ipynb index 6ebffdbbe..7c663c947 100644 --- a/sankey-diagram.ipynb +++ b/sankey-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "76ef36f8", + "id": "a67da89c", "metadata": {}, "source": [ "A [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram) is a flow diagram, in which the width of arrows is proportional to the flow quantity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "9bea02f1", + "id": "36f18db7", "metadata": {}, "source": [ "### Basic Sankey Diagram\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f9a8fff", + "id": "41c61c85", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "c1dfbed3", + "id": "4efa1645", "metadata": {}, "source": [ "### More complex Sankey diagram with colored links" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49348c0d", + "id": "d642c08f", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "cfe3b4c7", + "id": "2b836519", "metadata": {}, "source": [ "### Sankey Diagram in Dash\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23348140", + "id": "7aa0ed6b", "metadata": { "hide_code": true }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "e9c7e93f", + "id": "4b2e6c95", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "052b01e5", + "id": "163ee4d6", "metadata": {}, "source": [ "### Style Sankey Diagram\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9551b5d9", + "id": "d06f91f6", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "85586b35", + "id": "86b74448", "metadata": {}, "source": [ "### Link Hover Color\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5462e173", + "id": "1a9ed331", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "d4289e6f", + "id": "7216e848", "metadata": {}, "source": [ "### Hovertemplate and customdata of Sankey diagrams\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1a1fe55", + "id": "5ba86853", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "9c1e6ead", + "id": "5f39eef3", "metadata": {}, "source": [ "### Define Node Position\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94c20ab8", + "id": "6c4aacfd", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "70649328", + "id": "1257623c", "metadata": {}, "source": [ "### Sankey Diagram with Arrow Links\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd4dc2e4", + "id": "1b54f809", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "1bda259e", + "id": "077afed8", "metadata": {}, "source": [ "### Node Alignment\n", @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c8d3599", + "id": "49c2c29d", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fa75a30", + "id": "bd88cb08", "metadata": {}, "outputs": [], "source": [ @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "804ed10e", + "id": "9520f525", "metadata": {}, "source": [ "### Reference\n", @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "d3337c23", + "id": "2cda0276", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/scatter-plots-on-maps.ipynb b/scatter-plots-on-maps.ipynb index 1dfb52fe4..a85322d7c 100644 --- a/scatter-plots-on-maps.ipynb +++ b/scatter-plots-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ff1f61b9", + "id": "e4f864e9", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13a43486", + "id": "7571d383", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "58982548", + "id": "af126d71", "metadata": {}, "source": [ "#### Customize geographical scatter plot" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "208fa93e", + "id": "7a255496", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "e4387308", + "id": "5d9fa94d", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ba9dbdc", + "id": "f50b119a", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "6f8cc6ab", + "id": "24db7356", "metadata": {}, "source": [ "### U.S. Airports Map\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa11287b", + "id": "ebb8add1", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "cd66c92a", + "id": "28f6c118", "metadata": {}, "source": [ "#### Styled U.S. Airports Map" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "192222db", + "id": "a52d6491", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "be0a076f", + "id": "b4b7cb9d", "metadata": {}, "source": [ "### North American Precipitation Map" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd70562f", + "id": "e6dd4595", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "f9519fdb", + "id": "2ec1d8ec", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "819de8f5", + "id": "50f27ea7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/selections.ipynb b/selections.ipynb index cbdad0c5c..b6dfdda43 100644 --- a/selections.ipynb +++ b/selections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ea9caa11", + "id": "f7d9fd19", "metadata": {}, "source": [ "## Adding Selections to Cartesian Subplots\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "c6e6add6", + "id": "fb548903", "metadata": {}, "source": [ "You can also add selections to a figure that displays when it renders using `fig.add_selection`.\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2052b097", + "id": "68a16f56", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "6b9498c8", + "id": "cabb2371", "metadata": {}, "source": [ "## Selections Using a Custom SVG" @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "2f7a096f", + "id": "53d491b5", "metadata": {}, "source": [ "In the above example, we added a rectangular selection. You can also render a custom SVG for a selection by defining a `path` that can include single or multiple polygons. Here, we create a selection with a single polygon path \"M2,6.5L4,7.5L4,6Z\".\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "823f372f", + "id": "b17ae7f8", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "b117a16b", + "id": "073aa9ab", "metadata": {}, "source": [ "## Styling Selections" @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "e7f4e830", + "id": "42fca47e", "metadata": {}, "source": [ "In the above example, we added a selection to the figure that is displayed when the figure renders.\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a2fc7be", + "id": "303780c3", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "d0625f3c", + "id": "82592122", "metadata": {}, "source": [ "## Styling New Selections\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "692359b6", + "id": "7ff1c7d1", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "ee307d78", + "id": "442fbdc2", "metadata": {}, "source": [ "## Fill Color for Active Selections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea5db131", + "id": "d05b4e65", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "d355e96b", + "id": "8e02eb78", "metadata": {}, "source": [ "## Selections with Time Series\n", @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffe7e1ce", + "id": "7de45922", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "a51506d0", + "id": "534f7562", "metadata": {}, "source": [ "## Referencing Selections on Multiple Cartesian Subplots" @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "6d9702ed", + "id": "287d7053", "metadata": {}, "source": [ "You can add selections to multiple Cartesian subplots by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x` and `y2` and two selections to the the plot with axis ids `x` and `y`." @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "611dc54c", + "id": "a0c37631", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "42a66f23", + "id": "c0472502", "metadata": {}, "source": [ "## Referencing Selections on a Scatterplot Matrix" @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "86fe38fd", + "id": "4e4f53cf", "metadata": {}, "source": [ "You can add selections to a scatterplot matrix by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x2` and `y2` and another on the plot with ids `x3` and `y`." @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d337dc9a", + "id": "64eef088", "metadata": { "lines_to_next_cell": 0 }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "134067eb", + "id": "f8321807", "metadata": {}, "source": [ "\n" @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "32bb72b5", + "id": "702370c5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/setting-graph-size.ipynb b/setting-graph-size.ipynb index 7de3ba019..5a7237653 100644 --- a/setting-graph-size.ipynb +++ b/setting-graph-size.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "38d4fd44", + "id": "0d0fffd1", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a18a6e5d", + "id": "b2d7db7f", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "b1a51623", + "id": "8a08b942", "metadata": {}, "source": [ "### Adjusting graph size with Dash\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3322615e", + "id": "7f3f698d", "metadata": { "hide_code": true }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "58b6ed8d", + "id": "309c2368", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "9f805c25", + "id": "455e637d", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins With Graph Objects\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28c6038a", + "id": "141eeab6", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "a237d047", + "id": "2151447d", "metadata": {}, "source": [ "### Automatically Adjust Margins\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62d630a5", + "id": "7b4a269b", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "d698121f", + "id": "41be56e4", "metadata": {}, "source": [ "### Automatically Adjust Specific Margins\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f6d4ada", + "id": "baa04e63", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "3637b9fa", + "id": "ef928d9c", "metadata": {}, "source": [ "### Setting a Minimum Plot Size with Automargins\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26ecda6f", + "id": "022e337b", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "84a4d13b", + "id": "d6461e59", "metadata": {}, "source": [ "#### Reference\n", @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "3790ae66", + "id": "326ce633", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/shapes.ipynb b/shapes.ipynb index 138ef8bed..562fc9adc 100644 --- a/shapes.ipynb +++ b/shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e9ee2fd0", + "id": "b5c91828", "metadata": {}, "source": [ "### Adding Lines and Polygons to Figures\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "05b4971b", + "id": "27770233", "metadata": {}, "source": [ "### Shape-drawing with Scatter traces\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2bdc86e", + "id": "12749804", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "dff55ff6", + "id": "b7981295", "metadata": {}, "source": [ "You can have more shapes either by adding [more traces](https://plotly.com/python/filled-area-plots/) or interrupting the series with `None`." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22ed13b5", + "id": "995b67bc", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "184a72ea", + "id": "4f8b7e7a", "metadata": {}, "source": [ "#### Shapes in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88e72644", + "id": "dbcfbba3", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "53a3ced0", + "id": "112c2f3d", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "710c03dd", + "id": "041908d3", "metadata": {}, "source": [ "#### Vertical and Horizontal Lines Positioned Relative to the Axis Data" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83d0a7a2", + "id": "28ffdc03", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "97df7c9f", + "id": "2a8c759d", "metadata": {}, "source": [ "#### Lines Positioned Relative to the Plot & to the Axis Data" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6d5614f", + "id": "6a9a4e84", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "ac29b9a1", + "id": "8ff52379", "metadata": {}, "source": [ "#### Rectangles Positioned Relative to the Axis Data" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8aa8fb3", + "id": "1f9fb315", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "2c217eef", + "id": "fb5fa433", "metadata": {}, "source": [ "#### Rectangle Positioned Relative to the Plot & to the Axis Data" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34b209a6", + "id": "22747737", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "da4ba0ef", + "id": "21459aca", "metadata": {}, "source": [ "#### A Rectangle Placed Relative to the Axis Position and Length\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ff3ec7f", + "id": "9e648d00", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "74144889", + "id": "a07a0553", "metadata": {}, "source": [ "#### Highlighting Time Series Regions with Rectangle Shapes\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93b3e74e", + "id": "fb676683", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "129c79c0", + "id": "3eaab988", "metadata": {}, "source": [ "#### Circles Positioned Relative to the Axis Data" @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d3d5c9e", + "id": "09e42a4b", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ }, { "cell_type": "markdown", - "id": "a9e16c3d", + "id": "0f91e5cf", "metadata": {}, "source": [ "#### Highlighting Clusters of Scatter Points with Circle Shapes" @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "106ce7af", + "id": "3b8cfa12", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "d182f054", + "id": "894530bb", "metadata": {}, "source": [ "#### Venn Diagram with Circle Shapes" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b0a8d8a", + "id": "33eb6bbb", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "026cc878", + "id": "67d36531", "metadata": {}, "source": [ "#### Adding Shapes to Subplots\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ea8fc14", + "id": "e0921eeb", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "93510eb7", + "id": "710d9a43", "metadata": {}, "source": [ "#### Subplot-Spanning Shapes\n", @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "174acba8", + "id": "ba4ef933", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "5fa655a9", + "id": "28b8b46f", "metadata": {}, "source": [ "For `path` shapes, the array must have one entry for each coordinate in the path string. Each coordinate in the path maps to the corresponding element in the `xref`/`yref` array, in order." @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39028831", + "id": "3f34466b", "metadata": {}, "outputs": [], "source": [ @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "e5ce8776", + "id": "f99e059e", "metadata": {}, "source": [ "**Note:** When using arrays with `xref` and `yref`, `xsizemode=\"pixel\"` and `ysizemode=\"pixel\"` are not supported." @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "1c421e0a", + "id": "cd040e15", "metadata": { "lines_to_next_cell": 0 }, @@ -723,7 +723,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b707a39", + "id": "eb10d839", "metadata": { "lines_to_next_cell": 2 }, @@ -753,7 +753,7 @@ }, { "cell_type": "markdown", - "id": "e6a6d3f6", + "id": "968777d9", "metadata": {}, "source": [ "#### SVG Paths" @@ -762,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24d2beb0", + "id": "2765df46", "metadata": {}, "outputs": [], "source": [ @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "bc906d7f", + "id": "11831718", "metadata": {}, "source": [ "#### Shifting Shapes on Categorical Axes\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afe0cf7d", + "id": "934652d5", "metadata": {}, "outputs": [], "source": [ @@ -916,7 +916,7 @@ }, { "cell_type": "markdown", - "id": "cd70ff8f", + "id": "4774dc45", "metadata": {}, "source": [ "### Drawing shapes with a Mouse on Cartesian plots\n", @@ -940,7 +940,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcb9f6c9", + "id": "93d7ddc2", "metadata": {}, "outputs": [], "source": [ @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "8b53f635", + "id": "81230ce9", "metadata": {}, "source": [ "### Style of user-drawn shapes\n", @@ -986,7 +986,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6778f378", + "id": "d880a870", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ }, { "cell_type": "markdown", - "id": "8f99d436", + "id": "6b1901a5", "metadata": {}, "source": [ "### Adding Text Labels to Shapes\n", @@ -1039,7 +1039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e39fdbb5", + "id": "1f3e3a90", "metadata": {}, "outputs": [], "source": [ @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "2f75e3c4", + "id": "29eedb40", "metadata": {}, "source": [ "#### Styling Text Labels\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8250ae6", + "id": "d69ac07d", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "af6c3f28", + "id": "ac5d8050", "metadata": {}, "source": [ "#### Setting Label Position\n", @@ -1137,7 +1137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31d6903f", + "id": "8b8f7cff", "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1194,7 @@ }, { "cell_type": "markdown", - "id": "384926a1", + "id": "5f772168", "metadata": {}, "source": [ "#### Setting Label Angle\n", @@ -1205,7 +1205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2d9c399", + "id": "38d9ac4c", "metadata": {}, "outputs": [], "source": [ @@ -1238,7 +1238,7 @@ }, { "cell_type": "markdown", - "id": "d465325e", + "id": "9666f06b", "metadata": {}, "source": [ "#### Setting Label Padding\n", @@ -1249,7 +1249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea75ff04", + "id": "db869563", "metadata": {}, "outputs": [], "source": [ @@ -1284,7 +1284,7 @@ }, { "cell_type": "markdown", - "id": "f06427be", + "id": "b0a3fa7b", "metadata": {}, "source": [ "#### Setting Label Anchors\n", @@ -1298,7 +1298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b619a33", + "id": "be839265", "metadata": {}, "outputs": [], "source": [ @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "6eb2605a", + "id": "9d5e45e0", "metadata": {}, "source": [ "#### Variables in Shape Label Text\n", @@ -1366,7 +1366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2431c816", + "id": "de6e58fa", "metadata": {}, "outputs": [], "source": [ @@ -1426,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "557a9dc5", + "id": "1fbf7005", "metadata": {}, "source": [ "#### Variables in Shape Label Text for New Shapes\n", @@ -1441,7 +1441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3070371", + "id": "986751ad", "metadata": {}, "outputs": [], "source": [ @@ -1479,7 +1479,7 @@ }, { "cell_type": "markdown", - "id": "774b1bfe", + "id": "08b86728", "metadata": {}, "source": [ "#### Shapes in the Legend\n", @@ -1492,7 +1492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfca580e", + "id": "3d73c33f", "metadata": {}, "outputs": [], "source": [ @@ -1536,7 +1536,7 @@ }, { "cell_type": "markdown", - "id": "17cd4f79", + "id": "8b4ac855", "metadata": {}, "source": [ "`newshape` also supports `showlegend`. In this example, each new line drawn on the graph appears in the legend." @@ -1545,7 +1545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "641cbea3", + "id": "49280784", "metadata": {}, "outputs": [], "source": [ @@ -1584,7 +1584,7 @@ }, { "cell_type": "markdown", - "id": "17f3fb83", + "id": "799ccb1a", "metadata": {}, "source": [ "#### Shape Layer\n", @@ -1595,7 +1595,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3a048d4", + "id": "08f08152", "metadata": {}, "outputs": [], "source": [ @@ -1649,7 +1649,7 @@ }, { "cell_type": "markdown", - "id": "7ab6a8c9", + "id": "552eda77", "metadata": {}, "source": [ "### Reference\n", @@ -1658,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "ec35d088", + "id": "0625b11c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sliders.ipynb b/sliders.ipynb index 13a8770d4..c372ecd99 100644 --- a/sliders.ipynb +++ b/sliders.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f00d4280", + "id": "cfdf5461", "metadata": {}, "source": [ "### Simple Slider Control\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6991f41", + "id": "2066dbe7", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "28910a80", + "id": "2a6baab4", "metadata": {}, "source": [ "#### Methods\n", @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "13b94d38", + "id": "c8cce2cd", "metadata": {}, "source": [ "### Sliders in Plotly Express\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19d1c484", + "id": "5d37cce4", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "eb315867", + "id": "5485aa0d", "metadata": {}, "source": [ "#### Reference\n", @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "ea39cda6", + "id": "ead780fe", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smith-charts.ipynb b/smith-charts.ipynb index 24ac6ed7f..5165b48f1 100644 --- a/smith-charts.ipynb +++ b/smith-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "94b95442", + "id": "11b0bf7c", "metadata": {}, "source": [ "*New in v5.4*\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "2c664b3b", + "id": "c0b43384", "metadata": {}, "source": [ "### Smith Charts with Plotly Graph Objects" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c04b57a", + "id": "501c1e97", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "430fd8f9", + "id": "5b2e76a2", "metadata": {}, "source": [ "### Smith Chart Subplots and Styling" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a065ad5e", + "id": "5ad7dd01", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "2b8d5265", + "id": "e3668edf", "metadata": {}, "source": [ "#### Reference\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b92f6e69", + "id": "b841645e", "metadata": { "lines_to_next_cell": 2 }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "11e5884d", + "id": "67661f03", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smoothing.ipynb b/smoothing.ipynb index 0307bfbb4..07843cefb 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7fb18fb3", + "id": "9925cb2f", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f5f6f32", + "id": "aa82480d", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "f78a2a8e", + "id": "bc5b98ff", "metadata": {}, "source": [ "#### Savitzky-Golay Filter\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87546073", + "id": "f829ab7a", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "34decb3f", + "id": "48e523f4", "metadata": {}, "source": [ "#### Triangular Moving Average\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e0b02ba", + "id": "85ac1d6e", "metadata": { "lines_to_next_cell": 2 }, @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "61a90b7c", + "id": "a648ff6b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/splom.ipynb b/splom.ipynb index 154f4c513..1f1b976c1 100644 --- a/splom.ipynb +++ b/splom.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8bcbe02e", + "id": "7c5d208e", "metadata": {}, "source": [ "### Scatter matrix with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccbd5d41", + "id": "9f35e305", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "5a662821", + "id": "897b8c36", "metadata": {}, "source": [ "Specify the columns to be represented with the `dimensions` argument, and set colors using a column of the dataframe:" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51eefc6c", + "id": "c14ef8fe", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "78a882c5", + "id": "2a9a721c", "metadata": {}, "source": [ "#### Styled Scatter Matrix with Plotly Express\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37666890", + "id": "be876f77", "metadata": { "lines_to_next_cell": 2 }, @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "00e442c5", + "id": "40680390", "metadata": {}, "source": [ "### Scatter matrix (splom) with go.Splom\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "6e903f4f", + "id": "7ff437de", "metadata": {}, "source": [ "#### Splom of the Iris data set" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de85573f", + "id": "5c4b3032", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "18bda896", + "id": "d52fd70a", "metadata": {}, "source": [ "The scatter plots on the principal diagonal can be removed by setting `diagonal_visible=False`:" @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6055dbb", + "id": "38ab48e2", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "6589047c", + "id": "65401177", "metadata": {}, "source": [ "To plot only the lower/upper half of the splom we switch the default `showlowerhalf=True`/`showupperhalf=True` to `False`:" @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b283600", + "id": "36a4300d", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "69a59001", + "id": "55541ae3", "metadata": {}, "source": [ "Each dict in the list dimensions has a key, visible, set by default on True. We can choose to remove a variable from splom, by setting `visible=False` in its corresponding dimension. In this case the default grid associated to the scatterplot matrix keeps its number of cells, but the cells in the row and column corresponding to the visible false dimension are empty:" @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b5b83df", + "id": "cb44202f", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "a0106ad2", + "id": "83a84fdb", "metadata": {}, "source": [ "#### Splom for the diabetes dataset\n", @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93f26fd4", + "id": "4f8b1b20", "metadata": { "lines_to_next_cell": 0 }, @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "6dc537ae", + "id": "2407e33d", "metadata": {}, "source": [ "#### Hover Effects\n", @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "724c4d7c", + "id": "5b9a0256", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "35d6d17a", + "id": "bb61b0fa", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "838a5d43", + "id": "776a3eb6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-export.ipynb b/static-image-export.ipynb index 56fb48a7b..fa8a4e1ce 100644 --- a/static-image-export.ipynb +++ b/static-image-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6650e5af", + "id": "2f9ffed5", "metadata": {}, "source": [ "This page demonstrates how to export interactive Plotly figures to static image formats like PNG, JPEG, SVG, and PDF. If you want to export Plotly figures to HTML to retain interactivity, see the [Interactive HTML Export page](/python/interactive-html-export/)" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "3bed5505", + "id": "7721b29d", "metadata": {}, "source": [ "## Install Dependencies\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "083229aa", + "id": "30d92012", "metadata": {}, "source": [ "## Write Image to a File\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "22c4508b", + "id": "019d0f9e", "metadata": {}, "source": [ "### Raster Formats\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "b31adfe7", + "id": "6c6ca73f", "metadata": {}, "source": [ "**Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image." @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "4d892439", + "id": "4eb4431a", "metadata": {}, "source": [ "### Specify a Format\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "ab2aa9df", + "id": "c2ada5a7", "metadata": {}, "source": [ "### Write Multiple Images\n", @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "927e4426", + "id": "0eee56e5", "metadata": {}, "source": [ "## Get Image as Bytes\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df5f255d", + "id": "341bc384", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "239901ad", + "id": "0c30ff2d", "metadata": {}, "source": [ "Here's the bytes object displayed using `IPython.display.Image`:" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08917ee1", + "id": "f0113c66", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "6cd650a7", + "id": "625eefcb", "metadata": {}, "source": [ "## Specify Image Dimensions and Scale\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "207f5bf9", + "id": "80b23680", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "0ac9bd29", + "id": "86b8857e", "metadata": {}, "source": [ "## Specify Image Export Engine\n", @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "291b5c7c", + "id": "c13d5dd7", "metadata": {}, "source": [ "## plotly.io Functions\n", @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "57b46b2a", + "id": "2adf63c6", "metadata": {}, "source": [ "## Image Export Settings (Kaleido)\n", @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "bfc75bda", + "id": "da6826e0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-generation-migration.ipynb b/static-image-generation-migration.ipynb index 1f8daeac7..d1796b6f7 100644 --- a/static-image-generation-migration.ipynb +++ b/static-image-generation-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0d8ecf53", + "id": "fe32f6ce", "metadata": { "lines_to_next_cell": 2 }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "8b11538c", + "id": "7fbacd1d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamline-plots.ipynb b/streamline-plots.ipynb index 1434aa1b6..591c50a3b 100644 --- a/streamline-plots.ipynb +++ b/streamline-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1c7f3389", + "id": "cdd9b519", "metadata": {}, "source": [ "A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to the velocity field. In the case of a stationary velocity field, streamlines coincide with trajectories (see also the [Wikipedia page on streamlines, streaklines and pathlines](https://en.wikipedia.org/wiki/Streamlines,_streaklines,_and_pathlines)).\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af96f331", + "id": "e846a12c", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "7cec4bf6", + "id": "24a8da54", "metadata": {}, "source": [ "#### Streamline and Source Point Plot" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23c9cb32", + "id": "9dcbe0a8", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "905ee29d", + "id": "36075040", "metadata": {}, "source": [ "#### See also\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "94e84729", + "id": "83087009", "metadata": {}, "source": [ "#### Reference\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "b41a8693", + "id": "403af25f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamtube-plot.ipynb b/streamtube-plot.ipynb index c1f1a54c0..59a0fa155 100644 --- a/streamtube-plot.ipynb +++ b/streamtube-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "73503e3c", + "id": "168897a5", "metadata": {}, "source": [ "### Introduction" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "0a1f7940", + "id": "43e63719", "metadata": {}, "source": [ "In streamtube plots, attributes include `x`, `y`, and `z`, which set the coordinates of the vector field, and `u`, `v`, and `w`, which set the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "48151534", + "id": "dc42c7f7", "metadata": {}, "source": [ "### Basic Streamtube Plot" @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82701526", + "id": "ea42f268", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "b910cee7", + "id": "9da77d98", "metadata": {}, "source": [ "### Starting Position and Segments\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1642fba", + "id": "75db3c12", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "eb951e98", + "id": "ad8576a3", "metadata": {}, "source": [ "### Tube color and diameter\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98103e04", + "id": "07ca01ab", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "307199f8", + "id": "1d3f8d03", "metadata": {}, "source": [ "#### Reference\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "01f4645c", + "id": "3c95da64", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/strip-charts.ipynb b/strip-charts.ipynb index 8ebbd8704..4f406009b 100644 --- a/strip-charts.ipynb +++ b/strip-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "65eaedd8", + "id": "35eef26d", "metadata": {}, "source": [ "### Strip Charts with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5cd2521", + "id": "b455bc12", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "77b9bf06", + "id": "30af3f2f", "metadata": {}, "source": [ "Strip charts support [faceting](/python/facet-plots/) and [discrete color](/python/discrete-color/):" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1c943f8", + "id": "0b65ffbb", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "7f73fecf", + "id": "6943c707", "metadata": {}, "source": [ "#### Reference\n", @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "c94afa0c", + "id": "3e074111", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/styling-plotly-express.ipynb b/styling-plotly-express.ipynb index 1fa412436..727dc96e7 100644 --- a/styling-plotly-express.ipynb +++ b/styling-plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a983650e", + "id": "fae91fc3", "metadata": {}, "source": [ "### Styling Figures made with Plotly Express\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31b08ce8", + "id": "bc59df31", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "cbaa15b4", + "id": "1217f497", "metadata": {}, "source": [ "Here is the same figure, restyled by adding some extra parameters to the initial Plotly Express call:" @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26700e5c", + "id": "f450de4f", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "7c14f70e", + "id": "dbf1123f", "metadata": {}, "source": [ "### Updating or Modifying Figures made with Plotly Express\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43165689", + "id": "afeb024b", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "edc1ff84", + "id": "5598cb7a", "metadata": {}, "source": [ "### How Plotly Express Works with Templates\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d41cb56b", + "id": "d44c7ee0", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "21007d03", + "id": "d517a0c1", "metadata": {}, "source": [ "### Setting Plotly Express Styling Defaults\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63981ec4", + "id": "c45c30ce", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "d85f8977", + "id": "9b507d52", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/subplots.ipynb b/subplots.ipynb index ee06b09d8..6ca7332b0 100644 --- a/subplots.ipynb +++ b/subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1a4bc7d1", + "id": "c06feb9e", "metadata": {}, "source": [ "### Subplots and Plotly Express\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "92adfec5", + "id": "1eb4e86f", "metadata": {}, "source": [ "#### Simple Subplot\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ee8286a", + "id": "1b8bfe68", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "7230ef5a", + "id": "f6fc74d5", "metadata": {}, "source": [ "#### Stacked Subplots\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "589941bc", + "id": "aced01f4", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "3ade2968", + "id": "fd45a9a4", "metadata": {}, "source": [ "#### Multiple Subplots\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5ffa3b4", + "id": "20559780", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "a33e1b61", + "id": "7f6e151b", "metadata": {}, "source": [ "#### Multiple Subplots with Titles\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5192477", + "id": "b261268b", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "31ae5e6e", + "id": "eda6cee3", "metadata": {}, "source": [ "#### Subplots with Annotations" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74c1235c", + "id": "76c213cb", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "32b1fefa", + "id": "c5929851", "metadata": {}, "source": [ "#### Customize Subplot Column Widths and Row Heights\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8f4dd8d", + "id": "25946255", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "3cc6bfbc", + "id": "aa6f1259", "metadata": {}, "source": [ "#### Subplots in Dash\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9e7dfbd", + "id": "2f2a7e1e", "metadata": { "hide_code": true }, @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "3f339647", + "id": "48c5bbdd", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "d94e05ec", + "id": "08f929ac", "metadata": {}, "source": [ "#### Customizing Subplot Axes\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b6ce65a", + "id": "a71ac6cd", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "423f189d", + "id": "e2a11de8", "metadata": {}, "source": [ "#### Subplots with Shared X-Axes\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b164891", + "id": "37fdfaaf", "metadata": {}, "outputs": [], "source": [ @@ -379,7 +379,7 @@ }, { "cell_type": "markdown", - "id": "8e83e0f0", + "id": "1a461bc4", "metadata": {}, "source": [ "#### Subplots with Shared Y-Axes\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3ea5b08", + "id": "f8d60d6d", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "55abc918", + "id": "25469768", "metadata": {}, "source": [ "### Subplots with Shared Colorscale\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a6e26aa", + "id": "d11a250e", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "f84a9ae8", + "id": "981d5cd6", "metadata": {}, "source": [ "#### Custom Sized Subplot with Subplot Titles\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2214b106", + "id": "c8936484", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "a0495344", + "id": "ece0cea5", "metadata": {}, "source": [ "#### Multiple Custom Sized Subplots\n", @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e47554b", + "id": "180eb86a", "metadata": {}, "outputs": [], "source": [ @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "7ac24af3", + "id": "baafbcc3", "metadata": {}, "source": [ "#### Subplots Types\n", @@ -555,7 +555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b7473bc", + "id": "ca54c965", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "8c362729", + "id": "58ace28f", "metadata": {}, "source": [ "As an alternative to providing the name of a subplot type (e.g. `\"xy\"`, `\"polar\"`, `\"domain\"`, `\"scene\"`, etc), the `type` option may also be set to a string containing the name of a trace type (e.g. `\"bar\"`, `\"barpolar\"`, `\"pie\"`, `\"scatter3d\"`, etc.), which will be used to determine the subplot type that is compatible with that trace.\n", @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15a5151f", + "id": "9a5a58c7", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +632,7 @@ }, { "cell_type": "markdown", - "id": "93aed7b4", + "id": "d0c2c2ce", "metadata": {}, "source": [ "#### Side by Side Subplot (low-level API)" @@ -641,7 +641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d7213e3", + "id": "e685ac4e", "metadata": {}, "outputs": [], "source": [ @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "ad910322", + "id": "1fbec5fb", "metadata": {}, "source": [ "#### Subplots with shared axes (low-level API)" @@ -684,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c996ac1", + "id": "9d0f0d73", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "a55a6be4", + "id": "5143a6d3", "metadata": {}, "source": [ "#### Stacked Subplots with a Shared X-Axis (low-level API)" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "172cd692", + "id": "95bae05b", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "1c1ef609", + "id": "068ab530", "metadata": {}, "source": [ "#### Setting Subplots on a Figure Directly\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6db2a000", + "id": "8e794965", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "b8c467e3", + "id": "7192cf6b", "metadata": {}, "source": [ "is equivalent to:" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "652c8d89", + "id": "448dd301", "metadata": {}, "outputs": [], "source": [ @@ -835,7 +835,7 @@ }, { "cell_type": "markdown", - "id": "5dd790a9", + "id": "3a242a69", "metadata": {}, "source": [ "#### Reference\n", @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faa5c075", + "id": "62bb45f2", "metadata": { "lines_to_next_cell": 2 }, @@ -858,7 +858,7 @@ }, { "cell_type": "markdown", - "id": "99a8d420", + "id": "0e3a47a7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sunburst-charts.ipynb b/sunburst-charts.ipynb index 83426ac16..a2bec19bf 100644 --- a/sunburst-charts.ipynb +++ b/sunburst-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bae5caa4", + "id": "beb32754", "metadata": {}, "source": [ "Sunburst plots visualize hierarchical data spanning outwards radially from root to leaves. Similar to [Icicle charts](https://plotly.com/python/icicle-charts/) and [Treemaps](https://plotly.com/python/treemaps/), the hierarchy is defined by `labels` (`names` for `px.icicle`) and `parents` attributes. The root starts from the center and children are added to the outer rings.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9822020f", + "id": "3d9c3248", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "ac19cc4f", + "id": "5b9a86c1", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with plotly.express\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df807f7", + "id": "4500a642", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "41d77fee", + "id": "7019c5a4", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with continuous color argument in px.sunburst\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "810f2348", + "id": "40b97158", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "d3b6e92b", + "id": "0c6a334c", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with discrete color argument in px.sunburst\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e1b9181", + "id": "870b48ef", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "1c72d5bb", + "id": "613a1bd0", "metadata": {}, "source": [ "In the example below the color of `Saturday` and `Sunday` sectors is the same as `Dinner` because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6fa5a51", + "id": "6181517f", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "449662d2", + "id": "c85deb92", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f87f126", + "id": "661945b4", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "5599fb9c", + "id": "1479d480", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c7771ac", + "id": "53f94d4e", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "1e0a38f9", + "id": "bb81d6c1", "metadata": {}, "source": [ "### Basic Sunburst Plot with go.Sunburst\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86ea9ee6", + "id": "ffc25e08", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "4c3534de", + "id": "ac7d7a70", "metadata": {}, "source": [ "### Sunburst with Repeated Labels" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ef58888", + "id": "97922a91", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "05bfc9d6", + "id": "674530d3", "metadata": {}, "source": [ "### Branchvalues\n", @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8888f1fb", + "id": "e15ebfc8", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "3a66ef64", + "id": "4a2c3633", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e515de78", + "id": "f6458297", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "462aa961", + "id": "85cf0c56", "metadata": {}, "source": [ "#### Controlling text orientation inside sunburst sectors\n", @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16e4201d", + "id": "c0b1b331", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "fd827dc3", + "id": "33ea9473", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb93a341", + "id": "4569a8c0", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "f13c31ab", + "id": "076454be", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "919c22fb", + "id": "01773fac", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "6928c41f", + "id": "73e4fd33", "metadata": {}, "source": [ "### Sunburst chart with a continuous colorscale\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07c7e6a5", + "id": "4e259a0e", "metadata": {}, "outputs": [], "source": [ @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "f184225c", + "id": "4db362ad", "metadata": {}, "source": [ "#### Reference\n", @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "a3ef2226", + "id": "0007e876", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/supported-colors.ipynb b/supported-colors.ipynb index 3b76bb0ed..be3229718 100644 --- a/supported-colors.ipynb +++ b/supported-colors.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "23b7f8f6", + "id": "20d1bdb5", "metadata": {}, "source": [ "# Supported CSS Colors\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2df9d24", + "id": "71d8a20c", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "a7381958", + "id": "892e9e6c", "metadata": {}, "source": [ "These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color)." @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd954ab0", + "id": "3dd12218", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "8bdec856", + "id": "7bbd9442", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table-subplots.ipynb b/table-subplots.ipynb index 2ffea89a4..4af206e1d 100644 --- a/table-subplots.ipynb +++ b/table-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "20a4d62d", + "id": "4f03b150", "metadata": {}, "source": [ "#### Import CSV Data" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de16bb72", + "id": "d0777c05", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "c6d0af5e", + "id": "5ffe060e", "metadata": {}, "source": [ "#### Reference\n", @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "b9f8868e", + "id": "a745ffe9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table.ipynb b/table.ipynb index 7ddb3fdc2..d04308a75 100644 --- a/table.ipynb +++ b/table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "446ea192", + "id": "765ccdce", "metadata": {}, "source": [ "`go.Table` provides a Table object for detailed data viewing. The data are arranged in\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36c0c8b1", + "id": "f72ee958", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "3e824399", + "id": "9dade93a", "metadata": {}, "source": [ "#### Styled Table" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c97544c6", + "id": "61fa60e1", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "75bfe8aa", + "id": "b37f674c", "metadata": {}, "source": [ "#### Use a Pandas Dataframe" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5044b87c", + "id": "c8d873ad", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "40e38497", + "id": "632b15da", "metadata": {}, "source": [ "#### Tables in Dash\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97807b32", + "id": "a32c9ab5", "metadata": { "hide_code": true }, @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "08723d6b", + "id": "19fa3619", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "88cb3c00", + "id": "a046904e", "metadata": {}, "source": [ "#### Changing Row and Column Size" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffb5cd4a", + "id": "e0a0b836", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "6ae2f03a", + "id": "02cac38a", "metadata": {}, "source": [ "#### Alternating Row Colors" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b019f19", + "id": "cc5d8f3c", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "3204d70d", + "id": "e10d2c1b", "metadata": {}, "source": [ "#### Row Color Based on Variable" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4587764", + "id": "3d1ca6d1", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "f89e2407", + "id": "1f9d1da3", "metadata": {}, "source": [ "#### Cell Color Based on Variable" @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dad3e4ed", + "id": "19da9e97", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "4c096d98", + "id": "8e94ea54", "metadata": {}, "source": [ "#### Reference\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "7aef88b5", + "id": "ec017347", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/templates.ipynb b/templates.ipynb index 854f28abe..f8befc982 100644 --- a/templates.ipynb +++ b/templates.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "db56dc65", + "id": "169d041c", "metadata": {}, "source": [ "### Theming and templates\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3c7a74f", + "id": "ebc4eb51", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "2207d270", + "id": "f29dc785", "metadata": {}, "source": [ "From this, we can see that the default theme is `\"plotly\"`, and we can see the names of several additional themes that we can choose from.\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fa2c9b9", + "id": "2150115b", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "a0619af4", + "id": "7e8d5265", "metadata": {}, "source": [ "#### Specifying themes in graph object figures\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b75a2cfb", + "id": "7b3b234b", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "409d4366", + "id": "05defab0", "metadata": {}, "source": [ "#### Specifying a default themes\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c26e49bf", + "id": "f06360f1", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "0f7eb42f", + "id": "6399fe08", "metadata": {}, "source": [ "#### Disable default theming\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55d47b66", + "id": "86fa90d6", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "0ef8d4e4", + "id": "b4833921", "metadata": {}, "source": [ "### Creating themes\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30a540af", + "id": "f5448d9d", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "9bffd5db", + "id": "fb801261", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))`\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c832369c", + "id": "a2850d94", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "dd1a2cfd", + "id": "cb69f145", "metadata": {}, "source": [ "If a trace type property is set to a list of more than one trace, then the default properties are cycled as more traces are added to the figure. Here is an example that creates a template that cycles the default marker symbol for scatter traces, and then constructs a figure that uses this template." @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39640f20", + "id": "bb7be643", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "dcbcbbb1", + "id": "c31719ce", "metadata": {}, "source": [ "Note that because we built the template with a list of 3 scatter trace [graph objects](/python/graph-objects/) (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa921a3c", + "id": "c3f45271", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "33881e55", + "id": "07bf0e2f", "metadata": {}, "source": [ "#### Including tuple elements in a theme\n", @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e0d3c40", + "id": "6cb597ce", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "5f1720f7", + "id": "e11b127a", "metadata": {}, "source": [ "#### Customizing theme tuple elements in a figure\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1c9477f", + "id": "fa1581d6", "metadata": {}, "outputs": [], "source": [ @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "ca7e40d7", + "id": "69bca1e5", "metadata": {}, "source": [ "#### Registering themes as named templates\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a228dfb", + "id": "23d4dccc", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "11ee52bf", + "id": "2057fd0a", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])`\n", @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f370c37", + "id": "db391f2c", "metadata": {}, "outputs": [], "source": [ @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "e119d035", + "id": "0d0695ae", "metadata": {}, "source": [ "#### Combining themes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a35f66dc", + "id": "da409313", "metadata": {}, "outputs": [], "source": [ @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "67625172", + "id": "a60e1d22", "metadata": {}, "source": [ "Combining themes is also supported by Plotly Express" @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76d7113e", + "id": "55715be2", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "a5015c3a", + "id": "20c2cd93", "metadata": {}, "source": [ "\n", @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "be148ec5", + "id": "8e6ecb28", "metadata": {}, "source": [ "#### Examining built-in themes\n", @@ -630,7 +630,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea0ea088", + "id": "c62ee9fd", "metadata": {}, "outputs": [], "source": [ @@ -641,7 +641,7 @@ }, { "cell_type": "markdown", - "id": "7a2381d4", + "id": "46f9f9e3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-contour.ipynb b/ternary-contour.ipynb index 3fab175c8..ac9ad9484 100644 --- a/ternary-contour.ipynb +++ b/ternary-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b6805d01", + "id": "47c697d0", "metadata": {}, "source": [ "## Ternary contour plots" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "289bc8f6", + "id": "39e853ef", "metadata": {}, "source": [ "A ternary contour plots represents isovalue lines of a quantity defined inside a [ternary diagram](https://en.wikipedia.org/wiki/Ternary_plot), i.e. as a function of three variables which sum is constant. Coordinates of the ternary plot often correspond to concentrations of three species, and the quantity represented as contours is some property (e.g., physical, chemical, thermodynamical) varying with the composition.\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb386829", + "id": "2541dcd0", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "cbc80365", + "id": "fd58b16e", "metadata": {}, "source": [ "#### Customized ternary contour plot" @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2490f891", + "id": "0f4b565d", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "7ce468f9", + "id": "2e5fb140", "metadata": {}, "source": [ "#### Ternary contour plot with lines only" @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16d5736f", + "id": "a6e690ed", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "a914db76", + "id": "fbb52dac", "metadata": {}, "source": [ "#### Ternary contour plot with data points\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd516b1c", + "id": "f4601c4f", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "71e1396e", + "id": "41d677a7", "metadata": {}, "source": [ "#### Interpolation mode\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "698cecad", + "id": "c616ecb3", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e95b5bb5", + "id": "c44e1f7e", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "93696083", + "id": "9d95d3b1", "metadata": {}, "source": [ "#### Reference\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "2814c382", + "id": "5b901f38", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-plots.ipynb b/ternary-plots.ipynb index feebd37ab..4c5a40b9d 100644 --- a/ternary-plots.ipynb +++ b/ternary-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "230162ea", + "id": "69d6e2eb", "metadata": {}, "source": [ "## Ternary Plots\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ced5983b", + "id": "a157732b", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "3375298b", + "id": "e66d83f7", "metadata": {}, "source": [ "We can scale and color the markers to produce a ternary bubble chart." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23d92ec7", + "id": "a9058c14", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "39285d7d", + "id": "33df9a02", "metadata": {}, "source": [ "### Ternary scatter plot with Plotly Graph Objects" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "763ceab5", + "id": "10026699", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "7caf6153", + "id": "03c4b5a4", "metadata": {}, "source": [ "#### Reference\n", @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "33325388", + "id": "0f258cd4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-scatter-contour.ipynb b/ternary-scatter-contour.ipynb index 862077386..05a1e5e14 100644 --- a/ternary-scatter-contour.ipynb +++ b/ternary-scatter-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e63eb999", + "id": "fbe092af", "metadata": {}, "source": [ "#### Load and Process Data Files" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1e5224e", + "id": "9a4e2c28", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "6ee270fd", + "id": "4a4f1156", "metadata": {}, "source": [ "#### Create Ternary Scatter Plot:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c17303c", + "id": "571345b4", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "0abbb633", + "id": "4c92bcaf", "metadata": {}, "source": [ "#### Create Ternary Contour Plot:" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ca243f0", + "id": "d78befb5", "metadata": {}, "outputs": [], "source": [ @@ -155,14 +155,14 @@ { "cell_type": "code", "execution_count": null, - "id": "59138ebb", + "id": "9e4424d6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "cbcdc329", + "id": "989653f6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/text-and-annotations.ipynb b/text-and-annotations.ipynb index 3c6008104..65fc05d64 100644 --- a/text-and-annotations.ipynb +++ b/text-and-annotations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8836ed1a", + "id": "36e6b558", "metadata": {}, "source": [ "### Adding Text to Figures\n", @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "id": "6c4b4906", + "id": "950988a0", "metadata": {}, "source": [ "### Text on scatter plots with Plotly Express\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b20a70e", + "id": "f1ae97b2", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "58284ce4", + "id": "55974f9f", "metadata": {}, "source": [ "### Text on scatter plots with Graph Objects" @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6093e3f", + "id": "767d7e29", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "0ee93947", + "id": "151a9c99", "metadata": {}, "source": [ "### Text positioning in Dash\n", @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e8486e8", + "id": "5fa1fec9", "metadata": { "hide_code": true }, @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "669ee899", + "id": "a7e0e1da", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "bec9548a", + "id": "fd9912f8", "metadata": {}, "source": [ "### Controlling Text Size with `uniformtext`\n", @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "9c399300", + "id": "9ca307b3", "metadata": {}, "source": [ "Here is a bar chart with the default behavior which will scale down text to fit." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf622568", + "id": "85ef1dfa", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "e9d18c83", + "id": "089d8de0", "metadata": {}, "source": [ "Here is the same figure with uniform text applied: the text for all bars is the same size, with a minimum size of 8. Any text at the minimum size which does not fit in the bar is hidden." @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dea225b", + "id": "1823a357", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27cf5731", + "id": "1a407114", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "4de725cc", + "id": "18044525", "metadata": {}, "source": [ "### Controlling Maximum Text Size\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeeb4ca5", + "id": "f6ed4cbc", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "18103789", + "id": "cf731579", "metadata": {}, "source": [ "### Text Annotations\n", @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f626004", + "id": "23c7be71", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "ae6b0414", + "id": "2c81ff1a", "metadata": {}, "source": [ "#### Text Annotations with Log Axes\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6f68284", + "id": "f18b3a6b", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "58e903a5", + "id": "c7cca6b1", "metadata": {}, "source": [ "### 3D Annotations" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dd3d013", + "id": "5d890393", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "2cfa490e", + "id": "0a1f3847", "metadata": {}, "source": [ "### Font Color, Size, and Familiy\n", @@ -418,7 +418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06fb700a", + "id": "0283cc10", "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ }, { "cell_type": "markdown", - "id": "1856fb9a", + "id": "e1fc90e7", "metadata": {}, "source": [ "### Font Style, Variant, and Weight\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbdbb7f2", + "id": "509df5ca", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "4ce8475d", + "id": "521fc124", "metadata": {}, "source": [ "## Numeric Font Weight\n", @@ -533,7 +533,7 @@ { "cell_type": "code", "execution_count": null, - "id": "492de68f", + "id": "b4394c4f", "metadata": {}, "outputs": [], "source": [ @@ -577,7 +577,7 @@ }, { "cell_type": "markdown", - "id": "53a2a1a0", + "id": "bb4c701e", "metadata": {}, "source": [ "[scattergl](https://plotly.com/python/reference/scattergl) traces do not support all numeric font weights. When you specify a numeric font weight on `scattergl`, weights up to 500 are mapped to the keyword font weight \"normal\", while weights above 500 are mapped to \"bold\"." @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "e56e3997", + "id": "4c62c863", "metadata": {}, "source": [ "## Text Case\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f30f93c", + "id": "947ca210", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "05e6f65f", + "id": "3728cc6a", "metadata": {}, "source": [ "## Text Lines\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92d49ac4", + "id": "20f66ab1", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "455440db", + "id": "f147ccdf", "metadata": {}, "source": [ "## Text Shadow\n", @@ -694,7 +694,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f222ba89", + "id": "3cf55fd6", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "45f7dc06", + "id": "ae42433e", "metadata": {}, "source": [ "### Styling and Coloring Annotations" @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07f51cea", + "id": "fa4cb9b3", "metadata": {}, "outputs": [], "source": [ @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "9cb3cf9f", + "id": "b17cda2b", "metadata": {}, "source": [ "### Text Font as an Array - Styling Each Text Element" @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "deb68aa3", + "id": "5fce03a5", "metadata": {}, "outputs": [], "source": [ @@ -852,7 +852,7 @@ }, { "cell_type": "markdown", - "id": "c01d0901", + "id": "bc931314", "metadata": {}, "source": [ "### HTML Tags in Text\n", @@ -864,7 +864,7 @@ { "cell_type": "code", "execution_count": null, - "id": "deece94f", + "id": "076588ed", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "3236ebac", + "id": "60d0b2f6", "metadata": {}, "source": [ "### Positioning Text Annotations Absolutely\n", @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fe38ac9", + "id": "e5547317", "metadata": {}, "outputs": [], "source": [ @@ -941,7 +941,7 @@ }, { "cell_type": "markdown", - "id": "249a87d1", + "id": "4c1c8944", "metadata": {}, "source": [ "### Adding Annotations Referenced to an Axis\n", @@ -954,7 +954,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3edb8638", + "id": "20f1e49b", "metadata": {}, "outputs": [], "source": [ @@ -983,7 +983,7 @@ }, { "cell_type": "markdown", - "id": "566f80aa", + "id": "73c9a18f", "metadata": {}, "source": [ "### Specifying the Text's Position Absolutely\n", @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7e401cf", + "id": "4cafae43", "metadata": { "lines_to_next_cell": 0 }, @@ -1031,7 +1031,7 @@ }, { "cell_type": "markdown", - "id": "cf7a1cb7", + "id": "9c91d49a", "metadata": {}, "source": [ "### Specifying Source Lines or Figure Notes on the Bottom of a Figure\n", @@ -1042,7 +1042,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e17325c", + "id": "8b7ef8c0", "metadata": { "lines_to_next_cell": 2 }, @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "73ce6aef", + "id": "06e37336", "metadata": {}, "source": [ "### Customize Displayed Text with a Text Template\n", @@ -1123,7 +1123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f5a9d16", + "id": "5001b802", "metadata": {}, "outputs": [], "source": [ @@ -1140,7 +1140,7 @@ }, { "cell_type": "markdown", - "id": "5ce2dec0", + "id": "bd4fc980", "metadata": {}, "source": [ "### Customize Text Template\n", @@ -1151,7 +1151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed4d8f6b", + "id": "90d942fd", "metadata": {}, "outputs": [], "source": [ @@ -1173,7 +1173,7 @@ }, { "cell_type": "markdown", - "id": "89b49229", + "id": "603a1355", "metadata": {}, "source": [ "### Set Date in Text Template\n", @@ -1185,7 +1185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a884345", + "id": "a16e8550", "metadata": {}, "outputs": [], "source": [ @@ -1216,7 +1216,7 @@ }, { "cell_type": "markdown", - "id": "acc1cd33", + "id": "bf5d4c40", "metadata": {}, "source": [ "#### Reference\n", @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "f870b7b5", + "id": "ca2bfd68", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tick-formatting.ipynb b/tick-formatting.ipynb index 63ef256d8..13e4889cc 100644 --- a/tick-formatting.ipynb +++ b/tick-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "502eeef6", + "id": "ef6f5560", "metadata": {}, "source": [ "#### Tickmode - Linear" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "6d6ea4a6", + "id": "d5d2b521", "metadata": {}, "source": [ "If `\"linear\"`, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`" @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "639e474f", + "id": "c2cc18cd", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "7cd8e70d", + "id": "691bf3d9", "metadata": {}, "source": [ "#### Tickmode - Array" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "527381ab", + "id": "ad1b506d", "metadata": {}, "source": [ "If `\"array\"`, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bac5f06b", + "id": "99ac679e", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "0dba3555", + "id": "5e19c68e", "metadata": {}, "source": [ "### Dynamic tickmode in Dash\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa73c075", + "id": "cce1860b", "metadata": { "hide_code": true }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "fa9a3a61", + "id": "2f17d0e0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "542e6909", + "id": "cafa77ea", "metadata": {}, "source": [ "#### Using Tickformat Attribute" @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "2ed1314b", + "id": "ade2ef66", "metadata": {}, "source": [ "For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31264810", + "id": "a246959e", "metadata": {}, "outputs": [], "source": [ @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "cab516eb", + "id": "8e5d613f", "metadata": {}, "source": [ "#### Using Tickformat Attribute - Date/Time" @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "ed8c2b06", + "id": "ec27f283", "metadata": {}, "source": [ "For more date/time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bf6112f", + "id": "0e852715", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "0b571327", + "id": "262a9ddc", "metadata": {}, "source": [ "#### Using Exponentformat Attribute" @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d764027", + "id": "c891f2a8", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "5be9895f", + "id": "6d6be062", "metadata": {}, "source": [ "#### Tickformatstops to customize for different zoom levels" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a569595", + "id": "0f2d22e5", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "5314fab2", + "id": "ebca2abe", "metadata": {}, "source": [ "#### Placing ticks and gridlines between categories" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30479dc5", + "id": "4937b7f6", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "7bf6c166", + "id": "ef042a08", "metadata": {}, "source": [ "#### Reference\n", @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "14ef993a", + "id": "c3858adc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-county-choropleth.ipynb b/tile-county-choropleth.ipynb index 8b07e9f79..002a3c08b 100644 --- a/tile-county-choropleth.ipynb +++ b/tile-county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4fa1a23a", + "id": "a19211de", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **tile-map** choropleth maps, but you can also build [**outline** choropleth maps](/python/choropleth-maps).\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7103c5c7", + "id": "c4ba032a", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "83406c5a", + "id": "ae7e3a3c", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44e88fbf", + "id": "7a8a8a2a", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "21f21910", + "id": "3652f2d4", "metadata": {}, "source": [ "### Choropleth map using plotly.express and carto base map\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "030aa18e", + "id": "7bc33da9", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "487cf2bb", + "id": "72cb4cb0", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eec644a", + "id": "40278c4d", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "0dd675dc", + "id": "d4513db6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "014f553e", + "id": "b36bbdcc", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f8dc7fe", + "id": "76499e03", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "f9978f41", + "id": "0ca1ac44", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron." @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "688a36cc", + "id": "587a4cdd", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "8461f8a3", + "id": "3790d5b3", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "632b2498", + "id": "930f5cee", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "d3ab0e0f", + "id": "4135ce3a", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -239,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaffaa92", + "id": "96a990a8", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "aea85812", + "id": "3bd6ce6d", "metadata": {}, "source": [ "### Choropleth map using plotly.graph_objects and carto base map\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fce96bf", + "id": "022515df", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "b41de31b", + "id": "5c992a38", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68f7d1a1", + "id": "2dc7fdcd", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "a3214ece", + "id": "774e6aad", "metadata": {}, "source": [ "#### Reference\n", @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "af23ec8f", + "id": "b7be2e80", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-map-layers.ipynb b/tile-map-layers.ipynb index 63d2bed31..b07e62b30 100644 --- a/tile-map-layers.ipynb +++ b/tile-map-layers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c8ea616f", + "id": "2f6d065d", "metadata": {}, "source": [ "\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "888670b1", + "id": "b55c529f", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "1957bc6c", + "id": "01ad744e", "metadata": {}, "source": [ "#### Using `layout.map.layers` to Specify a Base Map\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f0e8e77", + "id": "6eb25b3e", "metadata": { "lines_to_next_cell": 2 }, @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "fdf96fd9", + "id": "a3e1f11f", "metadata": {}, "source": [ "#### Base Tiles from the USGS, radar overlay from Environment Canada\n", @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61d5d435", + "id": "da387b2d", "metadata": { "lines_to_next_cell": 2 }, @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "0dcb759f", + "id": "21cdcc80", "metadata": {}, "source": [ "#### Dark tiles example\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1f236e9", + "id": "a3d8bc01", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "db7af991", + "id": "2b90b85e", "metadata": {}, "source": [ "#### Stamen Watercolor using a Custom Style URL\n", @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "181407ee", + "id": "2feb5465", "metadata": {}, "source": [ "### Mapbox\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83ff65cc", + "id": "78de4c4b", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "81608fc0", + "id": "d720afb3", "metadata": {}, "source": [ "#### Using `layout.mapbox.layers` to Specify a Base Map\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "762201f5", + "id": "94def504", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "1ebdedaa", + "id": "3f384304", "metadata": {}, "source": [ "#### Dark tiles from Mapbox service: free token needed\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e81102ee", + "id": "f8094491", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "cf08733e", + "id": "0b99d154", "metadata": {}, "source": [ "## Setting Map Bounds\n", @@ -389,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "409239f8", + "id": "a6543e4c", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "c363d83d", + "id": "89cc6014", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "5eb4e6d3", + "id": "7dcfbe4b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-scatter-maps.ipynb b/tile-scatter-maps.ipynb index 5bc39e56f..76630d51f 100644 --- a/tile-scatter-maps.ipynb +++ b/tile-scatter-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "03bcc332", + "id": "0c009a86", "metadata": {}, "source": [ "### Basic example with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13df13b7", + "id": "2b7086f3", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "d5100a3f", + "id": "780c679b", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d9e5cb0", + "id": "b8c100b9", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "9f5becf4", + "id": "0a6a4258", "metadata": {}, "source": [ "#### Basic Example" @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc6e5d5e", + "id": "c8ab1398", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "073a65e9", + "id": "631ffb9e", "metadata": {}, "source": [ "#### Multiple Markers" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "841f8cb7", + "id": "3a24e808", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "7ba4a3e5", + "id": "b27859dc", "metadata": {}, "source": [ "#### Nuclear Waste Sites on Campuses" @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d770b6f4", + "id": "e1f06db3", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "0e58734e", + "id": "ed156521", "metadata": {}, "source": [ "### Set Marker Symbols\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9dfd676", + "id": "8f50a3ad", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "bb2c2d44", + "id": "5b7e75e0", "metadata": {}, "source": [ "#### Supported Symbols\n", @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "39a30fce", + "id": "d04112a1", "metadata": {}, "source": [ "#### Add Clusters\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d84eebf0", + "id": "6679512d", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "b76e7363", + "id": "4c5d9a7e", "metadata": {}, "source": [ "#### Font Customization\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b85f1a28", + "id": "4cd44a4f", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "aa2407be", + "id": "bf950155", "metadata": {}, "source": [ "`go.Scattermap` supports the following values for `textfont.family`:\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "24d59566", + "id": "ff60ce8a", "metadata": {}, "source": [ "##### Font Weight\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14f4a796", + "id": "1e54cb7c", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "5bb43aa2", + "id": "e328eaf7", "metadata": {}, "source": [ "## Mapbox Maps\n", @@ -422,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5848eac1", + "id": "41d756cd", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "094eb189", + "id": "7942ab4c", "metadata": {}, "source": [ "And here's an example using Graph Objects:" @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88efb673", + "id": "b39873cc", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "d0b741c6", + "id": "fc6d3249", "metadata": {}, "source": [ "#### Reference\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "d7d0434b", + "id": "431bcc2b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/time-series.ipynb b/time-series.ipynb index 89d62d135..292502146 100644 --- a/time-series.ipynb +++ b/time-series.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c1d8fe60", + "id": "65fdc069", "metadata": {}, "source": [ "### Time Series using Axes of type `date`\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcddd276", + "id": "41d73ef2", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5147e13a", + "id": "1c127dc3", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "c424c9fc", + "id": "4a8eff67", "metadata": {}, "source": [ "### Time Series in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1e70a02", + "id": "9b90f8e9", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "8c241572", + "id": "6c590597", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "87a6d815", + "id": "472ad0bd", "metadata": {}, "source": [ "### Different Chart Types on Date Axes\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6086e31c", + "id": "ca1aaa1b", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "84203786", + "id": "23a1a0e0", "metadata": {}, "source": [ "Or this [facetted](/python/facet-plots/) area plot:" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a27eb34", + "id": "578ac3f1", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "d2458448", + "id": "7b80cbe5", "metadata": {}, "source": [ "### Configuring Tick Labels\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e41e1dca", + "id": "07965925", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "617cd988", + "id": "f2c641fa", "metadata": {}, "source": [ "### Moving Tick Labels to the Middle of the Period\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13a82741", + "id": "eece2c1a", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "774aae5f", + "id": "63589d4a", "metadata": {}, "source": [ "### Adding Minor Ticks\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f601491", + "id": "6e6e6c5f", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "6ea695ed", + "id": "9fb86014", "metadata": {}, "source": [ "#### Monthly Period Labels With Weekly Minor Ticks\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df2d8f83", + "id": "58b1d996", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "a6869ebb", + "id": "618829fb", "metadata": {}, "source": [ "### Summarizing Time-series Data with Histograms\n", @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c745fb04", + "id": "1ba5894d", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "f2154219", + "id": "daf094e0", "metadata": {}, "source": [ "### Displaying Period Data\n", @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "799a38c7", + "id": "52c3c076", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "d4472744", + "id": "3dac8fcd", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08f82079", + "id": "359f7210", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "cf9d8d2a", + "id": "4f002be1", "metadata": { "tags": [] }, @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6349e6d7", + "id": "f1d28d6a", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7590a6ac", + "id": "edfc6e6b", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "793038cb", + "id": "55135977", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "ebcdb0e4", + "id": "0fb9cb28", "metadata": {}, "source": [ "### Time Series With Range Slider\n", @@ -485,7 +485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c33b700c", + "id": "bdc093a9", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ }, { "cell_type": "markdown", - "id": "9349c85e", + "id": "95b6867b", "metadata": {}, "source": [ "### Time Series with Range Selector Buttons\n", @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca7e0a47", + "id": "536d88ba", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "a85e348a", + "id": "8cb24d90", "metadata": {}, "source": [ "### Customizing Tick Label Formatting by Zoom Level\n", @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b995634", + "id": "26e64abc", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "fec7c85e", + "id": "c50e94b4", "metadata": {}, "source": [ "### Hiding Weekends and Holidays\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5fb6dad", + "id": "85323752", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1c8c5f6", + "id": "e7ae0247", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "6715a3ea", + "id": "9b6ba9eb", "metadata": {}, "source": [ "### Hiding Non-Business Hours\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "993814ea", + "id": "9d119dd9", "metadata": {}, "outputs": [], "source": [ @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f81eb7b2", + "id": "1b586e30", "metadata": { "lines_to_next_cell": 2 }, @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "8635df7a", + "id": "bed3786b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tree-plots.ipynb b/tree-plots.ipynb index e3f3ac8d7..88cf873db 100644 --- a/tree-plots.ipynb +++ b/tree-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7218d865", + "id": "b07381a5", "metadata": {}, "source": [ "#### Set Up Tree with [igraph](http://igraph.org/python/)\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19fe07f7", + "id": "67de56c9", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e397b2c7", + "id": "4dee1279", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "ccc630e1", + "id": "03f7c322", "metadata": {}, "source": [ "#### Create Plotly Traces" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "203bed6d", + "id": "b1220d60", "metadata": {}, "outputs": [], "source": [ @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "bc7c8c7e", + "id": "e2368d07", "metadata": {}, "source": [ "#### Create Text Inside the Circle via Annotations" @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "740963e7", + "id": "ff5a14d9", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "9850f897", + "id": "ccfcff20", "metadata": {}, "source": [ "#### Add Axis Specifications and Create the Layout" @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9774c47", + "id": "0264f4b6", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "9bc3b51d", + "id": "019ac631", "metadata": {}, "source": [ "#### Reference\n", @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "81ba7a18", + "id": "6ce74625", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/treemaps.ipynb b/treemaps.ipynb index 77e690fb4..448b66cf3 100644 --- a/treemaps.ipynb +++ b/treemaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b89eb3b7", + "id": "9be7933d", "metadata": {}, "source": [ "[Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. The input data format is the same as for [Sunburst Charts](https://plotly.com/python/sunburst-charts/) and [Icicle Charts](https://plotly.com/python/icicle-charts/): the hierarchy is defined by [labels](https://plotly.com/python/reference/treemap/#treemap-labels) (`names` for `px.treemap`) and [parents](https://plotly.com/python/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23662f0c", + "id": "68d29008", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "943fe452", + "id": "11096fb9", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with plotly.express\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "762bdaf2", + "id": "fba975d7", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "ca4f025d", + "id": "c8066a7d", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with continuous color argument in px.treemap\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fed21a1", + "id": "619231b4", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "a27a2d2d", + "id": "34d5205a", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with discrete color argument in px.treemap\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b41bb82d", + "id": "ef2bb1a3", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "fbf19bf2", + "id": "076f8ba8", "metadata": {}, "source": [ "In the example below the color of Saturday and Sunday sectors is the same as Dinner because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c0a783e", + "id": "2c8fada5", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "305f983e", + "id": "284dfdbf", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a19c30d9", + "id": "265dd729", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "93d98d02", + "id": "7a4478ea", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c17aead", + "id": "cd76b177", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "4e450570", + "id": "c85b8d26", "metadata": {}, "source": [ "### Treemap with Rounded Corners" @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "baee977e", + "id": "0c08043c", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b379b588", + "id": "7083ae73", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "5fce027c", + "id": "8b21c1cb", "metadata": {}, "source": [ "### Basic Treemap with go.Treemap\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f0c28eb", + "id": "6486de07", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "26e15d91", + "id": "ef5017e2", "metadata": {}, "source": [ "### Set Different Attributes in Treemap\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92fde0c1", + "id": "1166f620", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "c49ad348", + "id": "37395be1", "metadata": {}, "source": [ "### Set Color of Treemap Sectors\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6dc2e6b", + "id": "0c1e729d", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "178808a7", + "id": "983b1c82", "metadata": {}, "source": [ "This example uses `treemapcolorway` attribute, which should be set in layout." @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22f2525b", + "id": "a0d2236e", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ba15522", + "id": "3f74400c", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "bb1e35af", + "id": "d324c299", "metadata": {}, "source": [ "### Treemap chart with a continuous colorscale\n", @@ -428,7 +428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77c8f9e3", + "id": "4dcdb592", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "81bfea48", + "id": "8fbd19cb", "metadata": {}, "source": [ "### Nested Layers in Treemap\n", @@ -519,7 +519,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44a2f343", + "id": "fd9c2f8a", "metadata": {}, "outputs": [], "source": [ @@ -546,7 +546,7 @@ }, { "cell_type": "markdown", - "id": "2e9414d5", + "id": "52a652be", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -559,7 +559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cface09", + "id": "70b2e509", "metadata": {}, "outputs": [], "source": [ @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "b10dc8b4", + "id": "d6827edf", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2717779", + "id": "6725565f", "metadata": {}, "outputs": [], "source": [ @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "25e516f8", + "id": "a83c0e04", "metadata": {}, "source": [ "#### Reference\n", @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "792fd093", + "id": "5ce6e160", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/trisurf.ipynb b/trisurf.ipynb index 1167b60e6..e9118c278 100644 --- a/trisurf.ipynb +++ b/trisurf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "64bb9067", + "id": "03ef749c", "metadata": {}, "source": [ "Trisurf plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e204ed0", + "id": "5b1586e9", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "5525fc66", + "id": "40fec822", "metadata": {}, "source": [ "#### Mobius Band\n" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b87d1929", + "id": "d4bc4d6f", "metadata": { "lines_to_next_cell": 2 }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "f0499a1a", + "id": "30c6b7c5", "metadata": {}, "source": [ "#### Boy's Surface\n" @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "093b13bb", + "id": "d9a22ab7", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "fb7fada0", + "id": "a3bb3280", "metadata": {}, "source": [ "#### Reference\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "3efcca27", + "id": "ae19e905", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index 811437d96..fca562682 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c705e3af", + "id": "45b35974", "metadata": {}, "source": [ "### Version Problems\n", @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "791baf02", + "id": "51ac2ce7", "metadata": { "hide_code": true }, @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "3765adb2", + "id": "c1563a04", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "506edd27", + "id": "e3fa1a1b", "metadata": {}, "source": [ "### VSCode Notebook, Nteract and Streamlit Problems\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "14bd6ae9", + "id": "bb6f8628", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v4-migration.ipynb b/v4-migration.ipynb index f42148635..965d5bf9a 100644 --- a/v4-migration.ipynb +++ b/v4-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ebd7aad3", + "id": "cff773df", "metadata": {}, "source": [ "### Upgrading to Version 4\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "986e773a", + "id": "68d67289", "metadata": {}, "source": [ "### Online features (`plotly.plotly`) moved to `chart-studio` package\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "19008902", + "id": "1f791ee9", "metadata": {}, "source": [ "### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export\n", @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "d77f2377", + "id": "f60e1a51", "metadata": {}, "source": [ "### New default theme\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2b020d3", + "id": "7465cde8", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "4e335447", + "id": "8f8c083d", "metadata": {}, "source": [ "You can revert to the version 3 figure appearance by disabling the default theme as follows:" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86207d4a", + "id": "3413f9bb", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "378bf235", + "id": "bc73278f", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "fc9011f8", + "id": "2031fbc4", "metadata": {}, "source": [ "See [Theming and templates](/python/templates) for more information on theming in plotly.py version 4.\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05323e90", + "id": "1b0b86c0", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "341c5dec", + "id": "beb799d8", "metadata": {}, "source": [ "Code that relied on the `add_*` methods to return a reference to the newly created trace will need to be updated to access the trace from the returned figure. This can be done by appending `.data[-1]` to the add trace expression.\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "85a15b2b", + "id": "76bcd1fc", "metadata": {}, "source": [ "### `make_subplots` updates\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06c3998b", + "id": "39533a60", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "1a1ec486", + "id": "baefbf58", "metadata": {}, "source": [ "And here is the equivalent, version 4 example. Note how the order to the height list is reversed compared to the example above." @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f125e022", + "id": "16128fcd", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "aecfe60e", + "id": "faab75f5", "metadata": {}, "source": [ "#### Implementation of shared axes with `make_subplots`\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7727adc", + "id": "7fb7e581", "metadata": {}, "outputs": [], "source": [ @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "34568d77", + "id": "43de88f3", "metadata": {}, "source": [ "### Trace UIDs\n", @@ -339,7 +339,7 @@ }, { "cell_type": "markdown", - "id": "abc8d1f1", + "id": "e8907f4c", "metadata": {}, "source": [ "### Headless image export on Linux with Xvfb.\n", @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "9e39b8c6", + "id": "edd1a580", "metadata": {}, "source": [ "### Removals\n", @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "cdd0a716", + "id": "fdbe9fdb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v6-changes.ipynb b/v6-changes.ipynb index 3283d32cf..b0039d8b3 100644 --- a/v6-changes.ipynb +++ b/v6-changes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "03f30ee2", + "id": "f47621ed", "metadata": {}, "source": [ "This page outlines the changes in Plotly.py version 6 and cases where you may need to update your charts or tools that you use for working with Plotly.py." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "daf8b584", + "id": "9f93828b", "metadata": {}, "source": [ "## Jupyter Notebook Support\n", @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "4adcb150", + "id": "04c527ab", "metadata": { "lines_to_next_cell": 2 }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "5ba81203", + "id": "9a099758", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/violin.ipynb b/violin.ipynb index c583c12ab..f83e724e6 100644 --- a/violin.ipynb +++ b/violin.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "af0f4cdd", + "id": "21245198", "metadata": {}, "source": [ "## Violin Plot with Plotly Express\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68bf9b7a", + "id": "7bdb5f73", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "b00ebc46", + "id": "fd6586ac", "metadata": {}, "source": [ "### Violin plot with box and data points" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f700c333", + "id": "91ebd928", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "f02c24e6", + "id": "680073b4", "metadata": {}, "source": [ "### Multiple Violin Plots" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b64345dd", + "id": "ae0830fe", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2c6bf88", + "id": "68653613", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "27e9e209", + "id": "95269924", "metadata": {}, "source": [ "## Violin Plot with go.Violin\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06b80c8e", + "id": "dcbe9b32", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "ab012f5c", + "id": "d420d202", "metadata": {}, "source": [ "#### Multiple Traces" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd7b0a21", + "id": "f704eb5f", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "d33ee8a9", + "id": "ac358061", "metadata": {}, "source": [ "#### Grouped Violin Plot" @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6638ed21", + "id": "c6149019", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "b600a6dc", + "id": "a22935c6", "metadata": {}, "source": [ "#### Split Violin Plot" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8722368b", + "id": "f18e00f2", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "b41e4107", + "id": "40e6f19e", "metadata": {}, "source": [ "#### Advanced Violin Plot" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8db6010a", + "id": "907ef779", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "d75f6e89", + "id": "b9c92b2c", "metadata": {}, "source": [ "#### Ridgeline plot\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "454d415e", + "id": "fb95e6ec", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "111c96df", + "id": "70ee112a", "metadata": {}, "source": [ "### Violin Plot With Only Points\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d68b9e30", + "id": "5fc16577", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "1db9a963", + "id": "b8c7905d", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd5c2338", + "id": "64f1f3c4", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "f9d9fd16", + "id": "06f56267", "metadata": {}, "source": [ "#### Reference\n", @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "d8a95ae0", + "id": "9fdb26e9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/waterfall-charts.ipynb b/waterfall-charts.ipynb index 769d42cc4..7bc3ecea7 100644 --- a/waterfall-charts.ipynb +++ b/waterfall-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5fe656d9", + "id": "dc36d0db", "metadata": {}, "source": [ "### Simple Waterfall Chart" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94093757", + "id": "72f90692", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "2ecc95da", + "id": "2ee70d63", "metadata": {}, "source": [ "### Multi Category Waterfall Chart\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b37fa8fb", + "id": "f8eb81e0", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "b03c6ebf", + "id": "17473b76", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00a92a5d", + "id": "b0d82300", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "14a095f3", + "id": "8e327872", "metadata": {}, "source": [ "### Horizontal Waterfall Chart" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "359261eb", + "id": "4946aa55", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "1431c71f", + "id": "b97a0f0c", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "567d292e", + "id": "26cbd544", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wide-form.ipynb b/wide-form.ipynb index c43a3e52c..1d29960a0 100644 --- a/wide-form.ipynb +++ b/wide-form.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3e6d080a", + "id": "f5d53cf5", "metadata": {}, "source": [ "### Plotly Express works with Column-oriented, Matrix or Geographic Data\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f41137ee", + "id": "43040160", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da17b8e1", + "id": "059848e2", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "fd8b621f", + "id": "c017b448", "metadata": {}, "source": [ "Plotly Express can produce **the same plot from either form**. For the long-form input, `x` and `y` are set to the respective column names." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d1772b0", + "id": "9f8c4f4d", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "3b335e6f", + "id": "3dfb1316", "metadata": {}, "source": [ "For the wide-form input, we **pass in a list of column-names `y`**, which is enough to trigger the wide-form processing mode. Wide-form mode is also the default if neither `x` nor `y` are specified, see section at bottom regarding Wide-Form Defaults." @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8f7fe5d", + "id": "d947ae34", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "09f6cad7", + "id": "07b21109", "metadata": {}, "source": [ "### Labeling axes, legends and hover text\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a540b34", + "id": "c6bacec5", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "cff7797b", + "id": "12e6577e", "metadata": {}, "source": [ "Plotly Express figures created using wide-form data can be [styled just like any other Plotly Express figure](/python/styling-plotly-express/):" @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2374dd54", + "id": "6debfc94", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "e24606e4", + "id": "b15e9795", "metadata": {}, "source": [ "### Data Frames with Named Indexes\n", @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b22a1ab4", + "id": "ba0e50bc", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "1c237947", + "id": "fe90e5d9", "metadata": {}, "source": [ "When working with a data frame like the one above, you can pass the index references directly as arguments, to benefit from automatic labelling for everything except the y axis label, which will default to \"values\", but this can be overridden with the `labels` argument as above:" @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd7d9b8c", + "id": "09bb88d5", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "784957e9", + "id": "255a4a62", "metadata": {}, "source": [ "If you transpose `x` and `y`, thereby assigning the columns to `x`, the orientation will be switched to horizontal:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4115129d", + "id": "acbca779", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "554ae50e", + "id": "33b2daec", "metadata": {}, "source": [ "### Assigning Inferred Columns to Non-Default Arguments" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "1832051f", + "id": "89ac4ddb", "metadata": {}, "source": [ "In the examples above, the columns of the wide data frame are assigned by default as an \"inferred\" column named `variable` to the `color` argument (see section below for documentation of the default behaviours), but this is not a hard constraint. The `variable` column can be assigned to any Plotly Express argument, for example to accomplish faceting, and `color` can be reassigned to any other value. More generally, when plotting with a data frame without named indexes, you can reassign the inferred column named `variable` and `value` to any argument:" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae939c9", + "id": "195aff7b", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "aeea3033", + "id": "deecf726", "metadata": {}, "source": [ "You can also prevent `color` from getting assigned if you're mapping `variable` to some other argument:" @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7efb51d", + "id": "8f7e6851", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "8dbf16a2", + "id": "6d840087", "metadata": {}, "source": [ "If using a data frame's named indexes, either explicitly or relying on the defaults, the row-index references (i.e. `df.index`) or column-index names (i.e. the value of `df.columns.name`) must be used:" @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d8c1ffa", + "id": "d55cd472", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "595f93df", + "id": "3975e276", "metadata": {}, "source": [ "### Mixed-Form Data\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e85acb8", + "id": "3c56bef3", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "119d9daf", + "id": "ce79a40f", "metadata": {}, "source": [ "We can visualize just the wide-form portion of the data frame easily with a [violin chart](/python/violin/). As a special note, we'll assign the index, which is the participant ID, to the `hover_data`, so that hovering over outlier points will identify their row." @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35109b16", + "id": "d4658725", "metadata": { "lines_to_next_cell": 0 }, @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "bea63b6b", + "id": "e0af5451", "metadata": {}, "source": [ "\n" @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "041f5f73", + "id": "294a4cfa", "metadata": {}, "source": [ "We are not limited to visualizing only the wide-form portion of the data, however. We can also leverage the long-form portion of the data frame, for example to color by participant `gender` and facet by participant `group`, all without having to manipulate the data frame:" @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ccfe629", + "id": "b9f67b63", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "dcbf5e77", + "id": "c4e19a1a", "metadata": {}, "source": [ "In the plots above, the column names provided to `y` are internally mapped to long-form column called `variable`, as is apparent in the x-axis labels. We can reassign `variable` to another argument as well, in this case we'll assign it to `facet_col` and reassign `group` to the `x` axis. We'll switch to a [box plot](/python/box-plots/) for variety." @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93980fd5", + "id": "9811f392", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ }, { "cell_type": "markdown", - "id": "41111ca4", + "id": "ca673068", "metadata": {}, "source": [ "One interesting thing about a mixed-form data frame like this is that it remains easy to plot, say, one experiment against another, which would require some preliminary data wrangling if this was represented as a pure long-form dataset:" @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a055110e", + "id": "ed433aee", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "9710427f", + "id": "1e59fa9d", "metadata": {}, "source": [ "In fact, we can even visualize the results of every experiment against every other, using a [scatterplot matrix](/python/splom/):" @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05074149", + "id": "7c4905ad", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "7614920d", + "id": "cef5ecd0", "metadata": {}, "source": [ "### Wide-Form Defaults\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ec4466b", + "id": "3c398f1b", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3587e3ab", + "id": "571e3a9f", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "ad02f898", + "id": "ce83da68", "metadata": {}, "source": [ "### Orientation Control When Using Defaults\n", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60dc86f3", + "id": "4ab7c1d7", "metadata": { "lines_to_next_cell": 2 }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "44b4f0ab", + "id": "92f6db25", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wind-rose-charts.ipynb b/wind-rose-charts.ipynb index bba9f72ff..95af7aa5f 100644 --- a/wind-rose-charts.ipynb +++ b/wind-rose-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "13994026", + "id": "f1f74723", "metadata": {}, "source": [ "### Wind Rose Chart with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8958549a", + "id": "733fadd2", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "b29cb588", + "id": "e08af226", "metadata": {}, "source": [ "#### Basic Wind Rose Chart" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d5a195e", + "id": "0af277b3", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "5edc2342", + "id": "8279b04e", "metadata": {}, "source": [ "#### Reference\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "730a4439", + "id": "5cd22a7e", "metadata": {}, "source": [ "### What About Dash?\n", From 26ede4ff6056eee47a37557d28c98dfd254e8747 Mon Sep 17 00:00:00 2001 From: plotlydocbot Date: Tue, 17 Mar 2026 14:38:01 +0000 Subject: [PATCH 4/5] build of https://github.com/plotly/plotly.py/commit/3ae60745cb033cdab1e84268b0662938dbda1ccb --- 2D-Histogram.ipynb | 50 +++--- 2d-histogram-contour.ipynb | 40 ++--- 3d-axes.ipynb | 30 ++-- 3d-bubble-charts.ipynb | 20 +-- 3d-camera-controls.ipynb | 44 ++--- 3d-isosurface-plots.ipynb | 36 ++-- 3d-line-plots.ipynb | 14 +- 3d-mesh.ipynb | 32 ++-- 3d-scatter-plots.ipynb | 30 ++-- 3d-subplots.ipynb | 10 +- 3d-surface-plots.ipynb | 32 ++-- 3d-volume.ipynb | 30 ++-- LaTeX.ipynb | 8 +- animations.ipynb | 36 ++-- annotated-heatmap.ipynb | 40 ++--- axes.ipynb | 212 ++++++++++++------------ bar-charts.ipynb | 164 +++++++++--------- bio-alignment-chart.ipynb | 10 +- bio-clustergram.ipynb | 18 +- bio-manhattanplot.ipynb | 14 +- bio-volcano-plot.ipynb | 14 +- box-plots.ipynb | 86 +++++----- bubble-charts.ipynb | 32 ++-- bubble-maps.ipynb | 20 +-- builtin-colorscales.ipynb | 28 ++-- bullet-charts.ipynb | 22 +-- candlestick-charts.ipynb | 30 ++-- carpet-contour.ipynb | 16 +- carpet-plot.ipynb | 32 ++-- carpet-scatter.ipynb | 18 +- categorical-axes.ipynb | 48 +++--- choropleth-maps.ipynb | 62 +++---- click-events.ipynb | 14 +- colorscales.ipynb | 124 +++++++------- cone-plot.ipynb | 24 +-- configuration-options.ipynb | 60 +++---- continuous-error-bars.ipynb | 10 +- contour-plots.ipynb | 60 +++---- county-choropleth.ipynb | 42 ++--- creating-and-updating-figures.ipynb | 128 +++++++------- custom-buttons.ipynb | 24 +-- dash.ipynb | 4 +- dendrogram.ipynb | 20 +-- density-heatmaps.ipynb | 16 +- discrete-color.ipynb | 66 ++++---- distplot.ipynb | 58 +++---- dot-plots.ipynb | 16 +- dropdowns.ipynb | 26 +-- dumbbell-plots.ipynb | 12 +- ecdf-plots.ipynb | 56 +++---- error-bars.ipynb | 40 ++--- facet-plots.ipynb | 52 +++--- figure-factories.ipynb | 4 +- figure-factory-subplots.ipynb | 26 +-- figure-factory-table.ipynb | 42 ++--- figure-introspection.ipynb | 58 +++---- figure-labels.ipynb | 40 ++--- figure-structure.ipynb | 18 +- figurewidget-app.ipynb | 34 ++-- figurewidget.ipynb | 42 ++--- filled-area-plots.ipynb | 46 ++--- filled-area-tile-maps.ipynb | 18 +- funnel-charts.ipynb | 44 ++--- gantt.ipynb | 34 ++-- gauge-charts.ipynb | 16 +- getting-started.ipynb | 30 ++-- graph-objects.ipynb | 8 +- graphing-multiple-chart-types.ipynb | 26 +-- heatmaps.ipynb | 56 +++---- hexbin-mapbox.ipynb | 28 ++-- histograms.ipynb | 118 ++++++------- horizontal-bar-charts.ipynb | 36 ++-- horizontal-vertical-shapes.ipynb | 36 ++-- hover-text-and-formatting.ipynb | 88 +++++----- icicle-charts.ipynb | 86 +++++----- images.ipynb | 28 ++-- imshow.ipynb | 114 ++++++------- indicator.ipynb | 36 ++-- interactive-html-export.ipynb | 20 +-- ipython-vs-python.ipynb | 16 +- jupyter-lab-tools.ipynb | 12 +- legend.ipynb | 120 +++++++------- line-and-scatter.ipynb | 120 +++++++------- line-charts.ipynb | 70 ++++---- linear-fits.ipynb | 54 +++--- lines-on-maps.ipynb | 28 ++-- lines-on-tile-maps.ipynb | 20 +-- location-mode.ipynb | 28 ++-- log-plot.ipynb | 28 ++-- map-configuration.ipynb | 46 ++--- map-subplots-and-small-multiples.ipynb | 8 +- marginal-plots.ipynb | 28 ++-- marker-style.ipynb | 64 +++---- migrate-to-maplibre.ipynb | 4 +- mixed-subplots.ipynb | 10 +- ml-knn.ipynb | 34 ++-- ml-pca.ipynb | 38 ++--- ml-regression.ipynb | 64 +++---- ml-roc-pr.ipynb | 30 ++-- ml-tsne-umap-projections.ipynb | 28 ++-- ml_apps.ipynb | 4 +- multiple-axes.ipynb | 38 ++--- network-graphs.ipynb | 28 ++-- ohlc-charts.ipynb | 28 ++-- orca-management.ipynb | 56 +++---- pandas-backend.ipynb | 40 ++--- parallel-categories-diagram.ipynb | 32 ++-- parallel-coordinates-plot.ipynb | 30 ++-- pattern-hatching-texture.ipynb | 40 ++--- peak-finding.ipynb | 18 +- performance.ipynb | 30 ++-- pie-charts.ipynb | 72 ++++---- plot-data-from-csv.ipynb | 22 +-- plotly-express.ipynb | 154 ++++++++--------- polar-chart.ipynb | 52 +++--- px-arguments.ipynb | 70 ++++---- quiver-plots.ipynb | 12 +- radar-chart.ipynb | 20 +-- random-walk.ipynb | 18 +- range-slider.ipynb | 12 +- renderers.ipynb | 56 +++---- sankey-diagram.ipynb | 46 ++--- scatter-plots-on-maps.ipynb | 28 ++-- selections.ipynb | 46 ++--- setting-graph-size.ipynb | 30 ++-- shapes.ipynb | 134 +++++++-------- sliders.ipynb | 14 +- smith-charts.ipynb | 16 +- smoothing.ipynb | 14 +- splom.ipynb | 42 ++--- static-image-export.ipynb | 34 ++-- static-image-generation-migration.ipynb | 4 +- streamline-plots.ipynb | 14 +- streamtube-plot.ipynb | 20 +-- strip-charts.ipynb | 12 +- styling-plotly-express.ipynb | 22 +-- subplots.ipynb | 90 +++++----- sunburst-charts.ipynb | 64 +++---- supported-colors.ipynb | 10 +- table-subplots.ipynb | 8 +- table.ipynb | 38 ++--- templates.ipynb | 68 ++++---- ternary-contour.ipynb | 28 ++-- ternary-plots.ipynb | 16 +- ternary-scatter-contour.ipynb | 16 +- text-and-annotations.ipynb | 114 ++++++------- tick-formatting.ipynb | 46 ++--- tile-county-choropleth.ipynb | 46 ++--- tile-map-layers.ipynb | 38 ++--- tile-scatter-maps.ipynb | 52 +++--- time-series.ipynb | 82 ++++----- tree-plots.ipynb | 22 +-- treemaps.ipynb | 72 ++++---- trisurf.ipynb | 16 +- troubleshooting.ipynb | 10 +- v4-migration.ipynb | 42 ++--- v6-changes.ipynb | 8 +- violin.ipynb | 50 +++--- waterfall-charts.ipynb | 20 +-- wide-form.ipynb | 86 +++++----- wind-rose-charts.ipynb | 12 +- 161 files changed, 3237 insertions(+), 3237 deletions(-) diff --git a/2D-Histogram.ipynb b/2D-Histogram.ipynb index 73c44d520..62c15b525 100644 --- a/2D-Histogram.ipynb +++ b/2D-Histogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d9662818", + "id": "283f1535", "metadata": {}, "source": [ "## 2D Histograms or Density Heatmaps\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8aeeab75", + "id": "0da01d9f", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "24279572", + "id": "004bbdfd", "metadata": {}, "source": [ "The number of bins can be controlled with `nbinsx` and `nbinsy` and the [color scale](/python/colorscales/) with `color_continuous_scale`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ce43d40", + "id": "a2de46db", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "f4a1f145", + "id": "c88ab680", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c74f195", + "id": "b3c8a788", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "759688e7", + "id": "d1373adb", "metadata": {}, "source": [ "Density heatmaps can also be [faceted](/python/facet-plots/):" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0cf28f4", + "id": "134f2c2c", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "32dbaa04", + "id": "f3a390a7", "metadata": {}, "source": [ "### Displaying Text\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f9ccf60", + "id": "84fc00c9", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "d8790d38", + "id": "a0c34287", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e71f295", + "id": "fae6bb31", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "6d06dec7", + "id": "0e63ea0f", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "8a06bfc8", + "id": "15d6a11a", "metadata": {}, "source": [ "### 2D Histogram of a Bivariate Normal Distribution ###" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ff9e32b", + "id": "05952a34", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "cd0fb562", + "id": "139724c4", "metadata": {}, "source": [ "### 2D Histogram Binning and Styling Options ###" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d648bdb5", + "id": "9707cf46", "metadata": { "lines_to_next_cell": 0 }, @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "e21406de", + "id": "6f0071ac", "metadata": {}, "source": [ "### Sharing bin settings between 2D Histograms\n", @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e27b0791", + "id": "2493f671", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "85721272", + "id": "48d3d457", "metadata": {}, "source": [ "### 2D Histogram Overlaid with a Scatter Chart ###" @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21637adf", + "id": "94dfc28a", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ }, { "cell_type": "markdown", - "id": "1e7fe704", + "id": "647b2a1c", "metadata": {}, "source": [ "### Text on 2D Histogram Points\n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ce447a2", + "id": "6ac65e04", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "a665e30b", + "id": "4a49fa94", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "334bf9ec", + "id": "23bcfb09", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/2d-histogram-contour.ipynb b/2d-histogram-contour.ipynb index 91e10cfe0..93ecaf14d 100644 --- a/2d-histogram-contour.ipynb +++ b/2d-histogram-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6825575e", + "id": "a6c95d16", "metadata": {}, "source": [ "## 2D Histogram Contours or Density Contours\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42610ab1", + "id": "f17c7683", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "1c9da593", + "id": "3f7cd471", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b26d79d6", + "id": "4f1b445d", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "85da1750", + "id": "96697c3a", "metadata": {}, "source": [ "Density contours can also be [faceted](/python/facet-plots/) and [discretely colored](/python/discrete-color/):" @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bb5a207", + "id": "d72b0f19", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "be715338", + "id": "caf6f590", "metadata": {}, "source": [ "Plotly Express density contours can be [continuously-colored](/python/colorscales/) and labeled:" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ea3d080", + "id": "43f760e4", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "5bbb92ce", + "id": "0b8abcc7", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e35a741", + "id": "7ad43618", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "09ced9b3", + "id": "88ec2452", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "031e7f02", + "id": "c0eaef30", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "e74df09c", + "id": "1a3b1496", "metadata": {}, "source": [ "#### 2D Histogram Contour Colorscale" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d66653f9", + "id": "901efd9e", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "7431239d", + "id": "8deee350", "metadata": {}, "source": [ "#### 2D Histogram Contour Styled" @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8d9c52a", + "id": "839bafa3", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "503c867f", + "id": "ae91c7d6", "metadata": {}, "source": [ "#### 2D Histogram Contour Subplot" @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe1f2887", + "id": "f9db0ce8", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "ee80390e", + "id": "9e467e14", "metadata": {}, "source": [ "#### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "eb75bc89", + "id": "33bbfed2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-axes.ipynb b/3d-axes.ipynb index 110ef9185..7032632a9 100644 --- a/3d-axes.ipynb +++ b/3d-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "df3b7a74", + "id": "00649bcf", "metadata": {}, "source": [ "### Range of axes\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d1a5c68", + "id": "f80cc892", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "471a7ad8", + "id": "234916b0", "metadata": {}, "source": [ "### Setting only a Lower or Upper Bound for Range\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36d18e94", + "id": "3d3ac42b", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "2b632731", + "id": "39501e98", "metadata": {}, "source": [ "### Fixed Ratio Axes" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e04184be", + "id": "127ab655", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "42a619e2", + "id": "06991bf1", "metadata": {}, "source": [ "### Set Axes Title" @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c74c8e06", + "id": "80adc66b", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "cc34f350", + "id": "58d3e8e4", "metadata": {}, "source": [ "### Ticks Formatting" @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e8494ec", + "id": "b8bfdb45", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "20cd3168", + "id": "360ab307", "metadata": {}, "source": [ "### Background and Grid Color" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86bea75d", + "id": "f5764a8b", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "dc8ad68f", + "id": "ee1d34b7", "metadata": {}, "source": [ "### Disabling tooltip spikes\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad10239e", + "id": "f39b6833", "metadata": { "lines_to_next_cell": 2 }, @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "00491ad8", + "id": "9a2aa225", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-bubble-charts.ipynb b/3d-bubble-charts.ipynb index d8730b0fa..5207066ab 100644 --- a/3d-bubble-charts.ipynb +++ b/3d-bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9928e3bf", + "id": "0b6654cd", "metadata": {}, "source": [ "### 3d Bubble chart with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f92ca76", + "id": "1dcc78d6", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "a15b648c", + "id": "c2d1fd23", "metadata": {}, "source": [ "#### Simple Bubble Chart" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eb6b6fe", + "id": "2bac4920", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "ba967f03", + "id": "00f57c49", "metadata": {}, "source": [ "#### Bubble Chart Sized by a Variable\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a955129c", + "id": "399ce45d", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "0d3b85ec", + "id": "27ae793b", "metadata": {}, "source": [ "#### Edit the Colorbar\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d54e1e1", + "id": "65b01c86", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "a40ee5d1", + "id": "38e24816", "metadata": {}, "source": [ "#### Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "9db0b825", + "id": "4e489cd3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-camera-controls.ipynb b/3d-camera-controls.ipynb index aef6804d5..860b0b226 100644 --- a/3d-camera-controls.ipynb +++ b/3d-camera-controls.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "681d835e", + "id": "1fea1b96", "metadata": {}, "source": [ "### How camera controls work\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "27486ec3", + "id": "b5ceddaa", "metadata": {}, "source": [ "### Default parameters" @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8162a4fb", + "id": "c7ab607a", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "50b9bd6c", + "id": "6d3c3879", "metadata": {}, "source": [ "### Changing the camera position by setting the eye parameter\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82c95e8e", + "id": "8abfa1ae", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "4b85863c", + "id": "5f6ebf62", "metadata": {}, "source": [ "#### X-Z plane\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7e1bdc4", + "id": "d72f548b", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "b2a55645", + "id": "d64da51c", "metadata": {}, "source": [ "#### Y-Z plane" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c74a950e", + "id": "0231b88f", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "eb7754a5", + "id": "2eb3a1fa", "metadata": {}, "source": [ "#### View from Above (X-Y plane)" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a7d1b30", + "id": "b9b6f548", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "363e8569", + "id": "291ed18f", "metadata": {}, "source": [ "#### Zooming In\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f81f667e", + "id": "7aae3d44", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "b08b4b3f", + "id": "8f9d42f0", "metadata": {}, "source": [ "### Tilting the camera vertical by setting the up parameter\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cdcb84a", + "id": "5136cb1f", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "79078b06", + "id": "aba6f276", "metadata": {}, "source": [ "Note when `up` does not correspond to the direction of an axis, you also need to set `layout.scene.dragmode='orbit'`." @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dbc67cb", + "id": "b997f4f2", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "74cbb42d", + "id": "e7dc9edc", "metadata": {}, "source": [ "### Changing the focal point by setting center\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c555b219", + "id": "20d0e79f", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "b5329beb", + "id": "a27f5721", "metadata": {}, "source": [ "#### Reference" @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "25585e1e", + "id": "44e03913", "metadata": {}, "source": [ "See https://plotly.com/python/reference/layout/scene/#layout-scene-camera for more information and chart attribute options!" @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "89209a76", + "id": "35bc9f9a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-isosurface-plots.ipynb b/3d-isosurface-plots.ipynb index 910554dbb..e190adb95 100644 --- a/3d-isosurface-plots.ipynb +++ b/3d-isosurface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "779b1777", + "id": "e530519a", "metadata": {}, "source": [ "With ``go.Isosurface``, you can plot [isosurface contours](https://en.wikipedia.org/wiki/Isosurface) of a scalar field ``value``, which is defined on ``x``, ``y`` and ``z`` coordinates.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62f08015", + "id": "505d73fb", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "b7657d42", + "id": "00a82080", "metadata": {}, "source": [ "### Removing caps when visualizing isosurfaces\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3a9f81c", + "id": "58cc2cb0", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "1fff0b13", + "id": "1e905fc9", "metadata": {}, "source": [ "### Modifying the number of isosurfaces" @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a714cc0", + "id": "bfa52dc4", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "51d29b6f", + "id": "3067b85e", "metadata": {}, "source": [ "### Changing the opacity of isosurfaces" @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab7a4d8d", + "id": "99aa5cdc", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "c52b06a3", + "id": "9eee1031", "metadata": {}, "source": [ "#### Isosurface with Additional Slices\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14996338", + "id": "4bef0793", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "4b2661c1", + "id": "b69d75b6", "metadata": {}, "source": [ "#### Multiple Isosurfaces with Caps" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83789b7a", + "id": "3db92a85", "metadata": {}, "outputs": [], "source": [ @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "d71b6a05", + "id": "ac3eac4c", "metadata": {}, "source": [ "### Changing the default colorscale of isosurfaces" @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d773d509", + "id": "d7577871", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "865d66c9", + "id": "83974650", "metadata": {}, "source": [ "### Customizing the layout and appearance of isosurface plots" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "372e1a06", + "id": "039f4d12", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "68e7aea1", + "id": "88d37240", "metadata": {}, "source": [ "#### Reference\n", @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "5785c341", + "id": "97a3ce66", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-line-plots.ipynb b/3d-line-plots.ipynb index e0faa5bb3..925afce79 100644 --- a/3d-line-plots.ipynb +++ b/3d-line-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "68174746", + "id": "dafe2e20", "metadata": {}, "source": [ "### 3D Line plot with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ef33dd3", + "id": "f92a75e2", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fafdcb82", + "id": "b6f8ba63", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "73251b93", + "id": "ebd00a57", "metadata": {}, "source": [ "#### 3D Line Plot of Brownian Motion\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "932b52d3", + "id": "e2c6905a", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "f366b350", + "id": "b9d2d8c2", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "61c74450", + "id": "fce0d7e3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-mesh.ipynb b/3d-mesh.ipynb index 0c2b87d7e..4651db7c0 100644 --- a/3d-mesh.ipynb +++ b/3d-mesh.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "72c82be2", + "id": "a42ab084", "metadata": {}, "source": [ "### Simple 3D Mesh example ###\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15c09ee7", + "id": "8b2414cd", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "4490dfe8", + "id": "d906eacc", "metadata": {}, "source": [ "### 3D Mesh example with Alphahull" @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "3ca67d60", + "id": "732df6e1", "metadata": {}, "source": [ "The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body)." @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ede8a244", + "id": "0b55fe60", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "54beced8", + "id": "dfbe4543", "metadata": {}, "source": [ "### 3D Mesh in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c91d160", + "id": "e6c79890", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "9af84ca0", + "id": "10d22aa2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "f8f2bf86", + "id": "5df978df", "metadata": {}, "source": [ "### Mesh Tetrahedron\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "698a1586", + "id": "84825cba", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "be2abfce", + "id": "d45e2406", "metadata": {}, "source": [ "### Mesh Cube" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b595925", + "id": "a44abb55", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "759317e0", + "id": "434e0fc2", "metadata": {}, "source": [ "### Intensity values defined on vertices or cells\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8aba6393", + "id": "6803a54e", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "d806df13", + "id": "db4b5053", "metadata": {}, "source": [ "## Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "20411988", + "id": "c38dfbe0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-scatter-plots.ipynb b/3d-scatter-plots.ipynb index ac835c2a2..41a1f8b5b 100644 --- a/3d-scatter-plots.ipynb +++ b/3d-scatter-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dae83191", + "id": "4b31c0a8", "metadata": {}, "source": [ "## 3D scatter plot with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1140f4f2", + "id": "a7a773d5", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "9116bb40", + "id": "d9928a2f", "metadata": {}, "source": [ "A 4th dimension of the data can be represented thanks to the color of the markers. Also, values from the `species` column are used below to assign symbols to markers." @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4da6650", + "id": "c28485a3", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "fb49cac0", + "id": "2d0ba0be", "metadata": {}, "source": [ "#### Style 3d scatter plot\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2ce8a72", + "id": "c73caf66", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "733825e3", + "id": "01e37ba9", "metadata": {}, "source": [ "#### 3d scatter plots in Dash\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3891054", + "id": "f442912e", "metadata": { "hide_code": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "414ea834", + "id": "69b5a742", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "0150bc2d", + "id": "747ed59d", "metadata": {}, "source": [ "### 3D Scatter Plot with go.Scatter3d\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cda20ba", + "id": "9cca35f1", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "f71a6fe6", + "id": "6f948263", "metadata": {}, "source": [ "#### 3D Scatter Plot with Colorscaling and Marker Styling" @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c520ff6a", + "id": "e55f043f", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "c5aaf369", + "id": "db7c2325", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "b60ea58d", + "id": "7664f117", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-subplots.ipynb b/3d-subplots.ipynb index a5303dd7d..a9a52e81d 100644 --- a/3d-subplots.ipynb +++ b/3d-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "402dec48", + "id": "5d45deb5", "metadata": {}, "source": [ "#### 3D Surface Subplots" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ca63b0d", + "id": "fe725162", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "fba67ddb", + "id": "7cb861ed", "metadata": {}, "source": [ "#### Reference" @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "264cd1bb", + "id": "e7c39e8d", "metadata": {}, "source": [ "See https://plotly.com/python/subplots/ for more information regarding subplots!" @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "3fa1f3d8", + "id": "6bf119c5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-surface-plots.ipynb b/3d-surface-plots.ipynb index babebaf66..b89dac042 100644 --- a/3d-surface-plots.ipynb +++ b/3d-surface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5342b37a", + "id": "7a504110", "metadata": {}, "source": [ "#### Topographical 3D Surface Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf884f6f", + "id": "119e6843", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "e37301a5", + "id": "db0e9ab3", "metadata": {}, "source": [ "### Passing x and y data to 3D Surface Plot\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb9f2df4", + "id": "376c714a", "metadata": { "lines_to_next_cell": 2 }, @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "3bfff2ff", + "id": "6f67727b", "metadata": {}, "source": [ "#### Surface Plot With Contours" @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "1d8f9980", + "id": "7c3bc515", "metadata": {}, "source": [ "Display and customize contour data for each axis using the `contours` attribute ([reference](https://plotly.com/python/reference/surface/#surface-contours))." @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "697d2802", + "id": "263f9069", "metadata": { "lines_to_next_cell": 0 }, @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "b0519b93", + "id": "bcf4a621", "metadata": {}, "source": [ "#### Configure Surface Contour Levels\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c643bd9", + "id": "f4647869", "metadata": { "lines_to_next_cell": 0 }, @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "24a0e0ed", + "id": "cf7303d6", "metadata": {}, "source": [ "#### Multiple 3D Surface Plots" @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "510e94ab", + "id": "7e45a6c6", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "973d1039", + "id": "3a6a5271", "metadata": {}, "source": [ "### Setting the Surface Color\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bf8fe0b", + "id": "61ae67b1", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "722f288b", + "id": "734a88e8", "metadata": {}, "source": [ "#### Reference" @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "700e4265", + "id": "d4d808e5", "metadata": {}, "source": [ "See https://plotly.com/python/reference/surface/ for more information!\n" @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "6eede161", + "id": "4dd893b1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-volume.ipynb b/3d-volume.ipynb index 8ecaf3826..e028dd369 100644 --- a/3d-volume.ipynb +++ b/3d-volume.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4b034130", + "id": "f60927c1", "metadata": {}, "source": [ "A volume plot with `go.Volume` shows several partially transparent isosurfaces for volume rendering. The API of `go.Volume` is close to the one of `go.Isosurface`. However, whereas [isosurface plots](/python/3d-isosurface-plots/) show all surfaces with the same opacity, tweaking the `opacityscale` parameter of `go.Volume` results in a depth effect and better volume rendering.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb1580cc", + "id": "af7eb576", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f0f2a5a", + "id": "4937497c", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3430e04", + "id": "7cd17a5a", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "6b1c6bd6", + "id": "0be5d430", "metadata": {}, "source": [ "### Defining the opacity scale of volume plots\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "082378c4", + "id": "43a01e1e", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "280cbdbf", + "id": "8a142fcd", "metadata": {}, "source": [ "### Defining a custom opacity scale\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4a58a93", + "id": "43600ea4", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "8f069409", + "id": "9cbf7189", "metadata": {}, "source": [ "### Adding caps to a volume plot\n", @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e564af97", + "id": "3c0042f7", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11e52cfc", + "id": "1edb5a80", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "33b3d611", + "id": "6468943e", "metadata": {}, "source": [ "### Adding slices to a volume plot\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0df3335b", + "id": "35d8a264", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "384a2db7", + "id": "58463f2e", "metadata": {}, "source": [ "#### Reference\n", @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "923cbcbf", + "id": "1df00616", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/LaTeX.ipynb b/LaTeX.ipynb index 6c645e902..64c90d2f6 100644 --- a/LaTeX.ipynb +++ b/LaTeX.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "37a30826", + "id": "92bfb2e0", "metadata": {}, "source": [ "#### LaTeX Typesetting\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f51e9e9d", + "id": "9dfed665", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da50d94c", + "id": "3a227e9f", "metadata": { "lines_to_next_cell": 2 }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "8910e431", + "id": "88cad2f0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/animations.ipynb b/animations.ipynb index 7fbf9c944..98a106c5c 100644 --- a/animations.ipynb +++ b/animations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "70d0b3fe", + "id": "7d714f1f", "metadata": {}, "source": [ "#### Animated figures with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "503f6f6c", + "id": "fe72bc16", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "69b95262", + "id": "61b06a7a", "metadata": {}, "source": [ "#### Animated figures in Dash\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d83a23a", + "id": "aacbba0a", "metadata": { "hide_code": true }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "cac9321a", + "id": "9b6cacd2", "metadata": {}, "source": [ "#### Animated Bar Charts with Plotly Express\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1228b878", + "id": "eafaca03", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "94a4e2c1", + "id": "3ff2430d", "metadata": {}, "source": [ "### Current Animation Limitations and Caveats\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "23633264", + "id": "ff63ae08", "metadata": {}, "source": [ "\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "36c7cdcd", + "id": "5d056c75", "metadata": {}, "source": [ "#### Defining Button Arguments\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d0c07bc", + "id": "e0c89a39", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "56121bf6", + "id": "95824c5b", "metadata": {}, "source": [ "#### Moving Point on a Curve" @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9711cbb", + "id": "021e22bb", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "c6a97f51", + "id": "078fceb2", "metadata": {}, "source": [ "#### Moving Frenet Frame Along a Planar Curve" @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f2263d3", + "id": "2a72c4a8", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "39ceba3e", + "id": "c7689716", "metadata": {}, "source": [ "#### Using a Slider and Buttons\n", @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aebd331d", + "id": "36a620dc", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "b7603a95", + "id": "89085cfc", "metadata": {}, "source": [ "#### Important Notes\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "a179c884", + "id": "a75b9d4b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/annotated-heatmap.ipynb b/annotated-heatmap.ipynb index c607a9590..faa77c7da 100644 --- a/annotated-heatmap.ipynb +++ b/annotated-heatmap.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c6eece07", + "id": "9a6f54d1", "metadata": {}, "source": [ "### Annotated Heatmaps with Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "2fcb4eb7", + "id": "35c0dcbe", "metadata": {}, "source": [ "#### Basic Annotated Heatmap for z-annotations\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff02e445", + "id": "71c5725f", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "84f57b4d", + "id": "2b70b709", "metadata": {}, "source": [ "### Deprecated Figure Factory\n", @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "5538f1af", + "id": "42dc5b98", "metadata": {}, "source": [ "#### Simple Annotated Heatmap" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0f6e250", + "id": "99e126f1", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "9113b4b1", + "id": "98928cab", "metadata": {}, "source": [ "#### Custom Text and X & Y Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98122382", + "id": "5979376e", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "1cad5251", + "id": "8b408ae3", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45abe9df", + "id": "5bdd2fe9", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "c8612f1c", + "id": "6aa89014", "metadata": {}, "source": [ "#### Annotated Heatmap with numpy" @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca090d68", + "id": "a6ef0610", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "6e90433e", + "id": "66d65e77", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0477d35", + "id": "70109b14", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "fbdbe80d", + "id": "4935e108", "metadata": {}, "source": [ "Here is a fairly contrived example showing how one can display a periodic table with custom text and hover using `ff.create_annotated_heatmap()` (scroll below to see the `px.imshow()` equivalent)." @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "486abb77", + "id": "6ba813bd", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "1a6ef23f", + "id": "22aeab9e", "metadata": {}, "source": [ "Here is the same output using `px.imshow()` with much less array manipulation:" @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5367ade", + "id": "0fec8731", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "2ed5fe6a", + "id": "099c2c3a", "metadata": {}, "source": [ "#### Reference\n", @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "14eab73f", + "id": "80aa4a86", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/axes.ipynb b/axes.ipynb index b94b05814..30a60e0cc 100644 --- a/axes.ipynb +++ b/axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "85f520cd", + "id": "50d10761", "metadata": {}, "source": [ "This tutorial explains how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/yaxis/).\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "560f05c5", + "id": "f0691d8e", "metadata": {}, "source": [ "### Forcing an axis to be categorical\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a83a81e", + "id": "29a165d5", "metadata": { "lines_to_next_cell": 2 }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "1a1ca41a", + "id": "91e97e56", "metadata": {}, "source": [ "#### General Axis properties\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "46ffd3a5", + "id": "95f48e1f", "metadata": {}, "source": [ "#### Set and Style Axes Title Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fddda020", + "id": "824667dd", "metadata": {}, "outputs": [], "source": [ @@ -106,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "8e17b75f", + "id": "9b2a039f", "metadata": {}, "source": [ "Axis titles (and [legend titles](/python/legend/)) can also be overridden using the `labels` argument of Plotly Express functions:" @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef4c55f8", + "id": "ac2d889a", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "243a939e", + "id": "5432ba33", "metadata": {}, "source": [ "The PX `labels` argument can also be used without a data frame argument:\n" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6828eabd", + "id": "aca308c1", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "b6a8ca2d", + "id": "99b4a93a", "metadata": {}, "source": [ "##### Rotating tick labels in Dash\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa2b3efa", + "id": "9f9932db", "metadata": { "hide_code": true }, @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "bb1cd2c8", + "id": "1586b17e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "65d44d54", + "id": "ecf9b581", "metadata": {}, "source": [ "#### Moving Tick Labels Inside the Plot\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7937735d", + "id": "d9bd660f", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "be830bcd", + "id": "5c48b844", "metadata": {}, "source": [ "#### Specifying Label Aliases\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5016d6fb", + "id": "289c90ba", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "30d67ea4", + "id": "ecba19fd", "metadata": {}, "source": [ "##### Set axis title text with Graph Objects\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95f48603", + "id": "3b2de668", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "eaf301c1", + "id": "97dc9dd9", "metadata": {}, "source": [ "### Set axis title position\n", @@ -280,7 +280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f371ff0", + "id": "9fe14f78", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "e68e0097", + "id": "2601a728", "metadata": {}, "source": [ "##### Set axis title font\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdba7ac8", + "id": "e6a1adc2", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "eee2de49", + "id": "4c241c12", "metadata": {}, "source": [ "#### Tick Placement, Color, and Style\n", @@ -348,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "868ea83c", + "id": "6c810456", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "cceca3ce", + "id": "a9dbae96", "metadata": {}, "source": [ "##### Set number of tick marks (and grid lines)\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c750ef7", + "id": "b849c5b0", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "a79d6bda", + "id": "ed022e77", "metadata": {}, "source": [ "##### Set start position and distance between ticks\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3b926c2", + "id": "028d9180", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "c3143552", + "id": "108f47cf", "metadata": {}, "source": [ "##### Set exact location of axis ticks\n", @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c19c38c", + "id": "b45271f4", "metadata": {}, "outputs": [], "source": [ @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "8c04e098", + "id": "a3f4586a", "metadata": {}, "source": [ "##### Style tick marks\n", @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92463036", + "id": "99ae4e22", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "012cdf32", + "id": "22b41980", "metadata": {}, "source": [ "##### Step for tick labels\n", @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5a400c9", + "id": "97d368c9", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "0bb67670", + "id": "40b7b63f", "metadata": {}, "source": [ "##### Toggling axis labels\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "481f7133", + "id": "b7813bb4", "metadata": {}, "outputs": [], "source": [ @@ -536,7 +536,7 @@ }, { "cell_type": "markdown", - "id": "a125f852", + "id": "2797125c", "metadata": {}, "source": [ "##### Set axis label rotation and font\n", @@ -549,7 +549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "815377c1", + "id": "0976611c", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "4b93bb9c", + "id": "482069a8", "metadata": {}, "source": [ "##### Auto Tick Angle Options\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d58c40f", + "id": "19a0c4ed", "metadata": {}, "outputs": [], "source": [ @@ -593,7 +593,7 @@ }, { "cell_type": "markdown", - "id": "ea051c0e", + "id": "3e6532aa", "metadata": {}, "source": [ "#### Enumerated Ticks with Tickvals and Ticktext\n", @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71774626", + "id": "2670c99c", "metadata": {}, "outputs": [], "source": [ @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "08971130", + "id": "f41add02", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72ef0231", + "id": "481f3868", "metadata": {}, "outputs": [], "source": [ @@ -685,7 +685,7 @@ }, { "cell_type": "markdown", - "id": "39af8288", + "id": "e1507331", "metadata": {}, "source": [ "#### Adjust Tick Label Positions\n", @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "569cf341", + "id": "d61c7c20", "metadata": {}, "outputs": [], "source": [ @@ -727,7 +727,7 @@ }, { "cell_type": "markdown", - "id": "1674417e", + "id": "d9bc465a", "metadata": {}, "source": [ "#### Use Minor Tick for Label\n", @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21cc53ea", + "id": "b290c300", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "310ea594", + "id": "a5de9882", "metadata": {}, "source": [ "### Axis lines: grid and zerolines\n", @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7552c30c", + "id": "d8b69f63", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "c017a397", + "id": "d0439785", "metadata": {}, "source": [ "##### Toggling Axis zero lines\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccc71297", + "id": "8b08e3e8", "metadata": {}, "outputs": [], "source": [ @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "9220fced", + "id": "4f494e09", "metadata": {}, "source": [ "#### Styling and Coloring Axes and the Zero-Line\n", @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62af0a78", + "id": "6a7fccc3", "metadata": {}, "outputs": [], "source": [ @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "d66c2faf", + "id": "3edbf1ed", "metadata": {}, "source": [ "##### Mirroring axis lines\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a01d33a9", + "id": "531ea8a2", "metadata": {}, "outputs": [], "source": [ @@ -882,7 +882,7 @@ }, { "cell_type": "markdown", - "id": "823091d2", + "id": "36b7f3b7", "metadata": {}, "source": [ "##### Styling grid lines\n", @@ -895,7 +895,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dc3dd7c", + "id": "072c8d99", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "9f7e2d9f", + "id": "119b7d3c", "metadata": {}, "source": [ "_new in 5.8_\n", @@ -922,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f3ef6d0", + "id": "1c144495", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "c5f35e99", + "id": "8a2b15cb", "metadata": {}, "source": [ "##### Styling zero lines\n", @@ -950,7 +950,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac565d11", + "id": "38722d58", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "b533247a", + "id": "6fcbcdf4", "metadata": {}, "source": [ "##### Controlling Zero Line Layer\n", @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d58a7d9", + "id": "742ffc0c", "metadata": {}, "outputs": [], "source": [ @@ -1010,7 +1010,7 @@ }, { "cell_type": "markdown", - "id": "b9ff1f63", + "id": "9ff891d7", "metadata": {}, "source": [ "#### Setting the Range of Axes Manually\n", @@ -1023,7 +1023,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4a14bff", + "id": "411b50aa", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "2fdfc086", + "id": "10ac98d0", "metadata": {}, "source": [ "#### Exclude Inside Tick Labels from Range\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b946b4d", + "id": "40d73671", "metadata": {}, "outputs": [], "source": [ @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "f35a85e6", + "id": "6d599957", "metadata": {}, "source": [ "#### Setting only a Lower or Upper Bound for Range\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "050607da", + "id": "1b3c9752", "metadata": {}, "outputs": [], "source": [ @@ -1099,7 +1099,7 @@ }, { "cell_type": "markdown", - "id": "90038aa9", + "id": "aab55742", "metadata": {}, "source": [ "#### Setting a Maximum and Minimum Allowed Axis Value\n", @@ -1112,7 +1112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac1668b6", + "id": "d41155d0", "metadata": {}, "outputs": [], "source": [ @@ -1129,7 +1129,7 @@ }, { "cell_type": "markdown", - "id": "c64340ad", + "id": "b91e7ee3", "metadata": {}, "source": [ "#### Disabling Pan/Zoom on Axes (Fixed Range)\n", @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e93740a", + "id": "3df17608", "metadata": {}, "outputs": [], "source": [ @@ -1155,7 +1155,7 @@ }, { "cell_type": "markdown", - "id": "fa64d62a", + "id": "c3ebc455", "metadata": {}, "source": [ "### Fixed Ratio Axes\n", @@ -1168,7 +1168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dba9eddb", + "id": "43149242", "metadata": {}, "outputs": [], "source": [ @@ -1196,7 +1196,7 @@ }, { "cell_type": "markdown", - "id": "3a9f00b4", + "id": "edde9afd", "metadata": {}, "source": [ "### Fixed Ratio Axes with Compressed domain\n", @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd5afa7", + "id": "552df94b", "metadata": {}, "outputs": [], "source": [ @@ -1235,7 +1235,7 @@ }, { "cell_type": "markdown", - "id": "1adba07b", + "id": "66738682", "metadata": {}, "source": [ "##### Decreasing the domain spanned by an axis\n", @@ -1246,7 +1246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ede0aae", + "id": "41b4fd0a", "metadata": {}, "outputs": [], "source": [ @@ -1279,7 +1279,7 @@ }, { "cell_type": "markdown", - "id": "1b66d1af", + "id": "a63d24f4", "metadata": {}, "source": [ "#### Reversed Axes\n", @@ -1292,7 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bb249aa", + "id": "e5a8aaa1", "metadata": {}, "outputs": [], "source": [ @@ -1307,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "b5bc45cc", + "id": "c2477f20", "metadata": {}, "source": [ "#### Reversed Axes with Range ( Min/Max ) Specified\n", @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ab161d2", + "id": "4b91da3f", "metadata": {}, "outputs": [], "source": [ @@ -1335,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "dcb0e809", + "id": "3e724032", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1346,7 +1346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75fa845f", + "id": "6bd398a0", "metadata": {}, "outputs": [], "source": [ @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "a7b5326a", + "id": "bacb8634", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1373,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93c20656", + "id": "b38a7239", "metadata": {}, "outputs": [], "source": [ @@ -1389,7 +1389,7 @@ }, { "cell_type": "markdown", - "id": "124ab20c", + "id": "62118354", "metadata": {}, "source": [ "### Axis range for log axis type\n", @@ -1400,7 +1400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b01a098", + "id": "cd89604d", "metadata": {}, "outputs": [], "source": [ @@ -1415,7 +1415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dafa2feb", + "id": "62f83c61", "metadata": {}, "outputs": [], "source": [ @@ -1431,7 +1431,7 @@ }, { "cell_type": "markdown", - "id": "52d91f95", + "id": "674d7e88", "metadata": {}, "source": [ "#### Setting the domain of the axis" @@ -1440,7 +1440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99c46092", + "id": "ca6fc10c", "metadata": {}, "outputs": [], "source": [ @@ -1459,7 +1459,7 @@ }, { "cell_type": "markdown", - "id": "d68f954c", + "id": "6a85c78e", "metadata": {}, "source": [ "#### Synchronizing axes in subplots with `matches`\n", @@ -1472,7 +1472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c00c20f", + "id": "5853f339", "metadata": {}, "outputs": [], "source": [ @@ -1492,7 +1492,7 @@ }, { "cell_type": "markdown", - "id": "8fadc7ef", + "id": "2d442d0e", "metadata": {}, "source": [ "#### nonnegative, tozero, and normal Rangemode\n", @@ -1509,7 +1509,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f77616b6", + "id": "3a003246", "metadata": {}, "outputs": [], "source": [ @@ -1525,7 +1525,7 @@ }, { "cell_type": "markdown", - "id": "e574e5c6", + "id": "981aaa78", "metadata": {}, "source": [ "#### Autorange Options\n", @@ -1542,7 +1542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f695cba", + "id": "e6bbe8f7", "metadata": {}, "outputs": [], "source": [ @@ -1559,7 +1559,7 @@ }, { "cell_type": "markdown", - "id": "9dd50377", + "id": "0dcef922", "metadata": {}, "source": [ "##### Clip Minimum and Maximum\n", @@ -1570,7 +1570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a7a2bcc", + "id": "d6786226", "metadata": {}, "outputs": [], "source": [ @@ -1587,7 +1587,7 @@ }, { "cell_type": "markdown", - "id": "e97ac333", + "id": "d4054c64", "metadata": {}, "source": [ "##### Specify Values to be Included\n", @@ -1598,7 +1598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a112893", + "id": "99f1dc20", "metadata": {}, "outputs": [], "source": [ @@ -1614,7 +1614,7 @@ }, { "cell_type": "markdown", - "id": "fb069f90", + "id": "8d0db5c7", "metadata": {}, "source": [ "#### Reference\n", @@ -1624,7 +1624,7 @@ }, { "cell_type": "markdown", - "id": "9cc238bd", + "id": "72463ebc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bar-charts.ipynb b/bar-charts.ipynb index c9e36445c..d92689c36 100644 --- a/bar-charts.ipynb +++ b/bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3a1ffc79", + "id": "16746d6e", "metadata": {}, "source": [ "### Bar chart with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e58b3d1", + "id": "dad0759c", "metadata": { "lines_to_next_cell": 2 }, @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "655d2f36", + "id": "30b10666", "metadata": {}, "source": [ "#### Bar charts with Long Format Data\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c54336aa", + "id": "365a7b2b", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e65b55e", + "id": "e613fc9e", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "bd2c009a", + "id": "209a6aaf", "metadata": {}, "source": [ "#### Bar charts with Wide Format Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7d6719b", + "id": "2f7f504e", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "559fcf8d", + "id": "2a7e657e", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "73e233cc", + "id": "d3aefaec", "metadata": {}, "source": [ "### Bar charts in Dash\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "944afcb5", + "id": "1c7d0da4", "metadata": { "hide_code": true }, @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "cfeb5983", + "id": "34e5ed23", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "300a4a4e", + "id": "3be1cb16", "metadata": {}, "source": [ "### Colored Bars\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecf49e4d", + "id": "682f3161", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23b71485", + "id": "931cc273", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "fe12711d", + "id": "1e8ad61f", "metadata": {}, "source": [ "### Stacked vs Grouped Bars\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdc85c59", + "id": "b8cdc255", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "90823b70", + "id": "a1f3874d", "metadata": {}, "source": [ "The default stacked bar chart behavior can be changed to grouped (also known as clustered) using the `barmode` argument:" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64f16e73", + "id": "e7493163", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "332c73d4", + "id": "9e8cf3e1", "metadata": {}, "source": [ "### Aggregating into Single Colored Bars\n", @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d95b0fd", + "id": "b449eb0c", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "435b58ec", + "id": "a13556aa", "metadata": {}, "source": [ "`px.histogram()` will aggregate `y` values by summing them by default, but the `histfunc` argument can be used to set this to `avg` to create what is sometimes called a \"barplot\" which summarizes the central tendency of a dataset, rather than visually representing the totality of the dataset.\n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1aa46b69", + "id": "8ea14bd4", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "2f0d7cb0", + "id": "f89634dd", "metadata": {}, "source": [ "### Bar Charts with Text\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02e1f629", + "id": "378e1930", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "2dc73ffb", + "id": "5a260a45", "metadata": {}, "source": [ "The `text` argument can be used to display arbitrary text on the bars:" @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d198a2e0", + "id": "16829730", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "9eaf8175", + "id": "41b1ffd1", "metadata": {}, "source": [ "By default, Plotly will scale and rotate text labels to maximize the number of visible labels, which can result in a variety of text angles and sizes and positions in the same figure. The `textfont`, `textposition` and `textangle` trace attributes can be used to control these.\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4907d635", + "id": "4f35a049", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "168e05d2", + "id": "96945bae", "metadata": {}, "source": [ "Here is the same data with less variation in text formatting. Note that `textfont_size` will set the *maximum* size. The `layout.uniformtext` attribute can be used to guarantee that all text labels are the same size. See the [documentation on text and annotations](/python/text-and-annotations/) for details.\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbc9721c", + "id": "1b4a099e", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "0b971720", + "id": "726b76ed", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "70d108dc", + "id": "18fe35d4", "metadata": {}, "source": [ "Bar charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:" @@ -399,7 +399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f50ec70", + "id": "4f46cc4f", "metadata": {}, "outputs": [], "source": [ @@ -413,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "6cf95887", + "id": "137e4f69", "metadata": {}, "source": [ "### Facetted subplots\n", @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb3ee040", + "id": "9e85b301", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "cb3a3b30", + "id": "c5bf5e28", "metadata": {}, "source": [ "#### Basic Bar Charts with plotly.graph_objects\n", @@ -450,7 +450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "647ab45a", + "id": "72c7b25d", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "1f16b55f", + "id": "a8ebba59", "metadata": {}, "source": [ "#### Grouped Bar Chart\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6930783a", + "id": "940c18b1", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "c5b97fa1", + "id": "8f0dcf05", "metadata": {}, "source": [ "### Stacked Bar Chart" @@ -501,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44f3af49", + "id": "f91308d9", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "3d096439", + "id": "42ad8791", "metadata": {}, "source": [ "### Bar Chart with Relative Barmode\n", @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10232ee2", + "id": "9663bd4b", "metadata": {}, "outputs": [], "source": [ @@ -550,7 +550,7 @@ }, { "cell_type": "markdown", - "id": "12c77f73", + "id": "76e6f26c", "metadata": {}, "source": [ "### Grouped Stacked Bar Chart\n", @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc9657f9", + "id": "eb44ce9b", "metadata": {}, "outputs": [], "source": [ @@ -620,7 +620,7 @@ }, { "cell_type": "markdown", - "id": "72049eb8", + "id": "d559c72e", "metadata": {}, "source": [ "### Stacked Bar Chart From Aggregating a DataFrame\n", @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b64e509e", + "id": "0f6cbae4", "metadata": { "lines_to_next_cell": 2 }, @@ -683,7 +683,7 @@ }, { "cell_type": "markdown", - "id": "21615124", + "id": "492804a2", "metadata": {}, "source": [ "### Bar Chart with Hover Text" @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "532378c5", + "id": "c2e7ce89", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "8ed23b4a", + "id": "e2cfa871", "metadata": {}, "source": [ "### Bar Chart with Direct Labels" @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbadf171", + "id": "25e16b0f", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "5b4d0463", + "id": "09ea7ed1", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -754,7 +754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bea4977d", + "id": "93ba4a19", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "90cebaf8", + "id": "78a6e742", "metadata": {}, "source": [ "### Rotated Bar Chart Labels" @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7ad728c", + "id": "e8947d86", "metadata": {}, "outputs": [], "source": [ @@ -808,7 +808,7 @@ }, { "cell_type": "markdown", - "id": "c37b66ac", + "id": "070cc8a9", "metadata": {}, "source": [ "### Customizing Individual Bar Colors" @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e893bfd", + "id": "d532546a", "metadata": {}, "outputs": [], "source": [ @@ -837,7 +837,7 @@ }, { "cell_type": "markdown", - "id": "37c4b511", + "id": "bd110b1f", "metadata": {}, "source": [ "### Customizing Individual Bar Widths" @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82c15b81", + "id": "3beb8e35", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "a3013230", + "id": "55cd8382", "metadata": {}, "source": [ "Bar charts with custom widths can be used to make mekko charts (also known as marimekko charts, mosaic plots, or variwide charts)." @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "952641ce", + "id": "570effe3", "metadata": {}, "outputs": [], "source": [ @@ -925,7 +925,7 @@ }, { "cell_type": "markdown", - "id": "c8685a79", + "id": "30016082", "metadata": {}, "source": [ "### Using a scatterplot to wrap long bars into multiple columns\n", @@ -936,7 +936,7 @@ { "cell_type": "code", "execution_count": null, - "id": "751a0855", + "id": "8d250dd1", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "cfb49c09", + "id": "1429c233", "metadata": {}, "source": [ "### Customizing Individual Bar Base" @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c086dd65", + "id": "94490fe7", "metadata": {}, "outputs": [], "source": [ @@ -1072,7 +1072,7 @@ }, { "cell_type": "markdown", - "id": "4ababa67", + "id": "da87c6c8", "metadata": {}, "source": [ "### Rounded Bars\n", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d179f06a", + "id": "16e74155", "metadata": {}, "outputs": [], "source": [ @@ -1112,7 +1112,7 @@ }, { "cell_type": "markdown", - "id": "29fc6340", + "id": "fd5176ba", "metadata": {}, "source": [ "When you don't want all bar traces in a figure to have the same rounded corners, you can instead configure rounded corners on each trace using `marker.cornerradius`. In this example, which uses subplots, the first trace has a corner radius of 30 pixels, the second trace has a bar corner radius of 30% of the bar width, and the third trace has no rounded corners set." @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ec9aecf", + "id": "aee2f06a", "metadata": {}, "outputs": [], "source": [ @@ -1154,7 +1154,7 @@ }, { "cell_type": "markdown", - "id": "10527d06", + "id": "d5cc2f27", "metadata": {}, "source": [ "### Colored and Styled Bar Chart\n", @@ -1165,7 +1165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "925eb9a9", + "id": "b4b6c4ac", "metadata": {}, "outputs": [], "source": [ @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "3e59f628", + "id": "0321cbfa", "metadata": {}, "source": [ "### Bar Chart with Sorted or Ordered Categories\n", @@ -1227,7 +1227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98b27bb1", + "id": "7e3d289e", "metadata": {}, "outputs": [], "source": [ @@ -1244,7 +1244,7 @@ }, { "cell_type": "markdown", - "id": "aa4216b2", + "id": "7d6accf0", "metadata": {}, "source": [ "This example shows how to customise sort ordering by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -1253,7 +1253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3745eefd", + "id": "01ea09d2", "metadata": {}, "outputs": [], "source": [ @@ -1270,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "6c24e5f8", + "id": "741caf01", "metadata": {}, "source": [ "This example orders the bar chart by descending value with `categoryorder: 'total descending'`" @@ -1279,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5446085d", + "id": "0ebcaa3d", "metadata": {}, "outputs": [], "source": [ @@ -1296,7 +1296,7 @@ }, { "cell_type": "markdown", - "id": "2b418976", + "id": "7ce7169a", "metadata": {}, "source": [ "### Horizontal Bar Charts\n", @@ -1311,7 +1311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7542cb68", + "id": "6fa24a7f", "metadata": { "lines_to_next_cell": 0 }, @@ -1331,7 +1331,7 @@ }, { "cell_type": "markdown", - "id": "37dac038", + "id": "b1d83bbb", "metadata": {}, "source": [ "\n" @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "9802d074", + "id": "922eec42", "metadata": {}, "source": [ "### Reference\n", @@ -1349,7 +1349,7 @@ }, { "cell_type": "markdown", - "id": "ea2b3204", + "id": "a16f80e7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-alignment-chart.ipynb b/bio-alignment-chart.ipynb index cfdc8708b..835731c1b 100644 --- a/bio-alignment-chart.ipynb +++ b/bio-alignment-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a4acfbd7", + "id": "c060ee5b", "metadata": {}, "source": [ "## Alignment Viewer\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e19280b2", + "id": "27a5052a", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "30628e38", + "id": "7bdb1fb4", "metadata": {}, "source": [ "## Alignment Chart in dash_bio" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afc0f5d0", + "id": "04289816", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "8218ecd4", + "id": "623fce51", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-clustergram.ipynb b/bio-clustergram.ipynb index 3ed9273c8..d815cd012 100644 --- a/bio-clustergram.ipynb +++ b/bio-clustergram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9b95356e", + "id": "4dbb5561", "metadata": {}, "source": [ "## Default Clustergram\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c29ecdd", + "id": "23f9322d", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "3d5c7653", + "id": "eb022516", "metadata": {}, "source": [ "## Dendrogram Cluster Colors/Line Widths\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82cc1d29", + "id": "03ee6ce0", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "390e77c9", + "id": "7b9406ed", "metadata": {}, "source": [ "## Relative Dendrogram Size\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "baa8f4c1", + "id": "b886e59d", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "ca416c07", + "id": "3503c9bd", "metadata": {}, "source": [ "## Clustergram with Dash" @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46bcb82e", + "id": "be3c2648", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "0c2ea449", + "id": "1f4784aa", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-manhattanplot.ipynb b/bio-manhattanplot.ipynb index 1d85d276c..1188d16bb 100644 --- a/bio-manhattanplot.ipynb +++ b/bio-manhattanplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "09d47b36", + "id": "73545d89", "metadata": {}, "source": [ "## Manhattan Plot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9290d46", + "id": "f4070e04", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "6341ee93", + "id": "06054d96", "metadata": {}, "source": [ "## Highlighted points color, and colors of the suggestive line and the genome-wide line\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fada527", + "id": "59acdc01", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "4064ebd5", + "id": "a0430b07", "metadata": {}, "source": [ "## ManhattanPlot with Dash" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbd1f1d6", + "id": "a00eb9da", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "cac1d172", + "id": "59766770", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-volcano-plot.ipynb b/bio-volcano-plot.ipynb index a97c0d205..16d5aa4e0 100644 --- a/bio-volcano-plot.ipynb +++ b/bio-volcano-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "51424214", + "id": "ce9721a0", "metadata": {}, "source": [ "## VolcanoPlot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae1a4940", + "id": "d2de0c9b", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "c2d4b9c7", + "id": "42b8589e", "metadata": {}, "source": [ "## Point Sizes And Line Widths\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67698d33", + "id": "cecc7d94", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "5e8f421e", + "id": "80df3751", "metadata": {}, "source": [ "## VolcanoPlot with Dash" @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21d6432e", + "id": "47906492", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "3446d41a", + "id": "ac96577d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/box-plots.ipynb b/box-plots.ipynb index 60bbbe0b8..9e57492e3 100644 --- a/box-plots.ipynb +++ b/box-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "74ba785e", + "id": "6168179e", "metadata": {}, "source": [ "A [box plot](https://en.wikipedia.org/wiki/Box_plot) is a statistical representation of the distribution of a variable through its quartiles. The ends of the box represent the lower and upper quartiles, while the median (second quartile) is marked by a line inside the box. For other statistical representations of numerical data, see [other statistical charts](https://plotly.com/python/statistical-charts/).\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fba1b923", + "id": "321a7e86", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "1c479297", + "id": "1d0f7ec0", "metadata": {}, "source": [ "If a column name is given as `x` argument, a box plot is drawn for each value of `x`." @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76a77190", + "id": "dba7ef79", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "55eb2af2", + "id": "6e07ddd5", "metadata": {}, "source": [ "### Box Plots in Dash\n", @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c65065ce", + "id": "22ba5851", "metadata": { "hide_code": true }, @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "aa4238c6", + "id": "b706eb39", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "b04f8fce", + "id": "f42fb9db", "metadata": {}, "source": [ "### Display the underlying data\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7db385bc", + "id": "fb81eea5", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "be8a2d85", + "id": "1aaa94bc", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ff61062", + "id": "6f60cb5c", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "774b5682", + "id": "7e6d2bb3", "metadata": {}, "source": [ "#### Difference Between Quartile Algorithms\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2512be75", + "id": "eb80ff22", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "9b894eaa", + "id": "7e67a375", "metadata": {}, "source": [ "#### Styled box plot\n", @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a3297f4", + "id": "6921145b", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "5f103eb1", + "id": "82839001", "metadata": {}, "source": [ "## Box plot with go.Box\n", @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d935cdc", + "id": "97959409", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "312a7d50", + "id": "317175f5", "metadata": {}, "source": [ "### Basic Horizontal Box Plot" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "086649e6", + "id": "6a663add", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "bdd3c6a5", + "id": "24131ba2", "metadata": {}, "source": [ "### Box Plot That Displays The Underlying Data" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d7fd4f8", + "id": "20093397", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "aedfafba", + "id": "b8b3e5fa", "metadata": {}, "source": [ "### Modifying The Algorithm For Computing Quartiles\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17b821f6", + "id": "5636b7e5", "metadata": {}, "outputs": [], "source": [ @@ -325,7 +325,7 @@ }, { "cell_type": "markdown", - "id": "371272b9", + "id": "bff83d39", "metadata": {}, "source": [ "### Box Plot With Precomputed Quartiles\n", @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c47b0a7", + "id": "143f6e00", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "f1891613", + "id": "a0d90bce", "metadata": {}, "source": [ "### Colored Box Plot" @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c98b101d", + "id": "b174c76a", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "52421fdb", + "id": "84c35a15", "metadata": {}, "source": [ "### Box Plot Styling Mean & Standard Deviation" @@ -395,7 +395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fad766c", + "id": "6f529f34", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "788ec664", + "id": "0e1dca08", "metadata": {}, "source": [ "### Styling Outliers\n", @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d50c9b2", + "id": "d3720c81", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ }, { "cell_type": "markdown", - "id": "00d20269", + "id": "16a0eef8", "metadata": {}, "source": [ "### Grouped Box Plots" @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5920a63c", + "id": "5cbad8fd", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "ac9c8473", + "id": "e00a89a8", "metadata": {}, "source": [ "### Grouped Horizontal Box Plot" @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a3c39b6", + "id": "dc349b2d", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "ce1a0883", + "id": "e8c0cb38", "metadata": {}, "source": [ "### Rainbow Box Plots" @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed027535", + "id": "27149cbd", "metadata": {}, "outputs": [], "source": [ @@ -631,7 +631,7 @@ }, { "cell_type": "markdown", - "id": "c82ab14c", + "id": "200d2b39", "metadata": {}, "source": [ "### Fully Styled Box Plots" @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba354c1d", + "id": "53ca35d7", "metadata": {}, "outputs": [], "source": [ @@ -707,7 +707,7 @@ }, { "cell_type": "markdown", - "id": "7d2372ee", + "id": "aa3ab9f5", "metadata": {}, "source": [ "### Box Plot With Only Points\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "626b0fee", + "id": "080ef46c", "metadata": {}, "outputs": [], "source": [ @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "65455d1f", + "id": "1f64ee10", "metadata": {}, "source": [ "#### Reference\n", @@ -740,7 +740,7 @@ }, { "cell_type": "markdown", - "id": "ecd80372", + "id": "0d4d23cc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-charts.ipynb b/bubble-charts.ipynb index 3caf66c67..c34dd20b6 100644 --- a/bubble-charts.ipynb +++ b/bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "798e6a79", + "id": "77b14cc9", "metadata": {}, "source": [ "## Bubble chart with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7205c2c2", + "id": "e7804307", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "eec4bf86", + "id": "e52cb0e9", "metadata": {}, "source": [ "## Bubble Chart with plotly.graph_objects\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6decced9", + "id": "b7c3ded9", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "eb9ba282", + "id": "dea13426", "metadata": {}, "source": [ "### Setting Marker Size and Color" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2884c67f", + "id": "5f8aabb2", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "abfa4ca0", + "id": "25bb4a03", "metadata": {}, "source": [ "### Scaling the Size of Bubble Charts\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36b053fa", + "id": "b83b6d8d", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "1bf07da7", + "id": "96516bcb", "metadata": {}, "source": [ "### Hover Text with Bubble Charts" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "221b133d", + "id": "95137e18", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "6b8ea124", + "id": "ad6bcf43", "metadata": {}, "source": [ "### Bubble Charts with Colorscale" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bf5a5f2", + "id": "6124bae9", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "c6b752ca", + "id": "812fb927", "metadata": {}, "source": [ "### Categorical Bubble Charts" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c36e8e4", + "id": "4ad572e8", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "8ac6cd15", + "id": "a70078bf", "metadata": {}, "source": [ "### Reference\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "10564528", + "id": "4cb369e3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-maps.ipynb b/bubble-maps.ipynb index ed14e4837..0f40afc7a 100644 --- a/bubble-maps.ipynb +++ b/bubble-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "595d1214", + "id": "6c2ed82d", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9767f1e9", + "id": "f1aab1f4", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "fad3c5db", + "id": "01028894", "metadata": {}, "source": [ "### Bubble Map with animation" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b77f4b90", + "id": "de31a8ab", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "5d82980b", + "id": "8722ac6a", "metadata": {}, "source": [ "### Bubble Map with go.Scattergeo\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60a56abb", + "id": "46679215", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "c0dbac8f", + "id": "2503b586", "metadata": {}, "source": [ "#### Ebola Cases in West Africa" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7f6956d", + "id": "266a7612", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "097e97ee", + "id": "783125b2", "metadata": {}, "source": [ "#### Reference\n", @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "f193e624", + "id": "181d8e69", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/builtin-colorscales.ipynb b/builtin-colorscales.ipynb index 25b83f80f..f0d464195 100644 --- a/builtin-colorscales.ipynb +++ b/builtin-colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6830359d", + "id": "17ea2bcc", "metadata": {}, "source": [ "### Using Built-In Continuous Color Scales\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3b394c5", + "id": "8a5c00ea", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "80361fb9", + "id": "fa01286d", "metadata": {}, "source": [ "Built-in color scales are stored as lists of CSS colors:" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a30f9fc0", + "id": "38095c68", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "8cc8a0da", + "id": "427537ee", "metadata": {}, "source": [ "### Continuous Color Scales in Dash\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b88983ac", + "id": "8539d18e", "metadata": { "hide_code": true }, @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "91aaa184", + "id": "54b1fbab", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "67724cce", + "id": "d47aed08", "metadata": {}, "source": [ "### Built-In Sequential Color scales\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53183fd2", + "id": "56e575eb", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "7cdd9e83", + "id": "c42e2722", "metadata": {}, "source": [ "Note: `RdBu` was included in the `sequential` module by mistake, even though it is a diverging color scale.\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ba05cc4", + "id": "67177ac8", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "a3086949", + "id": "c03d4f88", "metadata": {}, "source": [ "### Built-In Cyclical Color scales\n", @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a16d682", + "id": "af5f7f3f", "metadata": { "lines_to_next_cell": 2 }, @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "fd4857f6", + "id": "870bc0d3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bullet-charts.ipynb b/bullet-charts.ipynb index 6ee6f5d8a..99021e2f9 100644 --- a/bullet-charts.ipynb +++ b/bullet-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d537cd2f", + "id": "1c9dcff1", "metadata": {}, "source": [ "#### Basic Bullet Charts\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a9288e1", + "id": "09169bac", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "0e2c97ae", + "id": "676849ce", "metadata": {}, "source": [ "#### Add Steps, and Threshold\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "707ba56b", + "id": "5254da2c", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "6d6015c0", + "id": "a40c9046", "metadata": {}, "source": [ "#### Custom Bullet\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc89650a", + "id": "36521b4f", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "dcdbc4ba", + "id": "5507ed08", "metadata": {}, "source": [ "#### Multi Bullet\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f57b20e", + "id": "cfa31935", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "bdcca7bb", + "id": "71b32970", "metadata": {}, "source": [ "#### Reference\n", @@ -193,14 +193,14 @@ { "cell_type": "code", "execution_count": null, - "id": "d33a661f", + "id": "141b131c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "98aca9eb", + "id": "0d452bdb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/candlestick-charts.ipynb b/candlestick-charts.ipynb index 60210f103..e2e0e9dac 100644 --- a/candlestick-charts.ipynb +++ b/candlestick-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dee2023e", + "id": "658525d5", "metadata": {}, "source": [ "The [candlestick chart](https://en.wikipedia.org/wiki/Candlestick_chart) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c5bc625", + "id": "00a441c1", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "a0e6086d", + "id": "1f4e68b6", "metadata": {}, "source": [ "#### Candlestick without Rangeslider" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a20d525", + "id": "4244507a", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "6b9160e5", + "id": "e9657502", "metadata": {}, "source": [ "#### Candlestick in Dash\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cea8a1f0", + "id": "fd0cd809", "metadata": { "hide_code": true }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "49aed1d3", + "id": "3ce2b3f3", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "f1d31eea", + "id": "5451ae58", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8abf94b0", + "id": "3bba2f34", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "1076a598", + "id": "a50dc408", "metadata": {}, "source": [ "#### Custom Candlestick Colors" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57712cf5", + "id": "72e29033", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ }, { "cell_type": "markdown", - "id": "2f8894c4", + "id": "c182304b", "metadata": {}, "source": [ "#### Simple Example with `datetime` Objects" @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32684ad1", + "id": "896bf8cf", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "910db492", + "id": "c23dc177", "metadata": {}, "source": [ "#### Reference\n", @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "007885ad", + "id": "3c081507", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-contour.ipynb b/carpet-contour.ipynb index 490c31faf..acc963a88 100644 --- a/carpet-contour.ipynb +++ b/carpet-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "11074353", + "id": "cc35a220", "metadata": {}, "source": [ "### Basic Carpet Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e72108c", + "id": "effa9dc5", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "ddb77686", + "id": "a5ebd8dd", "metadata": {}, "source": [ "### Add Contours" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f3c6193", + "id": "4fa823bd", "metadata": { "inputHidden": false, "outputHidden": false @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "9236c5d5", + "id": "4fd4c38a", "metadata": {}, "source": [ "### Add Multiple Traces" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "643be63b", + "id": "af29ad36", "metadata": { "inputHidden": false, "outputHidden": false @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "b7ba94db", + "id": "318aae2d", "metadata": {}, "source": [ "### Reference\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "350277b3", + "id": "459a54d3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-plot.ipynb b/carpet-plot.ipynb index 434817091..ca18a1428 100644 --- a/carpet-plot.ipynb +++ b/carpet-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e49e8bf9", + "id": "035ceacf", "metadata": {}, "source": [ "### Set X and Y Coordinates\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4eddd08", + "id": "d585a0fb", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "75ee0516", + "id": "8cd2619d", "metadata": {}, "source": [ "### Add Parameter Values\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "925add01", + "id": "e48d3a78", "metadata": { "inputHidden": false, "outputHidden": false @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "f36e28a2", + "id": "b1897e5c", "metadata": {}, "source": [ "### Add A and B axis\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43b2b05a", + "id": "90841d03", "metadata": { "inputHidden": false, "outputHidden": false @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "886a9970", + "id": "20d87ddd", "metadata": {}, "source": [ "### Alternate input format\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccb34d18", + "id": "27e7b6f9", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "3fa26e2f", + "id": "17aa2438", "metadata": {}, "source": [ "### Cheater plot layout" @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "bb08cbf5", + "id": "ba36e2a4", "metadata": {}, "source": [ "The layout of cheater plots is not unique and depends upon the `cheaterslope` and axis `cheatertype` parameters. If `x` is not specified, each row of the `x` array is constructed based on the the formula `a + cheaterslope * b`, where `a` and `b` are either the value or the integer index of `a` and `b` respectively, depending on the corresponding axis `cheatertype`. Although the layout of the axis below is different than the plots above, it represents the same data as the axes above." @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a06b162b", + "id": "450d6163", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "d2df3019", + "id": "75d3a68b", "metadata": {}, "source": [ "### Style A and B axis" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e561b670", + "id": "27a99b77", "metadata": { "inputHidden": false, "outputHidden": false @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "c60d870b", + "id": "1e3900e1", "metadata": {}, "source": [ "### Add Points and Contours\n", @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "6f07fcc9", + "id": "dee2d0a5", "metadata": {}, "source": [ "### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "ca2cb22d", + "id": "4501a430", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-scatter.ipynb b/carpet-scatter.ipynb index 0cafc0f92..12685bd3b 100644 --- a/carpet-scatter.ipynb +++ b/carpet-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ebe6c806", + "id": "2b409b42", "metadata": {}, "source": [ "### Basic Carpet Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e10f090", + "id": "c39e8327", "metadata": { "inputHidden": false, "outputHidden": false @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "b6e8f5f3", + "id": "4720ea7d", "metadata": {}, "source": [ "### Add Carpet Scatter Trace" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b7c6ca2", + "id": "f7258756", "metadata": { "inputHidden": false, "outputHidden": false @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "183999ea", + "id": "21780234", "metadata": {}, "source": [ "### Add Multiple Scatter Traces" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65c5e157", + "id": "7d6be570", "metadata": { "inputHidden": false, "outputHidden": false @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "3442d50a", + "id": "79f18f53", "metadata": {}, "source": [ "### Reference" @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "c73d6200", + "id": "83766706", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattercarpet/ for more information and chart attribute options!" @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "57f6e7ce", + "id": "8dd06714", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/categorical-axes.ipynb b/categorical-axes.ipynb index 857f6363c..28ed47902 100644 --- a/categorical-axes.ipynb +++ b/categorical-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2cbab585", + "id": "a1515439", "metadata": {}, "source": [ "\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b7208cc", + "id": "cbec68c3", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "9933093e", + "id": "b910dd6b", "metadata": {}, "source": [ "### Categorical Axes and Trace Types\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86fc06fb", + "id": "ab2e78a7", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "3c05dd79", + "id": "56bdbb1a", "metadata": {}, "source": [ "[Box plots]() and [violin plots]() are often shown with one categorical and one continuous axis." @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f65aceba", + "id": "3b024ca8", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccc6e017", + "id": "5f7cdf26", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "f90ae7bc", + "id": "3d0db0fd", "metadata": {}, "source": [ "### Controlling the Category Order with Plotly Express\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "696078ca", + "id": "3144c7e8", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "b1bfaae1", + "id": "579e18f4", "metadata": {}, "source": [ "### Automatically Sorting Categories by Name or Total Value\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2253cc84", + "id": "d421f420", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "3fdbed50", + "id": "6cf0855c", "metadata": {}, "source": [ "This example orders the categories **by total value** with `categoryorder: 'total descending'`" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b87e34dc", + "id": "e63ddbfd", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "42770cae", + "id": "a5a731e5", "metadata": {}, "source": [ "This example shows how to control category order when using `plotly.graph_objects` by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cb5f0f9", + "id": "e5b2cc14", "metadata": { "lines_to_next_cell": 0 }, @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "1c67236a", + "id": "a42feee6", "metadata": {}, "source": [ "### Gridlines, Ticks and Tick Labels" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "b7ea6779", + "id": "c98fc68a", "metadata": {}, "source": [ "By default, gridlines and ticks are not shown on categorical axes but they can be activated:" @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f22bf6f", + "id": "3532c026", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "8b2222f6", + "id": "1f11f69b", "metadata": {}, "source": [ "By default, ticks and gridlines appear on the categories but the `tickson` attribute can be used to move them to the category boundaries:" @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0308f97", + "id": "3f172692", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "29450e9b", + "id": "2e24ad26", "metadata": {}, "source": [ "### Multi-categorical Axes\n", @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7b40796", + "id": "f0cbfc26", "metadata": { "lines_to_next_cell": 0 }, @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "8f57cd48", + "id": "ef9d3d9e", "metadata": {}, "source": [ "### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "1a71beb2", + "id": "93d4e0f2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/choropleth-maps.ipynb b/choropleth-maps.ipynb index c0f860af1..b46c5dc4f 100644 --- a/choropleth-maps.ipynb +++ b/choropleth-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "36b44e22", + "id": "4d4b5840", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).\n", @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f9e778b", + "id": "60d3f375", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "78e7d69a", + "id": "e6884c4b", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6599a20", + "id": "fb6d589c", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "be7e9a2d", + "id": "cb58d0dc", "metadata": {}, "source": [ "### Choropleth map using GeoJSON\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba133a57", + "id": "16bce5d1", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "b1ad74a7", + "id": "33c1cd98", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "671fca3b", + "id": "9eca91f3", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "3c903134", + "id": "2ef6a87b", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron.\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7884d8f3", + "id": "c5bec732", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "8c5506c5", + "id": "0b589a49", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0301481", + "id": "4387d305", "metadata": { "hide_code": true }, @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "8a9627a0", + "id": "0b5e254f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "2f3741be", + "id": "35e67253", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb2b7279", + "id": "2eedfced", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "485a3df1", + "id": "16f29a93", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf31baab", + "id": "c770933d", "metadata": { "lines_to_next_cell": 2 }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "a16bbc0e", + "id": "faca2fcf", "metadata": {}, "source": [ "### Using Built-in Country and State Geometries\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c29b2a1", + "id": "71779de4", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "4114c5fb", + "id": "809f23b2", "metadata": {}, "source": [ "To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes):" @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ae2e1e2", + "id": "4a86393f", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "9912b0ad", + "id": "33ecba8e", "metadata": {}, "source": [ "### Choropleth Maps with go.Choropleth\n", @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe961af6", + "id": "a76c3612", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "021cec65", + "id": "083e0144", "metadata": {}, "source": [ "#### Customize choropleth chart" @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a45bff2", + "id": "de9a94ce", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "a9fa820a", + "id": "35360ffb", "metadata": {}, "source": [ "#### World Choropleth Map" @@ -437,7 +437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff82da15", + "id": "5d4ef819", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "a0f7dc3b", + "id": "d797e7f8", "metadata": {}, "source": [ "#### County Choropleth Figure Factory\n", @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93605730", + "id": "01f6ec73", "metadata": {}, "outputs": [], "source": [ @@ -531,7 +531,7 @@ }, { "cell_type": "markdown", - "id": "af5d2194", + "id": "e29434fc", "metadata": {}, "source": [ "#### Reference\n", @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "02979cdc", + "id": "5d9d18f1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/click-events.ipynb b/click-events.ipynb index d064bdd0f..ceb42c241 100644 --- a/click-events.ipynb +++ b/click-events.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "09c429db", + "id": "f9a04654", "metadata": {}, "source": [ "#### Update Points Using a Click Callback" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8328641", + "id": "b4a2717d", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "1b71f423", + "id": "12ba8cc7", "metadata": {}, "source": [ "" @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "fc228315", + "id": "11fe4ff7", "metadata": {}, "source": [ "#### Reference" @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "b3ccdade", + "id": "3e32bc08", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aebb8722", + "id": "b273f0d7", "metadata": { "lines_to_next_cell": 2 }, @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "fa520b34", + "id": "6af60b75", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/colorscales.ipynb b/colorscales.ipynb index 1efa0bd90..22c4380a8 100644 --- a/colorscales.ipynb +++ b/colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7b31f89a", + "id": "df441cc5", "metadata": {}, "source": [ "### Continuous vs Discrete Color\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61802ea8", + "id": "51ccd434", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "fde49a93", + "id": "d0ef801b", "metadata": {}, "source": [ "Converting this column to strings is very straightforward:" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe526645", + "id": "1c9b0ceb", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "b3a64db3", + "id": "45b5b348", "metadata": {}, "source": [ "If you have stringified numbers you can convert back just as easily:" @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "118fb1bf", + "id": "a43dbfbe", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "cb454200", + "id": "9382843d", "metadata": {}, "source": [ "### Colorscales in Dash\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3acebbcd", + "id": "cb205289", "metadata": { "hide_code": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "76fbbda2", + "id": "bb1c8c86", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "ebcdda0d", + "id": "23744e57", "metadata": {}, "source": [ "### Color Scales in Plotly Express\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7860041a", + "id": "69a80627", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "9bd31064", + "id": "f26aeb2c", "metadata": {}, "source": [ "It is also possible to specify color scales by name. Here is an example that specifies the `Inferno` color scale by name, as a string" @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d57179c2", + "id": "b3aec6f9", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "ac5b22fc", + "id": "2cb2da36", "metadata": {}, "source": [ "### Reversing a built-in color scale\n", @@ -187,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b10e2d37", + "id": "de03c54f", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d09e161", + "id": "6f777ac5", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "8a38cf23", + "id": "9a9c0666", "metadata": {}, "source": [ "### Explicitly Constructing a Color scale\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98fe02ec", + "id": "d952414b", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "616e64d4", + "id": "cf98d2a5", "metadata": {}, "source": [ "The example above provided a list of CSS colors to construct a scale, which inferred the reference points to be evenly spaced, but specific reference points can be provided as well. The following example has the same result:" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "170b7e52", + "id": "13944495", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "5b8c7cf1", + "id": "2f064036", "metadata": {}, "source": [ "### Constructing a Discrete or Discontinuous Color Scale\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a517b9c", + "id": "cf41d221", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "52465039", + "id": "29edcd60", "metadata": {}, "source": [ "### Explicitly setting a Color Range\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07fe97f2", + "id": "b5cff787", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "3d5af2d6", + "id": "57305eec", "metadata": {}, "source": [ "### Setting the Midpoint of a Color Range for a Diverging Color scale\n", @@ -327,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05523f8a", + "id": "7dfa06f9", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "58435425", + "id": "fad8b88c", "metadata": {}, "source": [ "### Hiding or Customizing the Plotly Express Color Bar\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1751ac56", + "id": "524c32e8", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "726981a4", + "id": "e55541f7", "metadata": {}, "source": [ "You can also configure the title, size, placement and tick marks and labels on a color bar:" @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4650971", + "id": "86e8fb3f", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "243118c5", + "id": "2275a741", "metadata": {}, "source": [ "### Customizing Tick Text on Discrete Color Bars\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d1febfb", + "id": "d3ee6115", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "6338bee6", + "id": "33e51038", "metadata": {}, "source": [ "### Customizing Tick Text on Logarithmic Color Bars\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cda492d8", + "id": "b1a4332a", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "d066044e", + "id": "b3e630f9", "metadata": {}, "source": [ "### Using Label Aliases on Colorbars\n", @@ -480,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcbd4318", + "id": "1539f567", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "cea61493", + "id": "32916909", "metadata": {}, "source": [ "### Custom Discretized Heatmap Color scale with Graph Objects" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "649dde50", + "id": "37426bc0", "metadata": {}, "outputs": [], "source": [ @@ -582,7 +582,7 @@ }, { "cell_type": "markdown", - "id": "13f0ee88", + "id": "b3a2456e", "metadata": {}, "source": [ "### Color scale for Scatter Plots with Graph Objects" @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a40303c2", + "id": "6b06f911", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "d18a880e", + "id": "01fdf392", "metadata": {}, "source": [ "### Color scale for Contour Plot with Graph Objects" @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "797a8e16", + "id": "487321c4", "metadata": {}, "outputs": [], "source": [ @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "4cf9b792", + "id": "d2cf5c61", "metadata": {}, "source": [ "### Custom Heatmap Color scale with Graph Objects" @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9ac6ed3", + "id": "e4d45e52", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "53f4c46a", + "id": "12cd4b5b", "metadata": {}, "source": [ "### Setting the Midpoint of a Diverging Color scale with Graph Objects\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "624ff4e8", + "id": "959d0173", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "cf5c87fa", + "id": "6e0cbf7c", "metadata": {}, "source": [ "The heatmap chart uses [marker.zmid](https://plotly.com/python/reference/scatter/#scatter-marker-zmid) attribute to set the mid-point of the color domain." @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2781515", + "id": "14393beb", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "76a019cd", + "id": "e8f762c6", "metadata": {}, "source": [ "### Custom Contour Plot Color scale with Graph Objects" @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67717f8f", + "id": "1ff408f8", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "b4dcc70e", + "id": "d012e114", "metadata": {}, "source": [ "### Custom Color bar Title, Labels, and Ticks with Graph Objects\n", @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18e32c6d", + "id": "7b5fd2d2", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "57452513", + "id": "520d2f11", "metadata": {}, "source": [ "### Color Bar Displayed Horizontally\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f285017c", + "id": "dc35d822", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "52bce164", + "id": "d2897fc7", "metadata": {}, "source": [ "### Sharing a Color Axis with Graph Objects\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3339247", + "id": "8a14d34c", "metadata": {}, "outputs": [], "source": [ @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "15ac7c5e", + "id": "6072d60b", "metadata": {}, "source": [ "### Logarithmic Color scale with Graph Objects" @@ -916,7 +916,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b58fb9ee", + "id": "d2a7c67d", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "0894ffd8", + "id": "e1fdd34d", "metadata": {}, "source": [ "### Positioning Colorbars\n", @@ -962,7 +962,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ef9bc7d", + "id": "19974d5b", "metadata": {}, "outputs": [], "source": [ @@ -991,7 +991,7 @@ }, { "cell_type": "markdown", - "id": "1797db63", + "id": "aeab83a3", "metadata": {}, "source": [ "### Reference\n", @@ -1001,7 +1001,7 @@ }, { "cell_type": "markdown", - "id": "b74ffe93", + "id": "1c761089", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/cone-plot.ipynb b/cone-plot.ipynb index e5e404b5e..673b1419d 100644 --- a/cone-plot.ipynb +++ b/cone-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5823344a", + "id": "8fb22a9e", "metadata": {}, "source": [ "A cone plot is the 3D equivalent of a 2D [quiver plot](/python/quiver-plots/), i.e., it represents a 3D vector field using cones to represent the direction and norm of the vectors. 3-D coordinates are given by `x`, `y` and `z`, and the coordinates of the vector field by `u`, `v` and `w`.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eeadc7e6", + "id": "a1ebd674", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "78ea1121", + "id": "d239ec98", "metadata": {}, "source": [ "### Multiple 3D Cones" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf45e774", + "id": "57b8f735", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "2b23888b", + "id": "3f56b696", "metadata": {}, "source": [ "### 3D Cone Lighting" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9777dac9", + "id": "c38229a3", "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "6862a65b", + "id": "24e6b6fe", "metadata": {}, "source": [ "### 3D Cone Vortex" @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3254f247", + "id": "fcb7c2fc", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "a6bb3771", + "id": "700e651e", "metadata": {}, "source": [ "### Sizemode\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "763879cc", + "id": "55a3a72a", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "3b3184b0", + "id": "a1f840b0", "metadata": {}, "source": [ "#### Reference\n", @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "b2aa07d0", + "id": "d9db5e9e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/configuration-options.ipynb b/configuration-options.ipynb index 567579894..60798f38d 100644 --- a/configuration-options.ipynb +++ b/configuration-options.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2ea647e9", + "id": "7812ace0", "metadata": {}, "source": [ "## Configuration Options\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78942ea8", + "id": "55a18f40", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "449ee202", + "id": "fe088e72", "metadata": {}, "source": [ "### Turning Off Responsiveness\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31ff70e9", + "id": "6108fa21", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "dbfbccee", + "id": "3b8a7660", "metadata": {}, "source": [ "### Making A Static Chart" @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3da1784", + "id": "43580d02", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "1b875785", + "id": "ea092923", "metadata": {}, "source": [ "### Forcing The Modebar to Always Be Visible\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a051502f", + "id": "a0b2401b", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "52558d73", + "id": "9a0ebdf4", "metadata": {}, "source": [ "### Preventing the Modebar from Appearing\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "575de043", + "id": "ed493379", "metadata": { "lines_to_next_cell": 2 }, @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "96918d32", + "id": "d5a2c624", "metadata": {}, "source": [ "### Hiding the Plotly Logo on the Modebar" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2e177b8", + "id": "3220f2c9", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "111f116d", + "id": "ee19980b", "metadata": {}, "source": [ "### Customizing Modebar \"Download Plot\" Button\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a45bcc3f", + "id": "c0bce1b8", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "1e00889d", + "id": "7e5e82ab", "metadata": {}, "source": [ "Figures can be set to download at the currently-rendered size by setting `height` and `width` to `None`:\n" @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a4d1eb2", + "id": "aed97567", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "05b6b62f", + "id": "eb32141c", "metadata": {}, "source": [ "### Removing Modebar Buttons\n", @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "357edeb7", + "id": "c4a272df", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "aa27c76c", + "id": "833c8b94", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74883aca", + "id": "1bdc35f8", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "a860df15", + "id": "49c45f73", "metadata": {}, "source": [ "### Add optional shape-drawing buttons to modebar\n", @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cfdfe8c", + "id": "2b3d5d51", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "0a1d585b", + "id": "7fec56d1", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02475121", + "id": "17fa53c4", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "54ff0066", + "id": "19519f00", "metadata": {}, "source": [ "### Double-Click Delay\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da11a151", + "id": "904e6210", "metadata": {}, "outputs": [], "source": [ @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "cb37f7a2", + "id": "ac1f59af", "metadata": {}, "source": [ "### Disabling Buttons for Specific Axes\n", @@ -460,7 +460,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9bbaed8", + "id": "c4e27495", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "c52a26ca", + "id": "a3115e48", "metadata": {}, "source": [ "### Configuring Figures in Dash Apps\n", @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "96182202", + "id": "36b216e8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/continuous-error-bars.ipynb b/continuous-error-bars.ipynb index d1326e9c3..2d445114c 100644 --- a/continuous-error-bars.ipynb +++ b/continuous-error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a8d688d8", + "id": "5708dd88", "metadata": {}, "source": [ "Continuous error bands are a graphical representation of error or uncertainty as a shaded region around a main trace, rather than as discrete whisker-like error bars. They can be implemented in a manner similar to [filled area plots](/python/filled-area-plots/) using `scatter` traces with the `fill` attribute.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51ff4989", + "id": "5359f880", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "b52a1c38", + "id": "c21a432f", "metadata": {}, "source": [ "#### Filling between two traces\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00f17c4d", + "id": "24f2cb99", "metadata": { "lines_to_next_cell": 2 }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "cdf85a20", + "id": "a117408f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/contour-plots.ipynb b/contour-plots.ipynb index 258117b62..a8eff7134 100644 --- a/contour-plots.ipynb +++ b/contour-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dd3b9619", + "id": "e3b8f719", "metadata": {}, "source": [ "### Basic Contour Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb0b4cb9", + "id": "1c57da4c", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "4f930cd1", + "id": "0ccbdde0", "metadata": {}, "source": [ "### Setting X and Y Coordinates in a Contour Plot ###" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e0c0f9e", + "id": "1d5bfbf5", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "18b53b1f", + "id": "6c84ed66", "metadata": {}, "source": [ "### Colorscale for Contour Plot ###" @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9f5a63e", + "id": "328ade4f", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "f2773720", + "id": "61c0be9f", "metadata": {}, "source": [ "### Customizing Size and Range of a Contour Plot's Contours ###" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d915d90b", + "id": "abea0191", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "ab7356ee", + "id": "d8a16183", "metadata": {}, "source": [ "### Customizing Spacing Between X and Y Axis Ticks ###" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5e7ad91", + "id": "aed02ec8", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "76a818fd", + "id": "b67c71ac", "metadata": {}, "source": [ "### Connect the Gaps Between None Values in the Z Matrix ###" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65edb9ae", + "id": "4ac511d7", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "c64b888b", + "id": "d36ead3b", "metadata": {}, "source": [ "### Smoothing the Contour lines ###" @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e885efd9", + "id": "a0f7dff2", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "aff9206e", + "id": "704bdbbc", "metadata": {}, "source": [ "### Smooth Contour Coloring ###" @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1402eda6", + "id": "b0a7845d", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "0df04433", + "id": "4e6473c5", "metadata": {}, "source": [ "### Contour Line Labels ###" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f032b7a", + "id": "c2c5a103", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "216da087", + "id": "54b5b6ee", "metadata": {}, "source": [ "### Contour Lines ###" @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94e9bb80", + "id": "228b2ca5", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "35e05b3c", + "id": "13d2ac02", "metadata": {}, "source": [ "### Custom Contour Plot Colorscale ###" @@ -344,7 +344,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d615cccc", + "id": "95a79804", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "5efd2cdc", + "id": "93643d85", "metadata": {}, "source": [ "### Color Bar Title ###" @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3e51fbf", + "id": "375397ed", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "23a1c884", + "id": "fbf8f552", "metadata": {}, "source": [ "### Color Bar Size for Contour Plots\n", @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d0ede0b", + "id": "23f34075", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ }, { "cell_type": "markdown", - "id": "f6a77bf7", + "id": "83e098f8", "metadata": {}, "source": [ "### Styling Color Bar Ticks for Contour Plots" @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c9bbfce", + "id": "46d4eb42", "metadata": {}, "outputs": [], "source": [ @@ -477,7 +477,7 @@ }, { "cell_type": "markdown", - "id": "9994365a", + "id": "9f650575", "metadata": {}, "source": [ "#### Reference\n", @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "400eecb3", + "id": "c89a9130", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/county-choropleth.ipynb b/county-choropleth.ipynb index a2dac0713..bd553cf46 100644 --- a/county-choropleth.ipynb +++ b/county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a985c6a8", + "id": "d378a551", "metadata": {}, "source": [ "### Deprecation warning" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "a5fc2b9a", + "id": "4afdfcbb", "metadata": {}, "source": [ "This page describes a [legacy \"figure factory\" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth)." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "336ec61f", + "id": "ae8c4c09", "metadata": {}, "source": [ "#### Required Packages\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fe51f1c", + "id": "a8c7158a", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "587be7f7", + "id": "9f6e145a", "metadata": {}, "source": [ "If you are using Windows, follow this post to properly install geopandas and dependencies: http://geoffboeing.com/2014/09/using-geopandas-windows/. If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:" @@ -50,7 +50,7 @@ }, { "cell_type": "raw", - "id": "2e5f5f49", + "id": "ea86b517", "metadata": {}, "source": [ "conda install plotly\n", @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "4df5149a", + "id": "50fe6460", "metadata": {}, "source": [ "#### FIPS and Values\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "3b15629a", + "id": "85fdc602", "metadata": {}, "source": [ "#### Simple Example\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb3ce336", + "id": "fb06cfb0", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "fe427c56", + "id": "640e3a50", "metadata": {}, "source": [ "#### Change the Scope\n", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e37da1b", + "id": "c4e2a8bb", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "57bd2cf9", + "id": "10a6bc9f", "metadata": {}, "source": [ "#### Single State" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f18bec3f", + "id": "4634d914", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "9cc946d8", + "id": "d73f25ab", "metadata": {}, "source": [ "#### Multiple States" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1286757b", + "id": "c1465ea4", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "57bca5c1", + "id": "1ac4f316", "metadata": {}, "source": [ "#### Simplify County, State Lines\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3709ddd5", + "id": "f19f42a5", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "a62c21d3", + "id": "5f41f240", "metadata": {}, "source": [ "#### The Entire USA" @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "520f1405", + "id": "4f566fb0", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "f881ebbe", + "id": "2b045b07", "metadata": {}, "source": [ "Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)\n", @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "7fab306d", + "id": "46a033dd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/creating-and-updating-figures.ipynb b/creating-and-updating-figures.ipynb index 31d1d7eb3..1760017f0 100644 --- a/creating-and-updating-figures.ipynb +++ b/creating-and-updating-figures.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "db61beba", + "id": "fb3a7bd5", "metadata": {}, "source": [ "The `plotly` Python package exists to create, manipulate and [render](/python/renderers/) graphical figures (i.e. charts, plots, maps and diagrams) represented by [data structures also referred to as figures](/python/figure-structure/). The rendering process uses the [Plotly.js JavaScript library](https://plotly.com/javascript/) under the hood although Python developers using this module very rarely need to interact with the Javascript library directly, if ever. Figures can be represented in Python either as dicts or as instances of the `plotly.graph_objects.Figure` class, and are serialized as text in [JavaScript Object Notation (JSON)](https://json.org/) before being passed to Plotly.js.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcfb3227", + "id": "85d6d5a3", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "199465f2", + "id": "62ce44f8", "metadata": {}, "source": [ "### Figures as Graph Objects\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "91487c5e", + "id": "1328213b", "metadata": {}, "source": [ "Below you can find an example of one way that the figure in the example above could be specified using a graph object instead of a dictionary." @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13655ebf", + "id": "a31657c1", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "524883d5", + "id": "b90c398c", "metadata": {}, "source": [ "You can also create a graph object figure from a dictionary representation by passing the dictionary to the `go.Figure` constructor." @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6bbe73a", + "id": "4a148635", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "210dba3f", + "id": "a687041d", "metadata": {}, "source": [ "##### Converting Graph Objects To Dictionaries and JSON\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9b3f7b8", + "id": "76935a95", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "ef0288ca", + "id": "3908238e", "metadata": {}, "source": [ "### Representing Figures in Dash\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa92c3dc", + "id": "736f6d14", "metadata": { "hide_code": true }, @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "fb6bb5f3", + "id": "ab7f0f83", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "f9dd12dc", + "id": "8d2cfa8e", "metadata": {}, "source": [ "### Creating Figures\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "f239f3fb", + "id": "511bac7c", "metadata": {}, "source": [ "#### Plotly Express\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b7ec921", + "id": "1ba9626f", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "3d3f638a", + "id": "a0be7bfd", "metadata": {}, "source": [ "#### Graph Objects `Figure` Constructor\n", @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0c50b03", + "id": "022962a5", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "735f2889", + "id": "bf754a63", "metadata": {}, "source": [ "#### Figure Factories\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "992c188a", + "id": "ba7778c5", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "3659fc69", + "id": "04e380bd", "metadata": {}, "source": [ "#### Make Subplots\n", @@ -289,7 +289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66478b20", + "id": "eacb0244", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "84adec5a", + "id": "9838345b", "metadata": {}, "source": [ "### Updating Figures\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d0dd6d6", + "id": "8594d132", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "8656ca07", + "id": "001e995a", "metadata": {}, "source": [ "You can also add traces to a figure produced by a figure factory or Plotly Express." @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31d3bf70", + "id": "96c979d2", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "a57e81dd", + "id": "eef8c5af", "metadata": {}, "source": [ "#### Adding Traces To Subplots\n", @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9f8c93d", + "id": "249c90f6", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "554e88d0", + "id": "6eb47fc1", "metadata": {}, "source": [ "This also works for figures created by Plotly Express using the `facet_row` and or `facet_col` arguments." @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e28e127", + "id": "0133a528", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "4456d6a3", + "id": "b7745a9d", "metadata": {}, "source": [ "#### Add Trace Convenience Methods\n", @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44046a3d", + "id": "e9dd07dc", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "4ce9ab43", + "id": "79eedbee", "metadata": {}, "source": [ "#### Magic Underscore Notation\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d7ac326", + "id": "ec811fc7", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "fb89051a", + "id": "92709525", "metadata": {}, "source": [ "With magic underscore notation, you can accomplish the same thing by passing the figure constructor a keyword argument named `layout_title_text`, and by passing the `go.Scatter` constructor a keyword argument named `line_color`." @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de65ad1d", + "id": "8a35ad05", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "58e95515", + "id": "fc6a7174", "metadata": {}, "source": [ "Magic underscore notation is supported throughout the graph objects API, and it can often significantly simplify operations involving deeply nested properties.\n", @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec5a1148", + "id": "42d72c0e", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +553,7 @@ }, { "cell_type": "markdown", - "id": "826de3be", + "id": "b0a87ee8", "metadata": {}, "source": [ "Note that the following `update_layout()` operations are equivalent:" @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "049d575c", + "id": "4ce47051", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "c4202dd6", + "id": "7376b566", "metadata": {}, "source": [ "#### Updating Traces\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36e7a63d", + "id": "36a96d72", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "535f0d12", + "id": "ed070146", "metadata": {}, "source": [ "Note that both `scatter` and `bar` traces have a `marker.color` property to control their coloring. Here is an example of using `update_traces()` to modify the color of all traces." @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d95471e", + "id": "197f7ddd", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "72bcafa4", + "id": "5516ba87", "metadata": {}, "source": [ "The `update_traces()` method supports a `selector` argument to control which traces should be updated. Only traces with properties that match the selector will be updated. Here is an example of using a selector to only update the color of the `bar` traces." @@ -676,7 +676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d007810a", + "id": "aaa8396d", "metadata": {}, "outputs": [], "source": [ @@ -708,7 +708,7 @@ }, { "cell_type": "markdown", - "id": "65a8a9d8", + "id": "1cfc940b", "metadata": {}, "source": [ "Magic underscore notation can be used in the selector to match nested properties. Here is an example of updating the color of all traces that were formally colored `\"MediumPurple\"`." @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27a9c3b9", + "id": "5d4d6f14", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "5e3925da", + "id": "9fca6684", "metadata": {}, "source": [ "For figures with subplots, the `update_traces()` method also supports `row` and `col` arguments to control which traces should be updated. Only traces in the specified subplot row and column will be updated. Here is an example of updating the color of all traces in the second subplot column." @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f1dbf61", + "id": "88e50979", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "df70a378", + "id": "ba1a04d5", "metadata": {}, "source": [ "The `update_traces()` method can also be used on figures produced by figure factories or Plotly Express. Here's an example of updating the regression lines produced by Plotly Express to be dotted." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b4c0c63", + "id": "d7dfc7dc", "metadata": {}, "outputs": [], "source": [ @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "926213ef", + "id": "ad119fa3", "metadata": {}, "source": [ "### Overwrite Existing Properties When Using Update Methods\n", @@ -833,7 +833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2856eaa3", + "id": "89156bd9", "metadata": {}, "outputs": [], "source": [ @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "7dc67be3", + "id": "0d4d9046", "metadata": {}, "source": [ "#### Conditionally Updating Traces\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3c1f733", + "id": "631509ed", "metadata": {}, "outputs": [], "source": [ @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "6731e3df", + "id": "5f03737a", "metadata": {}, "source": [ "#### Updating Figure Axes\n", @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "181f36e1", + "id": "9dddf2c0", "metadata": {}, "outputs": [], "source": [ @@ -917,7 +917,7 @@ }, { "cell_type": "markdown", - "id": "ae1064c3", + "id": "4b6b5921", "metadata": {}, "source": [ "There are also `for_each_xaxis()` and `for_each_yaxis()` methods that are analogous to the `for_each_trace()` method described above. For non-cartesian subplot types (e.g. polar), there are additional `update_{type}` and `for_each_{type}` methods (e.g. `update_polar()`, `for_each_polar()`).\n", @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b9f5540", + "id": "12013c85", "metadata": {}, "outputs": [], "source": [ @@ -967,7 +967,7 @@ }, { "cell_type": "markdown", - "id": "d94c1a46", + "id": "5624c154", "metadata": {}, "source": [ "#### Property Assignment\n", @@ -978,7 +978,7 @@ { "cell_type": "code", "execution_count": null, - "id": "284aaee6", + "id": "255973d5", "metadata": {}, "outputs": [], "source": [ @@ -990,7 +990,7 @@ }, { "cell_type": "markdown", - "id": "5a9c22d5", + "id": "8c80b090", "metadata": {}, "source": [ "And here is an example of updating the bar outline using property assignment." @@ -999,7 +999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57289aea", + "id": "54718bea", "metadata": { "lines_to_next_cell": 2 }, @@ -1017,7 +1017,7 @@ }, { "cell_type": "markdown", - "id": "057715c7", + "id": "c35f67fc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/custom-buttons.ipynb b/custom-buttons.ipynb index 32e253c62..ba66596b0 100644 --- a/custom-buttons.ipynb +++ b/custom-buttons.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c1715d22", + "id": "1fd26b45", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "94afa515", + "id": "c880aded", "metadata": {}, "source": [ "#### Restyle Button\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "596cc0e8", + "id": "941ef5b7", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "908c11ac", + "id": "ffaa7b1b", "metadata": {}, "source": [ "**Update Several Data Attributes**
\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33ff560d", + "id": "776f1da6", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "f70fbed5", + "id": "c720be5d", "metadata": {}, "source": [ "#### Relayout Button\n", @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9fc466b0", + "id": "e2acac3f", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "ce71f21f", + "id": "17292886", "metadata": {}, "source": [ "#### Update Button\n", @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00f8ddb1", + "id": "334043df", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "04dccdb7", + "id": "4bc92aaa", "metadata": {}, "source": [ "#### Animate Button\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "7b623db3", + "id": "04230bd4", "metadata": {}, "source": [ "#### Reference\n", @@ -503,7 +503,7 @@ }, { "cell_type": "markdown", - "id": "c042aa56", + "id": "2f9a44c4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dash.ipynb b/dash.ipynb index 57cbc95db..437f7fe72 100644 --- a/dash.ipynb +++ b/dash.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b049cd6f", + "id": "1bb31f35", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "fc87bdaf", + "id": "f5239b0f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dendrogram.ipynb b/dendrogram.ipynb index 9b8c7d846..e24d2f465 100644 --- a/dendrogram.ipynb +++ b/dendrogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b0939163", + "id": "910c259c", "metadata": {}, "source": [ "#### Basic Dendrogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74076f75", + "id": "52a553fa", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "a649967f", + "id": "5bb73323", "metadata": {}, "source": [ "#### Set Color Threshold" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "189e4ab1", + "id": "44a49151", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "01e3da9f", + "id": "67416456", "metadata": {}, "source": [ "#### Set Orientation and Add Labels" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fe59dcc", + "id": "038e2873", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "e3f7a26d", + "id": "dc0a7265", "metadata": {}, "source": [ "#### Plot a Dendrogram with a Heatmap\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35f9b37d", + "id": "a52e9adc", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "0fd287dd", + "id": "744b4aae", "metadata": {}, "source": [ "### Reference\n", @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "98224dfb", + "id": "b07029c2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/density-heatmaps.ipynb b/density-heatmaps.ipynb index 1f07fbd7c..316e0b170 100644 --- a/density-heatmaps.ipynb +++ b/density-heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a2981303", + "id": "870e7ae0", "metadata": {}, "source": [ "### Density map with `plotly.express`\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dbe083f", + "id": "f86c7e8e", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "104d2d5f", + "id": "797de2e1", "metadata": {}, "source": [ "### Density map with `plotly.graph_objects`\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bfd3624", + "id": "f77c0aef", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "437b8e7f", + "id": "e7fc4715", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "661b335a", + "id": "4cd5eb13", "metadata": {}, "source": [ "#### Stamen Terrain base map with Mapbox (Stadia Maps token needed): density heatmap with `plotly.express`\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "5d838be9", + "id": "89f53c4e", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "b2e75c7f", + "id": "d95c5024", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/discrete-color.ipynb b/discrete-color.ipynb index f48883a17..f932af0be 100644 --- a/discrete-color.ipynb +++ b/discrete-color.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c4182a49", + "id": "627471cb", "metadata": {}, "source": [ "### Discrete vs Continuous Color\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f999e0b", + "id": "10aa9f58", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "1fa910c5", + "id": "9cd8e82c", "metadata": {}, "source": [ "The `size` column, however, contains numbers:" @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f688934", + "id": "8460dabb", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "1d11be3b", + "id": "8d66643d", "metadata": {}, "source": [ "Converting this column to strings is very straightforward, but note that the ordering in the legend is not sequential by default (see below for how to control discrete order):" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2249ffa5", + "id": "74377585", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "a0e63929", + "id": "0e3ef6f0", "metadata": {}, "source": [ "Converting a string column to a numeric one is also quite straightforward:" @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a285faf3", + "id": "32b1caf7", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "1384647f", + "id": "e3c58d42", "metadata": {}, "source": [ "### Discrete Colors in Dash\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4862229", + "id": "34fef4b1", "metadata": { "hide_code": true }, @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "630f47df", + "id": "8e4e473b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "8580c878", + "id": "1ac4f305", "metadata": {}, "source": [ "### Color Sequences in Plotly Express\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c3539f9", + "id": "bdb31f37", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "a626113a", + "id": "4e46bc49", "metadata": {}, "source": [ "Color sequences in the `px.colors.qualitative` module are stored as lists of CSS colors:" @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3bdb44a", + "id": "a3d98b22", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "26798951", + "id": "cd376ea1", "metadata": {}, "source": [ "Here is an example that creates a scatter plot using Plotly Express, with points colored using the built-in qualitative `G10` color sequence." @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b799b16", + "id": "45afb2a2", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "c4fdf521", + "id": "ea7e3a1f", "metadata": {}, "source": [ "### Explicitly Constructing a Color Sequence\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "457becf6", + "id": "844051ec", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "73ead8b6", + "id": "3689accc", "metadata": {}, "source": [ "**_Warning_**: If your color sequence has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:" @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e33f165", + "id": "383c7020", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "9286b1dc", + "id": "958ad083", "metadata": {}, "source": [ "### Directly Mapping Colors to Data Values\n", @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f7b4de5", + "id": "b3986044", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "0c43ff8e", + "id": "e727b05c", "metadata": {}, "source": [ "If your data set already contains valid CSS colors which you wish to use directly, you can pass the special value `\"identity\"` to `color_discrete_map`, in which case the legend is hidden by default, and the color does not appear in the hover label:" @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc1f604c", + "id": "ac68ea6a", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "43b245c7", + "id": "eb296b17", "metadata": {}, "source": [ "### Controlling Discrete Color Order\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd14e82b", + "id": "77c9fd90", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "091cdcf9", + "id": "fe50fe71", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "943b11de", + "id": "02aaa235", "metadata": {}, "source": [ "### Using Sequential Scales as Discrete Sequences\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b87b3549", + "id": "f7926934", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "099d593b", + "id": "0882b85a", "metadata": {}, "source": [ "This works because just like in `px.colors.qualitative`, all [built-in continuous color scales](/python/builtin-colorscales/) are stored as lists of CSS colors:" @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd144b02", + "id": "05135323", "metadata": { "lines_to_next_cell": 2 }, @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "f2e025bf", + "id": "61137dcf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/distplot.ipynb b/distplot.ipynb index 9663db8c2..c80894f09 100644 --- a/distplot.ipynb +++ b/distplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3a757f8d", + "id": "8a86e526", "metadata": {}, "source": [ "## Combined statistical representations with px.histogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3aa20b48", + "id": "35c9d237", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "453bc4de", + "id": "8ea40eae", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "46987908", + "id": "e1b98c2a", "metadata": {}, "source": [ "### Combined statistical representations in Dash\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bbc31ea", + "id": "1b28659a", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "f4665d81", + "id": "d578c9a0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "b28c8534", + "id": "e99a0749", "metadata": {}, "source": [ "## Combined statistical representations with distplot figure factory\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b3b03e8", + "id": "e3979ddc", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "1187cbec", + "id": "695a1634", "metadata": {}, "source": [ "#### Plot Multiple Datasets" @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fcb7b97", + "id": "e9d927f6", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "00c61740", + "id": "7808ec43", "metadata": {}, "source": [ "#### Use Multiple Bin Sizes\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32967348", + "id": "9ba46941", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "93e18585", + "id": "23dc156a", "metadata": {}, "source": [ "#### Customize Rug Text, Colors & Title" @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48501f08", + "id": "6c5f30ec", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "74c0e492", + "id": "384c7c73", "metadata": {}, "source": [ "#### Plot Normal Curve" @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae0cb734", + "id": "3c5af094", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "91740616", + "id": "e0332002", "metadata": {}, "source": [ "#### Plot Only Curve and Rug" @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a709490", + "id": "6117af2d", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "f86849c0", + "id": "35be9fba", "metadata": {}, "source": [ "#### Plot Only Hist and Rug" @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a68a56d3", + "id": "73557b70", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "508dfd80", + "id": "41bc8516", "metadata": {}, "source": [ "#### Plot Hist and Rug with Different Bin Sizes" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2c1ab3e", + "id": "4c93a8d4", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "b6fe9434", + "id": "f3a9be4b", "metadata": {}, "source": [ "#### Plot Only Hist and Curve" @@ -374,7 +374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb50a8a5", + "id": "1809f910", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "203dcee8", + "id": "f4dd47aa", "metadata": {}, "source": [ "#### Distplot with Pandas" @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b652a05d", + "id": "5474ee85", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "ffea00ef", + "id": "ec7838da", "metadata": {}, "source": [ "#### Reference" @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "f078e052", + "id": "cff875f7", "metadata": {}, "source": [ "For more info on `ff.create_distplot()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_distplot.html)\n" @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "2319fd44", + "id": "ef892a87", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dot-plots.ipynb b/dot-plots.ipynb index adf399467..818c404c2 100644 --- a/dot-plots.ipynb +++ b/dot-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3fbc8d64", + "id": "6dcbe6fa", "metadata": {}, "source": [ "#### Basic Dot Plot\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd8fc9f3", + "id": "8b1ec2ce", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc371776", + "id": "5936345f", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a960b28", + "id": "6c46ee2e", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "7975c5bb", + "id": "d46e0436", "metadata": {}, "source": [ "#### Styled Categorical Dot Plot" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "739de96a", + "id": "9d194622", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "91f98a1e", + "id": "f9183734", "metadata": {}, "source": [ "### Reference\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "6e619a85", + "id": "16f039a8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dropdowns.ipynb b/dropdowns.ipynb index 798143e16..54543c4e5 100644 --- a/dropdowns.ipynb +++ b/dropdowns.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2a39cc5f", + "id": "4c351edf", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "329249df", + "id": "311e8ec8", "metadata": {}, "source": [ "## Restyle Dropdown\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7da238c5", + "id": "c1ffaec8", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "f44ed665", + "id": "a722e79c", "metadata": {}, "source": [ "### Update Several Data Attributes\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bbec841", + "id": "4296f6b3", "metadata": {}, "outputs": [], "source": [ @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "7f9b7efb", + "id": "fb1cc227", "metadata": {}, "source": [ "## Relayout Dropdown\n", @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0d69328", + "id": "7273f3a4", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "2ed54529", + "id": "02350bc1", "metadata": {}, "source": [ "### Update Dropdown\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8ffa951", + "id": "9726d0cd", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "95e676d2", + "id": "feed5d66", "metadata": {}, "source": [ "### Graph Selection Dropdowns in Jinja\n", @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "19860f13", + "id": "157f673c", "metadata": {}, "source": [ "\n", @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "4bb406f7", + "id": "4d4ad7b0", "metadata": {}, "source": [ "#### Reference\n", @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "ca37ba95", + "id": "52b2de6e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dumbbell-plots.ipynb b/dumbbell-plots.ipynb index 69aab47dd..707a108c8 100644 --- a/dumbbell-plots.ipynb +++ b/dumbbell-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "38d74bd5", + "id": "210f65b1", "metadata": {}, "source": [ "## Basic Dumbbell Plot" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "fedcecdb", + "id": "7e4b03f0", "metadata": {}, "source": [ "Dumbbell plots are useful for demonstrating change between two sets of data points, for example, the population change for a selection of countries for two different years.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1623c6e", + "id": "a23dd1aa", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "fd71b56b", + "id": "75c4d386", "metadata": {}, "source": [ "## Dumbbell Plot with Arrow Markers\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c502740", + "id": "7d5a8d07", "metadata": { "lines_to_next_cell": 2 }, @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "b9ddabb1", + "id": "0c6a0fd5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ecdf-plots.ipynb b/ecdf-plots.ipynb index a5ed808fe..09ac2ed53 100644 --- a/ecdf-plots.ipynb +++ b/ecdf-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1fc55485", + "id": "faccf6dc", "metadata": {}, "source": [ "### Overview\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de84d85e", + "id": "d4474493", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "56829cdb", + "id": "1ad7f3e6", "metadata": {}, "source": [ "Providing multiple columns leverage's Plotly Express' [wide-form data support](https://plotly.com/python/wide-form/) to show multiple variables on the same plot." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a905d87", + "id": "4aa1cc6d", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "64dd6274", + "id": "2ef1ff13", "metadata": {}, "source": [ "It is also possible to map another variable to the color dimension of a plot." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6320a0f1", + "id": "56115a52", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "40f26039", + "id": "73221eb1", "metadata": {}, "source": [ "### Configuring the Y axis\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed0adf24", + "id": "1125508a", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "f5cd0739", + "id": "de990e5f", "metadata": {}, "source": [ "If a `y` value is provided, the Y axis is set to the sum of `y` rather than counts." @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ac7f9f3", + "id": "604a3727", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "ff798621", + "id": "eead349b", "metadata": {}, "source": [ "### Reversed and Complementary CDF plots\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "818882ce", + "id": "3998cb39", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "ca7e2619", + "id": "78c1bcc3", "metadata": {}, "source": [ "In `reversed` mode, the right-most point is at 1 (or the total count/sum, depending on `ecdfnorm`) and the left-most point is above 0." @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a1d3b31", + "id": "d760ca79", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "6909f89e", + "id": "33343ea5", "metadata": {}, "source": [ "In `complementary` mode, the right-most point is at 0 and no points are at 1 (or the total count/sum) per the definition of the CCDF as 1-ECDF, which has no point at 0." @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14a13f17", + "id": "08684165", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "10cf8d9f", + "id": "e9c52ca4", "metadata": {}, "source": [ "### Orientation\n", @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d61089d", + "id": "cb126618", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "925eb187", + "id": "6d4b0e29", "metadata": {}, "source": [ "### Markers and/or Lines\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eedc5576", + "id": "f1308a37", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63bcdb58", + "id": "9466ee62", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "07574163", + "id": "e1c9fac8", "metadata": {}, "source": [ "### Marginal Plots\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bf5c49e", + "id": "26d26945", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3eabddfc", + "id": "97614b22", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "df54431f", + "id": "11cea6b0", "metadata": {}, "source": [ "### Facets\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5a19548", + "id": "369d2603", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6af47acf", + "id": "08d5315a", "metadata": { "lines_to_next_cell": 2 }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "e812b62e", + "id": "5cb05a6c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/error-bars.ipynb b/error-bars.ipynb index 50ee996fe..9a8cf5a34 100644 --- a/error-bars.ipynb +++ b/error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9acc74c3", + "id": "17913385", "metadata": {}, "source": [ "### Error Bars with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4e892fb", + "id": "cca33bab", "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "613ed8d0", + "id": "73d60ea8", "metadata": {}, "source": [ "#### Asymmetric Error Bars with Plotly Express" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45d1fe29", + "id": "124ac0cf", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "f2b76808", + "id": "1ae9aee5", "metadata": {}, "source": [ "### Error Bars with graph_objects\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dc9782f", + "id": "304023b4", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "ee353ab5", + "id": "3d94a552", "metadata": {}, "source": [ "#### Asymmetric Error Bars" @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11d2618e", + "id": "67cb9561", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "cd93dbe5", + "id": "531bc248", "metadata": {}, "source": [ "#### Error Bars as a Percentage of the y Value" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13558b00", + "id": "8a309bcb", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "57381eeb", + "id": "b07c5442", "metadata": {}, "source": [ "#### Asymmetric Error Bars with a Constant Offset" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec86b91b", + "id": "f82832d2", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "8bd22990", + "id": "4647befd", "metadata": {}, "source": [ "#### Horizontal Error Bars" @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bb04583", + "id": "70c102a2", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "81fbd68d", + "id": "6a3aca71", "metadata": {}, "source": [ "#### Bar Chart with Error Bars" @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e40ea855", + "id": "88b5e643", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "1d4860db", + "id": "b97ce141", "metadata": {}, "source": [ "#### Colored and Styled Error Bars" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbb62bf9", + "id": "42743087", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "0e8a7ddf", + "id": "e5cce8d4", "metadata": {}, "source": [ "#### Reference\n", @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "1e9ba202", + "id": "1f00e37b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/facet-plots.ipynb b/facet-plots.ipynb index 404a0ee55..9f1198941 100644 --- a/facet-plots.ipynb +++ b/facet-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5e0b6899", + "id": "998e97ab", "metadata": {}, "source": [ "### Facet and Trellis Plots\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb3081b4", + "id": "ecce31a4", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "4361412f", + "id": "b39fd3a2", "metadata": {}, "source": [ "### Bar Chart Row Facets\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a900cf6", + "id": "3587333f", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "185ccb8e", + "id": "9d618d28", "metadata": {}, "source": [ "### Wrapping Column Facets\n", @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "635e7309", + "id": "4d91c5a7", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "72fb91ce", + "id": "c59dad6d", "metadata": {}, "source": [ "### Histogram Facet Grids" @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2590151", + "id": "3c6090a1", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "452ce2cd", + "id": "8ca73dc4", "metadata": {}, "source": [ "### Choropleth Column Facets\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4492cd4c", + "id": "ceea4edf", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "570522c0", + "id": "de26bc2b", "metadata": {}, "source": [ "### Adding Lines and Rectangles to Facet Plots\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fda7070", + "id": "6535b4f3", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "af610b12", + "id": "20fbc530", "metadata": {}, "source": [ "### Adding the Same Trace to All Facets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d99554ee", + "id": "07c138b0", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "759993f6", + "id": "53719df1", "metadata": {}, "source": [ "### Facets With Independent Axes\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33fd0dc3", + "id": "f1a54e26", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52c5268f", + "id": "97b6a73d", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "ab12d564", + "id": "0caf7974", "metadata": {}, "source": [ "### Customizing Subplot Figure Titles\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1a2926a", + "id": "fb2981be", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "f461b0e1", + "id": "5f7ede8b", "metadata": {}, "source": [ "### Controlling Facet Ordering\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04bd400d", + "id": "57a524c2", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "99858c2c", + "id": "12084b6d", "metadata": {}, "source": [ "### Controlling Facet Spacing\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f870b5c4", + "id": "4c0ac572", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "014bc68d", + "id": "3e64ba1e", "metadata": {}, "source": [ "### Synchronizing axes in subplots with `matches`\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21480563", + "id": "c9c695a5", "metadata": { "lines_to_next_cell": 2 }, @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "4252dbd8", + "id": "39123d4d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factories.ipynb b/figure-factories.ipynb index 324ad853d..3a65ef1d1 100644 --- a/figure-factories.ipynb +++ b/figure-factories.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "653ece8b", + "id": "c18078aa", "metadata": {}, "source": [ "#### `plotly.figure_factory`\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "8976e664", + "id": "b0d20f28", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-subplots.ipynb b/figure-factory-subplots.ipynb index 6f9b8da85..f2100e40f 100644 --- a/figure-factory-subplots.ipynb +++ b/figure-factory-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "52517fd3", + "id": "d2e5d7a6", "metadata": {}, "source": [ "#### Plotly's Figure Factory Module\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "d7348cb1", + "id": "e91cbf84", "metadata": {}, "source": [ "#### Vertical Figure Factory Charts\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "665ec7d5", + "id": "f469eff6", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "2dbd7568", + "id": "43b09aea", "metadata": {}, "source": [ "Edit the figures' x and y axes attributes to create subplots:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5fb6222", + "id": "b0c52617", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "dd01deaa", + "id": "8d64a481", "metadata": {}, "source": [ "Combine the data and layout objects to create a figure" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73d5cdfc", + "id": "a4cd3cd4", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "0680e117", + "id": "0efaaa05", "metadata": {}, "source": [ "#### Horizontal Table and Chart" @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3742daf0", + "id": "91385cd6", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "255f5101", + "id": "8f69af68", "metadata": {}, "source": [ "#### Vertical Table and Chart" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26c56e0c", + "id": "1c4c7963", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "9eb66bdd", + "id": "f5a64e05", "metadata": {}, "source": [ "#### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "27e3fced", + "id": "cd140734", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-table.ipynb b/figure-factory-table.ipynb index 2b01f4ca6..098a12b4b 100644 --- a/figure-factory-table.ipynb +++ b/figure-factory-table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e56fc589", + "id": "440a8fe0", "metadata": {}, "source": [ "Tables can be created using a [`table` trace type](/python/table/), or by using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d62ea71", + "id": "89d186f0", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "3d088abb", + "id": "09c4d65f", "metadata": {}, "source": [ "#### Add Links" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "413dd854", + "id": "7b7a7dce", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "9ecccfc6", + "id": "80aacb7f", "metadata": {}, "source": [ "### Use LaTeX" @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d2c5175", + "id": "6b302e22", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "47a000cf", + "id": "a5b8fe15", "metadata": {}, "source": [ "### Use a Pandas Dataframe" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a081efd2", + "id": "0c39c609", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "79a16aae", + "id": "5ccaa3d8", "metadata": {}, "source": [ "### Modify Row Height\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54a9afb5", + "id": "72019ea4", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "b1d74a46", + "id": "31682e32", "metadata": {}, "source": [ "### Custom Table Colors\n" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c59c69fa", + "id": "1d5e40cf", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "2ae17a67", + "id": "a3c7e6e4", "metadata": {}, "source": [ "### Custom Font Colors" @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fa11a9b", + "id": "b0b32286", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "96dccec5", + "id": "4ee2d489", "metadata": {}, "source": [ "### Change Font Size" @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0978718", + "id": "3701aa1f", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "0666fef1", + "id": "19bd802f", "metadata": {}, "source": [ "#### Tables with Graphs" @@ -259,7 +259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e4a5390", + "id": "75c1c373", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7411fc54", + "id": "377abbe7", "metadata": { "lines_to_next_cell": 2 }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "87c940ce", + "id": "697aa340", "metadata": {}, "source": [ "#### Reference\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "1fe7814b", + "id": "6dab7097", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-introspection.ipynb b/figure-introspection.ipynb index 8c450d51e..626a0ac0e 100644 --- a/figure-introspection.ipynb +++ b/figure-introspection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d3f4427c", + "id": "e3b47c1c", "metadata": {}, "source": [ "### The Figure Lifecycle\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "81cd0127", + "id": "5ee0ba2a", "metadata": {}, "source": [ "### Introspecting Plotly Express Figures\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34248807", + "id": "2dd924e3", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "1e97593d", + "id": "264626ae", "metadata": {}, "source": [ "We can learn more about the attributes Plotly Express has set for us with the Python `help()` function:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35b7ccb5", + "id": "596b3092", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "0c15d73b", + "id": "e40fceab", "metadata": {}, "source": [ "### Accessing Javascript-Computed Defaults\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5baf47a5", + "id": "99aa7466", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "84c4cc2f", + "id": "439941aa", "metadata": {}, "source": [ "Let's print this figure to see the very small JSON object that is passed to Plotly.js as input:" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70d30a74", + "id": "8a2b9338", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "12256649", + "id": "d758b668", "metadata": {}, "source": [ "Now let's look at the \"full\" figure after Plotly.js has computed the default values for every necessary attribute.\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "244dc89a", + "id": "32f4fcd1", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "0c8e6a9c", + "id": "4c1d66fc", "metadata": {}, "source": [ "As you can see, Plotly.js does a lot of work filling things in for us! Let's look at the examples described at the top of the page of static and dynamic defaults. If we look just at `layout.font` and `layout.xaxis.range` we can see that the static default font size is 12 and that the dynamic default range is computed to be a bit beyond the data range which was 10-20:" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f54c7986", + "id": "3789c611", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "35ac88b8", + "id": "a5bb8c05", "metadata": {}, "source": [ "### Learning About Attributes" @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "f7823ce6", + "id": "9e25ce92", "metadata": {}, "source": [ "What else can we use this `full_fig` for? Let's start by looking at the first entry of the `data`" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2db2f527", + "id": "b98cbd36", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "ca796132", + "id": "b202a4dd", "metadata": {}, "source": [ "We see that this is an instance of `go.Scatter` (as expected, given the input) and that it has an attribute we've maybe never heard of called `cliponaxis` which by default seems to be set to `True` in this case. Let's find out more about this attribute using the built-in Python `help()` function" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f65b7f1e", + "id": "d56e7f0a", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "5a3ce096", + "id": "9a2c66f3", "metadata": {}, "source": [ "Aha! This explains why in our original figure above, the text was cut off by the edge of the plotting area! Let's try forcing that to `False`, and let's also use the attribute `textposition` which we see in the full figure is by default set to `\"middle center\"` to get our text off of our markers:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab72a8bc", + "id": "d67c0b86", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "a031e296", + "id": "a3a9453b", "metadata": {}, "source": [ "We can use this technique (of making a figure, and querying Plotly.js for the \"full\" version of that figure, and then exploring the attributes that are automatically set for us) to learn more about the range of possibilities that the figure schema makes available. We can drill down into `layout` attributes also:" @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d366b9f", + "id": "628151b2", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "e2bdcede", + "id": "205a20a2", "metadata": {}, "source": [ "### More about Layout\n", @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26377867", + "id": "3ccd3c10", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "13a6bfff", + "id": "a1f4de1d", "metadata": {}, "source": [ "If I then set `showrivers=True` and re-query the full figure, I see that new keys have appeared in the `layout.geo` object for `rivercolor` and `riverwidth`, showing the dynamic nature of these defaults." @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59978447", + "id": "65acecf5", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "3347858e", + "id": "e5a1514b", "metadata": {}, "source": [ "### Reference\n", @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b518ab17", + "id": "b3d17285", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "192dc216", + "id": "abc14cd4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-labels.ipynb b/figure-labels.ipynb index bc005fc3a..aab564678 100644 --- a/figure-labels.ipynb +++ b/figure-labels.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d121a1bb", + "id": "67226107", "metadata": {}, "source": [ "### Automatic Labelling with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a8ad247", + "id": "96507ca7", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99be3b8c", + "id": "f13ee046", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "0f0abaa8", + "id": "e86bde9d", "metadata": {}, "source": [ "### Global and Local Font Specification\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd6b1d63", + "id": "06dd97cf", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "89fd0373", + "id": "27042c32", "metadata": {}, "source": [ "### Set Automargin on the Plot Title\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d6eab92", + "id": "e4bfe3a8", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "05e09036", + "id": "1ac535eb", "metadata": {}, "source": [ "### Fonts and Labels in Dash\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "302c6e26", + "id": "730e837b", "metadata": { "hide_code": true }, @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "52b7852f", + "id": "20fabc09", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "94f5319c", + "id": "a37c5ac7", "metadata": {}, "source": [ "### Manual Labelling with Graph Objects\n", @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9012f4a6", + "id": "6e7b27fa", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "cf586691", + "id": "e730c8d5", "metadata": {}, "source": [ "### Configuring Font Variant, Style, and Weight\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0695c8dd", + "id": "cd927f0a", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "07e2956e", + "id": "7054de45", "metadata": {}, "source": [ "The configuration of the legend is discussed in detail in the [Legends](/python/legend/) page.\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99eded9f", + "id": "f86d5d45", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "3f45de7a", + "id": "2200a2a6", "metadata": {}, "source": [ "### Adding a Plot Subtitle\n", @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a29f9e40", + "id": "742b6dc1", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "e2517c83", + "id": "c9994d1f", "metadata": {}, "source": [ "#### Reference\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "6131ad56", + "id": "084ad1d7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-structure.ipynb b/figure-structure.ipynb index 21b112e8d..c7056ac73 100644 --- a/figure-structure.ipynb +++ b/figure-structure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "33a44a28", + "id": "e0c80e4e", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fed3684d", + "id": "ab5a1fbd", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "dbe70e35", + "id": "f89300d5", "metadata": {}, "source": [ "### Accessing figure structures in Dash\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c1e0ea8", + "id": "5d682143", "metadata": { "hide_code": true }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "d9eda6e7", + "id": "a2ccfa3c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "ba9f278a", + "id": "4be7424b", "metadata": {}, "source": [ "### Figures as Trees of Attributes\n", @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "1f744ac6", + "id": "d0fb55b1", "metadata": {}, "source": [ "### The Top-Level `layout` Attribute\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3206d75c", + "id": "fc4ed5d6", "metadata": { "lines_to_next_cell": 2 }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "32d6d83a", + "id": "20df417b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget-app.ipynb b/figurewidget-app.ipynb index 1cbf0c723..69366b3fe 100644 --- a/figurewidget-app.ipynb +++ b/figurewidget-app.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f1ab762b", + "id": "defa1f6c", "metadata": {}, "source": [ "#### NYC Flights Database" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9665c29b", + "id": "2fabd6a5", "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "dc8f7319", + "id": "50f1b02c", "metadata": {}, "source": [ "We'll be making an application to take a look at delays from all flights out of NYC in the year 2013." @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8eb076f", + "id": "c0ba2742", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce66beeb", + "id": "646b518d", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "880bf768", + "id": "e1a183ca", "metadata": {}, "source": [ "Let's get the set of all the `airlines`, so that we can type the right things into the search box later." @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8635572d", + "id": "8bfe40fe", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "56151648", + "id": "7cb54a07", "metadata": {}, "source": [ "Let's assign the widgets that we're going to be using in our app. In general all these widgets will be used to filter the data set, and thus what we visualize." @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75e2da70", + "id": "a92e7ef0", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "f8f31649", + "id": "df3f9bb7", "metadata": {}, "source": [ "Let now write a function that will handle the input from the widgets, and alter the state of the graph." @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca5a1a3a", + "id": "1efa4c50", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "35d14681", + "id": "adecfa86", "metadata": {}, "source": [ "Time to try the app out!!" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "518a0830", + "id": "abdbb0ea", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3254f19f", + "id": "0e56ec5e", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "35c07ca5", + "id": "5d467196", "metadata": {}, "source": [ "#### Reference" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5f995ab", + "id": "6a531166", "metadata": { "lines_to_next_cell": 2 }, @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "5cbe83a1", + "id": "7a9ae87c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget.ipynb b/figurewidget.ipynb index 6724347f6..56734321e 100644 --- a/figurewidget.ipynb +++ b/figurewidget.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d0828831", + "id": "542e051c", "metadata": {}, "source": [ "The Plotly FigureWidget allows you to add Plotly charts as interactive widgets in Jupyter and other compatible notebooks. To use the FigureWidget, you'll need to install `anywidget`: " @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0338ddce", + "id": "1c9b890b", "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "30e7b0fc", + "id": "fc2470b7", "metadata": {}, "source": [ "#### Create a Simple FigureWidget\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b026ffc", + "id": "66fd5264", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "2bc4f275", + "id": "46f859c2", "metadata": {}, "source": [ "" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "168e2980", + "id": "d39b9d5e", "metadata": {}, "source": [ "Add traces or update the layout and then watch the output above update in real time." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ceb6239c", + "id": "c5546609", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf810e9", + "id": "490a9474", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fa3a207", + "id": "e1317c42", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "b881bbbb", + "id": "459bd53a", "metadata": {}, "source": [ "" @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "0c81c8ae", + "id": "ac265561", "metadata": {}, "source": [ "#### Update the Data and the Layout" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13250fab", + "id": "ed5aba18", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33ffaef6", + "id": "b208f62e", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8561c32d", + "id": "d3604df4", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "d52c08d2", + "id": "a008d24d", "metadata": {}, "source": [ "#### Construct a FigureWidget from a Figure graph object" @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "6248415c", + "id": "2caceb27", "metadata": {}, "source": [ "A standard `Figure` object can be passed to the `FigureWidget` constructor." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5af8df6", + "id": "796a5ee6", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "0391fcd7", + "id": "28e47968", "metadata": {}, "source": [ "#### Reference" @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "bba1040f", + "id": "47a5f25b", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b72eb9a1", + "id": "9071552f", "metadata": { "lines_to_next_cell": 2 }, @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "8bf034cb", + "id": "4629ff20", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-plots.ipynb b/filled-area-plots.ipynb index 6ed2ead2e..2dbcfa40c 100644 --- a/filled-area-plots.ipynb +++ b/filled-area-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c9f8b7bf", + "id": "a7c36528", "metadata": {}, "source": [ "This example shows how to fill the area enclosed by traces.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67d360b2", + "id": "2f5a9249", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "b5668e00", + "id": "3a36a9fc", "metadata": {}, "source": [ "## Filled area plot in Dash\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e453c68", + "id": "e53df734", "metadata": { "hide_code": true }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "4a16195c", + "id": "175072cd", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "590beedd", + "id": "b4e7b63d", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34e6b5b9", + "id": "aa31334e", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "724d42dc", + "id": "72b3cf1a", "metadata": {}, "source": [ "### Filled area chart with plotly.graph_objects\n", @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef29ddc3", + "id": "c5285bff", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "5be1bf2a", + "id": "2e4a49af", "metadata": {}, "source": [ "#### Overlaid Area Chart Without Boundary Lines" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dc0b797", + "id": "bb9936d1", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "a5e4fb1a", + "id": "1d945d7c", "metadata": {}, "source": [ "#### Interior Filling for Area Chart" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "428df4ff", + "id": "80ff40a9", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "2de0fdd9", + "id": "06db1d9d", "metadata": {}, "source": [ "#### Gradient Fill\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a535cc9", + "id": "577c260a", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "b227bb08", + "id": "2e6b7e4b", "metadata": {}, "source": [ "#### Stacked Area Chart\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7266f404", + "id": "62911a17", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "e01d554b", + "id": "5b9fbcda", "metadata": {}, "source": [ "### Stacked Area Chart with Normalized Values" @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75aafdd2", + "id": "a861586b", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "6208514e", + "id": "c86643a4", "metadata": {}, "source": [ "#### Select Hover Points" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd1e8645", + "id": "5bfe5693", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "6bd55adb", + "id": "b0ddde05", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "782c6d85", + "id": "02261183", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-tile-maps.ipynb b/filled-area-tile-maps.ipynb index 7e8bac34d..2da8345fd 100644 --- a/filled-area-tile-maps.ipynb +++ b/filled-area-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b40af500", + "id": "f73bee22", "metadata": {}, "source": [ "There are three different ways to show a filled area on a tile-based map:\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e66410e", + "id": "f14775a6", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "c90b1258", + "id": "5844dd54", "metadata": {}, "source": [ "### Multiple Filled Areas with a `Scattermap` trace\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37e3210c", + "id": "3b1965dc", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "0880bf04", + "id": "01e16407", "metadata": {}, "source": [ "### GeoJSON Layers\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d08e115", + "id": "0c4e0618", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "1e5ea344", + "id": "36a619a6", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "5e43338f", + "id": "ae83577d", "metadata": {}, "source": [ "#### Reference\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "37638a6a", + "id": "015268bc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/funnel-charts.ipynb b/funnel-charts.ipynb index 3efba60c3..e77727452 100644 --- a/funnel-charts.ipynb +++ b/funnel-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "74bca530", + "id": "d8d640ef", "metadata": {}, "source": [ "### Introduction\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04c617df", + "id": "d4ac04e0", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "79bc0af9", + "id": "e08efa78", "metadata": {}, "source": [ "### Stacked Funnel Plot with plotly.express" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fda7484", + "id": "c0b4ae3f", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "bed411b7", + "id": "d32613f5", "metadata": {}, "source": [ "### Basic Funnel Chart with graph_objects trace go.Funnel\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f55883ee", + "id": "f72e702d", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "ec6b1d7b", + "id": "cba67b35", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39d55b25", + "id": "44b4b29c", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "6ec6e98b", + "id": "0a8255f8", "metadata": {}, "source": [ "### Stacked Funnel Plot with go.Funnel" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a46af008", + "id": "e431f4b1", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "1bcdff23", + "id": "e6ae7aec", "metadata": {}, "source": [ "### Basic Area Funnel Plot with plotly.express\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf6954ca", + "id": "636015c9", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "2c6c2adb", + "id": "691575e6", "metadata": {}, "source": [ "### Basic Area Funnel Plot with go.Funnelarea\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fd0f26f", + "id": "75b89ae4", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "6c1a22b1", + "id": "1bd1841d", "metadata": {}, "source": [ "#### Set Marker Size and Color in Area Funnel Plots" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b92998d", + "id": "15e8821b", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "363a0418", + "id": "f7189258", "metadata": {}, "source": [ "#### Multiple Area Funnels" @@ -246,7 +246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d726e7cb", + "id": "593beb84", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "b4c3de0c", + "id": "dba1003b", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa132992", + "id": "06759ba3", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "aab74134", + "id": "f4a49734", "metadata": {}, "source": [ "#### Reference\n", @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "134b7a90", + "id": "12234029", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gantt.ipynb b/gantt.ipynb index d15761b36..7f2b65bb6 100644 --- a/gantt.ipynb +++ b/gantt.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "90831616", + "id": "2782d034", "metadata": {}, "source": [ "A [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) is a type of bar chart that illustrates a project schedule. The chart lists the tasks to be performed on the vertical axis, and time intervals on the horizontal axis. The width of the horizontal bars in the graph shows the duration of each activity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "984badcb", + "id": "38ce75f7", "metadata": {}, "source": [ "### Gantt Charts and Timelines with plotly.express\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54c2aa7b", + "id": "57b8a770", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "e8e9fcf6", + "id": "3830083f", "metadata": {}, "source": [ "`px.timeline` supports [discrete color](/python/discrete-color/) as above, or [continuous color](/python/colorscales/) as follows." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36828d0d", + "id": "26f96b30", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "308b2eb3", + "id": "c59eb307", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "8689c17f", + "id": "0647cd83", "metadata": {}, "source": [ "It is also possible to have multiple bars on the same horizontal line, say by resource:\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78a7bdc7", + "id": "c1371b2a", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "763dee21", + "id": "588d6ee7", "metadata": {}, "source": [ "#### Deprecated Figure Factory\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a0457c1", + "id": "94252e7e", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "da69a739", + "id": "fa4fd3b3", "metadata": {}, "source": [ "#### Group Tasks Together\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93c4e04c", + "id": "feab7453", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "2b581287", + "id": "f85ee767", "metadata": {}, "source": [ "#### Color by Numeric Variable\n", @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "231c8f39", + "id": "b97642bb", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "8e312878", + "id": "2eeffe2a", "metadata": {}, "source": [ "#### Reference" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "f0e45aa8", + "id": "654aaf2e", "metadata": {}, "source": [ "For more info on `ff.create_gantt()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_gantt.html)\n" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "75d0883b", + "id": "bba5b7ec", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gauge-charts.ipynb b/gauge-charts.ipynb index 4297cc14c..bcb256d86 100644 --- a/gauge-charts.ipynb +++ b/gauge-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6f033966", + "id": "2e11feb3", "metadata": {}, "source": [ "#### Basic Gauge\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4454876", + "id": "99232581", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "a264d7c2", + "id": "2724887a", "metadata": {}, "source": [ "#### Add Steps, Threshold, and Delta\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc81c490", + "id": "ec80d2d5", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "d9082810", + "id": "90298213", "metadata": {}, "source": [ "#### Custom Gauge Chart\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46508ae7", + "id": "b082bdb3", "metadata": { "lines_to_next_cell": 2 }, @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "08222262", + "id": "6d2f24d2", "metadata": {}, "source": [ "#### Reference\n", @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "3b55816b", + "id": "a766cefd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/getting-started.ipynb b/getting-started.ipynb index 223938558..1a5d6d608 100644 --- a/getting-started.ipynb +++ b/getting-started.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8f514d91", + "id": "41bef25e", "metadata": {}, "source": [ "\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fd06c47", + "id": "3fa46b7d", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "5588987e", + "id": "94b2b82e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "c753dc3d", + "id": "6414348b", "metadata": {}, "source": [ "#### JupyterLab Support\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d94ca61", + "id": "0ac58d9f", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "ec87f445", + "id": "632d0ceb", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef7a7fc0", + "id": "7edf6a98", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "b272c5b6", + "id": "87203da4", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`.\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "2fcffc97", + "id": "40b0c8bb", "metadata": {}, "source": [ "#### Jupyter Notebook Support\n", @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ec10a50", + "id": "bdb44954", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "de855b82", + "id": "216730f9", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0e3927b", + "id": "a1dfd792", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "cadb4e98", + "id": "de4c00a8", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`." @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "95170a8a", + "id": "7cd5a6d5", "metadata": {}, "source": [ "### Static Image Export\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "250a72a0", + "id": "60ffe6bb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graph-objects.ipynb b/graph-objects.ipynb index 3950afdfb..0c19655e6 100644 --- a/graph-objects.ipynb +++ b/graph-objects.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d4733a66", + "id": "ece4f2ec", "metadata": {}, "source": [ "### What Are Graph Objects?\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2409d108", + "id": "8660ded7", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aca485c8", + "id": "74b7f63f", "metadata": { "lines_to_next_cell": 2 }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "8eb3befb", + "id": "0178a0ef", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graphing-multiple-chart-types.ipynb b/graphing-multiple-chart-types.ipynb index 288186c7b..eb2fd4e48 100644 --- a/graphing-multiple-chart-types.ipynb +++ b/graphing-multiple-chart-types.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9656fb10", + "id": "8e664269", "metadata": {}, "source": [ "### Chart Types versus Trace Types\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "d41506fc", + "id": "55e45d3d", "metadata": {}, "source": [ "### Multiple Trace Types with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "678bedf2", + "id": "125ff2d9", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "468d8798", + "id": "48906762", "metadata": {}, "source": [ "#### Grouped Bar and Scatter Chart\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "522e9f49", + "id": "587f0ca0", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "28916b6b", + "id": "02eb6cd8", "metadata": {}, "source": [ "#### Line Chart and a Bar Chart" @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13f3c58d", + "id": "332f3fc4", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "cde2b720", + "id": "3cfbbf45", "metadata": {}, "source": [ "#### A Contour and Scatter Plot of the Method of Steepest Descent" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b08873b", + "id": "c56d6490", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "05abaa44", + "id": "1c2cf8b6", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d6e4086", + "id": "46353dea", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "13ee33cc", + "id": "df0ea455", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "c6579f3d", + "id": "9ed7f3db", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/heatmaps.ipynb b/heatmaps.ipynb index b7bd421ce..da92b9e73 100644 --- a/heatmaps.ipynb +++ b/heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ca9b7aac", + "id": "a1caf71b", "metadata": {}, "source": [ "The term \"heatmap\" usually refers to a Cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/tile-density-heatmaps/).\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "482ffa1c", + "id": "1e3d5f76", "metadata": {}, "source": [ "### Heatmaps with Plotly Express\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "51572df6", + "id": "0739cf0e", "metadata": {}, "source": [ "The `px.imshow()` function can be used to display heatmaps (as well as full-color images, as its name suggests). It accepts both array-like objects like lists of lists and `numpy` or `xarray` arrays, as well as supported [DataFrame objects](/python/px-arguments#supported-dataframes).\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ba166b7", + "id": "6f12ad06", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3988fe98", + "id": "fdd8cb9d", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "10c5eec4", + "id": "932fcde5", "metadata": {}, "source": [ "### Displaying Text on Heatmaps\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "665c376a", + "id": "454d60ce", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "5d3cc4fb", + "id": "bb720ded", "metadata": {}, "source": [ "#### Heatmaps in Dash\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "728b405f", + "id": "11c3190e", "metadata": { "hide_code": true }, @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "ba453839", + "id": "49e62d0e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "8ebfc8a4", + "id": "abe49e95", "metadata": {}, "source": [ "### Controlling Aspect Ratio\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5969f2a7", + "id": "619ec5cc", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "6897bbee", + "id": "fea7570e", "metadata": {}, "source": [ "### Customizing the axes and labels on a heatmap\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fef39b4", + "id": "600e217e", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "168d3327", + "id": "6a3807de", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79f5b879", + "id": "40544238", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "f9265fc6", + "id": "93638bb2", "metadata": {}, "source": [ "### Basic Heatmap with `plotly.graph_objects`\n", @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5122bfd3", + "id": "ea97cfb8", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "348be9ed", + "id": "b60a6c16", "metadata": {}, "source": [ "### Heatmap with Categorical Axis Labels\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdd3c743", + "id": "3e8e0b1d", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "b29c28c6", + "id": "c4af7819", "metadata": {}, "source": [ "### Heatmap with Unequal Block Sizes\n" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "defd17b5", + "id": "f309ac7c", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "1ff46c52", + "id": "f908db23", "metadata": {}, "source": [ "### Heatmap with Datetime Axis" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "665e9707", + "id": "29f6798e", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "0f0696aa", + "id": "31457b24", "metadata": {}, "source": [ "### Text on Heatmap Points\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f07fe02d", + "id": "ae8cec50", "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "e6d75380", + "id": "93e36a66", "metadata": {}, "source": [ "### Heatmap and datashader\n", @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "0496a331", + "id": "6aa6ac76", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hexbin-mapbox.ipynb b/hexbin-mapbox.ipynb index fe26ba9c5..b2bbcf1af 100644 --- a/hexbin-mapbox.ipynb +++ b/hexbin-mapbox.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bc002cc3", + "id": "f63eb21e", "metadata": {}, "source": [ "#### Simple Count Hexbin\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3718f00d", + "id": "b21b98c4", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "13f92fe5", + "id": "296b9f85", "metadata": {}, "source": [ "#### Count Hexbin with Minimum Count and Opacity" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c08ae142", + "id": "7cb59055", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "58da6616", + "id": "045c493e", "metadata": {}, "source": [ "#### Display the Underlying Data" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d85ab3cd", + "id": "306df7a3", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "3f038228", + "id": "cee4394a", "metadata": {}, "source": [ "#### Compute the Mean Value per Hexbin" @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fde3b9e9", + "id": "a79cb8f1", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "9ed30f8f", + "id": "e84be0ca", "metadata": {}, "source": [ "#### Compute the Sum Value per Hexbin" @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35916210", + "id": "7917c83d", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "69ff1372", + "id": "c09355a7", "metadata": {}, "source": [ "#### Hexbin with Animation" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ceae351b", + "id": "cb14bbc9", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "acfd021f", + "id": "7dc4abeb", "metadata": {}, "source": [ "#### Reference\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "2595a634", + "id": "94903f36", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/histograms.ipynb b/histograms.ipynb index 8a26cace1..61a5b80a6 100644 --- a/histograms.ipynb +++ b/histograms.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0436cc03", + "id": "ec30d471", "metadata": {}, "source": [ "In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in Plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...) which can be used to visualize data on categorical and date axes as well as linear axes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55dd36ec", + "id": "eca79844", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e74fc69e", + "id": "14d05cdf", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "5b6565ab", + "id": "2002a2dd", "metadata": {}, "source": [ "#### Choosing the number of bins\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bc41b69", + "id": "489e394e", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "668e77dc", + "id": "5c429a31", "metadata": {}, "source": [ "### Histograms on Date Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10314fc8", + "id": "0684b7d7", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "80e45862", + "id": "1d5c6000", "metadata": {}, "source": [ "### Histograms on Categorical Data\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d93641fd", + "id": "ff64c5fd", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "7de81d29", + "id": "78713355", "metadata": {}, "source": [ "#### Histograms in Dash\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12ce386a", + "id": "7cfdc3ac", "metadata": { "hide_code": true }, @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "3d5632d0", + "id": "2d3b868e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "f024ca09", + "id": "d82d0176", "metadata": {}, "source": [ "#### Accessing the counts (y-axis) values\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d5e4677", + "id": "57065e51", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "df1803a3", + "id": "0a3c33dc", "metadata": {}, "source": [ "#### Type of normalization\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c74be586", + "id": "4735b47b", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "0b04c26d", + "id": "8727214b", "metadata": {}, "source": [ "#### Aspect of the histogram plot" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d419a9b", + "id": "4b36cbe3", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "9fd52129", + "id": "31f25bad", "metadata": {}, "source": [ "#### Several histograms for the different values of one column" @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d70183f", + "id": "52ec9e17", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "2a9d0e88", + "id": "6810ae3f", "metadata": {}, "source": [ "#### Aggregating with other functions than `count`\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "024934b5", + "id": "002324c3", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "9cffbba3", + "id": "61d9eee4", "metadata": {}, "source": [ "The default `histfunc` is `sum` if `y` is given, and works with categorical as well as binned numeric data on the `x` axis:" @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d968261", + "id": "06c60067", "metadata": { "lines_to_next_cell": 0 }, @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "4a5a5d5c", + "id": "bdbc67f3", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7c6bc6d", + "id": "f1bb93b9", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "fbec1dcd", + "id": "026c0414", "metadata": {}, "source": [ "#### Visualizing the distribution\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b15fc92", + "id": "ba10a088", "metadata": {}, "outputs": [], "source": [ @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "9f375b00", + "id": "92351b2f", "metadata": {}, "source": [ "### Adding text labels\n", @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3ec96dd", + "id": "a0a7dc35", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "7d5ef127", + "id": "6d744578", "metadata": {}, "source": [ "## Histograms with go.Histogram\n", @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c29b9d3f", + "id": "79282213", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "7fb9e61f", + "id": "c1faf8fa", "metadata": {}, "source": [ "### Normalized Histogram" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1acec2ae", + "id": "42378156", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "21c4f629", + "id": "dc42fb75", "metadata": {}, "source": [ "### Horizontal Histogram" @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1a0478a", + "id": "1bdf1e96", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "e8e5b25c", + "id": "def832c3", "metadata": {}, "source": [ "### Overlaid Histogram" @@ -462,7 +462,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f89d79f9", + "id": "0bb8e2c1", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "f79d2964", + "id": "42a8331b", "metadata": {}, "source": [ "### Stacked Histograms" @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1053d8c9", + "id": "68be5b9e", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "0bec29d2", + "id": "bbf114c6", "metadata": {}, "source": [ "### Styled Histogram" @@ -527,7 +527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ddfd548e", + "id": "55f78239", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "e1d976b2", + "id": "a6ceaf3e", "metadata": {}, "source": [ "### Histogram Bar Text\n", @@ -587,7 +587,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82b0308d", + "id": "4b9a2de6", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ }, { "cell_type": "markdown", - "id": "8c67e905", + "id": "baef7dd6", "metadata": {}, "source": [ "### Cumulative Histogram" @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fc1afb2", + "id": "bef00ff3", "metadata": {}, "outputs": [], "source": [ @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "4a506828", + "id": "48b50806", "metadata": {}, "source": [ "### Specify Aggregation Function" @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8af342b", + "id": "d28fc75c", "metadata": {}, "outputs": [], "source": [ @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "25da5993", + "id": "3a7515d5", "metadata": {}, "source": [ "### Custom Binning\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e24e6239", + "id": "1da614f4", "metadata": {}, "outputs": [], "source": [ @@ -715,7 +715,7 @@ }, { "cell_type": "markdown", - "id": "3d7da393", + "id": "87eabd60", "metadata": {}, "source": [ "### See also: Bar Charts\n", @@ -726,7 +726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b6410e2", + "id": "f7761dfa", "metadata": {}, "outputs": [], "source": [ @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "b7c5f7fa", + "id": "5f091163", "metadata": {}, "source": [ "### Share bins between histograms\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad4236c7", + "id": "ce304b16", "metadata": {}, "outputs": [], "source": [ @@ -777,7 +777,7 @@ }, { "cell_type": "markdown", - "id": "0b405dea", + "id": "08f469e7", "metadata": {}, "source": [ "### Sort Histogram by Category Order\n", @@ -788,7 +788,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3df1e72", + "id": "b0cba7c4", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a3d9d07", + "id": "70ffaa35", "metadata": {}, "outputs": [], "source": [ @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "cb16d4eb", + "id": "ab361096", "metadata": {}, "source": [ "#### Reference\n", @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "3a870e71", + "id": "f39f8595", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-bar-charts.ipynb b/horizontal-bar-charts.ipynb index 79dbcb038..f338e86e0 100644 --- a/horizontal-bar-charts.ipynb +++ b/horizontal-bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "badef594", + "id": "b2756011", "metadata": {}, "source": [ "See more examples of bar charts (including vertical bar charts) and styling options [here](https://plotly.com/python/bar-charts/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4316e0ec", + "id": "34a0de37", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "5d17c115", + "id": "ce558994", "metadata": {}, "source": [ "#### Configure horizontal bar chart\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "248aab69", + "id": "184f3c09", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "d0da53fa", + "id": "3e860e1b", "metadata": {}, "source": [ "### Horizontal Bar Chart with go.Bar\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "216be147", + "id": "872692f4", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "7ad4f280", + "id": "c90ce9af", "metadata": {}, "source": [ "### Colored Horizontal Bar Chart" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c542448", + "id": "7e02ac88", "metadata": { "lines_to_next_cell": 0 }, @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "756e76ba", + "id": "0f5e70bf", "metadata": { "lines_to_next_cell": 0 }, @@ -142,7 +142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "590e9d78", + "id": "d184c226", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "bbf1a5ed", + "id": "7dc56720", "metadata": {}, "source": [ "### Color Palette for Bar Chart\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec792615", + "id": "695b0046", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "25c07972", + "id": "3ac177d1", "metadata": {}, "source": [ "### Diverging Bar (or Butterfly) Chart\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e846e1f7", + "id": "ae2fa2c4", "metadata": {}, "outputs": [], "source": [ @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "5153ae65", + "id": "207f1d01", "metadata": {}, "source": [ "### Bar Chart with Line Plot" @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95c0cbbe", + "id": "2c14e282", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "7acb329b", + "id": "50988fd9", "metadata": {}, "source": [ "### Reference\n", @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "62cf7c2e", + "id": "17974fdd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-vertical-shapes.ipynb b/horizontal-vertical-shapes.ipynb index 2bcddc687..188c0bf80 100644 --- a/horizontal-vertical-shapes.ipynb +++ b/horizontal-vertical-shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e722a794", + "id": "43c762ca", "metadata": {}, "source": [ "### Horizontal and Vertical Lines and Rectangles\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ced40f9e", + "id": "38a3d5f0", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "08fd21f5", + "id": "93d163a2", "metadata": {}, "source": [ "These shapes can be styled by passing the same arguments as are accepted by `add_shape`:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91f5e8a0", + "id": "131cf5de", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "90bf3ac2", + "id": "12b65818", "metadata": {}, "source": [ "#### Horizontal and vertical lines in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92475217", + "id": "5e61f79d", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "44a452a5", + "id": "190d534b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "ee9615bd", + "id": "96ed3a66", "metadata": {}, "source": [ "#### Adding Text Annotations\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7946655", + "id": "1c7e5b5e", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "5d4499c2", + "id": "c5bc0ba1", "metadata": {}, "source": [ "Extra formatting of the annotation can be done using magic-underscores prefixed by `annotation_` or by passing a `dict` or `go.layout.Annotation` instance to the `annotation` argument:" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35254392", + "id": "91a5a7ca", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "472b03b9", + "id": "00f489b4", "metadata": { "lines_to_next_cell": 0 }, @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9262380e", + "id": "001fe02e", "metadata": { "lines_to_next_cell": 0 }, @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "0ac18e8a", + "id": "0e2d488c", "metadata": {}, "source": [ "#### Text Labels on Shapes\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20220c59", + "id": "3850fbef", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "d42b84ab", + "id": "f13557ae", "metadata": {}, "source": [ "With [text labels on shapes](/python/shapes/#adding-text-labels-to-shapes), you can also add text labels to shapes other than lines and rectangles, and the labels can be added automatically to shapes drawn by the user." @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "58c6969a", + "id": "6a557b6e", "metadata": {}, "source": [ "### Reference\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "2048e682", + "id": "0a6f1ccf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hover-text-and-formatting.ipynb b/hover-text-and-formatting.ipynb index f2b265ee1..ae05196bf 100644 --- a/hover-text-and-formatting.ipynb +++ b/hover-text-and-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e453b452", + "id": "54266f13", "metadata": {}, "source": [ "### Hover Labels\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a99fd26f", + "id": "1ff5b32e", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "4f429256", + "id": "54eb244f", "metadata": {}, "source": [ "#### Hovermode `x` or `y`\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afa02a42", + "id": "595a83f7", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "c188290d", + "id": "4cf61428", "metadata": {}, "source": [ "#### Unified hovermode\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ed034f3", + "id": "8ddafd42", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "4babb00a", + "id": "a12830ee", "metadata": {}, "source": [ "#### Customize Title in Unified Hovermode\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "360d2706", + "id": "ff1792ae", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "6a685d01", + "id": "6ef05730", "metadata": {}, "source": [ "#### Control hovermode with Dash\n", @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7d317f8", + "id": "11df7b70", "metadata": { "hide_code": true }, @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "99c59002", + "id": "6a85fa93", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "fd1da1f4", + "id": "240c1f85", "metadata": {}, "source": [ "#### Selecting a hovermode in a figure created with `plotly.graph_objects`\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "825b1a0b", + "id": "e3bb62e0", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "d029454f", + "id": "22265a57", "metadata": {}, "source": [ "#### Hover on Subplots\n", @@ -228,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0275d290", + "id": "527a0bd2", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "df057dd4", + "id": "66e04e5b", "metadata": {}, "source": [ "### Customizing Hover Label Appearance\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6623e11f", + "id": "aa96f99b", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "b8b8f656", + "id": "ac4342a0", "metadata": {}, "source": [ "### Customizing Hover text with Plotly Express\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ff06343", + "id": "7502f505", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "c374258c", + "id": "cc58d033", "metadata": {}, "source": [ "### Disabling or customizing hover of columns in plotly express\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2fc592f", + "id": "4b2979da", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "02dd8b5d", + "id": "5f1c14ce", "metadata": {}, "source": [ "### Customizing hover text with a hovertemplate\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28ae153f", + "id": "5a1d6d77", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3414937", + "id": "3feccdac", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "2f42919b", + "id": "2f2a8974", "metadata": {}, "source": [ "### Modifying the hovertemplate of a plotly express figure\n", @@ -441,7 +441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3753c983", + "id": "3a13a15a", "metadata": {}, "outputs": [], "source": [ @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "d44d906c", + "id": "f3c0aa5d", "metadata": {}, "source": [ "### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate\n", @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d48c3de2", + "id": "93fd9674", "metadata": { "lines_to_next_cell": 2 }, @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "35f9e392", + "id": "47212fee", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1331ceb", + "id": "d5452406", "metadata": {}, "outputs": [], "source": [ @@ -571,7 +571,7 @@ }, { "cell_type": "markdown", - "id": "11d3e987", + "id": "216f3d89", "metadata": {}, "source": [ "### Advanced Hover Template\n", @@ -582,7 +582,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acf8652c", + "id": "29debfcc", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "74411289", + "id": "981a470d", "metadata": {}, "source": [ "### Adding other data to the hover with customdata and a hovertemplate\n", @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90b0e1eb", + "id": "62c7e021", "metadata": {}, "outputs": [], "source": [ @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "34fa772b", + "id": "d8f1ac17", "metadata": {}, "source": [ "### Setting the Hover Template in Tile Maps" @@ -698,7 +698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "054c03cd", + "id": "5f798ea1", "metadata": {}, "outputs": [], "source": [ @@ -725,7 +725,7 @@ }, { "cell_type": "markdown", - "id": "5bd9fbf2", + "id": "72c8e9ef", "metadata": {}, "source": [ "### Controlling Hover Text with `graph_objects` and `hoverinfo`\n", @@ -736,7 +736,7 @@ { "cell_type": "code", "execution_count": null, - "id": "258d43d6", + "id": "f5d958be", "metadata": {}, "outputs": [], "source": [ @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "38aeae49", + "id": "6d267c9f", "metadata": {}, "source": [ "### Spike lines\n", @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8e3c874", + "id": "49c8aca3", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "75b4c21f", + "id": "cfe695f9", "metadata": {}, "source": [ "Spike lines can be styled per axis as well, and the cursor distance setting can be controlled via `layout.spikedistance`." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0697bc98", + "id": "820e74a8", "metadata": {}, "outputs": [], "source": [ @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "32d291b1", + "id": "1a55dc53", "metadata": {}, "source": [ "#### Reference\n", @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "913914d4", + "id": "3dd15790", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/icicle-charts.ipynb b/icicle-charts.ipynb index fa7b7ee3d..29446095c 100644 --- a/icicle-charts.ipynb +++ b/icicle-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8a5aead3", + "id": "3bfcec19", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8e8e866", + "id": "57c478e9", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "aeb8fd74", + "id": "dc6001aa", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with plotly.express\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e81776cf", + "id": "a1fe1bad", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "0f80c3ac", + "id": "baea631a", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with continuous color argument in px.icicle\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4bf5747", + "id": "c787c8b0", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "c4d0018a", + "id": "31f89c87", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with discrete color argument in px.icicle\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b983783c", + "id": "3db677c0", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "af5394e9", + "id": "56ce11d6", "metadata": {}, "source": [ "In the example below the color of **Saturday** and **Sunday** sectors is the same as **Dinner** because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b77f66e", + "id": "c7b23ff3", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "eee90eeb", + "id": "e7685ed8", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "baeeac2d", + "id": "38c48fac", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "18052661", + "id": "05252308", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6e3d33e", + "id": "70ed63b4", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "80de48de", + "id": "41e3f44e", "metadata": {}, "source": [ "### Basic Icicle Plot with go.Icicle\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb1aa16d", + "id": "e792e689", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "3a9da495", + "id": "4ea0c847", "metadata": {}, "source": [ "### Icicle with Repeated Labels" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "356bf963", + "id": "b186e24a", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ }, { "cell_type": "markdown", - "id": "027f56ff", + "id": "641e881b", "metadata": {}, "source": [ "### Branchvalues\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d251407c", + "id": "cc5a2283", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "c09ab137", + "id": "17ba0fac", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91553456", + "id": "e3fafecc", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "1f04a96c", + "id": "1eab2cb3", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55ebedaa", + "id": "eef130f7", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "1d3ad615", + "id": "3fe8ab27", "metadata": {}, "source": [ "### Icicle chart with a continuous colorscale\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea8f27a6", + "id": "4df5ea20", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "bca8a76e", + "id": "28d9eb0d", "metadata": {}, "source": [ "### Set Color of Icicle Sectors" @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28137959", + "id": "6350770d", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "b6afb0c3", + "id": "c72a8cf5", "metadata": {}, "source": [ "This example uses iciclecolorway attribute, which should be set in layout." @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "217b31e8", + "id": "c8fda0b3", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "685e28fc", + "id": "ba325c8a", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "73a3ca4a", + "id": "ceb81b76", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f79ea5f7", + "id": "2be3673a", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "87471223", + "id": "d175a13b", "metadata": {}, "source": [ "### Set the Direction of Icicle charts\n", @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c554089", + "id": "236d989d", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "99ad5364", + "id": "e393395b", "metadata": {}, "source": [ "**Down Direction (Icicle)**" @@ -658,7 +658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f651b9f1", + "id": "d48b3404", "metadata": {}, "outputs": [], "source": [ @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "75f52d6b", + "id": "be2bb42d", "metadata": {}, "source": [ "**Right Direction**" @@ -693,7 +693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd9a93d4", + "id": "2757fd7e", "metadata": {}, "outputs": [], "source": [ @@ -719,7 +719,7 @@ }, { "cell_type": "markdown", - "id": "f08f01f3", + "id": "8578753d", "metadata": {}, "source": [ "**Left Direction**" @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea03a596", + "id": "3e40597d", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "7e33c3e8", + "id": "216c46eb", "metadata": {}, "source": [ "#### Reference\n", @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "2eb2980d", + "id": "3c2d3f39", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/images.ipynb b/images.ipynb index b614ce8ac..7f6a6042b 100644 --- a/images.ipynb +++ b/images.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "00f812ce", + "id": "5eaf6ebd", "metadata": {}, "source": [ "#### Add a Background Image\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "714cf1a0", + "id": "66bcc2cc", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "107cbb58", + "id": "070301d2", "metadata": {}, "source": [ "#### Add a Logo\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12c9cd97", + "id": "e33a7bb9", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "b9ad6272", + "id": "3c10567f", "metadata": {}, "source": [ "#### Label Spectroscopy Data by Adding Multiple Images" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0615303a", + "id": "1a7ada3e", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "d98d1764", + "id": "fd54bacf", "metadata": {}, "source": [ "#### Zoom on Static Images" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e28c9ae8", + "id": "0dc4fc38", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "8780771e", + "id": "1b4227c7", "metadata": {}, "source": [ "### Annotating layout image with shapes\n", @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc363e3f", + "id": "b438632c", "metadata": { "lines_to_next_cell": 2 }, @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "852292dd", + "id": "f92c7d77", "metadata": {}, "source": [ "### Images Placed Relative to Axes\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc2fa228", + "id": "c4d683c0", "metadata": {}, "outputs": [], "source": [ @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "34425369", + "id": "a8f5e20b", "metadata": {}, "source": [ "#### Reference\n", @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "03829ed0", + "id": "bccc1b9f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/imshow.ipynb b/imshow.ipynb index 6089a6897..f56d7fc7b 100644 --- a/imshow.ipynb +++ b/imshow.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cba44a20", + "id": "11f7624e", "metadata": {}, "source": [ "This tutorial shows how to display and explore image data. If you would like\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1b2a39d", + "id": "597f38a8", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "cb2be7c8", + "id": "a3382b97", "metadata": {}, "source": [ "### Read image arrays from image files\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39c50c47", + "id": "51fdbbbf", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a31f7885", + "id": "e0e04eb5", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "c4f141db", + "id": "759fb6bc", "metadata": {}, "source": [ "### Display single-channel 2D data as a heatmap\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3ce3395", + "id": "d086c081", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "8a2c6f01", + "id": "c469983f", "metadata": {}, "source": [ "### Choose the colorscale to display a single-channel image\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8d7053a", + "id": "b0f7e990", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "21666135", + "id": "bba3a1a2", "metadata": {}, "source": [ "You can use this to make the image grayscale as well:" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57f446a4", + "id": "130e7bd1", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "2e122a38", + "id": "1dd33ca2", "metadata": {}, "source": [ "### Hiding the colorbar and axis labels\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e89b1c3c", + "id": "64b1797c", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "adb4ef82", + "id": "eca6d094", "metadata": {}, "source": [ "### Customizing the axes and labels on a single-channel image\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2c04c5b", + "id": "d0f8c0b0", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "0352ae27", + "id": "4ddfcc14", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73a35e1b", + "id": "2fc62298", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "e7d4dad7", + "id": "f924d6f7", "metadata": {}, "source": [ "### Display an xarray image with square pixels\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ed8414b", + "id": "5b15d6ae", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "12ce7ead", + "id": "66cc75e7", "metadata": {}, "source": [ "### Display multichannel image data with go.Image\n", @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cf3997e", + "id": "14356f95", "metadata": {}, "outputs": [], "source": [ @@ -271,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "18bf5a7b", + "id": "749f5b2d", "metadata": {}, "source": [ "### Passing image data as a binary string to `go.Image`\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e62028f", + "id": "4f4cda94", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "716431da", + "id": "67709c87", "metadata": {}, "source": [ "### Defining the data range covered by the color range with zmin and zmax\n", @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2834c79", + "id": "feb025b8", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ce9b8ad", + "id": "1ffe3a91", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "eba146a4", + "id": "352b5e15", "metadata": {}, "source": [ "### Automatic contrast rescaling in `px.imshow`\n", @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4f0cf90", + "id": "18eec3ef", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "ba0b52dc", + "id": "f158a88b", "metadata": {}, "source": [ "### Ticks and margins around image data" @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e8dbc32", + "id": "a0a06baa", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "ace54f0f", + "id": "fa59af62", "metadata": {}, "source": [ "### Combining image charts and other traces" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cc8122f", + "id": "f8aa3ed4", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "586585f7", + "id": "78c37c0f", "metadata": {}, "source": [ "### Displaying an image and the histogram of color values" @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "223c5668", + "id": "2720a074", "metadata": {}, "outputs": [], "source": [ @@ -458,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "eb9d7251", + "id": "3f42c971", "metadata": {}, "source": [ "### imshow and datashader\n", @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "1cfb33fa", + "id": "9f9f0f3e", "metadata": {}, "source": [ "### Annotating image traces with shapes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a2ff30c", + "id": "44ebe82e", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "839b6df1", + "id": "d80b26fa", "metadata": {}, "source": [ "### Passing image data as a binary string\n", @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdc9ab5b", + "id": "12085da0", "metadata": {}, "outputs": [], "source": [ @@ -555,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "a8f2ac06", + "id": "e0dba7b8", "metadata": {}, "source": [ "### Contrast rescaling im imshow with binary string\n", @@ -566,7 +566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88c8056a", + "id": "7274aca8", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "83ea60ca", + "id": "e47b2897", "metadata": {}, "source": [ "You can set `binary_string=False` if you want the intensity value to appear in the hover even for a rescaled image. In the example below we also modify the hovertemplate to display both `z` (the data of the original image array) and `color` (the pixel value displayed in the figure)." @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc2a9337", + "id": "0cfa3ada", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "b5d7fdab", + "id": "f900ee09", "metadata": {}, "source": [ "### Changing the level of compression of the binary string in `px.imshow`\n", @@ -620,7 +620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59a07957", + "id": "5f9adf96", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "bfbadf48", + "id": "e81b8e79", "metadata": {}, "source": [ "### Exploring 3-D images, timeseries and sequences of images with `facet_col`\n", @@ -652,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2457e7bb", + "id": "315ab0ef", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "76a63a5e", + "id": "5645544a", "metadata": {}, "source": [ "Facets can also be used to represent several images of equal shape, like in the example below where different values of the blurring parameter of a Gaussian filter are compared." @@ -675,7 +675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f8130c1", + "id": "65b863e8", "metadata": {}, "outputs": [], "source": [ @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "7c692b64", + "id": "ee47f11d", "metadata": {}, "source": [ "### Exploring 3-D images and timeseries with `animation_frame`\n", @@ -708,7 +708,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc8cd517", + "id": "ed324520", "metadata": {}, "outputs": [], "source": [ @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "586c7618", + "id": "0ee61768", "metadata": {}, "source": [ "### Animations of xarray datasets\n", @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01b660f1", + "id": "9e2f44d8", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "933de5b0", + "id": "e405e590", "metadata": {}, "source": [ "### Combining animations and facets\n", @@ -760,7 +760,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae9adcf6", + "id": "fb7b6f11", "metadata": {}, "outputs": [], "source": [ @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "7e707e9d", + "id": "28bc12fc", "metadata": {}, "source": [ "#### Reference\n", @@ -784,7 +784,7 @@ }, { "cell_type": "markdown", - "id": "a1835ee8", + "id": "5362882a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/indicator.ipynb b/indicator.ipynb index 23b9166c9..7ea9bf3ca 100644 --- a/indicator.ipynb +++ b/indicator.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dfb48779", + "id": "cc7f6670", "metadata": {}, "source": [ "#### Overview\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5acdb016", + "id": "f568da55", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "aa6847c2", + "id": "a3f6fd7b", "metadata": {}, "source": [ "#### A Single Angular Gauge Chart" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab8d72be", + "id": "5f820dca", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "f340dcfe", + "id": "b73ac64b", "metadata": {}, "source": [ "##### Bullet Gauge\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cee1a7d", + "id": "786634cb", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "c35beac6", + "id": "3a8e7cd3", "metadata": {}, "source": [ "#### Showing Information above Your Chart\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40ca1031", + "id": "752083f6", "metadata": { "lines_to_next_cell": 0 }, @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "961a963a", + "id": "c6121988", "metadata": {}, "source": [ "#### Data Cards / Big Numbers\n", @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "779a0eae", + "id": "38eff2b9", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "010dcd07", + "id": "a011e7d9", "metadata": {}, "source": [ "#### It's possible to display several numbers" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17629db6", + "id": "638fc99e", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "3abdd910", + "id": "f1a071d2", "metadata": {}, "source": [ "#### Adding a Prefix and Suffix" @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "1120e6bc", + "id": "b3624b6c", "metadata": {}, "source": [ "On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`. \n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48b4319c", + "id": "453fd974", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "5f3d67e1", + "id": "2e6fa2fe", "metadata": {}, "source": [ "#### Reference\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "250a1dc2", + "id": "a7fa44e9", "metadata": { "lines_to_next_cell": 2 }, @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "a8063080", + "id": "40206632", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/interactive-html-export.ipynb b/interactive-html-export.ipynb index fc9f7ca8e..0c3f06cb6 100644 --- a/interactive-html-export.ipynb +++ b/interactive-html-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bb1e83d9", + "id": "f5d18bf0", "metadata": {}, "source": [ "### Interactive vs Static Export\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "2e263f49", + "id": "0f0bbea2", "metadata": {}, "source": [ "### Saving to an HTML file\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "10a51da7", + "id": "03e1d083", "metadata": {}, "source": [ "### Controlling the size of the HTML file\n", @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "ad51f443", + "id": "6b1460b3", "metadata": {}, "source": [ "\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "45316e2a", + "id": "fb766266", "metadata": {}, "source": [ "### HTML export in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdba2eb3", + "id": "10b9c077", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "454c7b6a", + "id": "2eccee08", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "f5d538d6", + "id": "2ad56226", "metadata": {}, "source": [ "### Full Parameter Documentation" @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "832a1abc", + "id": "3d3a233c", "metadata": { "lines_to_next_cell": 2 }, @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "96409e31", + "id": "a5af9969", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ipython-vs-python.ipynb b/ipython-vs-python.ipynb index 4e4ecb68a..4cebeb3f3 100644 --- a/ipython-vs-python.ipynb +++ b/ipython-vs-python.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "24293d7a", + "id": "70049cc0", "metadata": {}, "source": [ "#### What is the difference between IPython and Python?\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "2974527e", + "id": "fcb76ae8", "metadata": {}, "source": [ "![IPython terminal](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/ipython-console.png)" @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "cc422019", + "id": "8aaf8331", "metadata": {}, "source": [ "In other words, IPython is a powerful *interface* to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write *scripts*, files with the `.py` extension.
\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "624409bd", + "id": "a1051931", "metadata": {}, "source": [ "#### Jupyter Notebook" @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "43e33062", + "id": "34af951b", "metadata": {}, "source": [ "In 2011, IPython introduced a new tool named the **Notebook**. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python." @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "cfa2af36", + "id": "4f0c865d", "metadata": {}, "source": [ "![IPython Notebook](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/notebook.png)" @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "0a03a0dc", + "id": "054cf057", "metadata": {}, "source": [ "Compared to the original IPython terminal, the Notebook offers a more convenient text editor, the possibility to write rich text, and improved graphical capabilities. Also, since it is a web interface, it can integrate many of the existing web libraries for data visualization, including *plotly.js*.
\n", @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "1276a0a1", + "id": "cbd9f033", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/jupyter-lab-tools.ipynb b/jupyter-lab-tools.ipynb index c19823a5c..0ec6fd36a 100644 --- a/jupyter-lab-tools.ipynb +++ b/jupyter-lab-tools.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "330edb95", + "id": "349b93c7", "metadata": {}, "source": [ "#### Create a New View for Output" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "1d29a6ac", + "id": "b3bfc932", "metadata": {}, "source": [ "Display a FigureWidget and then create a new window to display it in so that you can scroll through your code but still keep an eye on what you're doing." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "abd40291", + "id": "832c758d", "metadata": {}, "source": [ "\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "32f62452", + "id": "57065030", "metadata": {}, "source": [ "#### Reference" @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "02c8c04f", + "id": "b5a41b0f", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples.\n" @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "16f930e6", + "id": "2f71203c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/legend.ipynb b/legend.ipynb index ac10dd6d5..c83b88901 100644 --- a/legend.ipynb +++ b/legend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "71da38f4", + "id": "7b5908d6", "metadata": {}, "source": [ "### Trace Types, Legends and Color Bars\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "e8c4c79c", + "id": "c92c342d", "metadata": {}, "source": [ "### Legends with Plotly Express\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8bf3c70", + "id": "d83fdbf9", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "0abce5c1", + "id": "6bb8ddff", "metadata": {}, "source": [ "### Legend Order\n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24f9e896", + "id": "6b7995f3", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "351016ad", + "id": "e0fa01f7", "metadata": {}, "source": [ "When using stacked bars, the bars are stacked from the bottom in the same order as they appear in the legend, so it can make sense to set `layout.legend.traceorder` to `\"reversed\"` to get the legend and stacks to match:" @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e17590a", + "id": "4e11d355", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "683b752e", + "id": "e96bca6e", "metadata": {}, "source": [ "When using [`plotly.graph_objects`](/python/graph-objects/) rather than Plotly Express, legend items will appear in the order that traces appear in the `data`:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17082044", + "id": "7d432f32", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "8d957123", + "id": "48107ed0", "metadata": {}, "source": [ "*New in 5.16*\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2b106d8", + "id": "76e5adac", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "1e55199d", + "id": "7aa42b96", "metadata": {}, "source": [ "The `legendrank` attribute of a trace or shape can be used to control its placement in the legend.\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdc1d692", + "id": "f566d46b", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "840ac668", + "id": "fb5b2531", "metadata": {}, "source": [ "#### Showing and Hiding the Legend\n", @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6dca9c05", + "id": "7b378004", "metadata": { "lines_to_next_cell": 2 }, @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "f8ba4120", + "id": "f2281cdd", "metadata": {}, "source": [ "### Legend Positioning\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79f1f9cb", + "id": "265a045e", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "3584520d", + "id": "94ed8919", "metadata": {}, "source": [ "#### Legends in Dash\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aee160d3", + "id": "39609dce", "metadata": { "hide_code": true }, @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "f07e7861", + "id": "c87e04c5", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "47f37a79", + "id": "b2cf128f", "metadata": {}, "source": [ "#### Horizontal Legends\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c41f7895", + "id": "49184708", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "7b4100b5", + "id": "1a39112f", "metadata": {}, "source": [ "#### Horizontal Legend Entry Width\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d710608", + "id": "402038b5", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "65a4955f", + "id": "b5c5b037", "metadata": {}, "source": [ "#### Legend Max Height\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcd4c102", + "id": "813a2e32", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "cf08ab9c", + "id": "854b2103", "metadata": {}, "source": [ "#### Styling Legends\n", @@ -429,7 +429,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0a70b2f", + "id": "e1caa7ab", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "d77887a8", + "id": "26e7b4bc", "metadata": {}, "source": [ "### Legends with Graph Objects\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "2e9c0f06", + "id": "d0dd7799", "metadata": {}, "source": [ "#### Legend Item Names\n", @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea7d9119", + "id": "fd7d9ced", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "15b40638", + "id": "daf27831", "metadata": {}, "source": [ "By default, for shapes, legend items are disabled. Set `showlegend=True` on a shape for it to display a legend item.\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4599b73c", + "id": "55d817cd", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "bf5a89a5", + "id": "6cca0ab6", "metadata": {}, "source": [ "#### Legend titles" @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6c3e8ae", + "id": "b6d6205b", "metadata": {}, "outputs": [], "source": [ @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "0bd2d9f4", + "id": "b9072906", "metadata": {}, "source": [ "### Hiding Legend Items" @@ -596,7 +596,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf12212b", + "id": "6a8b30da", "metadata": {}, "outputs": [], "source": [ @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "a8c90c44", + "id": "b2e10552", "metadata": {}, "source": [ "#### Hiding the Trace Initially\n", @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5567913", + "id": "91cc4121", "metadata": {}, "outputs": [], "source": [ @@ -658,7 +658,7 @@ }, { "cell_type": "markdown", - "id": "753347d7", + "id": "94987d7b", "metadata": {}, "source": [ "#### Size of Legend Items\n", @@ -669,7 +669,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd7b45d7", + "id": "c69872d9", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "4c9af772", + "id": "723cfade", "metadata": {}, "source": [ "#### Grouped Legend Items\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f574748", + "id": "68a6fd76", "metadata": {}, "outputs": [], "source": [ @@ -762,7 +762,7 @@ }, { "cell_type": "markdown", - "id": "1c84f619", + "id": "6242ba2a", "metadata": {}, "source": [ "You can also hide entries in grouped legends, preserving the grouped show/hide behaviour. This is what Plotly Express does with its legends." @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dca0996", + "id": "6d4483af", "metadata": {}, "outputs": [], "source": [ @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "cc4fc4dc", + "id": "65d773d0", "metadata": {}, "source": [ "#### Indent Legend Entries\n", @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc22d52a", + "id": "7de52684", "metadata": {}, "outputs": [], "source": [ @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "c877a5f7", + "id": "9f096741", "metadata": {}, "source": [ "#### Group click toggle behavior\n", @@ -884,7 +884,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfa63bed", + "id": "9b6edc64", "metadata": {}, "outputs": [], "source": [ @@ -938,7 +938,7 @@ }, { "cell_type": "markdown", - "id": "1899706e", + "id": "fa01ab36", "metadata": {}, "source": [ "### Legend items for continuous fields (2D and 3D)\n", @@ -951,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5094cb14", + "id": "95893d03", "metadata": {}, "outputs": [], "source": [ @@ -994,7 +994,7 @@ }, { "cell_type": "markdown", - "id": "1443d9de", + "id": "36d6c2f3", "metadata": {}, "source": [ "### Adding Multiple Legends\n", @@ -1009,7 +1009,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1aff8ad", + "id": "7ccd170f", "metadata": {}, "outputs": [], "source": [ @@ -1079,7 +1079,7 @@ }, { "cell_type": "markdown", - "id": "be82bc03", + "id": "9b283883", "metadata": {}, "source": [ "### Positioning Legends\n", @@ -1090,7 +1090,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd32f11", + "id": "8656fc6f", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "bdb22456", + "id": "cd8884e8", "metadata": {}, "source": [ "### Legend Title Click Behavior\n", @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45927aa1", + "id": "e8ede885", "metadata": {}, "outputs": [], "source": [ @@ -1182,7 +1182,7 @@ }, { "cell_type": "markdown", - "id": "3fbecaf8", + "id": "8eb6f76e", "metadata": {}, "source": [ "To disable title click behavior, set `titleclick` and `titledoubleclick` to `False`:\n", @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "2bedc48a", + "id": "991e9394", "metadata": {}, "source": [ "#### Reference\n", @@ -1209,7 +1209,7 @@ }, { "cell_type": "markdown", - "id": "4ae7897d", + "id": "6a315382", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-and-scatter.ipynb b/line-and-scatter.ipynb index 3c1ee7f3a..d4b3f88a6 100644 --- a/line-and-scatter.ipynb +++ b/line-and-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67bc5476", + "id": "b4a364b5", "metadata": {}, "source": [ "## Scatter plots with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "417e0cfa", + "id": "ddd17d80", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52837d2f", + "id": "162649e7", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "6165023c", + "id": "3dd37260", "metadata": {}, "source": [ "#### Setting size and color with column names\n", @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80b61e25", + "id": "9665736a", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "1f4b97b1", + "id": "06a89bfe", "metadata": {}, "source": [ "Color can be [continuous](https://plotly.com/python/colorscales/) as follows, or [discrete/categorical](https://plotly.com/python/discrete-color/) as above." @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e136ed86", + "id": "a05a94a6", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "2337481e", + "id": "db4dce24", "metadata": {}, "source": [ "The `symbol` argument can be mapped to a column as well. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62e5d114", + "id": "3755b9f9", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "94ca12a4", + "id": "fc0159aa", "metadata": {}, "source": [ "## Scatter plots in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64a29245", + "id": "ff9487dd", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "3dd96b9c", + "id": "3d791198", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "b8cb70c5", + "id": "05100f96", "metadata": {}, "source": [ "### Scatter plots and Categorical Axes\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bc26b45", + "id": "b2343b7d", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "80462fe6", + "id": "813d4683", "metadata": {}, "source": [ "### Grouped Scatter Points\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28c74f31", + "id": "3629ef0d", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "e898b440", + "id": "c176155f", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afcba777", + "id": "70646e90", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "cbd9eb55", + "id": "fde3d69b", "metadata": {}, "source": [ "### Error Bars\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05564770", + "id": "a4854018", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "7a8e7fe0", + "id": "b2a4a674", "metadata": {}, "source": [ "### Marginal Distribution Plots\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72e8e237", + "id": "a7926a24", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "ccd48a54", + "id": "24495213", "metadata": {}, "source": [ "### Facetting\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac7d195d", + "id": "fcb17bb3", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "f2b251bd", + "id": "87b85974", "metadata": {}, "source": [ "### Linear Regression and Other Trendlines\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13be5907", + "id": "650469de", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "39042191", + "id": "37bf7b78", "metadata": {}, "source": [ "## Line plots with Plotly Express" @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1aa0db69", + "id": "3376b4fc", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cc8013d", + "id": "5e50d2bb", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "203bf82d", + "id": "9233b4c8", "metadata": {}, "source": [ "The `markers` argument can be set to `True` to show markers on lines." @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc1dbe0c", + "id": "ff8e4ae8", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "1a67ef85", + "id": "22b98368", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf48edaf", + "id": "2f65eb36", "metadata": {}, "outputs": [], "source": [ @@ -399,7 +399,7 @@ }, { "cell_type": "markdown", - "id": "5e165493", + "id": "b91fd286", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "537b5f20", + "id": "136ef729", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "788e0bc4", + "id": "f17be766", "metadata": {}, "source": [ "### Data Order in Scatter and Line Charts\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85e6da01", + "id": "286f258c", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "7ee11c5c", + "id": "87366c34", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -470,7 +470,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc05d504", + "id": "fa973115", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "a9f46ad0", + "id": "488f6bfb", "metadata": {}, "source": [ "### Swarm (or Beeswarm) Plots\n", @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dadbf2e8", + "id": "64a47831", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "fefc6276", + "id": "19661305", "metadata": {}, "source": [ "## Scatter and line plots with go.Scatter\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9fcff64", + "id": "97f401c1", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "9c3d7356", + "id": "c124b301", "metadata": {}, "source": [ "#### Line and Scatter Plots\n", @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4b8f39a", + "id": "d2c01aad", "metadata": {}, "outputs": [], "source": [ @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "d1ea7310", + "id": "4a26e334", "metadata": {}, "source": [ "#### Bubble Scatter Plots\n", @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aad065e4", + "id": "a8e5cde1", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "dda65824", + "id": "b07cf7c4", "metadata": {}, "source": [ "#### Style Scatter Plots" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e478750", + "id": "f5940cde", "metadata": {}, "outputs": [], "source": [ @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "6a1fac1f", + "id": "671a77ba", "metadata": {}, "source": [ "#### Data Labels on Hover" @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24ca09b2", + "id": "a6fda9c4", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "793a741b", + "id": "84a77d41", "metadata": {}, "source": [ "#### Scatter with a Color Dimension" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeccf090", + "id": "e816ea04", "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "b6bdd089", + "id": "904304fb", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c1413de", + "id": "539206a3", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "2182d436", + "id": "b5da0ed3", "metadata": {}, "source": [ "#### Large Data Sets\n", @@ -914,7 +914,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5060810d", + "id": "01d7c1f9", "metadata": {}, "outputs": [], "source": [ @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f2d4a31", + "id": "644fc4fb", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "10ca788a", + "id": "2f47350d", "metadata": {}, "source": [ "### Reference\n", @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "8e45a3ff", + "id": "07c0371a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-charts.ipynb b/line-charts.ipynb index 629245b47..dd2c85881 100644 --- a/line-charts.ipynb +++ b/line-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2f544399", + "id": "6e02f256", "metadata": {}, "source": [ "### Line Plots with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beb6455d", + "id": "af6705ee", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "0205cc62", + "id": "44970043", "metadata": {}, "source": [ "### Line Plots with column encoding color" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8dfc93aa", + "id": "95b529cb", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "1faf7c6e", + "id": "8667cfc6", "metadata": {}, "source": [ "### Line charts in Dash\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "702693aa", + "id": "532d5bed", "metadata": { "hide_code": true, "tags": [] @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "ce80161d", + "id": "d17767ef", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "bd466715", + "id": "400e65f9", "metadata": {}, "source": [ "### Data Order in Line Charts\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0c93333", + "id": "56992555", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "1f07b425", + "id": "1fcc2144", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b2dca54", + "id": "6eac3ba7", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "de5e3080", + "id": "7870c555", "metadata": {}, "source": [ "### Line charts with markers\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9e6fbe5", + "id": "8694cfc3", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "ecc8d957", + "id": "ba61ec93", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c861408", + "id": "5604a4af", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "d114f124", + "id": "097013b3", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab6f6c29", + "id": "8e3e7b80", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "75c97e25", + "id": "d3db0612", "metadata": {}, "source": [ "### Sparklines with Plotly Express\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d011851", + "id": "abaff052", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "9088b2d6", + "id": "d8dcf67d", "metadata": {}, "source": [ "### Line Plot with go.Scatter\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22ab7f40", + "id": "99d841a8", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "1f4fde4f", + "id": "accb525e", "metadata": {}, "source": [ "#### Line Plot Modes" @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b143fc67", + "id": "a84527d7", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "e85a9401", + "id": "f7d99575", "metadata": {}, "source": [ "#### Style Line Plots\n", @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b33b9f3e", + "id": "00aee4bf", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "5e980ab7", + "id": "5a778fd3", "metadata": {}, "source": [ "#### Connect Data Gaps\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "144bdfb8", + "id": "a2437123", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "62584567", + "id": "f30da8dc", "metadata": {}, "source": [ "#### Interpolation with Line Plots" @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae3c477e", + "id": "4dc9a37b", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "ba4af821", + "id": "059d8905", "metadata": {}, "source": [ "#### Label Lines with Annotations" @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4f8385e", + "id": "bc3889ec", "metadata": {}, "outputs": [], "source": [ @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "d64e79b0", + "id": "aa383d32", "metadata": {}, "source": [ "#### Filled Lines" @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcef9614", + "id": "b372476e", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "e3950fbf", + "id": "da1cd32c", "metadata": {}, "source": [ "#### Reference\n", @@ -697,7 +697,7 @@ }, { "cell_type": "markdown", - "id": "096a1bf3", + "id": "323a97ac", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/linear-fits.ipynb b/linear-fits.ipynb index 13847ca91..2fa231d19 100644 --- a/linear-fits.ipynb +++ b/linear-fits.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "94bb6acf", + "id": "8fb3d76e", "metadata": {}, "source": [ "### Linear fit trendlines with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13236a1c", + "id": "aefbc69f", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "6c85a63a", + "id": "6b9533cb", "metadata": {}, "source": [ "### Fitting multiple lines and retrieving the model parameters\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99cc876c", + "id": "d314cf92", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "077f2a80", + "id": "a6ef4b32", "metadata": {}, "source": [ "### Displaying a single trendline with multiple traces\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e11a6e4", + "id": "35844a49", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09fcd974", + "id": "498f67b3", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "1f988af5", + "id": "e180094b", "metadata": {}, "source": [ "### OLS Parameters\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b25db612", + "id": "84c611f9", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c50b5538", + "id": "ad67c75b", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "2e801a27", + "id": "e18ece28", "metadata": {}, "source": [ "### Locally Weighted Scatterplot Smoothing (LOWESS)\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7df0f5c7", + "id": "5ebae978", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "6c6e2f9b", + "id": "3777be12", "metadata": {}, "source": [ "_new in v5.2_\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de279a4b", + "id": "17cc2526", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "ebfe2a59", + "id": "5101f54e", "metadata": {}, "source": [ "### Moving Averages\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd968304", + "id": "2c050c73", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "711ebcaf", + "id": "55603373", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12bb05f0", + "id": "cde91b64", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "b62b0674", + "id": "076cf8b9", "metadata": {}, "source": [ "### Other Functions\n", @@ -257,7 +257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e600ef32", + "id": "a154dcbb", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92d471bd", + "id": "6df18774", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "c50f0d85", + "id": "fd312f14", "metadata": {}, "source": [ "In some cases, it is necessary to pass options into the underying Pandas function, for example the `std` parameter must be provided if the `win_type` argument to `rolling` is `\"gaussian\"`. This is possible with the `function_args` trendline option." @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d3bd23c", + "id": "5ea9bc51", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "cb92079f", + "id": "7fe2c9a2", "metadata": {}, "source": [ "### Displaying only the trendlines\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ad6ebf8", + "id": "365d5f16", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2004ea9a", + "id": "8d126cac", "metadata": { "lines_to_next_cell": 2 }, @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "fb333b2a", + "id": "6a2fee79", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-maps.ipynb b/lines-on-maps.ipynb index 2a59158ec..84bd9cd81 100644 --- a/lines-on-maps.ipynb +++ b/lines-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "01afb4c0", + "id": "f3cc7d3f", "metadata": {}, "source": [ "Below we show how to create geographical line plots using either Plotly Express with `px.line_geo` function or the lower-level `go.Scattergeo` object.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf6c5bf4", + "id": "c08ba2b5", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "be0565c6", + "id": "db92d461", "metadata": {}, "source": [ "### Lines on Maps from GeoPandas\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b03ab330", + "id": "791c893b", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "8756c158", + "id": "ffa69e5e", "metadata": {}, "source": [ "## Lines on Maps with plotly.graph_objects\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ebe782e", + "id": "d63b5034", "metadata": { "lines_to_next_cell": 0 }, @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "80e7135f", + "id": "a0a27603", "metadata": {}, "source": [ "### Performance improvement: put many lines in the same trace\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ef7462f", + "id": "2d4a79af", "metadata": { "lines_to_next_cell": 2 }, @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "1b2e9f6d", + "id": "90f53d57", "metadata": {}, "source": [ "### London to NYC Great Circle" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e94f9bf8", + "id": "e28f6164", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "25d30a83", + "id": "b27943e2", "metadata": {}, "source": [ "### Contour lines on globe" @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f952c4f8", + "id": "6435e2dd", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "8fffc4e3", + "id": "dd0586c7", "metadata": {}, "source": [ "#### Reference\n", @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "7b31af1b", + "id": "25b2ba32", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-tile-maps.ipynb b/lines-on-tile-maps.ipynb index 8b822465d..b46c7aeb4 100644 --- a/lines-on-tile-maps.ipynb +++ b/lines-on-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1c50e070", + "id": "da1900b5", "metadata": {}, "source": [ "### Lines on tile maps using Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2329c577", + "id": "82aeaf9f", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "e3d3c74a", + "id": "1b521185", "metadata": {}, "source": [ "### Lines on maps from GeoPandas\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "235cdaaa", + "id": "8995c0ff", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "2b6c3e6f", + "id": "a45c2a40", "metadata": {}, "source": [ "### Lines on maps using `Scattermap` traces\n", @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c79abbd", + "id": "bec7e6aa", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "195a3d05", + "id": "62c0c551", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "781c034e", + "id": "98496115", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "419f7086", + "id": "890dab77", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "db264ce4", + "id": "43244f73", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/location-mode.ipynb b/location-mode.ipynb index e8893f70e..9d397d0b1 100644 --- a/location-mode.ipynb +++ b/location-mode.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9b9a86f9", + "id": "df46b706", "metadata": {}, "source": [ "# Locations for Outline-based Maps\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "31c90591", + "id": "863e1b99", "metadata": {}, "source": [ "## locationmode='ISO-3'\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e278ebe0", + "id": "b4d010ef", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "c733d605", + "id": "1deb4786", "metadata": {}, "source": [ "## Supported ISO Codes\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "f6f98543", + "id": "7cc59bee", "metadata": {}, "source": [ "## locationmode='USA-states'\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26bbfc06", + "id": "27459639", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "d3a75d48", + "id": "bb95d473", "metadata": {}, "source": [ "## Supported US State Codes\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "0c68e043", + "id": "be28cf71", "metadata": {}, "source": [ "## locationmode='country names'\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "419265e2", + "id": "0bf7a12a", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "aeecefc9", + "id": "36d1bd02", "metadata": {}, "source": [ "> How Plotly matches 'country names' will change in a future version. Matching will become stricter and some country names may no longer match. We recommend using `locationmode='ISO-3'` with ISO codes for `locations` to ensure consistent behavior across versions." @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bfd33a2", + "id": "cfda6fda", "metadata": {}, "outputs": [], "source": [ @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "4343c190", + "id": "3e716648", "metadata": {}, "source": [ "## Using Different Data Types with `locations`\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25efe3a7", + "id": "7d0fe253", "metadata": { "lines_to_next_cell": 2 }, @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "7a5cc691", + "id": "7304f0e0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/log-plot.ipynb b/log-plot.ipynb index d284b2e8f..1e365b6f5 100644 --- a/log-plot.ipynb +++ b/log-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f0828fa3", + "id": "e6c698b9", "metadata": {}, "source": [ "This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots) to follow a logarithmic rather than linear progression. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbdc560e", + "id": "6020ed10", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "d2ff2da4", + "id": "43e13e2f", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with Plotly Express works the same was as with linear axes: using the `range_x` and `range_y` keywords. Note that you cannot set the range to include 0 or less." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8c2b221", + "id": "0976bc35", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "3eecab29", + "id": "fa3e4a0a", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0ff293c", + "id": "bcf31997", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "6a7424e4", + "id": "ccb4c8fb", "metadata": {}, "source": [ "#### Controlling Minor Log Labels\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02a57531", + "id": "675710c9", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "4f72ff06", + "id": "59a3a0f2", "metadata": {}, "source": [ "### Logarithmic Axes with Graph Objects\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d631176e", + "id": "1abd47da", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "2651c2fe", + "id": "cc08ffcd", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with `plotly.graph_objects` is *very different* than setting the range of linear axes: the range is set using the exponent rather than the actual value:\n" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc1d872d", + "id": "74ae6a6f", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "e3eba581", + "id": "5e3d906c", "metadata": {}, "source": [ "#### Reference\n", @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "8f4e7573", + "id": "5a7c92ec", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-configuration.ipynb b/map-configuration.ipynb index fb990fe9f..85d11362f 100644 --- a/map-configuration.ipynb +++ b/map-configuration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "663d1493", + "id": "4268b470", "metadata": {}, "source": [ "### Tile Maps vs Outline Maps\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60e18c25", + "id": "7dfe3e8b", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "e374578a", + "id": "81daba51", "metadata": {}, "source": [ "Here is a map with all physical features enabled and styled, at a larger-scale 1:50m resolution:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9257c5b", + "id": "397e8e95", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "9dcaffa7", + "id": "8ef85018", "metadata": {}, "source": [ "### Disabling Base Maps\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "971244ed", + "id": "6c625eab", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "cb7a03ce", + "id": "dab9bc15", "metadata": {}, "source": [ "### Cultural Base Maps\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "461f1a8b", + "id": "bf9b1663", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "763159ea", + "id": "a29e370a", "metadata": {}, "source": [ "### Map Projections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eec1847", + "id": "4bbc8489", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "576f88de", + "id": "d37e4d20", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "120b4aa8", + "id": "f4d37a1f", "metadata": {}, "source": [ "Map projections can be rotated using the `layout.geo.projection.rotation` attribute, and maps can be translated using the `layout.geo.center` attributed, as well as truncated to a certain longitude and latitude range using the `layout.geo.lataxis.range` and `layout.geo.lonaxis.range`.\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "360cafe0", + "id": "fd7a3ed5", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "820de590", + "id": "c3dc63be", "metadata": {}, "source": [ "### Automatic Zooming or Bounds Fitting\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fb07f2d", + "id": "6292d5c5", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "c323b928", + "id": "9b3c7ed4", "metadata": {}, "source": [ "### Named Map Scopes and Country Sub-Units\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9e2bf20", + "id": "a9bb20d1", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "678e55bb", + "id": "6204a95c", "metadata": {}, "source": [ "The `\"usa\"` scope contains state boundaries at both resolutions, and uses the special `'albers usa'` projection which moves Alaska and Hawaii closer to the \"lower 48 states\" to reduce projection distortion and produce a more compact map." @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03a0c34e", + "id": "0979e425", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "de259415", + "id": "63663ed1", "metadata": {}, "source": [ "### Graticules (Latitude and Longitude Grid Lines)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c8afd54", + "id": "9af66238", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "3a353e18", + "id": "a2675172", "metadata": {}, "source": [ "### Reference\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "3984c2a0", + "id": "46892681", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-subplots-and-small-multiples.ipynb b/map-subplots-and-small-multiples.ipynb index 203b0be1e..77a7703e9 100644 --- a/map-subplots-and-small-multiples.ipynb +++ b/map-subplots-and-small-multiples.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e871011e", + "id": "f6ef7df0", "metadata": {}, "source": [ "### US map small multiples" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a036b8f3", + "id": "a06cc7a2", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "cdb4d81d", + "id": "4615f75e", "metadata": {}, "source": [ "#### Reference\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "0e76b930", + "id": "626e52e9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marginal-plots.ipynb b/marginal-plots.ipynb index 9e946de6e..fda678e66 100644 --- a/marginal-plots.ipynb +++ b/marginal-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c2652d04", + "id": "ea908914", "metadata": {}, "source": [ "### Overview\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a886513d", + "id": "b6b3bb20", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "980c3022", + "id": "84b34258", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "111e557a", + "id": "bcf094cf", "metadata": {}, "source": [ "### Marginal Plots and Color\n", @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d4b74de", + "id": "09d9fae5", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "5e24d842", + "id": "8d735adc", "metadata": {}, "source": [ "### Marginal Plots on Histograms\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9be67988", + "id": "1a6c3aa3", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "260b843b", + "id": "f477f6e0", "metadata": {}, "source": [ "Try hovering over the rug plot points to identify individual country values in the histogram below:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41936304", + "id": "1c2d7b77", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "f3afe810", + "id": "68284bf2", "metadata": {}, "source": [ "### Marginal Plots and Facets\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e95a8113", + "id": "b8cf3afe", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdd0d57b", + "id": "4be7a827", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9da9f4c7", + "id": "768dc8ab", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "7ad6e443", + "id": "112d6e50", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marker-style.ipynb b/marker-style.ipynb index 81ad94443..c8988b1e1 100644 --- a/marker-style.ipynb +++ b/marker-style.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "64885b95", + "id": "32190b6c", "metadata": {}, "source": [ "### Add Marker Border\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c07a28e0", + "id": "019dfe56", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "bcb9fd64", + "id": "637f4d5e", "metadata": {}, "source": [ "Here is an example that creates an empty graph object figure, and then adds two scatter traces with a marker border." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2e87ccb", + "id": "20ae747e", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "e384bc56", + "id": "63d612cc", "metadata": {}, "source": [ "Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density.\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86959562", + "id": "3b9f1b26", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "fc395251", + "id": "d85ae6e0", "metadata": {}, "source": [ "You can also pass an array of dash styles to set different styles per marker:" @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90e170f5", + "id": "b673d3a2", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "857e84b6", + "id": "2e3b97bf", "metadata": {}, "source": [ "The `marker.line.dash` attribute is available on `go.Scatter`, `go.Scatterpolar`, `go.Scattergeo`, `go.Scatterternary`, `go.Scattercarpet`, and `go.Scattersmith` traces.\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "998ed164", + "id": "ce11d581", "metadata": { "hide_code": true }, @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "0f6c3f0d", + "id": "437dae37", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "502e4682", + "id": "dd471a52", "metadata": {}, "source": [ "### Opacity\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b582000", + "id": "42f5ed34", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "21b63b8c", + "id": "e74bcdea", "metadata": {}, "source": [ "### Marker Opacity\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfc8df6a", + "id": "dc051a9e", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "1e5cfd5f", + "id": "c18641c1", "metadata": {}, "source": [ "### Color Opacity\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "774b1b74", + "id": "097d35b3", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ }, { "cell_type": "markdown", - "id": "89c998b5", + "id": "89c2c4a1", "metadata": {}, "source": [ "### Custom Marker Symbols\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "caf60bf8", + "id": "733a4231", "metadata": { "lines_to_next_cell": 2 }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "2382534a", + "id": "c6e58d9a", "metadata": {}, "source": [ "### Using a Custom Marker\n", @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71defd06", + "id": "f5821ab6", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "995ec146", + "id": "94f9cf94", "metadata": {}, "source": [ "#### Open Marker Colors\n", @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ef6b525", + "id": "4fd115c4", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "d9dbff45", + "id": "2696b70e", "metadata": {}, "source": [ "### Setting Marker Angles" @@ -560,7 +560,7 @@ }, { "cell_type": "markdown", - "id": "c14c1dbc", + "id": "169b6b9c", "metadata": {}, "source": [ "*New in 5.11*\n", @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f6b225d", + "id": "a553ffea", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "f654d6d6", + "id": "8f265c0f", "metadata": {}, "source": [ "### Setting Angle Reference\n", @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7f6696f", + "id": "c8fe7d2f", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "ed23527d", + "id": "b71342e2", "metadata": {}, "source": [ "### Using Standoff to Position a Marker\n", @@ -651,7 +651,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1681d0a4", + "id": "3840c516", "metadata": {}, "outputs": [], "source": [ @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "40852608", + "id": "1017aae8", "metadata": {}, "source": [ "### Reference\n", @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "d65ede70", + "id": "a2895158", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/migrate-to-maplibre.ipynb b/migrate-to-maplibre.ipynb index 786231d34..c30d057a5 100644 --- a/migrate-to-maplibre.ipynb +++ b/migrate-to-maplibre.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2ba63428", + "id": "2bb7b3d2", "metadata": {}, "source": [ "## Migrating from Mapbox traces to MapLibre traces\n", @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "1433c1ac", + "id": "2bb11afe", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/mixed-subplots.ipynb b/mixed-subplots.ipynb index 3cab6c3e5..ddc5271b8 100644 --- a/mixed-subplots.ipynb +++ b/mixed-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1e21d87c", + "id": "9cd8d9ff", "metadata": {}, "source": [ "### Mixed Subplots and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "870e5764", + "id": "4c02854e", "metadata": {}, "source": [ "#### Mixed Subplot" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a951fb8", + "id": "61c2beeb", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "9b40d24c", + "id": "9f0274c8", "metadata": {}, "source": [ "#### Reference\n", @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "dba2c182", + "id": "5fa2c86e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-knn.ipynb b/ml-knn.ipynb index bcd906147..71b5a459c 100644 --- a/ml-knn.ipynb +++ b/ml-knn.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a0796c4e", + "id": "e2833d52", "metadata": {}, "source": [ "## Basic binary classification with kNN\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "772d8741", + "id": "84f3a45c", "metadata": {}, "source": [ "### Display training and test splits\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af8a5de8", + "id": "7c67ed46", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "0885221c", + "id": "85eff416", "metadata": {}, "source": [ "### Visualize predictions on test split with [`plotly.express`](https://plotly.com/python/plotly-express/)" @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "1820f1b3", + "id": "9277e8cb", "metadata": {}, "source": [ "Now, we train the kNN model on the same training data displayed in the previous graph. Then, we predict the confidence score of the model for each of the data points in the test set. We will use shapes to denote the true labels, and the color will indicate the confidence of the model for assign that score.\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c9bd786", + "id": "6f733ffe", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "78355f73", + "id": "8d7fbaa8", "metadata": {}, "source": [ "## Probability Estimates with `go.Contour`\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8602b22", + "id": "202fe8cf", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "7e80789c", + "id": "46cf2951", "metadata": {}, "source": [ "Now, let's try to combine our `go.Contour` plot with the first scatter plot of our data points, so that we can visually compare the confidence of our model with the true labels." @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efe5be8b", + "id": "a819c4e7", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "f682eb46", + "id": "6891955b", "metadata": {}, "source": [ "## k-NN classification in Dash\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11eaddd0", + "id": "bb189fe5", "metadata": { "hide_code": true }, @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "3b871c3a", + "id": "fa029028", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "4253aa73", + "id": "c9252d22", "metadata": {}, "source": [ "## Multi-class prediction confidence with [`go.Heatmap`](https://plotly.com/python/heatmaps/)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d06c7630", + "id": "9882565a", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "757c870a", + "id": "aff2ff2c", "metadata": {}, "source": [ "### Reference\n", @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "ef6e77d3", + "id": "2a881ad4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-pca.ipynb b/ml-pca.ipynb index ac7a75592..0213bac50 100644 --- a/ml-pca.ipynb +++ b/ml-pca.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e25822c7", + "id": "ee986c82", "metadata": {}, "source": [ "This page first shows how to visualize higher dimension data using various Plotly figures combined with dimensionality reduction (aka projection). Then, we dive into the specific details of our projection algorithm.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "efb23ea8", + "id": "06de2260", "metadata": {}, "source": [ "## High-dimensional PCA Analysis with `px.scatter_matrix`\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "ddb7468e", + "id": "26cbb6eb", "metadata": {}, "source": [ "### Visualize all the original dimensions\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3f69df9", + "id": "dd650956", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "c079f2a4", + "id": "eee5f9ad", "metadata": {}, "source": [ "### Visualize all the principal components\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5570281", + "id": "553279dd", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "aabb85d8", + "id": "d1de61e8", "metadata": {}, "source": [ "### Visualize a subset of the principal components\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97f3d4ce", + "id": "31dc9430", "metadata": { "lines_to_next_cell": 2 }, @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "609084b9", + "id": "2fb11fcc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "80d185ee", + "id": "10e02fe3", "metadata": {}, "source": [ "## 2D PCA Scatter Plot\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6ea4332", + "id": "911fec10", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "0c2355c7", + "id": "63447e59", "metadata": {}, "source": [ "## Visualize PCA with `px.scatter_3d`\n", @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3db5cce", + "id": "9371cc58", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "7d00bf7d", + "id": "943d139a", "metadata": {}, "source": [ "## Plotting explained variance\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5076074c", + "id": "ae3b8c61", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "20bb0834", + "id": "5be22629", "metadata": {}, "source": [ "## Visualize Loadings\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f502ac62", + "id": "f34f43cb", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "c431d435", + "id": "7394d264", "metadata": {}, "source": [ "## References\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "e3f6b751", + "id": "4d37dc7d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-regression.ipynb b/ml-regression.ipynb index 1f4303ccf..0eee131ab 100644 --- a/ml-regression.ipynb +++ b/ml-regression.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0e4c5426", + "id": "4b6e1b49", "metadata": {}, "source": [ "This page shows how to use Plotly charts for displaying various types of regression models, starting from simple models like [Linear Regression](https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html), and progressively move towards models like [Decision Tree][tree] and [Polynomial Features][poly]. We highlight various capabilities of plotly, such as comparative analysis of the same model with different parameters, displaying Latex, [surface plots](https://plotly.com/python/3d-surface-plots/) for 3D data, and enhanced prediction error analysis with [Plotly Express](https://plotly.com/python/plotly-express/).\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "3483066c", + "id": "154d84b9", "metadata": {}, "source": [ "## Basic linear regression plots\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91337dd7", + "id": "c7675dd9", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "a52f67fe", + "id": "7107bb36", "metadata": {}, "source": [ "### Linear Regression with scikit-learn\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5ee490f", + "id": "f2e18977", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "e4d526da", + "id": "3862d472", "metadata": {}, "source": [ "### ML Regression in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9b38ddb", + "id": "a9daaa08", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "167a2ff4", + "id": "a9e17f25", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "90917856", + "id": "4628f38c", "metadata": {}, "source": [ "## Model generalization on unseen data\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b357cacb", + "id": "23fa10f0", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "c6413231", + "id": "9ca71f11", "metadata": {}, "source": [ "## Comparing different kNN models parameters\n", @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea6a9656", + "id": "46dca038", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "34b9eb4c", + "id": "63c74116", "metadata": {}, "source": [ "## Displaying `PolynomialFeatures` using $\\LaTeX$\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "054a4e85", + "id": "c8446333", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "263d5e3a", + "id": "e0f5865e", "metadata": {}, "source": [ "## 3D regression surface with `px.scatter_3d` and `go.Surface`\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0e3d697", + "id": "8e6c1702", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "8a374108", + "id": "2a663bf9", "metadata": {}, "source": [ "## Visualizing coefficients for multiple linear regression (MLR)\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59607c26", + "id": "d55547f2", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "ee09278c", + "id": "6cb1a950", "metadata": {}, "source": [ "## Prediction Error Plots\n", @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "2cf3aa3b", + "id": "de82c746", "metadata": {}, "source": [ "### Simple actual vs predicted plot\n", @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0421ba9", + "id": "afbd0627", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "08afa079", + "id": "93c21445", "metadata": {}, "source": [ "### Enhanced prediction error analysis using `plotly.express`\n", @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abcc5338", + "id": "acdd70e2", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "6feb1123", + "id": "0d9d2096", "metadata": {}, "source": [ "## Residual plots\n", @@ -477,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "242e4dfb", + "id": "9ac071ff", "metadata": {}, "outputs": [], "source": [ @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "9bceaf23", + "id": "2b7f2a81", "metadata": {}, "source": [ "## Visualize regularization across cross-validation folds" @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "61c366ea", + "id": "96171311", "metadata": {}, "source": [ "In this example, we show how to plot the results of various $\\alpha$ penalization values from the results of cross-validation using scikit-learn's `LassoCV`. This is useful to see how much the error of the optimal alpha actually varies across CV folds." @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3a9d0e2", + "id": "9854b15b", "metadata": {}, "outputs": [], "source": [ @@ -598,7 +598,7 @@ }, { "cell_type": "markdown", - "id": "35ef6555", + "id": "8d0c9eb2", "metadata": {}, "source": [ "## Grid search visualization using `px.density_heatmap` and `px.box`\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bfe29c6", + "id": "9b2173e9", "metadata": {}, "outputs": [], "source": [ @@ -686,7 +686,7 @@ }, { "cell_type": "markdown", - "id": "adeb4051", + "id": "63577d1a", "metadata": {}, "source": [ "### Reference\n", @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "e0065129", + "id": "73e4e8f5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-roc-pr.ipynb b/ml-roc-pr.ipynb index 2428fe86a..86c72875c 100644 --- a/ml-roc-pr.ipynb +++ b/ml-roc-pr.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "39291c26", + "id": "2f6ac0c3", "metadata": {}, "source": [ "## Preliminary plots\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bf4ecc9", + "id": "eaf37ecf", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "efaa39d8", + "id": "eef4c6ed", "metadata": {}, "source": [ "## Basic binary ROC curve\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1677aa3", + "id": "f21a3d5c", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "322e62df", + "id": "5f1c2d44", "metadata": {}, "source": [ "## ROC curve in Dash\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c4ecfa9", + "id": "2e1c1006", "metadata": { "hide_code": true }, @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "58541079", + "id": "d9419730", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "38722788", + "id": "3fcf6a36", "metadata": {}, "source": [ "## Multiclass ROC Curve\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ba882d8", + "id": "96e54518", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "8770c7b4", + "id": "fe42d22b", "metadata": {}, "source": [ "## Precision-Recall Curves\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd3774d0", + "id": "a7dfb9bd", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "7cdbfc69", + "id": "db19bf75", "metadata": {}, "source": [ "In this example, we use the [average precision](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html) metric, which is an alternative scoring method to the area under the PR curve." @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "944264f8", + "id": "0164842e", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "e2f3342c", + "id": "f9614bb8", "metadata": {}, "source": [ "## References\n", @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "125439e1", + "id": "dfc07f33", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-tsne-umap-projections.ipynb b/ml-tsne-umap-projections.ipynb index 4b4c71b65..99048e28f 100644 --- a/ml-tsne-umap-projections.ipynb +++ b/ml-tsne-umap-projections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c875b8e9", + "id": "cec87c8b", "metadata": {}, "source": [ "This page presents various ways to visualize two popular dimensionality reduction techniques, namely the [t-distributed stochastic neighbor embedding](https://lvdmaaten.github.io/tsne/) (t-SNE) and [Uniform Manifold Approximation and Projection](https://umap-learn.readthedocs.io/en/latest/index.html) (UMAP). They are needed whenever you want to visualize data with more than two or three features (i.e. dimensions).\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "92c2e69e", + "id": "d711a5aa", "metadata": {}, "source": [ "## Basic t-SNE projections\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "8e295884", + "id": "96010165", "metadata": {}, "source": [ "### Visualizing high-dimensional data with `px.scatter_matrix`\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73d98ea4", + "id": "abd59434", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "06609b27", + "id": "3872f70f", "metadata": {}, "source": [ "### Project data into 2D with t-SNE and `px.scatter`\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9c01ce3", + "id": "e58d780a", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "4395c227", + "id": "6e7154fb", "metadata": {}, "source": [ "### Project data into 3D with t-SNE and `px.scatter_3d`\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4711cdc", + "id": "2f973f92", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "a55fb5ad", + "id": "f7728f85", "metadata": {}, "source": [ "## Projections with UMAP\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1302200f", + "id": "398de277", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "9d030a8b", + "id": "9a07649b", "metadata": {}, "source": [ "## Visualizing image datasets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec932185", + "id": "abab14ff", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "a658a413", + "id": "5215da3a", "metadata": { "lines_to_next_cell": 2 }, @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "d3ed9065", + "id": "d2fd31d2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml_apps.ipynb b/ml_apps.ipynb index 983e3f6ed..e64435c9e 100644 --- a/ml_apps.ipynb +++ b/ml_apps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0dab6570", + "id": "3b07039d", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "235bcfd6", + "id": "50da3998", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/multiple-axes.ipynb b/multiple-axes.ipynb index 19b9598e2..b9068d572 100644 --- a/multiple-axes.ipynb +++ b/multiple-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "009ca527", + "id": "4676c791", "metadata": {}, "source": [ "### Multiple Y Axes and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "594ec34c", + "id": "2690ab3e", "metadata": {}, "source": [ "#### Two Y Axes" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4b5d232", + "id": "c6ba37bb", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "18169642", + "id": "13003f1f", "metadata": {}, "source": [ "### Multiple axes in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0052866d", + "id": "2e408d11", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "248fbb1c", + "id": "f2818414", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "e4aaec40", + "id": "741e400a", "metadata": {}, "source": [ "#### Multiple Y-Axes Subplots" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1fad045", + "id": "2dbc7a2b", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "1c0c7719", + "id": "8bba4ac1", "metadata": {}, "source": [ "#### Multiple Axes\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4c939f6", + "id": "39c417c2", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "bd5f50ce", + "id": "a3b84f0e", "metadata": {}, "source": [ "#### Automatically Shifting Axes\n", @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d436e3c", + "id": "cf932c6e", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "50c76f90", + "id": "d5c80861", "metadata": {}, "source": [ "### Shift Axes by a Specific Number of Pixels\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c532bfc", + "id": "b0e1ef53", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "5a08ffb2", + "id": "5a5c17d0", "metadata": {}, "source": [ "### Sync Axes Ticks" @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "31be87b8", + "id": "61c536f0", "metadata": {}, "source": [ "*New in 5.13*\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2e3febb", + "id": "8c1803d3", "metadata": {}, "outputs": [], "source": [ @@ -506,7 +506,7 @@ }, { "cell_type": "markdown", - "id": "c773f574", + "id": "ca22c1f3", "metadata": {}, "source": [ "#### Reference\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "668cb894", + "id": "afd72a3d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/network-graphs.ipynb b/network-graphs.ipynb index 8e6e8504d..f95c636a1 100644 --- a/network-graphs.ipynb +++ b/network-graphs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d9263591", + "id": "b194860e", "metadata": {}, "source": [ "In this example we show how to visualize a network graph created using `networkx`.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "8e011958", + "id": "03f91baa", "metadata": {}, "source": [ "### Create random graph" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b15a6724", + "id": "13359042", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "454e48d2", + "id": "5a9ee9d9", "metadata": {}, "source": [ "#### Create Edges\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80f273d6", + "id": "1ba02225", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "979baff9", + "id": "9f60e7ae", "metadata": {}, "source": [ "#### Color Node Points\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "162598e7", + "id": "302b56a4", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "b50105c3", + "id": "1567751e", "metadata": {}, "source": [ "#### Create Network Graph" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f97485f7", + "id": "c1eb9dca", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "0d9bceab", + "id": "03815234", "metadata": {}, "source": [ "### Network graphs in Dash\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "564ec394", + "id": "63c7358d", "metadata": { "hide_code": true }, @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "20f8dbee", + "id": "d70c0e86", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "a5d1e075", + "id": "9279b489", "metadata": {}, "source": [ "#### Reference\n", @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "746615bd", + "id": "2159c3f9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ohlc-charts.ipynb b/ohlc-charts.ipynb index f57d2d93a..6dc9c67af 100644 --- a/ohlc-charts.ipynb +++ b/ohlc-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1a5c5a07", + "id": "e1b704ac", "metadata": {}, "source": [ "The [OHLC](https://en.wikipedia.org/wiki/Open-high-low-close_chart) chart (for open, high, low and close) is a style of financial chart describing open, high, low and close values for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. 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.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "306c5c52", + "id": "00c29dd0", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "82d07c65", + "id": "bd44a87f", "metadata": {}, "source": [ "#### OHLC Chart without Rangeslider" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7b6baae", + "id": "28f9d5ea", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "0b26b48a", + "id": "72390755", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38960264", + "id": "ca78d456", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "3366ebb3", + "id": "f4efad5a", "metadata": {}, "source": [ "#### Custom OHLC Colors" @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7002e11a", + "id": "fc761c0e", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "21616628", + "id": "7937195b", "metadata": {}, "source": [ "#### Simple OHLC with `datetime` Objects" @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2f575d4", + "id": "d1347c1d", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "bb34b54e", + "id": "850fee76", "metadata": {}, "source": [ "### Custom Hovertext" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84cd39e8", + "id": "b7cb62f6", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "610c23dd", + "id": "f511a519", "metadata": {}, "source": [ "#### Reference\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "7a02a0ef", + "id": "cb900323", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/orca-management.ipynb b/orca-management.ipynb index d5d0fa633..032dfc718 100644 --- a/orca-management.ipynb +++ b/orca-management.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f2f1fe32", + "id": "08741e98", "metadata": { "lines_to_next_cell": 0 }, @@ -28,7 +28,7 @@ }, { "cell_type": "raw", - "id": "faf93a0b", + "id": "ea39ea6c", "metadata": {}, "source": [ "$ conda install -c plotly plotly-orca==1.2.1 psutil requests" @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "cd851868", + "id": "83988ce0", "metadata": {}, "source": [ "**Note:** Even if you do not want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca==1.2.1` and the orca executable will be available system wide.\n", @@ -47,7 +47,7 @@ }, { "cell_type": "raw", - "id": "db0f93df", + "id": "4e856fd7", "metadata": {}, "source": [ "$ npm install -g electron@1.8.4 orca\n", @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "9d37dd93", + "id": "14af8853", "metadata": {}, "source": [ "##### Standalone Binaries + pip\n", @@ -65,7 +65,7 @@ }, { "cell_type": "raw", - "id": "55e75101", + "id": "6ab4a86d", "metadata": {}, "source": [ "$ pip install psutil requests" @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "10324834", + "id": "aefde83a", "metadata": {}, "source": [ "### Install orca on Google Colab\n", @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "7cc5cc35", + "id": "85add710", "metadata": {}, "source": [ "### Create a Figure\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3bcf2c2", + "id": "e1b07cdd", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "a1136c4d", + "id": "c7b84283", "metadata": {}, "source": [ "### config\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02ecf017", + "id": "36eab49e", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "46e8ad73", + "id": "532f0aae", "metadata": {}, "source": [ "### status\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c5c5511", + "id": "c78588bc", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "1b4d5eac", + "id": "8fabce18", "metadata": {}, "source": [ "Since no image export operations have been performed yet, the orca server is not yet running.\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2239ee28", + "id": "b519658b", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "e57b2564", + "id": "ff2f694c", "metadata": {}, "source": [ "By checking the `status` object again, we see that the orca server is now running" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2f1508d", + "id": "c42483e4", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "4455f48a", + "id": "f853fd06", "metadata": {}, "source": [ "Let's perform this same export operation again, now that the server is already running." @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7beb3bd8", + "id": "a073116e", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "f46c6eda", + "id": "6b12734a", "metadata": {}, "source": [ "The difference in runtime is dramatic. Starting the server and exporting the first image takes a couple seconds, while exporting an image with a running server is much faster." @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "168a2fdb", + "id": "1ec946db", "metadata": {}, "source": [ "### Shutdown the Server\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca5e7b7b", + "id": "dabdc2f8", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2f93347", + "id": "28e6b44b", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "990ea1ec", + "id": "fc49c125", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "8478592b", + "id": "41be68da", "metadata": {}, "source": [ "### Configuring the Executable\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "27d91179", + "id": "8acceff0", "metadata": {}, "source": [ "### Other Configuration Settings\n", @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "f2e72277", + "id": "072866f1", "metadata": {}, "source": [ "### Saving Configuration Settings\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "fd3f5802", + "id": "720998b6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pandas-backend.ipynb b/pandas-backend.ipynb index 8f8f22cfa..1ece9af90 100644 --- a/pandas-backend.ipynb +++ b/pandas-backend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7adb9dcf", + "id": "c344fbf7", "metadata": {}, "source": [ "### Introduction\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9315ac2b", + "id": "f4f8fa67", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "8eba62a7", + "id": "d3039c00", "metadata": {}, "source": [ "This functionality wraps [Plotly Express](/python/plotly-express/) and so you can use any of the [styling options available to Plotly Express methods](/python/styling-plotly-express/). Since what you get back is a regular `Figure` object, you can use any of the update mechanisms supported by these objects to apply [templates](/python/templates/) or further customize [axes](/python/axes/), [colors](/python/colorscales/), [legends](/python/legend/), [fonts](/python/figure-labels/), [hover labels](/python/hover-text-and-formatting/) etc. [Faceting](/python/facet-plots/) is also supported." @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8e77852", + "id": "10b0e65e", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "c8d79b01", + "id": "f3ffcf2e", "metadata": {}, "source": [ "### A Note on API Compatibility\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7117d0e", + "id": "78796079", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "0fb5545a", + "id": "c048b96a", "metadata": {}, "source": [ "To achieve a similar effect to `subplots=True`, for example, the [Plotly Express `facet_row` and `facet_col` options](/python/facet-plots/) can be used, the same was as they work when directly calling [Plotly Express with wide-form data](/python/wide-form/):" @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69b529cb", + "id": "a128d90f", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "13ee87b3", + "id": "152f8580", "metadata": {}, "source": [ "### Supported Methods\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8a49d2e", + "id": "248d25fe", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "968e486e", + "id": "4151be30", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30e5a1bf", + "id": "5e78f580", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "329f0b03", + "id": "41ff965a", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "398563ea", + "id": "90eb65f4", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b5b15a7", + "id": "e96ace8e", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62199904", + "id": "0e645b43", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "9cd02f60", + "id": "b963e39d", "metadata": {}, "source": [ "### `Series` and `DataFrame` functions: `hist` and `boxplot`\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d2a2c5b", + "id": "9180d382", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "0f29d8ab", + "id": "cf79d998", "metadata": {}, "source": [ "### What about Cufflinks?\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "20f29557", + "id": "df2a75b1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-categories-diagram.ipynb b/parallel-categories-diagram.ipynb index c815d59a7..5ce3cb968 100644 --- a/parallel-categories-diagram.ipynb +++ b/parallel-categories-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dc2aaf64", + "id": "ec056573", "metadata": {}, "source": [ "#### Parallel Categories Diagram\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a547733", + "id": "6582a62e", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "b5391a43", + "id": "9b18a987", "metadata": {}, "source": [ "#### Style Diagram\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ec09d5b", + "id": "439e6015", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "66ffdce1", + "id": "0071cd9a", "metadata": {}, "source": [ "### Basic Parallel Categories Diagram with `graph_objects`\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "039e8a8c", + "id": "4c076c3b", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "5b84c204", + "id": "2dd81e73", "metadata": {}, "source": [ "#### Basic Parallel Categories Diagram with Counts\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18fe278e", + "id": "0b2ad49c", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "1bbd1fb7", + "id": "a9f2a381", "metadata": {}, "source": [ "#### Multi-Color Parallel Categories Diagram\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dee9034", + "id": "5ad56d8b", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "bbeeb187", + "id": "375a9946", "metadata": {}, "source": [ "#### Parallel Categories Linked Brushing\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7208ac", + "id": "93fc915f", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "27cb4f9f", + "id": "1682a0a0", "metadata": {}, "source": [ "![Single-color brushing](https://user-images.githubusercontent.com/15064365/48087050-4a3eae80-e1cc-11e8-94c9-c0ffcedd3aa9.gif)\n", @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f160a856", + "id": "ef0bc0f0", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "d6001afb", + "id": "f4c3b237", "metadata": {}, "source": [ "![Multi-color brushing](https://user-images.githubusercontent.com/15064365/48087055-4e6acc00-e1cc-11e8-8f0c-c8316eb4def2.gif)\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "c98427b5", + "id": "102d9322", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-coordinates-plot.ipynb b/parallel-coordinates-plot.ipynb index c2a80cac6..79d12ca63 100644 --- a/parallel-coordinates-plot.ipynb +++ b/parallel-coordinates-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f72f5844", + "id": "6682cb6f", "metadata": {}, "source": [ "## Parallel Coordinates plot with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7213d6bf", + "id": "bfd2d299", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "bfd121d2", + "id": "619e1594", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions.\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9af363a3", + "id": "4aa2280c", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "63a13e6c", + "id": "d44a1af1", "metadata": {}, "source": [ "## Parallel Coordinates Chart with go.Parcoords" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dea57d8", + "id": "29dc2418", "metadata": { "inputHidden": false, "outputHidden": false @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "15bbac6b", + "id": "d613eeaf", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions and drag the axis names across the plot to rearrange variables.\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2591f963", + "id": "c8172852", "metadata": { "inputHidden": false, "outputHidden": false @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "50ac15b7", + "id": "1b6d942d", "metadata": {}, "source": [ "### Advanced Parallel Coordinates Plot" @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72b5ac67", + "id": "85eb1e88", "metadata": { "inputHidden": false, "outputHidden": false @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "18a8f7b8", + "id": "24f23dd5", "metadata": {}, "source": [ "### Unselected Line Color and Opacity" @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "011acc9a", + "id": "f0659b23", "metadata": {}, "source": [ "*New in 5.10*\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71e14b46", + "id": "9f6b963c", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "366d80a9", + "id": "7aadcebb", "metadata": {}, "source": [ "#### Reference\n", @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "27b687af", + "id": "79877271", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pattern-hatching-texture.ipynb b/pattern-hatching-texture.ipynb index 82bf6e5aa..f5f3f884b 100644 --- a/pattern-hatching-texture.ipynb +++ b/pattern-hatching-texture.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "91521559", + "id": "d42ac114", "metadata": {}, "source": [ "*New in 5.0, with support for pie, sunburst, icicle, funnelarea, and treemap charts in 5.15*\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "a7f4c205", + "id": "36bc21ca", "metadata": {}, "source": [ "### Patterned Charts with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfd7ca6c", + "id": "24dda7bf", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbc5709c", + "id": "54f67fd3", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "74781993", + "id": "9046fa56", "metadata": {}, "source": [ "In the chart below we use `px.histogram()` instead of `px.bar()` to aggregate multiple values together, and encode one variable (sex) using both color and x-position and another (smoker) using patterns:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41bbf691", + "id": "0eb1296e", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "aaa7d90d", + "id": "08741d71", "metadata": {}, "source": [ "### Controlling Pattern Assignment\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fb22d62", + "id": "71b64aff", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "12d45084", + "id": "075172bd", "metadata": {}, "source": [ "Here we use `pattern_shape_map` to explictly assign a shape to each value of `nation`, regardless of order:" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62fdae82", + "id": "a6aa6a2c", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "a0741d16", + "id": "64e64a64", "metadata": {}, "source": [ "### Black on White Patterns for Print\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "471eba4b", + "id": "aa9f1754", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "2df6bd5e", + "id": "72b7276b", "metadata": {}, "source": [ "Of course, this setting can be used without making the figure monochrome as well:" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "248bf388", + "id": "1f480172", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "27144208", + "id": "96fea0ce", "metadata": {}, "source": [ "### Patterns using Graph Objects\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b546b4a", + "id": "b74d74bd", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "d577ef73", + "id": "22baa902", "metadata": {}, "source": [ "### Patterns Using SVG Paths\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23a21670", + "id": "2001d65d", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "03ffd41b", + "id": "0660f6ca", "metadata": {}, "source": [ "#### Reference\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "7d75bd7b", + "id": "c4e8f48b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/peak-finding.ipynb b/peak-finding.ipynb index e48fc7273..ad96300c8 100644 --- a/peak-finding.ipynb +++ b/peak-finding.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "19091b56", + "id": "2d399a82", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "292e22e5", + "id": "0efb05af", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "fdb88cae", + "id": "328e31da", "metadata": {}, "source": [ "#### Import Data\n", @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a81379ed", + "id": "1a2af384", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "7d9f9d23", + "id": "63f4af25", "metadata": {}, "source": [ "#### Peak Detection\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "203f6f7a", + "id": "ed9c0b3c", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "461a7a20", + "id": "d4c4d0ba", "metadata": {}, "source": [ "#### Only Highest Peaks\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d99ebb02", + "id": "503bbfd8", "metadata": { "lines_to_next_cell": 2 }, @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "43b3cc87", + "id": "4a28b978", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/performance.ipynb b/performance.ipynb index 5db5a79e3..ac49bd042 100644 --- a/performance.ipynb +++ b/performance.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bac5bc86", + "id": "14ea2585", "metadata": {}, "source": [ "## DataFrame Types\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d19d8a91", + "id": "86e47d34", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "43deaf97", + "id": "4626efb5", "metadata": {}, "source": [ "## WebGL\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "3348e332", + "id": "8e7b3399", "metadata": {}, "source": [ "```\n", @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "6f60cd8b", + "id": "4b065862", "metadata": {}, "source": [ "### WebGL for Scatter Performance\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e40fb07f", + "id": "8ded2510", "metadata": { "lines_to_next_cell": 2 }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "2d97bef1", + "id": "012281b3", "metadata": {}, "source": [ "#### WebGL with 1,000,000 points with Graph Objects\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc6183f6", + "id": "529b18f7", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "1a07a8b7", + "id": "cfabc0d0", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5596536", + "id": "81aa426a", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "3799254e", + "id": "942b9aec", "metadata": {}, "source": [ "### Exploring Correlations of a Large Dataset\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "444da5a6", + "id": "780ac4a3", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "139ac282", + "id": "d071098c", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "0f815ff4", + "id": "a07c81e3", "metadata": {}, "source": [ "Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.\n" @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "d513704b", + "id": "fea58afc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pie-charts.ipynb b/pie-charts.ipynb index 7927166f5..7bee4cb92 100644 --- a/pie-charts.ipynb +++ b/pie-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "07438ac2", + "id": "88cd47b3", "metadata": {}, "source": [ "A pie chart is a circular statistical chart, which is divided into sectors to illustrate numerical proportion.\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c18ae94", + "id": "ecbbca28", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "8885d214", + "id": "dab64472", "metadata": {}, "source": [ "### Pie chart with repeated labels\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92c5783d", + "id": "6c3823c8", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "c3b53501", + "id": "863da6be", "metadata": {}, "source": [ "### Pie chart in Dash\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9c6077c", + "id": "95e72676", "metadata": { "hide_code": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "db647d27", + "id": "9bc99a61", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "615dff54", + "id": "c7e5d064", "metadata": {}, "source": [ "### Setting the color of pie sectors with px.pie" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d4d5b0b", + "id": "8a4c3998", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "100233cd", + "id": "b5a302a7", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00fd13db", + "id": "efdc3332", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "752c74bd", + "id": "0f3189dd", "metadata": {}, "source": [ "### Customizing a pie chart created with px.pie\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69dd4d99", + "id": "b670b109", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "ea00eced", + "id": "3b3dbddc", "metadata": {}, "source": [ "### Basic Pie Chart with go.Pie\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89abc202", + "id": "165a9c12", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "7b52ca20", + "id": "071fa6dc", "metadata": {}, "source": [ "### Styled Pie Chart\n", @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d7e8aff", + "id": "59068551", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "96601aba", + "id": "a07f2387", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc8489ba", + "id": "515699cb", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "3e268864", + "id": "cc131773", "metadata": {}, "source": [ "#### Controlling text orientation inside pie sectors\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e47b0de", + "id": "c1daaed7", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "7b47ef48", + "id": "ff9686d1", "metadata": {}, "source": [ "### Donut Chart" @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b4940d4", + "id": "9d707a94", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "19e5d761", + "id": "b435f265", "metadata": {}, "source": [ "### Pulling sectors out from the center\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec3d1cbd", + "id": "54fb1ffd", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "039e79e0", + "id": "6a805d8c", "metadata": {}, "source": [ "### Pie Charts in subplots" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6de4924a", + "id": "42430f4e", "metadata": {}, "outputs": [], "source": [ @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7637d37", + "id": "a962053b", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "154d0715", + "id": "943d38b8", "metadata": {}, "source": [ "#### Plot chart with area proportional to total count\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2a35c23", + "id": "066147ab", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "5b5f11b5", + "id": "58429213", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31439681", + "id": "bd8a2290", "metadata": {}, "outputs": [], "source": [ @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "d10e8f30", + "id": "a57c881f", "metadata": {}, "source": [ "### See Also: Sunburst charts\n", @@ -502,7 +502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1dfc70c", + "id": "811fecd5", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "5bb52af3", + "id": "bb5a8ff6", "metadata": {}, "source": [ "#### Reference\n", @@ -530,7 +530,7 @@ }, { "cell_type": "markdown", - "id": "45cfaed4", + "id": "8a5461f6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plot-data-from-csv.ipynb b/plot-data-from-csv.ipynb index a571c4e72..b2d028383 100644 --- a/plot-data-from-csv.ipynb +++ b/plot-data-from-csv.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "49ccd615", + "id": "d93b7a6b", "metadata": {}, "source": [ "CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b11c3e0", + "id": "b40a1b39", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "b2efca1b", + "id": "7061bebd", "metadata": {}, "source": [ "### Plot from CSV with Plotly Express" @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5925592", + "id": "47da48c4", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "29233b79", + "id": "d33dd1b2", "metadata": {}, "source": [ "### Plot from CSV in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2167ec76", + "id": "23494d28", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "119f8acc", + "id": "7ba5d08b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "8bd436d3", + "id": "ef67e4fb", "metadata": {}, "source": [ "### Plot from CSV with `graph_objects`" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9aa42da3", + "id": "a97399b0", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "0dd88afb", + "id": "92830e02", "metadata": {}, "source": [ "#### Reference\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "b4bed7f4", + "id": "b8d2a999", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plotly-express.ipynb b/plotly-express.ipynb index f3a61f09c..d9563b6e9 100644 --- a/plotly-express.ipynb +++ b/plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5e2f710e", + "id": "ca12dbe5", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b36d4d5", + "id": "96aa5e1f", "metadata": { "hide_code": true }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "9da10d33", + "id": "56b167a3", "metadata": {}, "source": [ "Plotly Express currently includes the following functions:\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "877f9c6e", + "id": "4ee41cd3", "metadata": {}, "source": [ "### Plotly Express in Dash\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24b845f5", + "id": "9a38dcee", "metadata": { "hide_code": true }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "1e890316", + "id": "ad2bd838", "metadata": {}, "source": [ "### Gallery\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f21852af", + "id": "d6f40b45", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "6f84cd48", + "id": "477e3c41", "metadata": {}, "source": [ "**Read more about [trendlines](/python/linear-fits/) and [templates](/python/templates/) and [marginal distribution plots](https://plotly.com/python/marginal-plots/).**" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "917afc8b", + "id": "1e395289", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "fb79d6e5", + "id": "78ae79f8", "metadata": {}, "source": [ "**Read more about [error bars](/python/error-bars/).**" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ad123b2", + "id": "7a7af91f", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "3c8b7bd8", + "id": "c803927c", "metadata": {}, "source": [ "**Read more about [bar charts](/python/bar-charts/).**" @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b58105f5", + "id": "0da66a34", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c2f1487", + "id": "1786cb29", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "84971979", + "id": "df7f6c38", "metadata": {}, "source": [ "**Read more about [facet plots](/python/facet-plots/).**" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84aec322", + "id": "c467dc8b", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "471ab27f", + "id": "09a9048a", "metadata": {}, "source": [ "**Read more about [scatterplot matrices (SPLOMs)](/python/splom/).**\n" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a29b4f9e", + "id": "e86eafaf", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "e4b05fee", + "id": "fabf591a", "metadata": {}, "source": [ "**Read more about [parallel coordinates](/python/parallel-coordinates-plot/) and [parallel categories](/python/parallel-categories-diagram/), as well as [continuous color](/python/colorscales/).**" @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2c51a98", + "id": "52e85e71", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a759bca", + "id": "3b591aea", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "d142c860", + "id": "ca985bb9", "metadata": {}, "source": [ "**Read more about [hover labels](/python/hover-text-and-formatting/).**" @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "971c9331", + "id": "96daf76d", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "e852f2fc", + "id": "79d2dbfa", "metadata": {}, "source": [ "**Read more about [animations](/python/animations/).**" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dc4c10b", + "id": "f3db1cf0", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "13dca4b5", + "id": "1e57164a", "metadata": {}, "source": [ "**Read more about [line charts](/python/line-charts/).**" @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2a4dcb3", + "id": "521ddd0e", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "76184994", + "id": "18ed2ef5", "metadata": {}, "source": [ "**Read more about [area charts](/python/filled-area-plots/).**" @@ -362,7 +362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cc17304", + "id": "3f5ff1bb", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "cdb342bd", + "id": "7980dc75", "metadata": {}, "source": [ "**Read more about [timeline/Gantt charts](/python/gantt/).**" @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1e3b2aa", + "id": "d0fb0b6a", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "e6b1fe80", + "id": "d1e0320d", "metadata": {}, "source": [ "**Read more about [funnel charts](/python/funnel-charts/).**" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4be80c7", + "id": "cca95c85", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "76425f39", + "id": "ce787967", "metadata": {}, "source": [ "### Part to Whole Charts\n", @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc1572c8", + "id": "0f56dc2e", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "71177069", + "id": "e29d86a2", "metadata": {}, "source": [ "**Read more about [sunburst charts](/python/sunburst-charts/).**" @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adc66c94", + "id": "1f0527b2", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "011c1269", + "id": "88d95fc3", "metadata": {}, "source": [ "**Read more about [treemaps](/python/treemaps/).**" @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9dc3933", + "id": "c8930adc", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "9b417b19", + "id": "0e041714", "metadata": {}, "source": [ "**Read more about [icicle charts](/python/icicle-charts/).**" @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c35adb57", + "id": "ba0318fb", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "0116297d", + "id": "1c4bc4b9", "metadata": {}, "source": [ "#### Distributions\n", @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80d33511", + "id": "2cf63fe1", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "369d8a0e", + "id": "173cb78c", "metadata": {}, "source": [ "**Read more about [box plots](/python/box-plots/).**" @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46de9ced", + "id": "e6bcb447", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "069c663f", + "id": "b9ebdfe1", "metadata": {}, "source": [ "**Read more about [violin plots](/python/violin/).**" @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d5b686c", + "id": "e594b3c2", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "05434881", + "id": "96daceac", "metadata": {}, "source": [ "**Read more about [Empirical Cumulative Distribution Function (ECDF) charts](https://plotly.com/python/ecdf-plots/).**" @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b6e89d4", + "id": "bc0af6fb", "metadata": {}, "outputs": [], "source": [ @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "61ce38cb", + "id": "1f497b61", "metadata": {}, "source": [ "**Read more about [strip charts](https://plotly.com/python/strip-charts/).**" @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccd1cfbb", + "id": "fe5f042b", "metadata": {}, "outputs": [], "source": [ @@ -625,7 +625,7 @@ }, { "cell_type": "markdown", - "id": "f3d14a2d", + "id": "1cf683a0", "metadata": {}, "source": [ "**Read more about [density contours, also known as 2D histogram contours](/python/2d-histogram-contour/).**" @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72f55019", + "id": "276c63e7", "metadata": {}, "outputs": [], "source": [ @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "9c028f5d", + "id": "4334171d", "metadata": {}, "source": [ "**Read more about [density heatmaps, also known as 2D histograms](/python/2D-Histogram/).**" @@ -655,7 +655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "704f9b47", + "id": "5a7fa435", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "78ab0fe6", + "id": "4b76691c", "metadata": {}, "source": [ "### Images and Heatmaps\n", @@ -678,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f843c11d", + "id": "80fe84b0", "metadata": {}, "outputs": [], "source": [ @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "323832e1", + "id": "d3f459cf", "metadata": {}, "outputs": [], "source": [ @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "fff4c754", + "id": "8d9f6aaa", "metadata": {}, "source": [ "#### Tile Maps\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4de9ecae", + "id": "673b76ba", "metadata": {}, "outputs": [], "source": [ @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "dc56412b", + "id": "5d953171", "metadata": {}, "source": [ "**Read more about [tile map GeoJSON choropleths](/python/tile-county-choropleth/).**" @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d017c772", + "id": "d529fd92", "metadata": {}, "outputs": [], "source": [ @@ -761,7 +761,7 @@ }, { "cell_type": "markdown", - "id": "e1f89964", + "id": "ae849c17", "metadata": {}, "source": [ "### Outline Maps\n", @@ -772,7 +772,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2fcbd8c", + "id": "3c1a7c73", "metadata": { "lines_to_next_cell": 2 }, @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "03424b6c", + "id": "81c887e9", "metadata": {}, "source": [ "**Read more about [choropleth maps](/python/choropleth-maps/).**" @@ -796,7 +796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "225db29f", + "id": "a34a9226", "metadata": { "lines_to_next_cell": 2 }, @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "b8d27499", + "id": "520c043d", "metadata": {}, "source": [ "#### Polar Coordinates\n", @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b2be5fb", + "id": "65ec9f8a", "metadata": {}, "outputs": [], "source": [ @@ -834,7 +834,7 @@ }, { "cell_type": "markdown", - "id": "30787adf", + "id": "73ef1bb4", "metadata": {}, "source": [ "**Read more about [radar charts](https://plotly.com/python/radar-chart/).**" @@ -843,7 +843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b17748e8", + "id": "e879bf39", "metadata": {}, "outputs": [], "source": [ @@ -856,7 +856,7 @@ }, { "cell_type": "markdown", - "id": "1d002312", + "id": "685ae02e", "metadata": {}, "source": [ "**Read more about [polar bar charts](/python/wind-rose-charts/).**" @@ -865,7 +865,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41c2439a", + "id": "c8f368a7", "metadata": {}, "outputs": [], "source": [ @@ -878,7 +878,7 @@ }, { "cell_type": "markdown", - "id": "19402eac", + "id": "ec3a741c", "metadata": {}, "source": [ "#### 3D Coordinates\n", @@ -889,7 +889,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d1494af", + "id": "c310ee3f", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "23fd6eef", + "id": "9de4b537", "metadata": {}, "source": [ "#### Ternary Coordinates\n", @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d654f41", + "id": "aec0e87e", "metadata": { "lines_to_next_cell": 2 }, @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "ad8db519", + "id": "c0f11f03", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/polar-chart.ipynb b/polar-chart.ipynb index fd0e5c930..4aaced33a 100644 --- a/polar-chart.ipynb +++ b/polar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e8a6db2a", + "id": "d156dc04", "metadata": {}, "source": [ "## Polar chart with Plotly Express\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf7cd6bb", + "id": "fadd7641", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "04ea6664", + "id": "10eedbf3", "metadata": {}, "source": [ "The \"strength\" column corresponds to strength categories of the wind, and there is a frequency value for each direction and strength. Below we use the strength column to encode the color, symbol and size of the markers." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "289bb7fc", + "id": "e38a64b2", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "b2ea3185", + "id": "397d2f3e", "metadata": {}, "source": [ "For a line polar plot, use `px.line_polar`:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0729cd9", + "id": "39d22705", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "8d77fc84", + "id": "ad675899", "metadata": {}, "source": [ "See also the [wind rose page](https://plotly.com/python/wind-rose-charts/) for more wind rose visualizations in polar coordinates.\n", @@ -88,7 +88,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33258c28", + "id": "b3d72901", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "29903149", + "id": "6403dc3f", "metadata": {}, "source": [ "## Polar Scatter Plot with go.Scatterpolar\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4835395a", + "id": "39fe5d45", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "618d4e62", + "id": "3bc0c22f", "metadata": {}, "source": [ "#### Line Polar Chart" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b05bc16f", + "id": "d90e13f0", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "059c8efc", + "id": "49af91a4", "metadata": {}, "source": [ "#### Polar Bar Chart\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3106188", + "id": "d0d36296", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "728573b0", + "id": "198bf187", "metadata": {}, "source": [ "#### Categorical Polar Chart" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "092e718d", + "id": "955736f0", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "7f7fd2de", + "id": "4a71bffb", "metadata": {}, "source": [ "#### Polar Chart Sector" @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22f0ca4c", + "id": "79e0e3ef", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "6d2f74ff", + "id": "a71bfe4d", "metadata": {}, "source": [ "#### Polar Chart Directions" @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f2dfbea", + "id": "b27303f9", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "5c24eaf3", + "id": "23284bb8", "metadata": {}, "source": [ "#### Webgl Polar Chart\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8c1f6fb", + "id": "4c799a04", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "ee47836b", + "id": "d7372f49", "metadata": {}, "source": [ "#### Polar Chart Subplots" @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7f18c18", + "id": "bc57fd7c", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "d6f9dff1", + "id": "8aeac167", "metadata": {}, "source": [ "#### Reference\n", @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "424de551", + "id": "49ae7ecd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/px-arguments.ipynb b/px-arguments.ipynb index 04852bd56..89fdea091 100644 --- a/px-arguments.ipynb +++ b/px-arguments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6e10424e", + "id": "f3a78d32", "metadata": {}, "source": [ "Plotly Express (`px`) is the high-level interface to Plotly and provides functions for generating charts. `px` functions support data provided in a number of different formats (long, wide, and mixed) and as different types of objects, including pandas and Polars dataframes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c4a66e5", + "id": "39385c44", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "49a4f19a", + "id": "d058b982", "metadata": {}, "source": [ "By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a65d210", + "id": "b3be43b5", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "54eb15b1", + "id": "03b92067", "metadata": {}, "source": [ "## Long, Wide, and Mixed-Form Data\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "013a3f49", + "id": "13d699f0", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d7f7e2e", + "id": "4cfb24d3", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "be5628e5", + "id": "3bc09e93", "metadata": {}, "source": [ "Plotly Express can produce the same plot from either form:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14f1c19a", + "id": "3331fb29", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04425227", + "id": "ec083725", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "68134cad", + "id": "6aa0a38b", "metadata": {}, "source": [ "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, or [you can use a data frame with named row- and column-indexes](/python/wide-form/). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2f1bfad", + "id": "9bd556f3", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "f4ab5174", + "id": "e052826a", "metadata": {}, "source": [ "Many more examples of wide-form and messy data input can be found in our [detailed wide-form support documentation](/python/wide-form/)." @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "2225c499", + "id": "baf6e6b3", "metadata": {}, "source": [ "## Dataframe Input\n", @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e2197e8", + "id": "3d912416", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "cb6730ea", + "id": "99b74742", "metadata": {}, "source": [ "### Example: Polars DataFrame with `px.bar`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fc49474", + "id": "e9fdb6d3", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "6d66e37e", + "id": "51ad130f", "metadata": {}, "source": [ "### Using the Index of a Dataframe\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3474664c", + "id": "2e3a86e7", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "2a5f63b4", + "id": "69c26dc6", "metadata": {}, "source": [ "### Using Columns from Multiple Dataframes\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "359d2985", + "id": "b485be94", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "68027a2d", + "id": "824e849d", "metadata": {}, "source": [ "### Using labels to pass names\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2a6c4d4", + "id": "ef16c8d1", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72622693", + "id": "5d1aca9a", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "b7ba538f", + "id": "a9e35a54", "metadata": {}, "source": [ "### Input Data as array-like columns: NumPy arrays, lists...\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa189690", + "id": "8bfc6130", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "5784b67b", + "id": "d0635063", "metadata": {}, "source": [ "List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[].name = \"name\"`." @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff2c0d2e", + "id": "0d221c84", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "eb486a04", + "id": "48d8a33e", "metadata": {}, "source": [ "### Passing dictionaries or array-likes as the data_frame argument\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b4290c3", + "id": "cad5c148", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "72ac3d95", + "id": "20d74353", "metadata": {}, "source": [ "To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90c3c1b6", + "id": "908ac11e", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "22d85e3b", + "id": "9d590b91", "metadata": {}, "source": [ "### Mixing dataframes and other types\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59e56d14", + "id": "78d629c4", "metadata": { "lines_to_next_cell": 2 }, @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "52f345a9", + "id": "e34f2a81", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/quiver-plots.ipynb b/quiver-plots.ipynb index 9d6e82551..fb7fd8cfb 100644 --- a/quiver-plots.ipynb +++ b/quiver-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "72a07b85", + "id": "3674a219", "metadata": {}, "source": [ "Quiver plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb2f85bd", + "id": "7063a5cb", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "92143919", + "id": "c6bb1321", "metadata": {}, "source": [ "#### Quiver Plot with Points" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a170c1fd", + "id": "83590d4a", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "ed80a50e", + "id": "798ff940", "metadata": {}, "source": [ "#### See also\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "3bb6c33b", + "id": "0221d617", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/radar-chart.ipynb b/radar-chart.ipynb index 5e5a7ee03..c0c4483bc 100644 --- a/radar-chart.ipynb +++ b/radar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "532508c1", + "id": "0bd71bd3", "metadata": {}, "source": [ "A [Radar Chart](https://en.wikipedia.org/wiki/Radar_chart) (also known as a spider plot or star plot) displays multivariate data in the form of a two-dimensional chart of quantitative variables represented on axes originating from the center. The relative position and angle of the axes is typically uninformative. It is equivalent to a [parallel coordinates plot](/python/parallel-coordinates-plot/) with the axes arranged radially.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d85d326a", + "id": "fa47996f", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "007ff66b", + "id": "ddb774a6", "metadata": {}, "source": [ "For a filled line in a Radar Chart, update the figure created with `px.line_polar` with `fig.update_traces`." @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fcb0e84", + "id": "94dfbdbe", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "64e8a690", + "id": "944fa2b6", "metadata": {}, "source": [ "### Basic Radar Chart with go.Scatterpolar" @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2509372c", + "id": "a853f14b", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "5ea6e02a", + "id": "f648bd2a", "metadata": {}, "source": [ "#### Multiple Trace Radar Chart" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d6af1d7", + "id": "d3f915e8", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "d49f9abf", + "id": "bac28bc8", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "198c5ee4", + "id": "08d52d72", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/random-walk.ipynb b/random-walk.ipynb index bc744c504..f4eb6041f 100644 --- a/random-walk.ipynb +++ b/random-walk.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6b74b018", + "id": "556d31e5", "metadata": {}, "source": [ "A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\\mathbb{Z}$), two dimensions ($\\mathbb{Z}^2$) or three dimensions ($\\mathbb{Z}^3$) in Cartesian space, where $\\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plotly.com/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33ff57eb", + "id": "009cd551", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "2c4cc420", + "id": "a6953f52", "metadata": {}, "source": [ "#### Random Walk in 2D" @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cf0136d", + "id": "b6b4bf69", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "4899c92a", + "id": "24c1ccaa", "metadata": {}, "source": [ "#### Random walk and diffusion\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0545a48", + "id": "5128f3b6", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f307ff5", + "id": "1c37349e", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "16743e01", + "id": "42af76cb", "metadata": {}, "source": [ "#### Advanced Tip\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "61316655", + "id": "7a9c5e09", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/range-slider.ipynb b/range-slider.ipynb index 7407c7f1d..7ecdd2637 100644 --- a/range-slider.ipynb +++ b/range-slider.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "106cc18c", + "id": "75d1d04b", "metadata": {}, "source": [ "#### Basic Range Slider and Range Selectors" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8b197ac", + "id": "6612f76f", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "02d7d8ed", + "id": "24eae2b4", "metadata": {}, "source": [ "#### Range Slider with Vertically Stacked Subplots" @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11b9fcfe", + "id": "47198965", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "f92bd750", + "id": "adb9500d", "metadata": {}, "source": [ "#### Reference\n", @@ -362,7 +362,7 @@ }, { "cell_type": "markdown", - "id": "c4b0e046", + "id": "420fec2a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/renderers.ipynb b/renderers.ipynb index 3161f2b1a..0d254c217 100644 --- a/renderers.ipynb +++ b/renderers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9f188ac3", + "id": "c0f12918", "metadata": {}, "source": [ "# Displaying Figures\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f27117e", + "id": "b0db99ef", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "04a03385", + "id": "d6175592", "metadata": {}, "source": [ "In most situations, you can omit the call to `.show()` and allow the figure to display itself." @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67c84411", + "id": "f19a9e13", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "c7ba486e", + "id": "b80e7811", "metadata": {}, "source": [ "> To be precise, figures will display themselves using the current default renderer when the two following conditions are true. First, the last expression in a cell must evaluate to a figure. Second, `plotly.py` must be running from within an `IPython` kernel.\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "43b83b1e", + "id": "517655d1", "metadata": {}, "source": [ "#### Setting The Default Renderer\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7fcaeea", + "id": "08fc0ead", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "c6942e8d", + "id": "01ee23c6", "metadata": {}, "source": [ "The default renderer that you see when you display `pio.renderers` might be different than what is shown here. This is because `plotly.py` attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of an available renderer to the `pio.renderers.default` property. For example, to switch to the `'browser'` renderer, which opens figures in a tab of the default web browser, you would run the following." @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf8641d9", + "id": "915386ca", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "8b78bdd8", + "id": "240058be", "metadata": {}, "source": [ "> Note: Default renderers persist for the duration of a single session. For example, if you set a default renderer in an `IPython` kernel, that default won't persist across kernel restarts.\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b44ee0a", + "id": "20a1c7c9", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "c94dafe7", + "id": "80396819", "metadata": {}, "source": [ "#### Built-in Renderers\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "5c95d28d", + "id": "97571f36", "metadata": {}, "source": [ "###### `plotly_mimetype`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3448b31f", + "id": "7eb90b1c", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "daeabc81", + "id": "f63096ae", "metadata": {}, "source": [ "###### PDF\n", @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b73047ab", + "id": "ffc5d0c1", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "3a7bd7bc", + "id": "bc738272", "metadata": {}, "source": [ "From this output, you can see that the `png` renderer supports 3 properties: `width`, `height`, and `scale`. You can customize these properties by assigning new values to them.\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e150d7f", + "id": "f27b7150", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "42006333", + "id": "b972b209", "metadata": {}, "source": [ "You can also override the values of renderer parameters temporarily by passing them as keyword arguments to the `show()` method. For example" @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd9155ca", + "id": "23767b8f", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "772407da", + "id": "d0b6b76d", "metadata": {}, "source": [ "### Displaying figures in Plotly Studio\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13f3290a", + "id": "ce193b5e", "metadata": { "hide_code": true }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "626b17cb", + "id": "596a9c7a", "metadata": {}, "source": [ "### Displaying figures in Dash\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "793e3d48", + "id": "a4d8e29e", "metadata": { "hide_code": true }, @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "d86798cc", + "id": "d2abf8c2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "e257b158", + "id": "f5b6f16f", "metadata": {}, "source": [ "## Displaying Figures Using `ipywidgets`\n", @@ -388,7 +388,7 @@ }, { "cell_type": "markdown", - "id": "3a83dab8", + "id": "cb309d01", "metadata": {}, "source": [ "## Performance\n", @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "9414de34", + "id": "0aa7d8c2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sankey-diagram.ipynb b/sankey-diagram.ipynb index 7c663c947..20b13588c 100644 --- a/sankey-diagram.ipynb +++ b/sankey-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a67da89c", + "id": "d853fa6b", "metadata": {}, "source": [ "A [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram) is a flow diagram, in which the width of arrows is proportional to the flow quantity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "36f18db7", + "id": "e15250e8", "metadata": {}, "source": [ "### Basic Sankey Diagram\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41c61c85", + "id": "77a557f7", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "4efa1645", + "id": "705cdd79", "metadata": {}, "source": [ "### More complex Sankey diagram with colored links" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d642c08f", + "id": "8d261836", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "2b836519", + "id": "1e6f95d5", "metadata": {}, "source": [ "### Sankey Diagram in Dash\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7aa0ed6b", + "id": "3f5e5e8d", "metadata": { "hide_code": true }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "4b2e6c95", + "id": "29813667", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "163ee4d6", + "id": "046b6424", "metadata": {}, "source": [ "### Style Sankey Diagram\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d06f91f6", + "id": "30eb173b", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "86b74448", + "id": "e2639648", "metadata": {}, "source": [ "### Link Hover Color\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a9ed331", + "id": "076073b8", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "7216e848", + "id": "db63a175", "metadata": {}, "source": [ "### Hovertemplate and customdata of Sankey diagrams\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ba86853", + "id": "8f27bc85", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "5f39eef3", + "id": "781ebf05", "metadata": {}, "source": [ "### Define Node Position\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c4aacfd", + "id": "8f7f1112", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "1257623c", + "id": "93a67577", "metadata": {}, "source": [ "### Sankey Diagram with Arrow Links\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b54f809", + "id": "72abadcd", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "077afed8", + "id": "5fcbb1b1", "metadata": {}, "source": [ "### Node Alignment\n", @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49c2c29d", + "id": "70ace748", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd88cb08", + "id": "30e4204b", "metadata": {}, "outputs": [], "source": [ @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "9520f525", + "id": "a55a1553", "metadata": {}, "source": [ "### Reference\n", @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "2cda0276", + "id": "55b242d7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/scatter-plots-on-maps.ipynb b/scatter-plots-on-maps.ipynb index a85322d7c..5f027e568 100644 --- a/scatter-plots-on-maps.ipynb +++ b/scatter-plots-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e4f864e9", + "id": "cbd34a03", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7571d383", + "id": "14ff96a0", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "af126d71", + "id": "18dc787a", "metadata": {}, "source": [ "#### Customize geographical scatter plot" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a255496", + "id": "af4529b0", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "5d9fa94d", + "id": "5ac74941", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f50b119a", + "id": "bbbbb91b", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "24db7356", + "id": "1d091b8f", "metadata": {}, "source": [ "### U.S. Airports Map\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ebb8add1", + "id": "1d0fdb3f", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "28f6c118", + "id": "3a9066d2", "metadata": {}, "source": [ "#### Styled U.S. Airports Map" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a52d6491", + "id": "34fd0531", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "b4b7cb9d", + "id": "958f891a", "metadata": {}, "source": [ "### North American Precipitation Map" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6dd4595", + "id": "2021abae", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "2ec1d8ec", + "id": "7e4d324b", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "50f27ea7", + "id": "12be24a2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/selections.ipynb b/selections.ipynb index b6dfdda43..31d2fc28b 100644 --- a/selections.ipynb +++ b/selections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f7d9fd19", + "id": "d3e87189", "metadata": {}, "source": [ "## Adding Selections to Cartesian Subplots\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "fb548903", + "id": "1ac74a9f", "metadata": {}, "source": [ "You can also add selections to a figure that displays when it renders using `fig.add_selection`.\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68a16f56", + "id": "4955cc9b", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "cabb2371", + "id": "99662fbc", "metadata": {}, "source": [ "## Selections Using a Custom SVG" @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "53d491b5", + "id": "2a4d241e", "metadata": {}, "source": [ "In the above example, we added a rectangular selection. You can also render a custom SVG for a selection by defining a `path` that can include single or multiple polygons. Here, we create a selection with a single polygon path \"M2,6.5L4,7.5L4,6Z\".\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b17ae7f8", + "id": "ce46f87a", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "073aa9ab", + "id": "3556be16", "metadata": {}, "source": [ "## Styling Selections" @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "42fca47e", + "id": "9bff1023", "metadata": {}, "source": [ "In the above example, we added a selection to the figure that is displayed when the figure renders.\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "303780c3", + "id": "7317f1e4", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "82592122", + "id": "20b5ef77", "metadata": {}, "source": [ "## Styling New Selections\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ff1c7d1", + "id": "6dfec7ff", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "442fbdc2", + "id": "6ae4194b", "metadata": {}, "source": [ "## Fill Color for Active Selections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d05b4e65", + "id": "e6f0461e", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "8e02eb78", + "id": "fda87cac", "metadata": {}, "source": [ "## Selections with Time Series\n", @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7de45922", + "id": "81daf57c", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "534f7562", + "id": "b244f009", "metadata": {}, "source": [ "## Referencing Selections on Multiple Cartesian Subplots" @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "287d7053", + "id": "a591d356", "metadata": {}, "source": [ "You can add selections to multiple Cartesian subplots by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x` and `y2` and two selections to the the plot with axis ids `x` and `y`." @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0c37631", + "id": "8f5e5861", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "c0472502", + "id": "fc2ffc4f", "metadata": {}, "source": [ "## Referencing Selections on a Scatterplot Matrix" @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "4e4f53cf", + "id": "1f14caf2", "metadata": {}, "source": [ "You can add selections to a scatterplot matrix by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x2` and `y2` and another on the plot with ids `x3` and `y`." @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64eef088", + "id": "df550d80", "metadata": { "lines_to_next_cell": 0 }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "f8321807", + "id": "e54e6a68", "metadata": {}, "source": [ "\n" @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "702370c5", + "id": "2cd79d14", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/setting-graph-size.ipynb b/setting-graph-size.ipynb index 5a7237653..bedbf7f18 100644 --- a/setting-graph-size.ipynb +++ b/setting-graph-size.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0d0fffd1", + "id": "52d70106", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2d7db7f", + "id": "ce9fd645", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "8a08b942", + "id": "381aa320", "metadata": {}, "source": [ "### Adjusting graph size with Dash\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f3f698d", + "id": "244d245e", "metadata": { "hide_code": true }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "309c2368", + "id": "cbe0d30c", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "455e637d", + "id": "bc612333", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins With Graph Objects\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "141eeab6", + "id": "59bb469e", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "2151447d", + "id": "23c89daf", "metadata": {}, "source": [ "### Automatically Adjust Margins\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b4a269b", + "id": "b32d634f", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "41be56e4", + "id": "46540750", "metadata": {}, "source": [ "### Automatically Adjust Specific Margins\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "baa04e63", + "id": "576017e7", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "ef928d9c", + "id": "247232bd", "metadata": {}, "source": [ "### Setting a Minimum Plot Size with Automargins\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022e337b", + "id": "eab50e2d", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "d6461e59", + "id": "27acf944", "metadata": {}, "source": [ "#### Reference\n", @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "326ce633", + "id": "8634cf11", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/shapes.ipynb b/shapes.ipynb index 562fc9adc..5949b4756 100644 --- a/shapes.ipynb +++ b/shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b5c91828", + "id": "1f668317", "metadata": {}, "source": [ "### Adding Lines and Polygons to Figures\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "27770233", + "id": "94d84647", "metadata": {}, "source": [ "### Shape-drawing with Scatter traces\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12749804", + "id": "455fe0e9", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "b7981295", + "id": "5bdf8180", "metadata": {}, "source": [ "You can have more shapes either by adding [more traces](https://plotly.com/python/filled-area-plots/) or interrupting the series with `None`." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "995b67bc", + "id": "b5e7802b", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "4f8b7e7a", + "id": "22dab3c4", "metadata": {}, "source": [ "#### Shapes in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbcfbba3", + "id": "bde674e5", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "112c2f3d", + "id": "b796d2a6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "041908d3", + "id": "ead91626", "metadata": {}, "source": [ "#### Vertical and Horizontal Lines Positioned Relative to the Axis Data" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28ffdc03", + "id": "a857a111", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "2a8c759d", + "id": "9a5c6eac", "metadata": {}, "source": [ "#### Lines Positioned Relative to the Plot & to the Axis Data" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a9a4e84", + "id": "9b5eb91e", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "8ff52379", + "id": "6915eb8b", "metadata": {}, "source": [ "#### Rectangles Positioned Relative to the Axis Data" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f9fb315", + "id": "81bdd587", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "fb5fa433", + "id": "92a6e366", "metadata": {}, "source": [ "#### Rectangle Positioned Relative to the Plot & to the Axis Data" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22747737", + "id": "61c5ba6d", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "21459aca", + "id": "7656eb40", "metadata": {}, "source": [ "#### A Rectangle Placed Relative to the Axis Position and Length\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e648d00", + "id": "e2782797", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "a07a0553", + "id": "91e8bcf6", "metadata": {}, "source": [ "#### Highlighting Time Series Regions with Rectangle Shapes\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb676683", + "id": "85d504d5", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "3eaab988", + "id": "7fbe4753", "metadata": {}, "source": [ "#### Circles Positioned Relative to the Axis Data" @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09e42a4b", + "id": "565fc9c7", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ }, { "cell_type": "markdown", - "id": "0f91e5cf", + "id": "c3620e12", "metadata": {}, "source": [ "#### Highlighting Clusters of Scatter Points with Circle Shapes" @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b8cfa12", + "id": "dc4b81e7", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "894530bb", + "id": "b78c0e76", "metadata": {}, "source": [ "#### Venn Diagram with Circle Shapes" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33eb6bbb", + "id": "9487de45", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "67d36531", + "id": "01aac33a", "metadata": {}, "source": [ "#### Adding Shapes to Subplots\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0921eeb", + "id": "44e48bed", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "710d9a43", + "id": "6a024140", "metadata": {}, "source": [ "#### Subplot-Spanning Shapes\n", @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba4ef933", + "id": "cd2c8d9d", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "28b8b46f", + "id": "8006a149", "metadata": {}, "source": [ "For `path` shapes, the array must have one entry for each coordinate in the path string. Each coordinate in the path maps to the corresponding element in the `xref`/`yref` array, in order." @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f34466b", + "id": "7a2069e5", "metadata": {}, "outputs": [], "source": [ @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "f99e059e", + "id": "40899fbf", "metadata": {}, "source": [ "**Note:** When using arrays with `xref` and `yref`, `xsizemode=\"pixel\"` and `ysizemode=\"pixel\"` are not supported." @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "cd040e15", + "id": "66751f0b", "metadata": { "lines_to_next_cell": 0 }, @@ -723,7 +723,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb10d839", + "id": "291bf2b0", "metadata": { "lines_to_next_cell": 2 }, @@ -753,7 +753,7 @@ }, { "cell_type": "markdown", - "id": "968777d9", + "id": "b9fe3473", "metadata": {}, "source": [ "#### SVG Paths" @@ -762,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2765df46", + "id": "2fe85ab0", "metadata": {}, "outputs": [], "source": [ @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "11831718", + "id": "a23ce724", "metadata": {}, "source": [ "#### Shifting Shapes on Categorical Axes\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "934652d5", + "id": "beddcd94", "metadata": {}, "outputs": [], "source": [ @@ -916,7 +916,7 @@ }, { "cell_type": "markdown", - "id": "4774dc45", + "id": "46aec64a", "metadata": {}, "source": [ "### Drawing shapes with a Mouse on Cartesian plots\n", @@ -940,7 +940,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93d7ddc2", + "id": "65b6ba69", "metadata": {}, "outputs": [], "source": [ @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "81230ce9", + "id": "971623e3", "metadata": {}, "source": [ "### Style of user-drawn shapes\n", @@ -986,7 +986,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d880a870", + "id": "09a42622", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ }, { "cell_type": "markdown", - "id": "6b1901a5", + "id": "3438a18c", "metadata": {}, "source": [ "### Adding Text Labels to Shapes\n", @@ -1039,7 +1039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f3e3a90", + "id": "23653804", "metadata": {}, "outputs": [], "source": [ @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "29eedb40", + "id": "58cbaf34", "metadata": {}, "source": [ "#### Styling Text Labels\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d69ac07d", + "id": "496b2a9e", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "ac5d8050", + "id": "fff5544a", "metadata": {}, "source": [ "#### Setting Label Position\n", @@ -1137,7 +1137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b8f7cff", + "id": "60992a3f", "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1194,7 @@ }, { "cell_type": "markdown", - "id": "5f772168", + "id": "0eb0157a", "metadata": {}, "source": [ "#### Setting Label Angle\n", @@ -1205,7 +1205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38d9ac4c", + "id": "bbf790c8", "metadata": {}, "outputs": [], "source": [ @@ -1238,7 +1238,7 @@ }, { "cell_type": "markdown", - "id": "9666f06b", + "id": "f6d00e0f", "metadata": {}, "source": [ "#### Setting Label Padding\n", @@ -1249,7 +1249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db869563", + "id": "1683f8ed", "metadata": {}, "outputs": [], "source": [ @@ -1284,7 +1284,7 @@ }, { "cell_type": "markdown", - "id": "b0a3fa7b", + "id": "eedbd184", "metadata": {}, "source": [ "#### Setting Label Anchors\n", @@ -1298,7 +1298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be839265", + "id": "e614fee1", "metadata": {}, "outputs": [], "source": [ @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "9d5e45e0", + "id": "29233459", "metadata": {}, "source": [ "#### Variables in Shape Label Text\n", @@ -1366,7 +1366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de6e58fa", + "id": "1e401897", "metadata": {}, "outputs": [], "source": [ @@ -1426,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "1fbf7005", + "id": "9ff506ef", "metadata": {}, "source": [ "#### Variables in Shape Label Text for New Shapes\n", @@ -1441,7 +1441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "986751ad", + "id": "fc59a45d", "metadata": {}, "outputs": [], "source": [ @@ -1479,7 +1479,7 @@ }, { "cell_type": "markdown", - "id": "08b86728", + "id": "9a7bc923", "metadata": {}, "source": [ "#### Shapes in the Legend\n", @@ -1492,7 +1492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d73c33f", + "id": "30e572bd", "metadata": {}, "outputs": [], "source": [ @@ -1536,7 +1536,7 @@ }, { "cell_type": "markdown", - "id": "8b4ac855", + "id": "14fe6c46", "metadata": {}, "source": [ "`newshape` also supports `showlegend`. In this example, each new line drawn on the graph appears in the legend." @@ -1545,7 +1545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49280784", + "id": "981b3d4d", "metadata": {}, "outputs": [], "source": [ @@ -1584,7 +1584,7 @@ }, { "cell_type": "markdown", - "id": "799ccb1a", + "id": "092ab642", "metadata": {}, "source": [ "#### Shape Layer\n", @@ -1595,7 +1595,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08f08152", + "id": "7aa4a5a9", "metadata": {}, "outputs": [], "source": [ @@ -1649,7 +1649,7 @@ }, { "cell_type": "markdown", - "id": "552eda77", + "id": "e4b566af", "metadata": {}, "source": [ "### Reference\n", @@ -1658,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "0625b11c", + "id": "54282e3c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sliders.ipynb b/sliders.ipynb index c372ecd99..39726c6c2 100644 --- a/sliders.ipynb +++ b/sliders.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cfdf5461", + "id": "f27e4e74", "metadata": {}, "source": [ "### Simple Slider Control\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2066dbe7", + "id": "3fa563eb", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "2a6baab4", + "id": "3b5d5f13", "metadata": {}, "source": [ "#### Methods\n", @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "c8cce2cd", + "id": "b1081dff", "metadata": {}, "source": [ "### Sliders in Plotly Express\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d37cce4", + "id": "bf95be36", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "5485aa0d", + "id": "12ea6bef", "metadata": {}, "source": [ "#### Reference\n", @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "ead780fe", + "id": "aefc1546", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smith-charts.ipynb b/smith-charts.ipynb index 5165b48f1..5147b4f42 100644 --- a/smith-charts.ipynb +++ b/smith-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "11b0bf7c", + "id": "2c13ed74", "metadata": {}, "source": [ "*New in v5.4*\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "c0b43384", + "id": "cba5fd75", "metadata": {}, "source": [ "### Smith Charts with Plotly Graph Objects" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "501c1e97", + "id": "c3b663a2", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "5b2e76a2", + "id": "97bb9d92", "metadata": {}, "source": [ "### Smith Chart Subplots and Styling" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ad7dd01", + "id": "72968841", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "e3668edf", + "id": "1e589a2e", "metadata": {}, "source": [ "#### Reference\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b841645e", + "id": "e820c180", "metadata": { "lines_to_next_cell": 2 }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "67661f03", + "id": "054bc3e0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smoothing.ipynb b/smoothing.ipynb index 07843cefb..7b3ba2457 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9925cb2f", + "id": "45b14a14", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa82480d", + "id": "afc692eb", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "bc5b98ff", + "id": "babd77d5", "metadata": {}, "source": [ "#### Savitzky-Golay Filter\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f829ab7a", + "id": "5146d1bc", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "48e523f4", + "id": "28d2afe5", "metadata": {}, "source": [ "#### Triangular Moving Average\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85ac1d6e", + "id": "1e6cc55e", "metadata": { "lines_to_next_cell": 2 }, @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "a648ff6b", + "id": "5c080e0d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/splom.ipynb b/splom.ipynb index 1f1b976c1..88f996f1f 100644 --- a/splom.ipynb +++ b/splom.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7c5d208e", + "id": "3b3099f0", "metadata": {}, "source": [ "### Scatter matrix with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f35e305", + "id": "38f902c3", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "897b8c36", + "id": "bd28915b", "metadata": {}, "source": [ "Specify the columns to be represented with the `dimensions` argument, and set colors using a column of the dataframe:" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c14ef8fe", + "id": "2b95d622", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "2a9a721c", + "id": "0aab3ce1", "metadata": {}, "source": [ "#### Styled Scatter Matrix with Plotly Express\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be876f77", + "id": "ce361b8f", "metadata": { "lines_to_next_cell": 2 }, @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "40680390", + "id": "c0feaab2", "metadata": {}, "source": [ "### Scatter matrix (splom) with go.Splom\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "7ff437de", + "id": "dbe331e7", "metadata": {}, "source": [ "#### Splom of the Iris data set" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c4b3032", + "id": "db5746a3", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "d52fd70a", + "id": "8ebab27a", "metadata": {}, "source": [ "The scatter plots on the principal diagonal can be removed by setting `diagonal_visible=False`:" @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38ab48e2", + "id": "6eaa106f", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "65401177", + "id": "c5019db4", "metadata": {}, "source": [ "To plot only the lower/upper half of the splom we switch the default `showlowerhalf=True`/`showupperhalf=True` to `False`:" @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36a4300d", + "id": "fa4fcd8f", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "55541ae3", + "id": "bdeccc95", "metadata": {}, "source": [ "Each dict in the list dimensions has a key, visible, set by default on True. We can choose to remove a variable from splom, by setting `visible=False` in its corresponding dimension. In this case the default grid associated to the scatterplot matrix keeps its number of cells, but the cells in the row and column corresponding to the visible false dimension are empty:" @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb44202f", + "id": "c384ffb2", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "83a84fdb", + "id": "c3605243", "metadata": {}, "source": [ "#### Splom for the diabetes dataset\n", @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f8b1b20", + "id": "472d5669", "metadata": { "lines_to_next_cell": 0 }, @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "2407e33d", + "id": "57d4a500", "metadata": {}, "source": [ "#### Hover Effects\n", @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b9a0256", + "id": "81b4bd6e", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "bb61b0fa", + "id": "caefccbd", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "776a3eb6", + "id": "7ecc6f1c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-export.ipynb b/static-image-export.ipynb index fa8a4e1ce..9dd1d3112 100644 --- a/static-image-export.ipynb +++ b/static-image-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2f9ffed5", + "id": "122b082e", "metadata": {}, "source": [ "This page demonstrates how to export interactive Plotly figures to static image formats like PNG, JPEG, SVG, and PDF. If you want to export Plotly figures to HTML to retain interactivity, see the [Interactive HTML Export page](/python/interactive-html-export/)" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "7721b29d", + "id": "f176a25a", "metadata": {}, "source": [ "## Install Dependencies\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "30d92012", + "id": "9b07a42c", "metadata": {}, "source": [ "## Write Image to a File\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "019d0f9e", + "id": "878516e0", "metadata": {}, "source": [ "### Raster Formats\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "6c6ca73f", + "id": "6c4885bc", "metadata": {}, "source": [ "**Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image." @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "4eb4431a", + "id": "437290ec", "metadata": {}, "source": [ "### Specify a Format\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "c2ada5a7", + "id": "42507902", "metadata": {}, "source": [ "### Write Multiple Images\n", @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "0eee56e5", + "id": "29067c99", "metadata": {}, "source": [ "## Get Image as Bytes\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "341bc384", + "id": "5456eec7", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "0c30ff2d", + "id": "bb1e147a", "metadata": {}, "source": [ "Here's the bytes object displayed using `IPython.display.Image`:" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0113c66", + "id": "33850206", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "625eefcb", + "id": "0d17ae18", "metadata": {}, "source": [ "## Specify Image Dimensions and Scale\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80b23680", + "id": "d2636f28", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "86b8857e", + "id": "b9bc4bf4", "metadata": {}, "source": [ "## Specify Image Export Engine\n", @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "c13d5dd7", + "id": "4463a17e", "metadata": {}, "source": [ "## plotly.io Functions\n", @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "2adf63c6", + "id": "d4541562", "metadata": {}, "source": [ "## Image Export Settings (Kaleido)\n", @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "da6826e0", + "id": "22ac3fb0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-generation-migration.ipynb b/static-image-generation-migration.ipynb index d1796b6f7..eca95f7c5 100644 --- a/static-image-generation-migration.ipynb +++ b/static-image-generation-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fe32f6ce", + "id": "cf6e9180", "metadata": { "lines_to_next_cell": 2 }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "7fbacd1d", + "id": "6e4d42b5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamline-plots.ipynb b/streamline-plots.ipynb index 591c50a3b..9d583ac9d 100644 --- a/streamline-plots.ipynb +++ b/streamline-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cdd9b519", + "id": "ae3b5ce7", "metadata": {}, "source": [ "A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to the velocity field. In the case of a stationary velocity field, streamlines coincide with trajectories (see also the [Wikipedia page on streamlines, streaklines and pathlines](https://en.wikipedia.org/wiki/Streamlines,_streaklines,_and_pathlines)).\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e846a12c", + "id": "5dbb8f0c", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "24a8da54", + "id": "e2ed9821", "metadata": {}, "source": [ "#### Streamline and Source Point Plot" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dcbe0a8", + "id": "4fa157f3", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "36075040", + "id": "27a6ae6f", "metadata": {}, "source": [ "#### See also\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "83087009", + "id": "14272821", "metadata": {}, "source": [ "#### Reference\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "403af25f", + "id": "0390e802", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamtube-plot.ipynb b/streamtube-plot.ipynb index 59a0fa155..208b0151e 100644 --- a/streamtube-plot.ipynb +++ b/streamtube-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "168897a5", + "id": "a01e5f62", "metadata": {}, "source": [ "### Introduction" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "43e63719", + "id": "f64f201b", "metadata": {}, "source": [ "In streamtube plots, attributes include `x`, `y`, and `z`, which set the coordinates of the vector field, and `u`, `v`, and `w`, which set the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "dc42c7f7", + "id": "fc2fde90", "metadata": {}, "source": [ "### Basic Streamtube Plot" @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea42f268", + "id": "3df2e802", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "9da77d98", + "id": "4a5323e7", "metadata": {}, "source": [ "### Starting Position and Segments\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75db3c12", + "id": "fcbbcabb", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "ad8576a3", + "id": "72979a30", "metadata": {}, "source": [ "### Tube color and diameter\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07ca01ab", + "id": "993a825c", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "1d3f8d03", + "id": "2efb5c9b", "metadata": {}, "source": [ "#### Reference\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "3c95da64", + "id": "57585b2d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/strip-charts.ipynb b/strip-charts.ipynb index 4f406009b..56bdf554d 100644 --- a/strip-charts.ipynb +++ b/strip-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "35eef26d", + "id": "8ba7e5dc", "metadata": {}, "source": [ "### Strip Charts with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b455bc12", + "id": "c0766fea", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "30af3f2f", + "id": "6e9bece7", "metadata": {}, "source": [ "Strip charts support [faceting](/python/facet-plots/) and [discrete color](/python/discrete-color/):" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b65ffbb", + "id": "17ae8847", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "6943c707", + "id": "17249cd5", "metadata": {}, "source": [ "#### Reference\n", @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "3e074111", + "id": "69053d14", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/styling-plotly-express.ipynb b/styling-plotly-express.ipynb index 727dc96e7..ea6ae5c47 100644 --- a/styling-plotly-express.ipynb +++ b/styling-plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fae91fc3", + "id": "10167b5f", "metadata": {}, "source": [ "### Styling Figures made with Plotly Express\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc59df31", + "id": "f4a2963a", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "1217f497", + "id": "095afa88", "metadata": {}, "source": [ "Here is the same figure, restyled by adding some extra parameters to the initial Plotly Express call:" @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f450de4f", + "id": "12ca141e", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "dbf1123f", + "id": "1e877093", "metadata": {}, "source": [ "### Updating or Modifying Figures made with Plotly Express\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afeb024b", + "id": "130093c1", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "5598cb7a", + "id": "d9f59296", "metadata": {}, "source": [ "### How Plotly Express Works with Templates\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d44c7ee0", + "id": "da33d48d", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "d517a0c1", + "id": "8186eafa", "metadata": {}, "source": [ "### Setting Plotly Express Styling Defaults\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c45c30ce", + "id": "29d8820b", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "9b507d52", + "id": "05ab416e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/subplots.ipynb b/subplots.ipynb index 6ca7332b0..fc3f4b5ff 100644 --- a/subplots.ipynb +++ b/subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c06feb9e", + "id": "9ae9fced", "metadata": {}, "source": [ "### Subplots and Plotly Express\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "1eb4e86f", + "id": "f4d9bc7a", "metadata": {}, "source": [ "#### Simple Subplot\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b8bfe68", + "id": "def8ad5c", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "f6fc74d5", + "id": "fa6c299e", "metadata": {}, "source": [ "#### Stacked Subplots\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aced01f4", + "id": "9e9cc691", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "fd45a9a4", + "id": "e286f3fd", "metadata": {}, "source": [ "#### Multiple Subplots\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20559780", + "id": "c75b1064", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "7f6e151b", + "id": "d77d2159", "metadata": {}, "source": [ "#### Multiple Subplots with Titles\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b261268b", + "id": "644c20c8", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "eda6cee3", + "id": "9f009b5e", "metadata": {}, "source": [ "#### Subplots with Annotations" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76c213cb", + "id": "0774e5cb", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "c5929851", + "id": "c190ecb6", "metadata": {}, "source": [ "#### Customize Subplot Column Widths and Row Heights\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25946255", + "id": "8b360e1b", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "aa6f1259", + "id": "36e9cd41", "metadata": {}, "source": [ "#### Subplots in Dash\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f2a7e1e", + "id": "05dcb443", "metadata": { "hide_code": true }, @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "48c5bbdd", + "id": "63332f64", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "08f929ac", + "id": "c3ab0a61", "metadata": {}, "source": [ "#### Customizing Subplot Axes\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a71ac6cd", + "id": "43632ce9", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "e2a11de8", + "id": "8ccf025a", "metadata": {}, "source": [ "#### Subplots with Shared X-Axes\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37fdfaaf", + "id": "5bcccfac", "metadata": {}, "outputs": [], "source": [ @@ -379,7 +379,7 @@ }, { "cell_type": "markdown", - "id": "1a461bc4", + "id": "f11bd6d1", "metadata": {}, "source": [ "#### Subplots with Shared Y-Axes\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8d60d6d", + "id": "0ce4bb7c", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "25469768", + "id": "10d3ae06", "metadata": {}, "source": [ "### Subplots with Shared Colorscale\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d11a250e", + "id": "2d9cdd13", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "981d5cd6", + "id": "d6aa283b", "metadata": {}, "source": [ "#### Custom Sized Subplot with Subplot Titles\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8936484", + "id": "6da0d1e9", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "ece0cea5", + "id": "0b880597", "metadata": {}, "source": [ "#### Multiple Custom Sized Subplots\n", @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "180eb86a", + "id": "c809129c", "metadata": {}, "outputs": [], "source": [ @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "baafbcc3", + "id": "346b936a", "metadata": {}, "source": [ "#### Subplots Types\n", @@ -555,7 +555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca54c965", + "id": "fd4706ca", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "58ace28f", + "id": "2450b328", "metadata": {}, "source": [ "As an alternative to providing the name of a subplot type (e.g. `\"xy\"`, `\"polar\"`, `\"domain\"`, `\"scene\"`, etc), the `type` option may also be set to a string containing the name of a trace type (e.g. `\"bar\"`, `\"barpolar\"`, `\"pie\"`, `\"scatter3d\"`, etc.), which will be used to determine the subplot type that is compatible with that trace.\n", @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a5a58c7", + "id": "8688b6fc", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +632,7 @@ }, { "cell_type": "markdown", - "id": "d0c2c2ce", + "id": "8b815e11", "metadata": {}, "source": [ "#### Side by Side Subplot (low-level API)" @@ -641,7 +641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e685ac4e", + "id": "52aba398", "metadata": {}, "outputs": [], "source": [ @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "1fbec5fb", + "id": "2f8f1554", "metadata": {}, "source": [ "#### Subplots with shared axes (low-level API)" @@ -684,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d0f0d73", + "id": "55b6b632", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "5143a6d3", + "id": "9b0009fd", "metadata": {}, "source": [ "#### Stacked Subplots with a Shared X-Axis (low-level API)" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95bae05b", + "id": "d875848e", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "068ab530", + "id": "bf5d47d7", "metadata": {}, "source": [ "#### Setting Subplots on a Figure Directly\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e794965", + "id": "d0dc767c", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "7192cf6b", + "id": "8274355e", "metadata": {}, "source": [ "is equivalent to:" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "448dd301", + "id": "88cb4110", "metadata": {}, "outputs": [], "source": [ @@ -835,7 +835,7 @@ }, { "cell_type": "markdown", - "id": "3a242a69", + "id": "cb96c62c", "metadata": {}, "source": [ "#### Reference\n", @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62bb45f2", + "id": "0a58658d", "metadata": { "lines_to_next_cell": 2 }, @@ -858,7 +858,7 @@ }, { "cell_type": "markdown", - "id": "0e3a47a7", + "id": "6730c82b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sunburst-charts.ipynb b/sunburst-charts.ipynb index a2bec19bf..0e986de1e 100644 --- a/sunburst-charts.ipynb +++ b/sunburst-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "beb32754", + "id": "4f713130", "metadata": {}, "source": [ "Sunburst plots visualize hierarchical data spanning outwards radially from root to leaves. Similar to [Icicle charts](https://plotly.com/python/icicle-charts/) and [Treemaps](https://plotly.com/python/treemaps/), the hierarchy is defined by `labels` (`names` for `px.icicle`) and `parents` attributes. The root starts from the center and children are added to the outer rings.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d9c3248", + "id": "3f778718", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "5b9a86c1", + "id": "a3c1a623", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with plotly.express\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4500a642", + "id": "78b896a3", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "7019c5a4", + "id": "0d08bef1", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with continuous color argument in px.sunburst\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40b97158", + "id": "a220aad6", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "0c6a334c", + "id": "a347c6d4", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with discrete color argument in px.sunburst\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "870b48ef", + "id": "64bfa902", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "613a1bd0", + "id": "c788d8b1", "metadata": {}, "source": [ "In the example below the color of `Saturday` and `Sunday` sectors is the same as `Dinner` because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6181517f", + "id": "cbbd5e6e", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "c85deb92", + "id": "99a477bb", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "661945b4", + "id": "354cbb51", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "1479d480", + "id": "ccf6ea78", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53f94d4e", + "id": "df0b1a7c", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "bb81d6c1", + "id": "801e2fef", "metadata": {}, "source": [ "### Basic Sunburst Plot with go.Sunburst\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffc25e08", + "id": "63dd275d", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "ac7d7a70", + "id": "856317c5", "metadata": {}, "source": [ "### Sunburst with Repeated Labels" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97922a91", + "id": "385b06e0", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "674530d3", + "id": "1a43c035", "metadata": {}, "source": [ "### Branchvalues\n", @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e15ebfc8", + "id": "8add3101", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "4a2c3633", + "id": "b84403bf", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6458297", + "id": "a72d2b35", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "85cf0c56", + "id": "c49ba905", "metadata": {}, "source": [ "#### Controlling text orientation inside sunburst sectors\n", @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0b1b331", + "id": "7ba94e5e", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "33ea9473", + "id": "02ba4ff9", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4569a8c0", + "id": "c8407b10", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "076454be", + "id": "85797a11", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01773fac", + "id": "2c46bfbb", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "73e4fd33", + "id": "92c50a02", "metadata": {}, "source": [ "### Sunburst chart with a continuous colorscale\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e259a0e", + "id": "aa72dd8b", "metadata": {}, "outputs": [], "source": [ @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "4db362ad", + "id": "25da0c67", "metadata": {}, "source": [ "#### Reference\n", @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "0007e876", + "id": "a72894d2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/supported-colors.ipynb b/supported-colors.ipynb index be3229718..41a14d8e6 100644 --- a/supported-colors.ipynb +++ b/supported-colors.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "20d1bdb5", + "id": "e05a504e", "metadata": {}, "source": [ "# Supported CSS Colors\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71d8a20c", + "id": "91fb436e", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "892e9e6c", + "id": "7bfc396b", "metadata": {}, "source": [ "These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color)." @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dd12218", + "id": "225476ac", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "7bbd9442", + "id": "54d9e5cd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table-subplots.ipynb b/table-subplots.ipynb index 4af206e1d..48f7eefbb 100644 --- a/table-subplots.ipynb +++ b/table-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4f03b150", + "id": "e368ba5c", "metadata": {}, "source": [ "#### Import CSV Data" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0777c05", + "id": "28dd0ac3", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "5ffe060e", + "id": "dbbef732", "metadata": {}, "source": [ "#### Reference\n", @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "a745ffe9", + "id": "959b51e9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table.ipynb b/table.ipynb index d04308a75..65eeead72 100644 --- a/table.ipynb +++ b/table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "765ccdce", + "id": "ac37ad41", "metadata": {}, "source": [ "`go.Table` provides a Table object for detailed data viewing. The data are arranged in\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f72ee958", + "id": "2f8bec91", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "9dade93a", + "id": "2f5f47da", "metadata": {}, "source": [ "#### Styled Table" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61fa60e1", + "id": "ed6e6a6d", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "b37f674c", + "id": "90bcecba", "metadata": {}, "source": [ "#### Use a Pandas Dataframe" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8d873ad", + "id": "4c51b872", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "632b15da", + "id": "6affa15a", "metadata": {}, "source": [ "#### Tables in Dash\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a32c9ab5", + "id": "749da5d7", "metadata": { "hide_code": true }, @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "19fa3619", + "id": "4a0e6d0f", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "a046904e", + "id": "9d39196f", "metadata": {}, "source": [ "#### Changing Row and Column Size" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0a0b836", + "id": "eec91688", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "02cac38a", + "id": "fb3e7843", "metadata": {}, "source": [ "#### Alternating Row Colors" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc5d8f3c", + "id": "c174ddb7", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "e10d2c1b", + "id": "83042364", "metadata": {}, "source": [ "#### Row Color Based on Variable" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d1ca6d1", + "id": "adfe136d", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "1f9d1da3", + "id": "c45f56f2", "metadata": {}, "source": [ "#### Cell Color Based on Variable" @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19da9e97", + "id": "c2743217", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "8e94ea54", + "id": "63d24d94", "metadata": {}, "source": [ "#### Reference\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "ec017347", + "id": "ce6cd473", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/templates.ipynb b/templates.ipynb index f8befc982..93f672e23 100644 --- a/templates.ipynb +++ b/templates.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "169d041c", + "id": "1afca1c3", "metadata": {}, "source": [ "### Theming and templates\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ebc4eb51", + "id": "212c83fe", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "f29dc785", + "id": "d32745f4", "metadata": {}, "source": [ "From this, we can see that the default theme is `\"plotly\"`, and we can see the names of several additional themes that we can choose from.\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2150115b", + "id": "109057d7", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "7e8d5265", + "id": "4ef3423a", "metadata": {}, "source": [ "#### Specifying themes in graph object figures\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b3b234b", + "id": "eaa322b0", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "05defab0", + "id": "01fb4daa", "metadata": {}, "source": [ "#### Specifying a default themes\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f06360f1", + "id": "814dc6f2", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "6399fe08", + "id": "49cff384", "metadata": {}, "source": [ "#### Disable default theming\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86fa90d6", + "id": "9d17acfd", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "b4833921", + "id": "e16de82b", "metadata": {}, "source": [ "### Creating themes\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5448d9d", + "id": "da4a79cd", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "fb801261", + "id": "9e244d66", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))`\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2850d94", + "id": "6b3e6130", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "cb69f145", + "id": "cee949ae", "metadata": {}, "source": [ "If a trace type property is set to a list of more than one trace, then the default properties are cycled as more traces are added to the figure. Here is an example that creates a template that cycles the default marker symbol for scatter traces, and then constructs a figure that uses this template." @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb7be643", + "id": "817d8f31", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "c31719ce", + "id": "e07eee93", "metadata": {}, "source": [ "Note that because we built the template with a list of 3 scatter trace [graph objects](/python/graph-objects/) (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3f45271", + "id": "712e8cb8", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "07bf0e2f", + "id": "2d03cc48", "metadata": {}, "source": [ "#### Including tuple elements in a theme\n", @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6cb597ce", + "id": "8dae7439", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "e11b127a", + "id": "ff72aeb7", "metadata": {}, "source": [ "#### Customizing theme tuple elements in a figure\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa1581d6", + "id": "0ffefc3e", "metadata": {}, "outputs": [], "source": [ @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "69bca1e5", + "id": "b55773d0", "metadata": {}, "source": [ "#### Registering themes as named templates\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23d4dccc", + "id": "3ba4487d", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "2057fd0a", + "id": "4cb0a180", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])`\n", @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db391f2c", + "id": "78931621", "metadata": {}, "outputs": [], "source": [ @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "0d0695ae", + "id": "cf6c86e2", "metadata": {}, "source": [ "#### Combining themes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da409313", + "id": "97ebf68e", "metadata": {}, "outputs": [], "source": [ @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "a60e1d22", + "id": "16b836ae", "metadata": {}, "source": [ "Combining themes is also supported by Plotly Express" @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55715be2", + "id": "0088498f", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "20c2cd93", + "id": "060b5996", "metadata": {}, "source": [ "\n", @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "8e6ecb28", + "id": "c8908228", "metadata": {}, "source": [ "#### Examining built-in themes\n", @@ -630,7 +630,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c62ee9fd", + "id": "70f09eb5", "metadata": {}, "outputs": [], "source": [ @@ -641,7 +641,7 @@ }, { "cell_type": "markdown", - "id": "46f9f9e3", + "id": "f3517fcb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-contour.ipynb b/ternary-contour.ipynb index ac9ad9484..3c8557dbe 100644 --- a/ternary-contour.ipynb +++ b/ternary-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "47c697d0", + "id": "639b3748", "metadata": {}, "source": [ "## Ternary contour plots" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "39e853ef", + "id": "5d712275", "metadata": {}, "source": [ "A ternary contour plots represents isovalue lines of a quantity defined inside a [ternary diagram](https://en.wikipedia.org/wiki/Ternary_plot), i.e. as a function of three variables which sum is constant. Coordinates of the ternary plot often correspond to concentrations of three species, and the quantity represented as contours is some property (e.g., physical, chemical, thermodynamical) varying with the composition.\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2541dcd0", + "id": "6de9d329", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "fd58b16e", + "id": "2a172a43", "metadata": {}, "source": [ "#### Customized ternary contour plot" @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f4b565d", + "id": "17c8c0c4", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "2e5fb140", + "id": "0678852d", "metadata": {}, "source": [ "#### Ternary contour plot with lines only" @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6e690ed", + "id": "e275f88c", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "fbb52dac", + "id": "d24eeb24", "metadata": {}, "source": [ "#### Ternary contour plot with data points\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4601c4f", + "id": "7f514c87", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "41d677a7", + "id": "1fd99b59", "metadata": {}, "source": [ "#### Interpolation mode\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c616ecb3", + "id": "2296c3f7", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c44e1f7e", + "id": "b85939dc", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "9d95d3b1", + "id": "f56534b0", "metadata": {}, "source": [ "#### Reference\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "5b901f38", + "id": "d30688e7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-plots.ipynb b/ternary-plots.ipynb index 4c5a40b9d..b398426fd 100644 --- a/ternary-plots.ipynb +++ b/ternary-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "69d6e2eb", + "id": "363d7b88", "metadata": {}, "source": [ "## Ternary Plots\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a157732b", + "id": "e0567070", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "e66d83f7", + "id": "be57d055", "metadata": {}, "source": [ "We can scale and color the markers to produce a ternary bubble chart." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9058c14", + "id": "67465e44", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "33df9a02", + "id": "97d6f439", "metadata": {}, "source": [ "### Ternary scatter plot with Plotly Graph Objects" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10026699", + "id": "9755362d", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "03c4b5a4", + "id": "32f9d4ab", "metadata": {}, "source": [ "#### Reference\n", @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "0f258cd4", + "id": "0646cc4a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-scatter-contour.ipynb b/ternary-scatter-contour.ipynb index 05a1e5e14..a542d8ef2 100644 --- a/ternary-scatter-contour.ipynb +++ b/ternary-scatter-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fbe092af", + "id": "70c74520", "metadata": {}, "source": [ "#### Load and Process Data Files" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a4e2c28", + "id": "7dacd084", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "4a4f1156", + "id": "54f7c457", "metadata": {}, "source": [ "#### Create Ternary Scatter Plot:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "571345b4", + "id": "35fe0128", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "4c92bcaf", + "id": "494ff491", "metadata": {}, "source": [ "#### Create Ternary Contour Plot:" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d78befb5", + "id": "bd03c120", "metadata": {}, "outputs": [], "source": [ @@ -155,14 +155,14 @@ { "cell_type": "code", "execution_count": null, - "id": "9e4424d6", + "id": "d5a1b16e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "989653f6", + "id": "d8e72e0a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/text-and-annotations.ipynb b/text-and-annotations.ipynb index 65fc05d64..c0f9062fa 100644 --- a/text-and-annotations.ipynb +++ b/text-and-annotations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "36e6b558", + "id": "5df17373", "metadata": {}, "source": [ "### Adding Text to Figures\n", @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "id": "950988a0", + "id": "d1271051", "metadata": {}, "source": [ "### Text on scatter plots with Plotly Express\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1ae97b2", + "id": "03302c05", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "55974f9f", + "id": "71353f48", "metadata": {}, "source": [ "### Text on scatter plots with Graph Objects" @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "767d7e29", + "id": "5243f1d5", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "151a9c99", + "id": "c47fe6d1", "metadata": {}, "source": [ "### Text positioning in Dash\n", @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fa1fec9", + "id": "048d2840", "metadata": { "hide_code": true }, @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "a7e0e1da", + "id": "7ef5fac8", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "fd9912f8", + "id": "4edcb4fd", "metadata": {}, "source": [ "### Controlling Text Size with `uniformtext`\n", @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "9ca307b3", + "id": "9dcfb3e2", "metadata": {}, "source": [ "Here is a bar chart with the default behavior which will scale down text to fit." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85ef1dfa", + "id": "54c28981", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "089d8de0", + "id": "94795757", "metadata": {}, "source": [ "Here is the same figure with uniform text applied: the text for all bars is the same size, with a minimum size of 8. Any text at the minimum size which does not fit in the bar is hidden." @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1823a357", + "id": "aea7c9c3", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a407114", + "id": "15d67a10", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "18044525", + "id": "10196112", "metadata": {}, "source": [ "### Controlling Maximum Text Size\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6ed4cbc", + "id": "62710979", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "cf731579", + "id": "cb7c9b1e", "metadata": {}, "source": [ "### Text Annotations\n", @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23c7be71", + "id": "61ff9408", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "2c81ff1a", + "id": "5d2285a2", "metadata": {}, "source": [ "#### Text Annotations with Log Axes\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f18b3a6b", + "id": "af1c543c", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "c7cca6b1", + "id": "e8c9e8d6", "metadata": {}, "source": [ "### 3D Annotations" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d890393", + "id": "8cd38fe7", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "0a1f3847", + "id": "b836fd0d", "metadata": {}, "source": [ "### Font Color, Size, and Familiy\n", @@ -418,7 +418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0283cc10", + "id": "c24762a1", "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ }, { "cell_type": "markdown", - "id": "e1fc90e7", + "id": "ae7aeb87", "metadata": {}, "source": [ "### Font Style, Variant, and Weight\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "509df5ca", + "id": "4b32dff0", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "521fc124", + "id": "630c4e25", "metadata": {}, "source": [ "## Numeric Font Weight\n", @@ -533,7 +533,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4394c4f", + "id": "1db99832", "metadata": {}, "outputs": [], "source": [ @@ -577,7 +577,7 @@ }, { "cell_type": "markdown", - "id": "bb4c701e", + "id": "daa53da1", "metadata": {}, "source": [ "[scattergl](https://plotly.com/python/reference/scattergl) traces do not support all numeric font weights. When you specify a numeric font weight on `scattergl`, weights up to 500 are mapped to the keyword font weight \"normal\", while weights above 500 are mapped to \"bold\"." @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "4c62c863", + "id": "325d5244", "metadata": {}, "source": [ "## Text Case\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "947ca210", + "id": "93ddc7b9", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "3728cc6a", + "id": "14367c72", "metadata": {}, "source": [ "## Text Lines\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20f66ab1", + "id": "f7605c64", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "f147ccdf", + "id": "bb2664d8", "metadata": {}, "source": [ "## Text Shadow\n", @@ -694,7 +694,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf55fd6", + "id": "c4d0b84e", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "ae42433e", + "id": "c8c4185e", "metadata": {}, "source": [ "### Styling and Coloring Annotations" @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa4cb9b3", + "id": "f24132af", "metadata": {}, "outputs": [], "source": [ @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "b17cda2b", + "id": "e929fb68", "metadata": {}, "source": [ "### Text Font as an Array - Styling Each Text Element" @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fce03a5", + "id": "b46b91b6", "metadata": {}, "outputs": [], "source": [ @@ -852,7 +852,7 @@ }, { "cell_type": "markdown", - "id": "bc931314", + "id": "30888860", "metadata": {}, "source": [ "### HTML Tags in Text\n", @@ -864,7 +864,7 @@ { "cell_type": "code", "execution_count": null, - "id": "076588ed", + "id": "8ce04664", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "60d0b2f6", + "id": "4acb7498", "metadata": {}, "source": [ "### Positioning Text Annotations Absolutely\n", @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5547317", + "id": "39508a83", "metadata": {}, "outputs": [], "source": [ @@ -941,7 +941,7 @@ }, { "cell_type": "markdown", - "id": "4c1c8944", + "id": "152141d5", "metadata": {}, "source": [ "### Adding Annotations Referenced to an Axis\n", @@ -954,7 +954,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20f1e49b", + "id": "520a597b", "metadata": {}, "outputs": [], "source": [ @@ -983,7 +983,7 @@ }, { "cell_type": "markdown", - "id": "73c9a18f", + "id": "8e627c93", "metadata": {}, "source": [ "### Specifying the Text's Position Absolutely\n", @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cafae43", + "id": "74411aab", "metadata": { "lines_to_next_cell": 0 }, @@ -1031,7 +1031,7 @@ }, { "cell_type": "markdown", - "id": "9c91d49a", + "id": "1197fe37", "metadata": {}, "source": [ "### Specifying Source Lines or Figure Notes on the Bottom of a Figure\n", @@ -1042,7 +1042,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b7ef8c0", + "id": "f373aec5", "metadata": { "lines_to_next_cell": 2 }, @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "06e37336", + "id": "0417f41b", "metadata": {}, "source": [ "### Customize Displayed Text with a Text Template\n", @@ -1123,7 +1123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5001b802", + "id": "c6c00340", "metadata": {}, "outputs": [], "source": [ @@ -1140,7 +1140,7 @@ }, { "cell_type": "markdown", - "id": "bd4fc980", + "id": "be41ca64", "metadata": {}, "source": [ "### Customize Text Template\n", @@ -1151,7 +1151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90d942fd", + "id": "1ec63f12", "metadata": {}, "outputs": [], "source": [ @@ -1173,7 +1173,7 @@ }, { "cell_type": "markdown", - "id": "603a1355", + "id": "c2d89abf", "metadata": {}, "source": [ "### Set Date in Text Template\n", @@ -1185,7 +1185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a16e8550", + "id": "432c01ba", "metadata": {}, "outputs": [], "source": [ @@ -1216,7 +1216,7 @@ }, { "cell_type": "markdown", - "id": "bf5d4c40", + "id": "eff994b2", "metadata": {}, "source": [ "#### Reference\n", @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "ca2bfd68", + "id": "4baf4171", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tick-formatting.ipynb b/tick-formatting.ipynb index 13e4889cc..896b5a146 100644 --- a/tick-formatting.ipynb +++ b/tick-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ef6f5560", + "id": "8f321c3e", "metadata": {}, "source": [ "#### Tickmode - Linear" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "d5d2b521", + "id": "0c2e121e", "metadata": {}, "source": [ "If `\"linear\"`, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`" @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2cc18cd", + "id": "0436c361", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "691bf3d9", + "id": "cddb5ed0", "metadata": {}, "source": [ "#### Tickmode - Array" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "ad1b506d", + "id": "33e5e3da", "metadata": {}, "source": [ "If `\"array\"`, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99ac679e", + "id": "d7a9287f", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "5e19c68e", + "id": "7da78950", "metadata": {}, "source": [ "### Dynamic tickmode in Dash\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cce1860b", + "id": "648882d2", "metadata": { "hide_code": true }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "2f17d0e0", + "id": "970e59b8", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "cafa77ea", + "id": "3de8ce64", "metadata": {}, "source": [ "#### Using Tickformat Attribute" @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "ade2ef66", + "id": "e74f1f85", "metadata": {}, "source": [ "For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a246959e", + "id": "f5b1d586", "metadata": {}, "outputs": [], "source": [ @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "8e5d613f", + "id": "65636627", "metadata": {}, "source": [ "#### Using Tickformat Attribute - Date/Time" @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "ec27f283", + "id": "84fd708c", "metadata": {}, "source": [ "For more date/time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e852715", + "id": "147da80a", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "262a9ddc", + "id": "b9745e00", "metadata": {}, "source": [ "#### Using Exponentformat Attribute" @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c891f2a8", + "id": "eba9c032", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "6d6be062", + "id": "bf74eb8e", "metadata": {}, "source": [ "#### Tickformatstops to customize for different zoom levels" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f2d22e5", + "id": "30a48156", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "ebca2abe", + "id": "c90c04b7", "metadata": {}, "source": [ "#### Placing ticks and gridlines between categories" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4937b7f6", + "id": "7cbd7430", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "ef042a08", + "id": "bbc7570c", "metadata": {}, "source": [ "#### Reference\n", @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "c3858adc", + "id": "d5fc47ae", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-county-choropleth.ipynb b/tile-county-choropleth.ipynb index 002a3c08b..81b7da640 100644 --- a/tile-county-choropleth.ipynb +++ b/tile-county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a19211de", + "id": "5f1860ce", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **tile-map** choropleth maps, but you can also build [**outline** choropleth maps](/python/choropleth-maps).\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4ba032a", + "id": "b0e2aa03", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "ae7e3a3c", + "id": "2c67dce5", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a8a8a2a", + "id": "b6b8d7dc", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "3652f2d4", + "id": "32f16cfb", "metadata": {}, "source": [ "### Choropleth map using plotly.express and carto base map\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bc33da9", + "id": "b3614ddb", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "72cb4cb0", + "id": "4aaf081a", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40278c4d", + "id": "edbffc14", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "d4513db6", + "id": "84524443", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "b36bbdcc", + "id": "96c5c5d7", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76499e03", + "id": "c4aa41fb", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "0ca1ac44", + "id": "fb1129d0", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron." @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "587a4cdd", + "id": "d69ac1f6", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "3790d5b3", + "id": "e52003e5", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "930f5cee", + "id": "3cddef5b", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "4135ce3a", + "id": "06888c05", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -239,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96a990a8", + "id": "e32523fd", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "3bd6ce6d", + "id": "cfa1fc9e", "metadata": {}, "source": [ "### Choropleth map using plotly.graph_objects and carto base map\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022515df", + "id": "645c44fd", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "5c992a38", + "id": "1b780822", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dc7fdcd", + "id": "25c0eb8d", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "774e6aad", + "id": "4cef3847", "metadata": {}, "source": [ "#### Reference\n", @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "b7be2e80", + "id": "d6cab45f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-map-layers.ipynb b/tile-map-layers.ipynb index b07e62b30..e0048148e 100644 --- a/tile-map-layers.ipynb +++ b/tile-map-layers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2f6d065d", + "id": "40a78c80", "metadata": {}, "source": [ "\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b55c529f", + "id": "5934f503", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "01ad744e", + "id": "334e7302", "metadata": {}, "source": [ "#### Using `layout.map.layers` to Specify a Base Map\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eb25b3e", + "id": "a582ce3f", "metadata": { "lines_to_next_cell": 2 }, @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "a3e1f11f", + "id": "e24c97fb", "metadata": {}, "source": [ "#### Base Tiles from the USGS, radar overlay from Environment Canada\n", @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da387b2d", + "id": "2873694b", "metadata": { "lines_to_next_cell": 2 }, @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "21cdcc80", + "id": "e2a94cc3", "metadata": {}, "source": [ "#### Dark tiles example\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3d8bc01", + "id": "1d1849a8", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "2b90b85e", + "id": "5ec87328", "metadata": {}, "source": [ "#### Stamen Watercolor using a Custom Style URL\n", @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "2feb5465", + "id": "06c79e47", "metadata": {}, "source": [ "### Mapbox\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78de4c4b", + "id": "f4a45cd0", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "d720afb3", + "id": "684a88a5", "metadata": {}, "source": [ "#### Using `layout.mapbox.layers` to Specify a Base Map\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94def504", + "id": "198022ae", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "3f384304", + "id": "ef7adec6", "metadata": {}, "source": [ "#### Dark tiles from Mapbox service: free token needed\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8094491", + "id": "e105f334", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "0b99d154", + "id": "307fab4f", "metadata": {}, "source": [ "## Setting Map Bounds\n", @@ -389,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6543e4c", + "id": "9ebb4236", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "89cc6014", + "id": "b6593480", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "7dcfbe4b", + "id": "f4b2f2b0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-scatter-maps.ipynb b/tile-scatter-maps.ipynb index 76630d51f..4dd297d48 100644 --- a/tile-scatter-maps.ipynb +++ b/tile-scatter-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0c009a86", + "id": "831fe31c", "metadata": {}, "source": [ "### Basic example with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b7086f3", + "id": "379648cc", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "780c679b", + "id": "7073f873", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8c100b9", + "id": "5af1052f", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "0a6a4258", + "id": "687dc837", "metadata": {}, "source": [ "#### Basic Example" @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8ab1398", + "id": "b04e2ccf", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "631ffb9e", + "id": "110a8267", "metadata": {}, "source": [ "#### Multiple Markers" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a24e808", + "id": "b819393d", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "b27859dc", + "id": "2a3da9db", "metadata": {}, "source": [ "#### Nuclear Waste Sites on Campuses" @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1f06db3", + "id": "4c676a65", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "ed156521", + "id": "f5a5349c", "metadata": {}, "source": [ "### Set Marker Symbols\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f50a3ad", + "id": "278f73a3", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "5b7e75e0", + "id": "8eaaa50d", "metadata": {}, "source": [ "#### Supported Symbols\n", @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "d04112a1", + "id": "ca8ec5d6", "metadata": {}, "source": [ "#### Add Clusters\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6679512d", + "id": "55b06819", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "4c5d9a7e", + "id": "c3731858", "metadata": {}, "source": [ "#### Font Customization\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cd44a4f", + "id": "0610a605", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "bf950155", + "id": "92567a03", "metadata": {}, "source": [ "`go.Scattermap` supports the following values for `textfont.family`:\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "ff60ce8a", + "id": "d669054e", "metadata": {}, "source": [ "##### Font Weight\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e54cb7c", + "id": "b8c1e8d2", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "e328eaf7", + "id": "903de600", "metadata": {}, "source": [ "## Mapbox Maps\n", @@ -422,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41d756cd", + "id": "a5353e3e", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "7942ab4c", + "id": "9cd6acd0", "metadata": {}, "source": [ "And here's an example using Graph Objects:" @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b39873cc", + "id": "14ac4873", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "fc6d3249", + "id": "3c723ffd", "metadata": {}, "source": [ "#### Reference\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "431bcc2b", + "id": "15e84f70", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/time-series.ipynb b/time-series.ipynb index 292502146..3ffbbd9e2 100644 --- a/time-series.ipynb +++ b/time-series.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "65fdc069", + "id": "5a885c65", "metadata": {}, "source": [ "### Time Series using Axes of type `date`\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41d73ef2", + "id": "b538d0b8", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c127dc3", + "id": "bdaca6ea", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "4a8eff67", + "id": "67b3a22d", "metadata": {}, "source": [ "### Time Series in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b90f8e9", + "id": "95e20a6b", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "6c590597", + "id": "b7752a8b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "472ad0bd", + "id": "cb87f4ea", "metadata": {}, "source": [ "### Different Chart Types on Date Axes\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca1aaa1b", + "id": "9e623ce8", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "23a1a0e0", + "id": "bdf2e3d1", "metadata": {}, "source": [ "Or this [facetted](/python/facet-plots/) area plot:" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "578ac3f1", + "id": "408e40d3", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "7b80cbe5", + "id": "b00645ee", "metadata": {}, "source": [ "### Configuring Tick Labels\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07965925", + "id": "ed8871d2", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "f2c641fa", + "id": "6fd99c16", "metadata": {}, "source": [ "### Moving Tick Labels to the Middle of the Period\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eece2c1a", + "id": "082711b5", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "63589d4a", + "id": "8b0d50ea", "metadata": {}, "source": [ "### Adding Minor Ticks\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e6e6c5f", + "id": "f7d14fa5", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "9fb86014", + "id": "853e2f53", "metadata": {}, "source": [ "#### Monthly Period Labels With Weekly Minor Ticks\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58b1d996", + "id": "3c331977", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "618829fb", + "id": "50060d26", "metadata": {}, "source": [ "### Summarizing Time-series Data with Histograms\n", @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ba5894d", + "id": "11ee276a", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "daf094e0", + "id": "5ee8e3b4", "metadata": {}, "source": [ "### Displaying Period Data\n", @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52c3c076", + "id": "48b5a7c6", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "3dac8fcd", + "id": "beb3fa52", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "359f7210", + "id": "39042632", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "4f002be1", + "id": "561644a9", "metadata": { "tags": [] }, @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1d28d6a", + "id": "bedc61fd", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edfc6e6b", + "id": "6e14add3", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55135977", + "id": "eaa80868", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "0fb9cb28", + "id": "d8389948", "metadata": {}, "source": [ "### Time Series With Range Slider\n", @@ -485,7 +485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdc093a9", + "id": "5a5eb807", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ }, { "cell_type": "markdown", - "id": "95b6867b", + "id": "0e57110f", "metadata": {}, "source": [ "### Time Series with Range Selector Buttons\n", @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "536d88ba", + "id": "cb957af5", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "8cb24d90", + "id": "b638b2f0", "metadata": {}, "source": [ "### Customizing Tick Label Formatting by Zoom Level\n", @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26e64abc", + "id": "667e2d8a", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "c50e94b4", + "id": "4383665b", "metadata": {}, "source": [ "### Hiding Weekends and Holidays\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85323752", + "id": "120c095b", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7ae0247", + "id": "f796f368", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "9b6ba9eb", + "id": "60ff34f1", "metadata": {}, "source": [ "### Hiding Non-Business Hours\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d119dd9", + "id": "c30678fc", "metadata": {}, "outputs": [], "source": [ @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b586e30", + "id": "85d253e8", "metadata": { "lines_to_next_cell": 2 }, @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "bed3786b", + "id": "318d6782", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tree-plots.ipynb b/tree-plots.ipynb index 88cf873db..5148af7b5 100644 --- a/tree-plots.ipynb +++ b/tree-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b07381a5", + "id": "f7f2de89", "metadata": {}, "source": [ "#### Set Up Tree with [igraph](http://igraph.org/python/)\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67de56c9", + "id": "68072a1a", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4dee1279", + "id": "48323399", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "03f7c322", + "id": "506f4376", "metadata": {}, "source": [ "#### Create Plotly Traces" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1220d60", + "id": "368aff16", "metadata": {}, "outputs": [], "source": [ @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "e2368d07", + "id": "5efce6d5", "metadata": {}, "source": [ "#### Create Text Inside the Circle via Annotations" @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff5a14d9", + "id": "147d6ade", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "ccfcff20", + "id": "194e7859", "metadata": {}, "source": [ "#### Add Axis Specifications and Create the Layout" @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0264f4b6", + "id": "3c69f0f9", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "019ac631", + "id": "e2369a71", "metadata": {}, "source": [ "#### Reference\n", @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "6ce74625", + "id": "d901306f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/treemaps.ipynb b/treemaps.ipynb index 448b66cf3..a9622614b 100644 --- a/treemaps.ipynb +++ b/treemaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9be7933d", + "id": "1f7a1fcc", "metadata": {}, "source": [ "[Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. The input data format is the same as for [Sunburst Charts](https://plotly.com/python/sunburst-charts/) and [Icicle Charts](https://plotly.com/python/icicle-charts/): the hierarchy is defined by [labels](https://plotly.com/python/reference/treemap/#treemap-labels) (`names` for `px.treemap`) and [parents](https://plotly.com/python/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68d29008", + "id": "16f69fdf", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "11096fb9", + "id": "9bb32507", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with plotly.express\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fba975d7", + "id": "af3c6644", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "c8066a7d", + "id": "21fd6ae3", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with continuous color argument in px.treemap\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "619231b4", + "id": "4693b09d", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "34d5205a", + "id": "82a19159", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with discrete color argument in px.treemap\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef2bb1a3", + "id": "ea3bef27", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "076f8ba8", + "id": "064b897d", "metadata": {}, "source": [ "In the example below the color of Saturday and Sunday sectors is the same as Dinner because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c8fada5", + "id": "e56b9763", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "284dfdbf", + "id": "9ecb361b", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "265dd729", + "id": "63cbf6fe", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "7a4478ea", + "id": "8a44214c", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd76b177", + "id": "59661b6d", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "c85b8d26", + "id": "f4943f69", "metadata": {}, "source": [ "### Treemap with Rounded Corners" @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "0c08043c", + "id": "e2e10135", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7083ae73", + "id": "62e7afbc", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "8b21c1cb", + "id": "c1499c6e", "metadata": {}, "source": [ "### Basic Treemap with go.Treemap\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6486de07", + "id": "13652172", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "ef5017e2", + "id": "50e4fad0", "metadata": {}, "source": [ "### Set Different Attributes in Treemap\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1166f620", + "id": "77c8e538", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "37395be1", + "id": "96265fcf", "metadata": {}, "source": [ "### Set Color of Treemap Sectors\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c1e729d", + "id": "023e5c0f", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "983b1c82", + "id": "9dd828ed", "metadata": {}, "source": [ "This example uses `treemapcolorway` attribute, which should be set in layout." @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0d2236e", + "id": "b94918c2", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f74400c", + "id": "a6c153e0", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "d324c299", + "id": "a3ef9ced", "metadata": {}, "source": [ "### Treemap chart with a continuous colorscale\n", @@ -428,7 +428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4dcdb592", + "id": "58693055", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "8fbd19cb", + "id": "27253d6b", "metadata": {}, "source": [ "### Nested Layers in Treemap\n", @@ -519,7 +519,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd9c2f8a", + "id": "a52125e2", "metadata": {}, "outputs": [], "source": [ @@ -546,7 +546,7 @@ }, { "cell_type": "markdown", - "id": "52a652be", + "id": "65718220", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -559,7 +559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70b2e509", + "id": "797e1140", "metadata": {}, "outputs": [], "source": [ @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "d6827edf", + "id": "2381b34a", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6725565f", + "id": "5e39c976", "metadata": {}, "outputs": [], "source": [ @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "a83c0e04", + "id": "aa4f4352", "metadata": {}, "source": [ "#### Reference\n", @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "5ce6e160", + "id": "6a7158b8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/trisurf.ipynb b/trisurf.ipynb index e9118c278..5c0ff351b 100644 --- a/trisurf.ipynb +++ b/trisurf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "03ef749c", + "id": "4d2a1095", "metadata": {}, "source": [ "Trisurf plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b1586e9", + "id": "e81ff416", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "40fec822", + "id": "02c18695", "metadata": {}, "source": [ "#### Mobius Band\n" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4bc4d6f", + "id": "b9ea7cbe", "metadata": { "lines_to_next_cell": 2 }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "30c6b7c5", + "id": "833f1581", "metadata": {}, "source": [ "#### Boy's Surface\n" @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9a22ab7", + "id": "2d0c3dde", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "a3bb3280", + "id": "f8117ad1", "metadata": {}, "source": [ "#### Reference\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "ae19e905", + "id": "16557624", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index fca562682..bfb035b5b 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "45b35974", + "id": "55cdec65", "metadata": {}, "source": [ "### Version Problems\n", @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51ac2ce7", + "id": "619d298b", "metadata": { "hide_code": true }, @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "c1563a04", + "id": "4b6a1cf6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "e3fa1a1b", + "id": "64f3c609", "metadata": {}, "source": [ "### VSCode Notebook, Nteract and Streamlit Problems\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "bb6f8628", + "id": "992b72d1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v4-migration.ipynb b/v4-migration.ipynb index 965d5bf9a..b4afd1cb1 100644 --- a/v4-migration.ipynb +++ b/v4-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cff773df", + "id": "28327b59", "metadata": {}, "source": [ "### Upgrading to Version 4\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "68d67289", + "id": "d3fc94a2", "metadata": {}, "source": [ "### Online features (`plotly.plotly`) moved to `chart-studio` package\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "1f791ee9", + "id": "43888257", "metadata": {}, "source": [ "### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export\n", @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "f60e1a51", + "id": "7a0ce64d", "metadata": {}, "source": [ "### New default theme\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7465cde8", + "id": "5da2c35a", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "8f8c083d", + "id": "804d2b26", "metadata": {}, "source": [ "You can revert to the version 3 figure appearance by disabling the default theme as follows:" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3413f9bb", + "id": "eebd5d59", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc73278f", + "id": "626f264b", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "2031fbc4", + "id": "aeabc8ad", "metadata": {}, "source": [ "See [Theming and templates](/python/templates) for more information on theming in plotly.py version 4.\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b0b86c0", + "id": "40cfd6a3", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "beb799d8", + "id": "9b09c2f8", "metadata": {}, "source": [ "Code that relied on the `add_*` methods to return a reference to the newly created trace will need to be updated to access the trace from the returned figure. This can be done by appending `.data[-1]` to the add trace expression.\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "76bcd1fc", + "id": "4fafb35c", "metadata": {}, "source": [ "### `make_subplots` updates\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39533a60", + "id": "8b699d63", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "baefbf58", + "id": "78932bf0", "metadata": {}, "source": [ "And here is the equivalent, version 4 example. Note how the order to the height list is reversed compared to the example above." @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16128fcd", + "id": "da39b2d3", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "faab75f5", + "id": "d8ec1b30", "metadata": {}, "source": [ "#### Implementation of shared axes with `make_subplots`\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fb7e581", + "id": "15f5b944", "metadata": {}, "outputs": [], "source": [ @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "43de88f3", + "id": "94cf0a56", "metadata": {}, "source": [ "### Trace UIDs\n", @@ -339,7 +339,7 @@ }, { "cell_type": "markdown", - "id": "e8907f4c", + "id": "3bb1d440", "metadata": {}, "source": [ "### Headless image export on Linux with Xvfb.\n", @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "edd1a580", + "id": "aad90423", "metadata": {}, "source": [ "### Removals\n", @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "fdbe9fdb", + "id": "a30cc4e9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v6-changes.ipynb b/v6-changes.ipynb index b0039d8b3..6d1c07017 100644 --- a/v6-changes.ipynb +++ b/v6-changes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f47621ed", + "id": "f66f7c28", "metadata": {}, "source": [ "This page outlines the changes in Plotly.py version 6 and cases where you may need to update your charts or tools that you use for working with Plotly.py." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "9f93828b", + "id": "a8d436b2", "metadata": {}, "source": [ "## Jupyter Notebook Support\n", @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "04c527ab", + "id": "79d27d69", "metadata": { "lines_to_next_cell": 2 }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "9a099758", + "id": "a9421dd6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/violin.ipynb b/violin.ipynb index f83e724e6..cdead159f 100644 --- a/violin.ipynb +++ b/violin.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "21245198", + "id": "49fb2ad6", "metadata": {}, "source": [ "## Violin Plot with Plotly Express\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bdb5f73", + "id": "e34c5fb8", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "fd6586ac", + "id": "0b9f13a2", "metadata": {}, "source": [ "### Violin plot with box and data points" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91ebd928", + "id": "025a4c3b", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "680073b4", + "id": "01d64041", "metadata": {}, "source": [ "### Multiple Violin Plots" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae0830fe", + "id": "bd69aa52", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68653613", + "id": "53ed72d9", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "95269924", + "id": "e1ed73ef", "metadata": {}, "source": [ "## Violin Plot with go.Violin\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcbe9b32", + "id": "2a99dc61", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "d420d202", + "id": "b207956f", "metadata": {}, "source": [ "#### Multiple Traces" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f704eb5f", + "id": "7132bc40", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "ac358061", + "id": "1a994a96", "metadata": {}, "source": [ "#### Grouped Violin Plot" @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6149019", + "id": "fc4b21dc", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "a22935c6", + "id": "33bb2e53", "metadata": {}, "source": [ "#### Split Violin Plot" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f18e00f2", + "id": "ae00f040", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "40e6f19e", + "id": "1e3c3bed", "metadata": {}, "source": [ "#### Advanced Violin Plot" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "907ef779", + "id": "34128116", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "b9c92b2c", + "id": "b65033a4", "metadata": {}, "source": [ "#### Ridgeline plot\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb95e6ec", + "id": "e613863a", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "70ee112a", + "id": "544cc94e", "metadata": {}, "source": [ "### Violin Plot With Only Points\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fc16577", + "id": "1236245e", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "b8c7905d", + "id": "e46ef089", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64f1f3c4", + "id": "fece51bf", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "06f56267", + "id": "810ecf46", "metadata": {}, "source": [ "#### Reference\n", @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "9fdb26e9", + "id": "571e66fe", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/waterfall-charts.ipynb b/waterfall-charts.ipynb index 7bc3ecea7..9ba35c14d 100644 --- a/waterfall-charts.ipynb +++ b/waterfall-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dc36d0db", + "id": "cfb34ea9", "metadata": {}, "source": [ "### Simple Waterfall Chart" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72f90692", + "id": "2c0ab5e6", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "2ee70d63", + "id": "78f6aa9c", "metadata": {}, "source": [ "### Multi Category Waterfall Chart\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8eb81e0", + "id": "2e9a5f01", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "17473b76", + "id": "294c05d1", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0d82300", + "id": "6d058977", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "8e327872", + "id": "e6aea1da", "metadata": {}, "source": [ "### Horizontal Waterfall Chart" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4946aa55", + "id": "755c01b0", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "b97a0f0c", + "id": "24875ed0", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "26cbd544", + "id": "55d72fd2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wide-form.ipynb b/wide-form.ipynb index 1d29960a0..2e5f75262 100644 --- a/wide-form.ipynb +++ b/wide-form.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f5d53cf5", + "id": "480d6634", "metadata": {}, "source": [ "### Plotly Express works with Column-oriented, Matrix or Geographic Data\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43040160", + "id": "6403455f", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "059848e2", + "id": "314886bc", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "c017b448", + "id": "98662a61", "metadata": {}, "source": [ "Plotly Express can produce **the same plot from either form**. For the long-form input, `x` and `y` are set to the respective column names." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f8c4f4d", + "id": "1e5b28ce", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "3dfb1316", + "id": "0e487bad", "metadata": {}, "source": [ "For the wide-form input, we **pass in a list of column-names `y`**, which is enough to trigger the wide-form processing mode. Wide-form mode is also the default if neither `x` nor `y` are specified, see section at bottom regarding Wide-Form Defaults." @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d947ae34", + "id": "acb2c86a", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "07b21109", + "id": "f020806d", "metadata": {}, "source": [ "### Labeling axes, legends and hover text\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6bacec5", + "id": "9df7ab7e", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "12e6577e", + "id": "857368c4", "metadata": {}, "source": [ "Plotly Express figures created using wide-form data can be [styled just like any other Plotly Express figure](/python/styling-plotly-express/):" @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6debfc94", + "id": "563449d5", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "b15e9795", + "id": "c58820ac", "metadata": {}, "source": [ "### Data Frames with Named Indexes\n", @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba0e50bc", + "id": "03ed17c1", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "fe90e5d9", + "id": "a5cc3bc6", "metadata": {}, "source": [ "When working with a data frame like the one above, you can pass the index references directly as arguments, to benefit from automatic labelling for everything except the y axis label, which will default to \"values\", but this can be overridden with the `labels` argument as above:" @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09bb88d5", + "id": "064dd6c9", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "255a4a62", + "id": "e6f41db5", "metadata": {}, "source": [ "If you transpose `x` and `y`, thereby assigning the columns to `x`, the orientation will be switched to horizontal:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acbca779", + "id": "1e070a33", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "33b2daec", + "id": "bdd5a299", "metadata": {}, "source": [ "### Assigning Inferred Columns to Non-Default Arguments" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "89ac4ddb", + "id": "03f98fbb", "metadata": {}, "source": [ "In the examples above, the columns of the wide data frame are assigned by default as an \"inferred\" column named `variable` to the `color` argument (see section below for documentation of the default behaviours), but this is not a hard constraint. The `variable` column can be assigned to any Plotly Express argument, for example to accomplish faceting, and `color` can be reassigned to any other value. More generally, when plotting with a data frame without named indexes, you can reassign the inferred column named `variable` and `value` to any argument:" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "195aff7b", + "id": "1dffb839", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "deecf726", + "id": "232dc501", "metadata": {}, "source": [ "You can also prevent `color` from getting assigned if you're mapping `variable` to some other argument:" @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f7e6851", + "id": "40a14570", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "6d840087", + "id": "33f073bf", "metadata": {}, "source": [ "If using a data frame's named indexes, either explicitly or relying on the defaults, the row-index references (i.e. `df.index`) or column-index names (i.e. the value of `df.columns.name`) must be used:" @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d55cd472", + "id": "f02b0d50", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "3975e276", + "id": "1969dd24", "metadata": {}, "source": [ "### Mixed-Form Data\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c56bef3", + "id": "0d39132d", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "ce79a40f", + "id": "82e132c6", "metadata": {}, "source": [ "We can visualize just the wide-form portion of the data frame easily with a [violin chart](/python/violin/). As a special note, we'll assign the index, which is the participant ID, to the `hover_data`, so that hovering over outlier points will identify their row." @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4658725", + "id": "dd023431", "metadata": { "lines_to_next_cell": 0 }, @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "e0af5451", + "id": "f486b5be", "metadata": {}, "source": [ "\n" @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "294a4cfa", + "id": "8e2d095b", "metadata": {}, "source": [ "We are not limited to visualizing only the wide-form portion of the data, however. We can also leverage the long-form portion of the data frame, for example to color by participant `gender` and facet by participant `group`, all without having to manipulate the data frame:" @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9f67b63", + "id": "eca6e85d", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "c4e19a1a", + "id": "f68bf7e7", "metadata": {}, "source": [ "In the plots above, the column names provided to `y` are internally mapped to long-form column called `variable`, as is apparent in the x-axis labels. We can reassign `variable` to another argument as well, in this case we'll assign it to `facet_col` and reassign `group` to the `x` axis. We'll switch to a [box plot](/python/box-plots/) for variety." @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9811f392", + "id": "491f8343", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ }, { "cell_type": "markdown", - "id": "ca673068", + "id": "74fb42c7", "metadata": {}, "source": [ "One interesting thing about a mixed-form data frame like this is that it remains easy to plot, say, one experiment against another, which would require some preliminary data wrangling if this was represented as a pure long-form dataset:" @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed433aee", + "id": "36acf699", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "1e59fa9d", + "id": "db78d262", "metadata": {}, "source": [ "In fact, we can even visualize the results of every experiment against every other, using a [scatterplot matrix](/python/splom/):" @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c4905ad", + "id": "712384f3", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "cef5ecd0", + "id": "7e3a2241", "metadata": {}, "source": [ "### Wide-Form Defaults\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c398f1b", + "id": "8f4974c4", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "571e3a9f", + "id": "739c94d9", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "ce83da68", + "id": "5b6ee4f1", "metadata": {}, "source": [ "### Orientation Control When Using Defaults\n", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ab7c1d7", + "id": "a8973472", "metadata": { "lines_to_next_cell": 2 }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "92f6db25", + "id": "af1dda48", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wind-rose-charts.ipynb b/wind-rose-charts.ipynb index 95af7aa5f..c045dd8fd 100644 --- a/wind-rose-charts.ipynb +++ b/wind-rose-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f1f74723", + "id": "cba84955", "metadata": {}, "source": [ "### Wind Rose Chart with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "733fadd2", + "id": "9aad5ccb", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "e08af226", + "id": "e2a18d70", "metadata": {}, "source": [ "#### Basic Wind Rose Chart" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0af277b3", + "id": "f6b213af", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "8279b04e", + "id": "34a863d7", "metadata": {}, "source": [ "#### Reference\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "5cd22a7e", + "id": "d26ad4e0", "metadata": {}, "source": [ "### What About Dash?\n", From 942e5e176847fc1be11bbe63d591677f6be842ed Mon Sep 17 00:00:00 2001 From: plotlydocbot Date: Tue, 17 Mar 2026 14:56:30 +0000 Subject: [PATCH 5/5] build of https://github.com/plotly/plotly.py/commit/52a0d06b4ba0b5bb6e515e7c0800fb01d0222a08 --- 2D-Histogram.ipynb | 50 +++--- 2d-histogram-contour.ipynb | 40 ++--- 3d-axes.ipynb | 30 ++-- 3d-bubble-charts.ipynb | 20 +-- 3d-camera-controls.ipynb | 44 ++--- 3d-isosurface-plots.ipynb | 36 ++-- 3d-line-plots.ipynb | 14 +- 3d-mesh.ipynb | 32 ++-- 3d-scatter-plots.ipynb | 30 ++-- 3d-subplots.ipynb | 10 +- 3d-surface-plots.ipynb | 32 ++-- 3d-volume.ipynb | 30 ++-- LaTeX.ipynb | 8 +- animations.ipynb | 36 ++-- annotated-heatmap.ipynb | 40 ++--- axes.ipynb | 212 ++++++++++++------------ bar-charts.ipynb | 164 +++++++++--------- bio-alignment-chart.ipynb | 10 +- bio-clustergram.ipynb | 18 +- bio-manhattanplot.ipynb | 14 +- bio-volcano-plot.ipynb | 14 +- box-plots.ipynb | 86 +++++----- bubble-charts.ipynb | 32 ++-- bubble-maps.ipynb | 20 +-- builtin-colorscales.ipynb | 28 ++-- bullet-charts.ipynb | 22 +-- candlestick-charts.ipynb | 30 ++-- carpet-contour.ipynb | 16 +- carpet-plot.ipynb | 32 ++-- carpet-scatter.ipynb | 18 +- categorical-axes.ipynb | 48 +++--- choropleth-maps.ipynb | 62 +++---- click-events.ipynb | 14 +- colorscales.ipynb | 124 +++++++------- cone-plot.ipynb | 24 +-- configuration-options.ipynb | 60 +++---- continuous-error-bars.ipynb | 10 +- contour-plots.ipynb | 60 +++---- county-choropleth.ipynb | 42 ++--- creating-and-updating-figures.ipynb | 128 +++++++------- custom-buttons.ipynb | 24 +-- dash.ipynb | 4 +- dendrogram.ipynb | 20 +-- density-heatmaps.ipynb | 16 +- discrete-color.ipynb | 66 ++++---- distplot.ipynb | 58 +++---- dot-plots.ipynb | 16 +- dropdowns.ipynb | 26 +-- dumbbell-plots.ipynb | 12 +- ecdf-plots.ipynb | 56 +++---- error-bars.ipynb | 40 ++--- facet-plots.ipynb | 52 +++--- figure-factories.ipynb | 4 +- figure-factory-subplots.ipynb | 26 +-- figure-factory-table.ipynb | 42 ++--- figure-introspection.ipynb | 58 +++---- figure-labels.ipynb | 40 ++--- figure-structure.ipynb | 18 +- figurewidget-app.ipynb | 34 ++-- figurewidget.ipynb | 42 ++--- filled-area-plots.ipynb | 46 ++--- filled-area-tile-maps.ipynb | 18 +- funnel-charts.ipynb | 44 ++--- gantt.ipynb | 34 ++-- gauge-charts.ipynb | 16 +- getting-started.ipynb | 30 ++-- graph-objects.ipynb | 8 +- graphing-multiple-chart-types.ipynb | 26 +-- heatmaps.ipynb | 56 +++---- hexbin-mapbox.ipynb | 28 ++-- histograms.ipynb | 118 ++++++------- horizontal-bar-charts.ipynb | 36 ++-- horizontal-vertical-shapes.ipynb | 36 ++-- hover-text-and-formatting.ipynb | 88 +++++----- icicle-charts.ipynb | 86 +++++----- images.ipynb | 28 ++-- imshow.ipynb | 114 ++++++------- indicator.ipynb | 36 ++-- interactive-html-export.ipynb | 20 +-- ipython-vs-python.ipynb | 16 +- jupyter-lab-tools.ipynb | 12 +- legend.ipynb | 120 +++++++------- line-and-scatter.ipynb | 120 +++++++------- line-charts.ipynb | 70 ++++---- linear-fits.ipynb | 54 +++--- lines-on-maps.ipynb | 28 ++-- lines-on-tile-maps.ipynb | 20 +-- location-mode.ipynb | 28 ++-- log-plot.ipynb | 28 ++-- map-configuration.ipynb | 46 ++--- map-subplots-and-small-multiples.ipynb | 8 +- marginal-plots.ipynb | 28 ++-- marker-style.ipynb | 64 +++---- migrate-to-maplibre.ipynb | 4 +- mixed-subplots.ipynb | 10 +- ml-knn.ipynb | 34 ++-- ml-pca.ipynb | 38 ++--- ml-regression.ipynb | 64 +++---- ml-roc-pr.ipynb | 30 ++-- ml-tsne-umap-projections.ipynb | 28 ++-- ml_apps.ipynb | 4 +- multiple-axes.ipynb | 38 ++--- network-graphs.ipynb | 28 ++-- ohlc-charts.ipynb | 28 ++-- orca-management.ipynb | 56 +++---- pandas-backend.ipynb | 40 ++--- parallel-categories-diagram.ipynb | 32 ++-- parallel-coordinates-plot.ipynb | 30 ++-- pattern-hatching-texture.ipynb | 40 ++--- peak-finding.ipynb | 18 +- performance.ipynb | 30 ++-- pie-charts.ipynb | 72 ++++---- plot-data-from-csv.ipynb | 22 +-- plotly-express.ipynb | 154 ++++++++--------- polar-chart.ipynb | 52 +++--- px-arguments.ipynb | 70 ++++---- quiver-plots.ipynb | 12 +- radar-chart.ipynb | 20 +-- random-walk.ipynb | 18 +- range-slider.ipynb | 12 +- renderers.ipynb | 56 +++---- sankey-diagram.ipynb | 46 ++--- scatter-plots-on-maps.ipynb | 28 ++-- selections.ipynb | 46 ++--- setting-graph-size.ipynb | 30 ++-- shapes.ipynb | 134 +++++++-------- sliders.ipynb | 14 +- smith-charts.ipynb | 16 +- smoothing.ipynb | 14 +- splom.ipynb | 42 ++--- static-image-export.ipynb | 34 ++-- static-image-generation-migration.ipynb | 6 +- streamline-plots.ipynb | 14 +- streamtube-plot.ipynb | 20 +-- strip-charts.ipynb | 12 +- styling-plotly-express.ipynb | 22 +-- subplots.ipynb | 90 +++++----- sunburst-charts.ipynb | 64 +++---- supported-colors.ipynb | 10 +- table-subplots.ipynb | 8 +- table.ipynb | 38 ++--- templates.ipynb | 68 ++++---- ternary-contour.ipynb | 28 ++-- ternary-plots.ipynb | 16 +- ternary-scatter-contour.ipynb | 16 +- text-and-annotations.ipynb | 114 ++++++------- tick-formatting.ipynb | 46 ++--- tile-county-choropleth.ipynb | 46 ++--- tile-map-layers.ipynb | 38 ++--- tile-scatter-maps.ipynb | 52 +++--- time-series.ipynb | 82 ++++----- tree-plots.ipynb | 22 +-- treemaps.ipynb | 72 ++++---- trisurf.ipynb | 16 +- troubleshooting.ipynb | 10 +- v4-migration.ipynb | 42 ++--- v6-changes.ipynb | 8 +- violin.ipynb | 50 +++--- waterfall-charts.ipynb | 20 +-- wide-form.ipynb | 86 +++++----- wind-rose-charts.ipynb | 12 +- 161 files changed, 3238 insertions(+), 3238 deletions(-) diff --git a/2D-Histogram.ipynb b/2D-Histogram.ipynb index 62c15b525..2bc4a5565 100644 --- a/2D-Histogram.ipynb +++ b/2D-Histogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "283f1535", + "id": "a564812c", "metadata": {}, "source": [ "## 2D Histograms or Density Heatmaps\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0da01d9f", + "id": "c93b72ff", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "004bbdfd", + "id": "65c94f11", "metadata": {}, "source": [ "The number of bins can be controlled with `nbinsx` and `nbinsy` and the [color scale](/python/colorscales/) with `color_continuous_scale`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2de46db", + "id": "6df6fc3c", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "c88ab680", + "id": "f1218a95", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3c8a788", + "id": "4866ed5a", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "d1373adb", + "id": "e471a2a4", "metadata": {}, "source": [ "Density heatmaps can also be [faceted](/python/facet-plots/):" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "134f2c2c", + "id": "f7f11ef0", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "f3a390a7", + "id": "ef3aecd4", "metadata": {}, "source": [ "### Displaying Text\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84fc00c9", + "id": "55deb75f", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "a0c34287", + "id": "8f0f4d77", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae6bb31", + "id": "cc7b470b", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "0e63ea0f", + "id": "2d99531a", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "15d6a11a", + "id": "839cfa76", "metadata": {}, "source": [ "### 2D Histogram of a Bivariate Normal Distribution ###" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05952a34", + "id": "195b7814", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "139724c4", + "id": "2c7ef8d2", "metadata": {}, "source": [ "### 2D Histogram Binning and Styling Options ###" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9707cf46", + "id": "30f59959", "metadata": { "lines_to_next_cell": 0 }, @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "6f0071ac", + "id": "a71161ce", "metadata": {}, "source": [ "### Sharing bin settings between 2D Histograms\n", @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2493f671", + "id": "3655c160", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "48d3d457", + "id": "a728a675", "metadata": {}, "source": [ "### 2D Histogram Overlaid with a Scatter Chart ###" @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94dfc28a", + "id": "43cc0ef0", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ }, { "cell_type": "markdown", - "id": "647b2a1c", + "id": "11f0a813", "metadata": {}, "source": [ "### Text on 2D Histogram Points\n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ac65e04", + "id": "5f3a9fee", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "4a49fa94", + "id": "3001b684", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "23bcfb09", + "id": "937fb580", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/2d-histogram-contour.ipynb b/2d-histogram-contour.ipynb index 93ecaf14d..1f238d4de 100644 --- a/2d-histogram-contour.ipynb +++ b/2d-histogram-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a6c95d16", + "id": "2cf7e7ec", "metadata": {}, "source": [ "## 2D Histogram Contours or Density Contours\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f17c7683", + "id": "685e0a5d", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "3f7cd471", + "id": "22bcf002", "metadata": {}, "source": [ "Marginal plots can be added to visualize the 1-dimensional distributions of the two variables. Here we use a marginal [`histogram`](/python/histograms/). Other allowable values are `violin`, `box` and `rug`." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f1b445d", + "id": "8c7ece6f", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "96697c3a", + "id": "71d4daf2", "metadata": {}, "source": [ "Density contours can also be [faceted](/python/facet-plots/) and [discretely colored](/python/discrete-color/):" @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d72b0f19", + "id": "29389c7b", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "caf6f590", + "id": "cc92b2e3", "metadata": {}, "source": [ "Plotly Express density contours can be [continuously-colored](/python/colorscales/) and labeled:" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43f760e4", + "id": "6d612b26", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "0b8abcc7", + "id": "e1ac2637", "metadata": {}, "source": [ "### Other aggregation functions than `count`\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ad43618", + "id": "27ec2f88", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "88ec2452", + "id": "9788e78b", "metadata": {}, "source": [ "### 2D Histograms with Graph Objects\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0eaef30", + "id": "5034613d", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "1a3b1496", + "id": "7faff489", "metadata": {}, "source": [ "#### 2D Histogram Contour Colorscale" @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "901efd9e", + "id": "ec37817e", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "8deee350", + "id": "98e14262", "metadata": {}, "source": [ "#### 2D Histogram Contour Styled" @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "839bafa3", + "id": "3ca1623f", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ }, { "cell_type": "markdown", - "id": "ae91c7d6", + "id": "bb371b59", "metadata": {}, "source": [ "#### 2D Histogram Contour Subplot" @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9db0ce8", + "id": "9a701278", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "9e467e14", + "id": "19335564", "metadata": {}, "source": [ "#### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "33bbfed2", + "id": "14f276fd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-axes.ipynb b/3d-axes.ipynb index 7032632a9..7ff9c5397 100644 --- a/3d-axes.ipynb +++ b/3d-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "00649bcf", + "id": "f8470dd0", "metadata": {}, "source": [ "### Range of axes\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f80cc892", + "id": "c263e3bc", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "234916b0", + "id": "5b5b9ed3", "metadata": {}, "source": [ "### Setting only a Lower or Upper Bound for Range\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d3ac42b", + "id": "b8179a75", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "39501e98", + "id": "e3a7b760", "metadata": {}, "source": [ "### Fixed Ratio Axes" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "127ab655", + "id": "6c87a148", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "06991bf1", + "id": "97064387", "metadata": {}, "source": [ "### Set Axes Title" @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80adc66b", + "id": "79c39773", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "58d3e8e4", + "id": "7aad6608", "metadata": {}, "source": [ "### Ticks Formatting" @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8bfdb45", + "id": "24e16687", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "360ab307", + "id": "28a45f89", "metadata": {}, "source": [ "### Background and Grid Color" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5764a8b", + "id": "1009a0cb", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "ee1d34b7", + "id": "b1b6e157", "metadata": {}, "source": [ "### Disabling tooltip spikes\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f39b6833", + "id": "b361b4ee", "metadata": { "lines_to_next_cell": 2 }, @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "9a2aa225", + "id": "13a10456", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-bubble-charts.ipynb b/3d-bubble-charts.ipynb index 5207066ab..ee6bf3113 100644 --- a/3d-bubble-charts.ipynb +++ b/3d-bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0b6654cd", + "id": "fe76e7ae", "metadata": {}, "source": [ "### 3d Bubble chart with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dcc78d6", + "id": "a705fbff", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "c2d1fd23", + "id": "be8fb1ac", "metadata": {}, "source": [ "#### Simple Bubble Chart" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bac4920", + "id": "5526c34f", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "00f57c49", + "id": "e1a2e023", "metadata": {}, "source": [ "#### Bubble Chart Sized by a Variable\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "399ce45d", + "id": "189ce2e0", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "27ae793b", + "id": "ea6dbb31", "metadata": {}, "source": [ "#### Edit the Colorbar\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65b01c86", + "id": "8c82ce89", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "38e24816", + "id": "bcb5c81b", "metadata": {}, "source": [ "#### Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "4e489cd3", + "id": "7448d2c5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-camera-controls.ipynb b/3d-camera-controls.ipynb index 860b0b226..2047b22f3 100644 --- a/3d-camera-controls.ipynb +++ b/3d-camera-controls.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1fea1b96", + "id": "93947cb2", "metadata": {}, "source": [ "### How camera controls work\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "b5ceddaa", + "id": "ecd3b47a", "metadata": {}, "source": [ "### Default parameters" @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7ab607a", + "id": "8e4ce147", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "6d3c3879", + "id": "32331505", "metadata": {}, "source": [ "### Changing the camera position by setting the eye parameter\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8abfa1ae", + "id": "7605ea02", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "5f6ebf62", + "id": "656837bb", "metadata": {}, "source": [ "#### X-Z plane\n", @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d72f548b", + "id": "06f5ae89", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "d64da51c", + "id": "66a4c3eb", "metadata": {}, "source": [ "#### Y-Z plane" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0231b88f", + "id": "ab5ed5d5", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "2eb3a1fa", + "id": "3479710b", "metadata": {}, "source": [ "#### View from Above (X-Y plane)" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9b6f548", + "id": "edcc26ba", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "291ed18f", + "id": "9ae0b1d4", "metadata": {}, "source": [ "#### Zooming In\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7aae3d44", + "id": "8193820d", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "8f9d42f0", + "id": "0a6fb913", "metadata": {}, "source": [ "### Tilting the camera vertical by setting the up parameter\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5136cb1f", + "id": "de9804d6", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "aba6f276", + "id": "3dc0ace7", "metadata": {}, "source": [ "Note when `up` does not correspond to the direction of an axis, you also need to set `layout.scene.dragmode='orbit'`." @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b997f4f2", + "id": "ccbcf8cc", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "e7dc9edc", + "id": "a2f205ed", "metadata": {}, "source": [ "### Changing the focal point by setting center\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20d0e79f", + "id": "540edcde", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "a27f5721", + "id": "74ee2668", "metadata": {}, "source": [ "#### Reference" @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "44e03913", + "id": "999c4cbd", "metadata": {}, "source": [ "See https://plotly.com/python/reference/layout/scene/#layout-scene-camera for more information and chart attribute options!" @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "35bc9f9a", + "id": "67208427", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-isosurface-plots.ipynb b/3d-isosurface-plots.ipynb index e190adb95..88e3dd779 100644 --- a/3d-isosurface-plots.ipynb +++ b/3d-isosurface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e530519a", + "id": "b7bf367d", "metadata": {}, "source": [ "With ``go.Isosurface``, you can plot [isosurface contours](https://en.wikipedia.org/wiki/Isosurface) of a scalar field ``value``, which is defined on ``x``, ``y`` and ``z`` coordinates.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "505d73fb", + "id": "15a73b4c", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "00a82080", + "id": "c7dd5a3c", "metadata": {}, "source": [ "### Removing caps when visualizing isosurfaces\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58cc2cb0", + "id": "df928583", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "1e905fc9", + "id": "2f6331a3", "metadata": {}, "source": [ "### Modifying the number of isosurfaces" @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfa52dc4", + "id": "9e4e9dbf", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "3067b85e", + "id": "5d8f2635", "metadata": {}, "source": [ "### Changing the opacity of isosurfaces" @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99aa5cdc", + "id": "db1f58f8", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "9eee1031", + "id": "3f172817", "metadata": {}, "source": [ "#### Isosurface with Additional Slices\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bef0793", + "id": "f1fe8f2f", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "b69d75b6", + "id": "db1dcc8d", "metadata": {}, "source": [ "#### Multiple Isosurfaces with Caps" @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3db92a85", + "id": "c91faf7e", "metadata": {}, "outputs": [], "source": [ @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "ac3eac4c", + "id": "2200d94b", "metadata": {}, "source": [ "### Changing the default colorscale of isosurfaces" @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7577871", + "id": "1babfeab", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "83974650", + "id": "6340d551", "metadata": {}, "source": [ "### Customizing the layout and appearance of isosurface plots" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "039f4d12", + "id": "81e15a8d", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "88d37240", + "id": "db8733f1", "metadata": {}, "source": [ "#### Reference\n", @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "97a3ce66", + "id": "0fa9b488", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-line-plots.ipynb b/3d-line-plots.ipynb index 925afce79..8e49ef942 100644 --- a/3d-line-plots.ipynb +++ b/3d-line-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dafe2e20", + "id": "697f704a", "metadata": {}, "source": [ "### 3D Line plot with Plotly Express" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f92a75e2", + "id": "634bc651", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6f8ba63", + "id": "235cbdf7", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "ebd00a57", + "id": "ed92d8f1", "metadata": {}, "source": [ "#### 3D Line Plot of Brownian Motion\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2c6905a", + "id": "08143456", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "b9d2d8c2", + "id": "75d1863c", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "fce0d7e3", + "id": "3f402828", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-mesh.ipynb b/3d-mesh.ipynb index 4651db7c0..2957d31d0 100644 --- a/3d-mesh.ipynb +++ b/3d-mesh.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a42ab084", + "id": "0e5049ee", "metadata": {}, "source": [ "### Simple 3D Mesh example ###\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b2414cd", + "id": "4d32f4ef", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "d906eacc", + "id": "2313b580", "metadata": {}, "source": [ "### 3D Mesh example with Alphahull" @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "732df6e1", + "id": "4cbee4c0", "metadata": {}, "source": [ "The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body)." @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b55fe60", + "id": "50d4d627", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "dfbe4543", + "id": "1fadd8e5", "metadata": {}, "source": [ "### 3D Mesh in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6c79890", + "id": "f3d6e45e", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "10d22aa2", + "id": "05f4cf0b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "5df978df", + "id": "5cf56d3f", "metadata": {}, "source": [ "### Mesh Tetrahedron\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84825cba", + "id": "b58d8f76", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "d45e2406", + "id": "cc606ebd", "metadata": {}, "source": [ "### Mesh Cube" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a44abb55", + "id": "e0360c5d", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "434e0fc2", + "id": "07e1c502", "metadata": {}, "source": [ "### Intensity values defined on vertices or cells\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6803a54e", + "id": "8c166cc7", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "db4b5053", + "id": "5122f3f5", "metadata": {}, "source": [ "## Reference\n", @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "c38dfbe0", + "id": "8aba79b3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-scatter-plots.ipynb b/3d-scatter-plots.ipynb index 41a1f8b5b..05422a38b 100644 --- a/3d-scatter-plots.ipynb +++ b/3d-scatter-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4b31c0a8", + "id": "95eb2aa2", "metadata": {}, "source": [ "## 3D scatter plot with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7a773d5", + "id": "1cb938b7", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "d9928a2f", + "id": "9ab9dbd7", "metadata": {}, "source": [ "A 4th dimension of the data can be represented thanks to the color of the markers. Also, values from the `species` column are used below to assign symbols to markers." @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c28485a3", + "id": "ddf26e8d", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "2d0ba0be", + "id": "a8deb5b0", "metadata": {}, "source": [ "#### Style 3d scatter plot\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c73caf66", + "id": "0a3e9ce3", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "01e37ba9", + "id": "0cca5989", "metadata": {}, "source": [ "#### 3d scatter plots in Dash\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f442912e", + "id": "2e03be58", "metadata": { "hide_code": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "69b5a742", + "id": "7ef41be6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "747ed59d", + "id": "e26894eb", "metadata": {}, "source": [ "### 3D Scatter Plot with go.Scatter3d\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9cca35f1", + "id": "d1876276", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "6f948263", + "id": "4d1802b8", "metadata": {}, "source": [ "#### 3D Scatter Plot with Colorscaling and Marker Styling" @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e55f043f", + "id": "33b36ccb", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "db7c2325", + "id": "a2aa5fa9", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "7664f117", + "id": "10bdfa57", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-subplots.ipynb b/3d-subplots.ipynb index a9a52e81d..0ac3e2f0c 100644 --- a/3d-subplots.ipynb +++ b/3d-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5d45deb5", + "id": "bb33b9cd", "metadata": {}, "source": [ "#### 3D Surface Subplots" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe725162", + "id": "be688896", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "7cb861ed", + "id": "4f92e138", "metadata": {}, "source": [ "#### Reference" @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "e7c39e8d", + "id": "84150502", "metadata": {}, "source": [ "See https://plotly.com/python/subplots/ for more information regarding subplots!" @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "6bf119c5", + "id": "a29efe43", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-surface-plots.ipynb b/3d-surface-plots.ipynb index b89dac042..fb25ec568 100644 --- a/3d-surface-plots.ipynb +++ b/3d-surface-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7a504110", + "id": "333963b8", "metadata": {}, "source": [ "#### Topographical 3D Surface Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "119e6843", + "id": "6d9e8143", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "db0e9ab3", + "id": "d755aafe", "metadata": {}, "source": [ "### Passing x and y data to 3D Surface Plot\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "376c714a", + "id": "eb44e1c9", "metadata": { "lines_to_next_cell": 2 }, @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "6f67727b", + "id": "f7961166", "metadata": {}, "source": [ "#### Surface Plot With Contours" @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "7c3bc515", + "id": "c7ae0d31", "metadata": {}, "source": [ "Display and customize contour data for each axis using the `contours` attribute ([reference](https://plotly.com/python/reference/surface/#surface-contours))." @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "263f9069", + "id": "27522251", "metadata": { "lines_to_next_cell": 0 }, @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "bcf4a621", + "id": "daceca07", "metadata": {}, "source": [ "#### Configure Surface Contour Levels\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4647869", + "id": "fe2384c4", "metadata": { "lines_to_next_cell": 0 }, @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "cf7303d6", + "id": "6aeb5c0f", "metadata": {}, "source": [ "#### Multiple 3D Surface Plots" @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e45a6c6", + "id": "919923c1", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "3a6a5271", + "id": "81394086", "metadata": {}, "source": [ "### Setting the Surface Color\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61ae67b1", + "id": "d08ed2bc", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "734a88e8", + "id": "35e60a3d", "metadata": {}, "source": [ "#### Reference" @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "d4d808e5", + "id": "51686a83", "metadata": {}, "source": [ "See https://plotly.com/python/reference/surface/ for more information!\n" @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "4dd893b1", + "id": "deeb8bd0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/3d-volume.ipynb b/3d-volume.ipynb index e028dd369..97b240d6e 100644 --- a/3d-volume.ipynb +++ b/3d-volume.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f60927c1", + "id": "37db7787", "metadata": {}, "source": [ "A volume plot with `go.Volume` shows several partially transparent isosurfaces for volume rendering. The API of `go.Volume` is close to the one of `go.Isosurface`. However, whereas [isosurface plots](/python/3d-isosurface-plots/) show all surfaces with the same opacity, tweaking the `opacityscale` parameter of `go.Volume` results in a depth effect and better volume rendering.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af7eb576", + "id": "97ecf473", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4937497c", + "id": "1d6dcca3", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cd17a5a", + "id": "7fce0e92", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "0be5d430", + "id": "7756fa73", "metadata": {}, "source": [ "### Defining the opacity scale of volume plots\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43a01e1e", + "id": "bb728138", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "8a142fcd", + "id": "8427b369", "metadata": {}, "source": [ "### Defining a custom opacity scale\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43600ea4", + "id": "d2eed6f6", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "9cbf7189", + "id": "3750e673", "metadata": {}, "source": [ "### Adding caps to a volume plot\n", @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c0042f7", + "id": "4b816e42", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1edb5a80", + "id": "3e8dffbf", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "6468943e", + "id": "71667964", "metadata": {}, "source": [ "### Adding slices to a volume plot\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35d8a264", + "id": "94310ade", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "58463f2e", + "id": "d94d54fa", "metadata": {}, "source": [ "#### Reference\n", @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "1df00616", + "id": "80ee9c61", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/LaTeX.ipynb b/LaTeX.ipynb index 64c90d2f6..b8cabc487 100644 --- a/LaTeX.ipynb +++ b/LaTeX.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "92bfb2e0", + "id": "fd124875", "metadata": {}, "source": [ "#### LaTeX Typesetting\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dfed665", + "id": "cdc7dfc9", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a227e9f", + "id": "8d167605", "metadata": { "lines_to_next_cell": 2 }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "88cad2f0", + "id": "5909506b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/animations.ipynb b/animations.ipynb index 98a106c5c..d02adc8fe 100644 --- a/animations.ipynb +++ b/animations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7d714f1f", + "id": "38602cec", "metadata": {}, "source": [ "#### Animated figures with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe72bc16", + "id": "4aa6cdb5", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "61b06a7a", + "id": "7b30d573", "metadata": {}, "source": [ "#### Animated figures in Dash\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aacbba0a", + "id": "543505ef", "metadata": { "hide_code": true }, @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "9b6cacd2", + "id": "275734f0", "metadata": {}, "source": [ "#### Animated Bar Charts with Plotly Express\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eafaca03", + "id": "50f84497", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "3ff2430d", + "id": "3b115e26", "metadata": {}, "source": [ "### Current Animation Limitations and Caveats\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "ff63ae08", + "id": "15ac0082", "metadata": {}, "source": [ "\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "5d056c75", + "id": "cc89c98f", "metadata": {}, "source": [ "#### Defining Button Arguments\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0c89a39", + "id": "1e67217c", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "95824c5b", + "id": "7bfa3a8e", "metadata": {}, "source": [ "#### Moving Point on a Curve" @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "021e22bb", + "id": "3a380b63", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "078fceb2", + "id": "f1a02109", "metadata": {}, "source": [ "#### Moving Frenet Frame Along a Planar Curve" @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a72c4a8", + "id": "65290a6d", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "c7689716", + "id": "8ff0d2a4", "metadata": {}, "source": [ "#### Using a Slider and Buttons\n", @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36a620dc", + "id": "d8f5bffa", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "89085cfc", + "id": "d51d267e", "metadata": {}, "source": [ "#### Important Notes\n", @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "a75b9d4b", + "id": "b233118e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/annotated-heatmap.ipynb b/annotated-heatmap.ipynb index faa77c7da..b54c5781f 100644 --- a/annotated-heatmap.ipynb +++ b/annotated-heatmap.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9a6f54d1", + "id": "68f1dd2b", "metadata": {}, "source": [ "### Annotated Heatmaps with Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "35c0dcbe", + "id": "5138892a", "metadata": {}, "source": [ "#### Basic Annotated Heatmap for z-annotations\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71c5725f", + "id": "8ed32a26", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "2b70b709", + "id": "8fe1d3ea", "metadata": {}, "source": [ "### Deprecated Figure Factory\n", @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "42dc5b98", + "id": "01ee4cde", "metadata": {}, "source": [ "#### Simple Annotated Heatmap" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99e126f1", + "id": "687bbcbd", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "98928cab", + "id": "2d4144d6", "metadata": {}, "source": [ "#### Custom Text and X & Y Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5979376e", + "id": "9c54fbdc", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "8b408ae3", + "id": "8bd8e3d1", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bdd2fe9", + "id": "5d58f9e9", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "6aa89014", + "id": "93b8a6cb", "metadata": {}, "source": [ "#### Annotated Heatmap with numpy" @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6ef0610", + "id": "dd982934", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "66d65e77", + "id": "5dbf8681", "metadata": {}, "source": [ "Here is the same figure using `px.imshow()`" @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70109b14", + "id": "09aa004c", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "4935e108", + "id": "21edf287", "metadata": {}, "source": [ "Here is a fairly contrived example showing how one can display a periodic table with custom text and hover using `ff.create_annotated_heatmap()` (scroll below to see the `px.imshow()` equivalent)." @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ba813bd", + "id": "b4795d68", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "22aeab9e", + "id": "7ee21411", "metadata": {}, "source": [ "Here is the same output using `px.imshow()` with much less array manipulation:" @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fec8731", + "id": "2c2b18bb", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "099c2c3a", + "id": "95b0aa55", "metadata": {}, "source": [ "#### Reference\n", @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "80aa4a86", + "id": "55609b7f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/axes.ipynb b/axes.ipynb index 30a60e0cc..e5555cfdc 100644 --- a/axes.ipynb +++ b/axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "50d10761", + "id": "fbc3b910", "metadata": {}, "source": [ "This tutorial explains how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/yaxis/).\n", @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "f0691d8e", + "id": "c372d7cf", "metadata": {}, "source": [ "### Forcing an axis to be categorical\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29a165d5", + "id": "4d4f6a44", "metadata": { "lines_to_next_cell": 2 }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "91e97e56", + "id": "7fb07885", "metadata": {}, "source": [ "#### General Axis properties\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "95f48e1f", + "id": "7fc8ae4a", "metadata": {}, "source": [ "#### Set and Style Axes Title Labels\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "824667dd", + "id": "b6f2b868", "metadata": {}, "outputs": [], "source": [ @@ -106,7 +106,7 @@ }, { "cell_type": "markdown", - "id": "9b2a039f", + "id": "a6b5b7c8", "metadata": {}, "source": [ "Axis titles (and [legend titles](/python/legend/)) can also be overridden using the `labels` argument of Plotly Express functions:" @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac2d889a", + "id": "a2c61a13", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "5432ba33", + "id": "cfbccc1c", "metadata": {}, "source": [ "The PX `labels` argument can also be used without a data frame argument:\n" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aca308c1", + "id": "c870e109", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "99b4a93a", + "id": "10157e4b", "metadata": {}, "source": [ "##### Rotating tick labels in Dash\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f9932db", + "id": "1e052f0e", "metadata": { "hide_code": true }, @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "1586b17e", + "id": "57116e0b", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "ecf9b581", + "id": "4f2634fc", "metadata": {}, "source": [ "#### Moving Tick Labels Inside the Plot\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9bd660f", + "id": "685129ea", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "5c48b844", + "id": "0285dbad", "metadata": {}, "source": [ "#### Specifying Label Aliases\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "289c90ba", + "id": "14a601f7", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "ecba19fd", + "id": "cdc34e78", "metadata": {}, "source": [ "##### Set axis title text with Graph Objects\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b2de668", + "id": "662fdb50", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "97dc9dd9", + "id": "f400061c", "metadata": {}, "source": [ "### Set axis title position\n", @@ -280,7 +280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9fe14f78", + "id": "e32f9f43", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "2601a728", + "id": "7850cc36", "metadata": {}, "source": [ "##### Set axis title font\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6a1adc2", + "id": "7c7c4c97", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "4c241c12", + "id": "1490f2f9", "metadata": {}, "source": [ "#### Tick Placement, Color, and Style\n", @@ -348,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c810456", + "id": "7d596660", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "a9dbae96", + "id": "4cd8d655", "metadata": {}, "source": [ "##### Set number of tick marks (and grid lines)\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b849c5b0", + "id": "136a88aa", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "ed022e77", + "id": "14da1c80", "metadata": {}, "source": [ "##### Set start position and distance between ticks\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "028d9180", + "id": "03d5c5cb", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "108f47cf", + "id": "36bf50cb", "metadata": {}, "source": [ "##### Set exact location of axis ticks\n", @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b45271f4", + "id": "bf122995", "metadata": {}, "outputs": [], "source": [ @@ -448,7 +448,7 @@ }, { "cell_type": "markdown", - "id": "a3f4586a", + "id": "153d63db", "metadata": {}, "source": [ "##### Style tick marks\n", @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99ae4e22", + "id": "5d123199", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "22b41980", + "id": "ba759e7e", "metadata": {}, "source": [ "##### Step for tick labels\n", @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97d368c9", + "id": "40671755", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "40b7b63f", + "id": "e6c0c7ab", "metadata": {}, "source": [ "##### Toggling axis labels\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7813bb4", + "id": "b8a92816", "metadata": {}, "outputs": [], "source": [ @@ -536,7 +536,7 @@ }, { "cell_type": "markdown", - "id": "2797125c", + "id": "5416a7eb", "metadata": {}, "source": [ "##### Set axis label rotation and font\n", @@ -549,7 +549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0976611c", + "id": "4bab2951", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "482069a8", + "id": "46ce1dae", "metadata": {}, "source": [ "##### Auto Tick Angle Options\n", @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19a0c4ed", + "id": "aa858005", "metadata": {}, "outputs": [], "source": [ @@ -593,7 +593,7 @@ }, { "cell_type": "markdown", - "id": "3e6532aa", + "id": "791e9027", "metadata": {}, "source": [ "#### Enumerated Ticks with Tickvals and Ticktext\n", @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2670c99c", + "id": "fc82f90a", "metadata": {}, "outputs": [], "source": [ @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "f41add02", + "id": "19ba39f3", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "481f3868", + "id": "3232101d", "metadata": {}, "outputs": [], "source": [ @@ -685,7 +685,7 @@ }, { "cell_type": "markdown", - "id": "e1507331", + "id": "0c3f880a", "metadata": {}, "source": [ "#### Adjust Tick Label Positions\n", @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d61c7c20", + "id": "90601b51", "metadata": {}, "outputs": [], "source": [ @@ -727,7 +727,7 @@ }, { "cell_type": "markdown", - "id": "d9bc465a", + "id": "a6ca8a7e", "metadata": {}, "source": [ "#### Use Minor Tick for Label\n", @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b290c300", + "id": "d45de813", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "a5de9882", + "id": "19a3a43c", "metadata": {}, "source": [ "### Axis lines: grid and zerolines\n", @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8b69f63", + "id": "a35af809", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "d0439785", + "id": "c677d267", "metadata": {}, "source": [ "##### Toggling Axis zero lines\n", @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b08e3e8", + "id": "3ce57e60", "metadata": {}, "outputs": [], "source": [ @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "4f494e09", + "id": "42ed5a3d", "metadata": {}, "source": [ "#### Styling and Coloring Axes and the Zero-Line\n", @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a7fccc3", + "id": "48746481", "metadata": {}, "outputs": [], "source": [ @@ -853,7 +853,7 @@ }, { "cell_type": "markdown", - "id": "3edbf1ed", + "id": "5d279de1", "metadata": {}, "source": [ "##### Mirroring axis lines\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "531ea8a2", + "id": "2305a936", "metadata": {}, "outputs": [], "source": [ @@ -882,7 +882,7 @@ }, { "cell_type": "markdown", - "id": "36b7f3b7", + "id": "c7491d38", "metadata": {}, "source": [ "##### Styling grid lines\n", @@ -895,7 +895,7 @@ { "cell_type": "code", "execution_count": null, - "id": "072c8d99", + "id": "54f38f7d", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "119b7d3c", + "id": "4af8937b", "metadata": {}, "source": [ "_new in 5.8_\n", @@ -922,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c144495", + "id": "2c635c97", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ }, { "cell_type": "markdown", - "id": "8a2b15cb", + "id": "9fd69f6b", "metadata": {}, "source": [ "##### Styling zero lines\n", @@ -950,7 +950,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38722d58", + "id": "543faa0c", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "6fcbcdf4", + "id": "a978d8a4", "metadata": {}, "source": [ "##### Controlling Zero Line Layer\n", @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "742ffc0c", + "id": "8c05edda", "metadata": {}, "outputs": [], "source": [ @@ -1010,7 +1010,7 @@ }, { "cell_type": "markdown", - "id": "9ff891d7", + "id": "bc54f008", "metadata": {}, "source": [ "#### Setting the Range of Axes Manually\n", @@ -1023,7 +1023,7 @@ { "cell_type": "code", "execution_count": null, - "id": "411b50aa", + "id": "25be5655", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "10ac98d0", + "id": "4af1b740", "metadata": {}, "source": [ "#### Exclude Inside Tick Labels from Range\n", @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40d73671", + "id": "253ba56a", "metadata": {}, "outputs": [], "source": [ @@ -1070,7 +1070,7 @@ }, { "cell_type": "markdown", - "id": "6d599957", + "id": "69aa38c9", "metadata": {}, "source": [ "#### Setting only a Lower or Upper Bound for Range\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b3c9752", + "id": "6881fc5c", "metadata": {}, "outputs": [], "source": [ @@ -1099,7 +1099,7 @@ }, { "cell_type": "markdown", - "id": "aab55742", + "id": "4ce717f4", "metadata": {}, "source": [ "#### Setting a Maximum and Minimum Allowed Axis Value\n", @@ -1112,7 +1112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d41155d0", + "id": "0cbb1580", "metadata": {}, "outputs": [], "source": [ @@ -1129,7 +1129,7 @@ }, { "cell_type": "markdown", - "id": "b91e7ee3", + "id": "437b1dea", "metadata": {}, "source": [ "#### Disabling Pan/Zoom on Axes (Fixed Range)\n", @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df17608", + "id": "9b431ca5", "metadata": {}, "outputs": [], "source": [ @@ -1155,7 +1155,7 @@ }, { "cell_type": "markdown", - "id": "c3ebc455", + "id": "08047b85", "metadata": {}, "source": [ "### Fixed Ratio Axes\n", @@ -1168,7 +1168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43149242", + "id": "9223d3c3", "metadata": {}, "outputs": [], "source": [ @@ -1196,7 +1196,7 @@ }, { "cell_type": "markdown", - "id": "edde9afd", + "id": "f31f6933", "metadata": {}, "source": [ "### Fixed Ratio Axes with Compressed domain\n", @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "552df94b", + "id": "3d6d2abf", "metadata": {}, "outputs": [], "source": [ @@ -1235,7 +1235,7 @@ }, { "cell_type": "markdown", - "id": "66738682", + "id": "8702e5aa", "metadata": {}, "source": [ "##### Decreasing the domain spanned by an axis\n", @@ -1246,7 +1246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41b4fd0a", + "id": "d84f7dcc", "metadata": {}, "outputs": [], "source": [ @@ -1279,7 +1279,7 @@ }, { "cell_type": "markdown", - "id": "a63d24f4", + "id": "9aafa2c3", "metadata": {}, "source": [ "#### Reversed Axes\n", @@ -1292,7 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5a8aaa1", + "id": "b4e162cb", "metadata": {}, "outputs": [], "source": [ @@ -1307,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "c2477f20", + "id": "f4fbfe3b", "metadata": {}, "source": [ "#### Reversed Axes with Range ( Min/Max ) Specified\n", @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b91da3f", + "id": "8cbe2420", "metadata": {}, "outputs": [], "source": [ @@ -1335,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "3e724032", + "id": "3c80ddff", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1346,7 +1346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bd398a0", + "id": "3a277c95", "metadata": {}, "outputs": [], "source": [ @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "bacb8634", + "id": "464650a7", "metadata": {}, "source": [ "*New in 5.17*\n", @@ -1373,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b38a7239", + "id": "18bf45cb", "metadata": {}, "outputs": [], "source": [ @@ -1389,7 +1389,7 @@ }, { "cell_type": "markdown", - "id": "62118354", + "id": "b00e59fb", "metadata": {}, "source": [ "### Axis range for log axis type\n", @@ -1400,7 +1400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd89604d", + "id": "4ee47190", "metadata": {}, "outputs": [], "source": [ @@ -1415,7 +1415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62f83c61", + "id": "55af8d76", "metadata": {}, "outputs": [], "source": [ @@ -1431,7 +1431,7 @@ }, { "cell_type": "markdown", - "id": "674d7e88", + "id": "9322a452", "metadata": {}, "source": [ "#### Setting the domain of the axis" @@ -1440,7 +1440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca6fc10c", + "id": "39b8bd20", "metadata": {}, "outputs": [], "source": [ @@ -1459,7 +1459,7 @@ }, { "cell_type": "markdown", - "id": "6a85c78e", + "id": "1f3ed321", "metadata": {}, "source": [ "#### Synchronizing axes in subplots with `matches`\n", @@ -1472,7 +1472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5853f339", + "id": "9ce08a21", "metadata": {}, "outputs": [], "source": [ @@ -1492,7 +1492,7 @@ }, { "cell_type": "markdown", - "id": "2d442d0e", + "id": "64f5d8d7", "metadata": {}, "source": [ "#### nonnegative, tozero, and normal Rangemode\n", @@ -1509,7 +1509,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a003246", + "id": "ac101503", "metadata": {}, "outputs": [], "source": [ @@ -1525,7 +1525,7 @@ }, { "cell_type": "markdown", - "id": "981aaa78", + "id": "27d1107b", "metadata": {}, "source": [ "#### Autorange Options\n", @@ -1542,7 +1542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6bbe8f7", + "id": "9a19e407", "metadata": {}, "outputs": [], "source": [ @@ -1559,7 +1559,7 @@ }, { "cell_type": "markdown", - "id": "0dcef922", + "id": "370d0bcd", "metadata": {}, "source": [ "##### Clip Minimum and Maximum\n", @@ -1570,7 +1570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6786226", + "id": "10a4ae6c", "metadata": {}, "outputs": [], "source": [ @@ -1587,7 +1587,7 @@ }, { "cell_type": "markdown", - "id": "d4054c64", + "id": "43cf6aff", "metadata": {}, "source": [ "##### Specify Values to be Included\n", @@ -1598,7 +1598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99f1dc20", + "id": "6c72672e", "metadata": {}, "outputs": [], "source": [ @@ -1614,7 +1614,7 @@ }, { "cell_type": "markdown", - "id": "8d0db5c7", + "id": "6d454059", "metadata": {}, "source": [ "#### Reference\n", @@ -1624,7 +1624,7 @@ }, { "cell_type": "markdown", - "id": "72463ebc", + "id": "960627e6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bar-charts.ipynb b/bar-charts.ipynb index d92689c36..4971ea703 100644 --- a/bar-charts.ipynb +++ b/bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "16746d6e", + "id": "e0369ea6", "metadata": {}, "source": [ "### Bar chart with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dad0759c", + "id": "4aad93a4", "metadata": { "lines_to_next_cell": 2 }, @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "30b10666", + "id": "249c43d3", "metadata": {}, "source": [ "#### Bar charts with Long Format Data\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "365a7b2b", + "id": "0c1bbc70", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e613fc9e", + "id": "ad54bd33", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "209a6aaf", + "id": "53fe7c1a", "metadata": {}, "source": [ "#### Bar charts with Wide Format Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f7f504e", + "id": "365376f4", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a7e657e", + "id": "ffb07cea", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "d3aefaec", + "id": "596985c6", "metadata": {}, "source": [ "### Bar charts in Dash\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c7d0da4", + "id": "005512ac", "metadata": { "hide_code": true }, @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "34e5ed23", + "id": "a3cf1fa5", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "3be1cb16", + "id": "135141d8", "metadata": {}, "source": [ "### Colored Bars\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "682f3161", + "id": "0ae685ec", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "931cc273", + "id": "0c3fbd63", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "1e8ad61f", + "id": "23eb59ef", "metadata": {}, "source": [ "### Stacked vs Grouped Bars\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8cdc255", + "id": "6f5434d3", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "a1f3874d", + "id": "9dadbc1c", "metadata": {}, "source": [ "The default stacked bar chart behavior can be changed to grouped (also known as clustered) using the `barmode` argument:" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7493163", + "id": "feb2ba59", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "9e8cf3e1", + "id": "109e2d2c", "metadata": {}, "source": [ "### Aggregating into Single Colored Bars\n", @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b449eb0c", + "id": "8bd8d074", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "a13556aa", + "id": "a285d121", "metadata": {}, "source": [ "`px.histogram()` will aggregate `y` values by summing them by default, but the `histfunc` argument can be used to set this to `avg` to create what is sometimes called a \"barplot\" which summarizes the central tendency of a dataset, rather than visually representing the totality of the dataset.\n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ea14bd4", + "id": "1c74a546", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "f89634dd", + "id": "712317cf", "metadata": {}, "source": [ "### Bar Charts with Text\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "378e1930", + "id": "c6a02384", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "5a260a45", + "id": "39d4dbe0", "metadata": {}, "source": [ "The `text` argument can be used to display arbitrary text on the bars:" @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16829730", + "id": "6cbfabc6", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "41b1ffd1", + "id": "98b2ce9c", "metadata": {}, "source": [ "By default, Plotly will scale and rotate text labels to maximize the number of visible labels, which can result in a variety of text angles and sizes and positions in the same figure. The `textfont`, `textposition` and `textangle` trace attributes can be used to control these.\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f35a049", + "id": "49eaa94e", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "96945bae", + "id": "4e2e70c0", "metadata": {}, "source": [ "Here is the same data with less variation in text formatting. Note that `textfont_size` will set the *maximum* size. The `layout.uniformtext` attribute can be used to guarantee that all text labels are the same size. See the [documentation on text and annotations](/python/text-and-annotations/) for details.\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b4a099e", + "id": "3e307b4c", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ }, { "cell_type": "markdown", - "id": "726b76ed", + "id": "f0f0c500", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "18fe35d4", + "id": "0586014e", "metadata": {}, "source": [ "Bar charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:" @@ -399,7 +399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f46cc4f", + "id": "5e0133c2", "metadata": {}, "outputs": [], "source": [ @@ -413,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "137e4f69", + "id": "b40bc205", "metadata": {}, "source": [ "### Facetted subplots\n", @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e85b301", + "id": "6f48d856", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "c5bf5e28", + "id": "c792b524", "metadata": {}, "source": [ "#### Basic Bar Charts with plotly.graph_objects\n", @@ -450,7 +450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72c7b25d", + "id": "1bc394d4", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "a8ebba59", + "id": "48382a1c", "metadata": {}, "source": [ "#### Grouped Bar Chart\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "940c18b1", + "id": "e96eba22", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "8f0dcf05", + "id": "0529e3a2", "metadata": {}, "source": [ "### Stacked Bar Chart" @@ -501,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f91308d9", + "id": "aca0b767", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "42ad8791", + "id": "b0e5235c", "metadata": {}, "source": [ "### Bar Chart with Relative Barmode\n", @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9663bd4b", + "id": "df84db76", "metadata": {}, "outputs": [], "source": [ @@ -550,7 +550,7 @@ }, { "cell_type": "markdown", - "id": "76e6f26c", + "id": "d784a052", "metadata": {}, "source": [ "### Grouped Stacked Bar Chart\n", @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb44ce9b", + "id": "96a5f8e1", "metadata": {}, "outputs": [], "source": [ @@ -620,7 +620,7 @@ }, { "cell_type": "markdown", - "id": "d559c72e", + "id": "d97b3dcd", "metadata": {}, "source": [ "### Stacked Bar Chart From Aggregating a DataFrame\n", @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f6cbae4", + "id": "4236166c", "metadata": { "lines_to_next_cell": 2 }, @@ -683,7 +683,7 @@ }, { "cell_type": "markdown", - "id": "492804a2", + "id": "e2c7c1d8", "metadata": {}, "source": [ "### Bar Chart with Hover Text" @@ -692,7 +692,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2e7ce89", + "id": "84e554cf", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +713,7 @@ }, { "cell_type": "markdown", - "id": "e2cfa871", + "id": "4963fb4b", "metadata": {}, "source": [ "### Bar Chart with Direct Labels" @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25e16b0f", + "id": "fd247073", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "09ea7ed1", + "id": "fd8ee02e", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -754,7 +754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93ba4a19", + "id": "85a731e5", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "78a6e742", + "id": "a3503e84", "metadata": {}, "source": [ "### Rotated Bar Chart Labels" @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8947d86", + "id": "36c63561", "metadata": {}, "outputs": [], "source": [ @@ -808,7 +808,7 @@ }, { "cell_type": "markdown", - "id": "070cc8a9", + "id": "81b790df", "metadata": {}, "source": [ "### Customizing Individual Bar Colors" @@ -817,7 +817,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d532546a", + "id": "945acb7d", "metadata": {}, "outputs": [], "source": [ @@ -837,7 +837,7 @@ }, { "cell_type": "markdown", - "id": "bd110b1f", + "id": "9f7aad53", "metadata": {}, "source": [ "### Customizing Individual Bar Widths" @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3beb8e35", + "id": "27fd0203", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ }, { "cell_type": "markdown", - "id": "55cd8382", + "id": "fb153ce3", "metadata": {}, "source": [ "Bar charts with custom widths can be used to make mekko charts (also known as marimekko charts, mosaic plots, or variwide charts)." @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "570effe3", + "id": "610c4377", "metadata": {}, "outputs": [], "source": [ @@ -925,7 +925,7 @@ }, { "cell_type": "markdown", - "id": "30016082", + "id": "1dca7a97", "metadata": {}, "source": [ "### Using a scatterplot to wrap long bars into multiple columns\n", @@ -936,7 +936,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d250dd1", + "id": "bd8c9251", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ }, { "cell_type": "markdown", - "id": "1429c233", + "id": "25c4d4b1", "metadata": {}, "source": [ "### Customizing Individual Bar Base" @@ -1048,7 +1048,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94490fe7", + "id": "9053d740", "metadata": {}, "outputs": [], "source": [ @@ -1072,7 +1072,7 @@ }, { "cell_type": "markdown", - "id": "da87c6c8", + "id": "b917f816", "metadata": {}, "source": [ "### Rounded Bars\n", @@ -1087,7 +1087,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16e74155", + "id": "924a7252", "metadata": {}, "outputs": [], "source": [ @@ -1112,7 +1112,7 @@ }, { "cell_type": "markdown", - "id": "fd5176ba", + "id": "42881455", "metadata": {}, "source": [ "When you don't want all bar traces in a figure to have the same rounded corners, you can instead configure rounded corners on each trace using `marker.cornerradius`. In this example, which uses subplots, the first trace has a corner radius of 30 pixels, the second trace has a bar corner radius of 30% of the bar width, and the third trace has no rounded corners set." @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aee2f06a", + "id": "69fc69b9", "metadata": {}, "outputs": [], "source": [ @@ -1154,7 +1154,7 @@ }, { "cell_type": "markdown", - "id": "d5cc2f27", + "id": "732ee211", "metadata": {}, "source": [ "### Colored and Styled Bar Chart\n", @@ -1165,7 +1165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4b6c4ac", + "id": "3ac98af3", "metadata": {}, "outputs": [], "source": [ @@ -1214,7 +1214,7 @@ }, { "cell_type": "markdown", - "id": "0321cbfa", + "id": "581d4caa", "metadata": {}, "source": [ "### Bar Chart with Sorted or Ordered Categories\n", @@ -1227,7 +1227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e3d289e", + "id": "377847b4", "metadata": {}, "outputs": [], "source": [ @@ -1244,7 +1244,7 @@ }, { "cell_type": "markdown", - "id": "7d6accf0", + "id": "ac6af10b", "metadata": {}, "source": [ "This example shows how to customise sort ordering by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -1253,7 +1253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01ea09d2", + "id": "44427486", "metadata": {}, "outputs": [], "source": [ @@ -1270,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "741caf01", + "id": "860eff66", "metadata": {}, "source": [ "This example orders the bar chart by descending value with `categoryorder: 'total descending'`" @@ -1279,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ebcaa3d", + "id": "f33222bb", "metadata": {}, "outputs": [], "source": [ @@ -1296,7 +1296,7 @@ }, { "cell_type": "markdown", - "id": "7ce7169a", + "id": "cee1f0d1", "metadata": {}, "source": [ "### Horizontal Bar Charts\n", @@ -1311,7 +1311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fa24a7f", + "id": "39f47017", "metadata": { "lines_to_next_cell": 0 }, @@ -1331,7 +1331,7 @@ }, { "cell_type": "markdown", - "id": "b1d83bbb", + "id": "5864df41", "metadata": {}, "source": [ "\n" @@ -1339,7 +1339,7 @@ }, { "cell_type": "markdown", - "id": "922eec42", + "id": "93d384ae", "metadata": {}, "source": [ "### Reference\n", @@ -1349,7 +1349,7 @@ }, { "cell_type": "markdown", - "id": "a16f80e7", + "id": "fb713672", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-alignment-chart.ipynb b/bio-alignment-chart.ipynb index 835731c1b..db881089b 100644 --- a/bio-alignment-chart.ipynb +++ b/bio-alignment-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c060ee5b", + "id": "034bad4a", "metadata": {}, "source": [ "## Alignment Viewer\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27a5052a", + "id": "5a9c1e44", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "7bdb1fb4", + "id": "9e9ee857", "metadata": {}, "source": [ "## Alignment Chart in dash_bio" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04289816", + "id": "07a0dd61", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "623fce51", + "id": "46059023", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-clustergram.ipynb b/bio-clustergram.ipynb index d815cd012..d5f10d4ba 100644 --- a/bio-clustergram.ipynb +++ b/bio-clustergram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4dbb5561", + "id": "3190ace2", "metadata": {}, "source": [ "## Default Clustergram\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23f9322d", + "id": "a2bfb68e", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "eb022516", + "id": "e0e9a634", "metadata": {}, "source": [ "## Dendrogram Cluster Colors/Line Widths\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03ee6ce0", + "id": "f5e5380b", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "7b9406ed", + "id": "94fb4bd5", "metadata": {}, "source": [ "## Relative Dendrogram Size\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b886e59d", + "id": "98a587dd", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "3503c9bd", + "id": "4b8fd915", "metadata": {}, "source": [ "## Clustergram with Dash" @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be3c2648", + "id": "e95f75a9", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "1f4784aa", + "id": "bea5295b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-manhattanplot.ipynb b/bio-manhattanplot.ipynb index 1188d16bb..264af5d1b 100644 --- a/bio-manhattanplot.ipynb +++ b/bio-manhattanplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "73545d89", + "id": "36a16542", "metadata": {}, "source": [ "## Manhattan Plot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4070e04", + "id": "9475e80d", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "06054d96", + "id": "8df7c392", "metadata": {}, "source": [ "## Highlighted points color, and colors of the suggestive line and the genome-wide line\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59acdc01", + "id": "213c5bba", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "a0430b07", + "id": "2b8b612f", "metadata": {}, "source": [ "## ManhattanPlot with Dash" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a00eb9da", + "id": "e11e85b9", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "59766770", + "id": "5e2155df", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bio-volcano-plot.ipynb b/bio-volcano-plot.ipynb index 16d5aa4e0..787720ca5 100644 --- a/bio-volcano-plot.ipynb +++ b/bio-volcano-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ce9721a0", + "id": "af8aad63", "metadata": {}, "source": [ "## VolcanoPlot\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2de0c9b", + "id": "83c69e29", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "42b8589e", + "id": "2e2327a7", "metadata": {}, "source": [ "## Point Sizes And Line Widths\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cecc7d94", + "id": "28d8e9fb", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "80df3751", + "id": "424e2293", "metadata": {}, "source": [ "## VolcanoPlot with Dash" @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47906492", + "id": "c5fe6c3c", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "ac96577d", + "id": "b057618c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/box-plots.ipynb b/box-plots.ipynb index 9e57492e3..8181b174e 100644 --- a/box-plots.ipynb +++ b/box-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6168179e", + "id": "e229ba91", "metadata": {}, "source": [ "A [box plot](https://en.wikipedia.org/wiki/Box_plot) is a statistical representation of the distribution of a variable through its quartiles. The ends of the box represent the lower and upper quartiles, while the median (second quartile) is marked by a line inside the box. For other statistical representations of numerical data, see [other statistical charts](https://plotly.com/python/statistical-charts/).\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "321a7e86", + "id": "3797733e", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "1d0f7ec0", + "id": "ec8f3033", "metadata": {}, "source": [ "If a column name is given as `x` argument, a box plot is drawn for each value of `x`." @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dba7ef79", + "id": "9dc7990a", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "6e07ddd5", + "id": "b665e0ec", "metadata": {}, "source": [ "### Box Plots in Dash\n", @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22ba5851", + "id": "48fe2656", "metadata": { "hide_code": true }, @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "b706eb39", + "id": "eb9924b7", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "f42fb9db", + "id": "5155a88b", "metadata": {}, "source": [ "### Display the underlying data\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb81eea5", + "id": "3adf0bf5", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "1aaa94bc", + "id": "fbafad0a", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f60cb5c", + "id": "4657921b", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "7e6d2bb3", + "id": "0db57e19", "metadata": {}, "source": [ "#### Difference Between Quartile Algorithms\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb80ff22", + "id": "de747562", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "7e67a375", + "id": "b3ed474f", "metadata": {}, "source": [ "#### Styled box plot\n", @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6921145b", + "id": "add2f996", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "82839001", + "id": "178fdc2d", "metadata": {}, "source": [ "## Box plot with go.Box\n", @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97959409", + "id": "48a80444", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "317175f5", + "id": "fbc188bf", "metadata": {}, "source": [ "### Basic Horizontal Box Plot" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a663add", + "id": "5169e939", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "24131ba2", + "id": "fa970b7c", "metadata": {}, "source": [ "### Box Plot That Displays The Underlying Data" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20093397", + "id": "bc089e20", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "b8b3e5fa", + "id": "78d88091", "metadata": {}, "source": [ "### Modifying The Algorithm For Computing Quartiles\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5636b7e5", + "id": "f02020f3", "metadata": {}, "outputs": [], "source": [ @@ -325,7 +325,7 @@ }, { "cell_type": "markdown", - "id": "bff83d39", + "id": "50629b1c", "metadata": {}, "source": [ "### Box Plot With Precomputed Quartiles\n", @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "143f6e00", + "id": "a301ba20", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "a0d90bce", + "id": "f7c7b3fb", "metadata": {}, "source": [ "### Colored Box Plot" @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b174c76a", + "id": "97cf2615", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "84c35a15", + "id": "810a0e8f", "metadata": {}, "source": [ "### Box Plot Styling Mean & Standard Deviation" @@ -395,7 +395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f529f34", + "id": "4b4f5344", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "0e1dca08", + "id": "e595ee21", "metadata": {}, "source": [ "### Styling Outliers\n", @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3720c81", + "id": "9fc56fb4", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ }, { "cell_type": "markdown", - "id": "16a0eef8", + "id": "cd8542fd", "metadata": {}, "source": [ "### Grouped Box Plots" @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cbad8fd", + "id": "7698a2dc", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "e00a89a8", + "id": "e1ab365e", "metadata": {}, "source": [ "### Grouped Horizontal Box Plot" @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc349b2d", + "id": "b18dce35", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "e8c0cb38", + "id": "4e77c558", "metadata": {}, "source": [ "### Rainbow Box Plots" @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27149cbd", + "id": "b990daed", "metadata": {}, "outputs": [], "source": [ @@ -631,7 +631,7 @@ }, { "cell_type": "markdown", - "id": "200d2b39", + "id": "ca071137", "metadata": {}, "source": [ "### Fully Styled Box Plots" @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53ca35d7", + "id": "46b74dd1", "metadata": {}, "outputs": [], "source": [ @@ -707,7 +707,7 @@ }, { "cell_type": "markdown", - "id": "aa3ab9f5", + "id": "11d7acbd", "metadata": {}, "source": [ "### Box Plot With Only Points\n", @@ -718,7 +718,7 @@ { "cell_type": "code", "execution_count": null, - "id": "080ef46c", + "id": "72435045", "metadata": {}, "outputs": [], "source": [ @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "1f64ee10", + "id": "a999bac4", "metadata": {}, "source": [ "#### Reference\n", @@ -740,7 +740,7 @@ }, { "cell_type": "markdown", - "id": "0d4d23cc", + "id": "9295626d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-charts.ipynb b/bubble-charts.ipynb index c34dd20b6..221aa8f29 100644 --- a/bubble-charts.ipynb +++ b/bubble-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "77b14cc9", + "id": "758273ea", "metadata": {}, "source": [ "## Bubble chart with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7804307", + "id": "13574219", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "e52cb0e9", + "id": "e86b408a", "metadata": {}, "source": [ "## Bubble Chart with plotly.graph_objects\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7c3ded9", + "id": "18469cac", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "dea13426", + "id": "2c420e53", "metadata": {}, "source": [ "### Setting Marker Size and Color" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f8aabb2", + "id": "1cc3576d", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "25bb4a03", + "id": "7994c3f4", "metadata": {}, "source": [ "### Scaling the Size of Bubble Charts\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b83b6d8d", + "id": "3b8bc92e", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "96516bcb", + "id": "a51ea9c7", "metadata": {}, "source": [ "### Hover Text with Bubble Charts" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95137e18", + "id": "165ec4f5", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "ad6bcf43", + "id": "b4ed6a06", "metadata": {}, "source": [ "### Bubble Charts with Colorscale" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6124bae9", + "id": "be7b8156", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "812fb927", + "id": "5bac0bc0", "metadata": {}, "source": [ "### Categorical Bubble Charts" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ad572e8", + "id": "744856c9", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "a70078bf", + "id": "1bf0e3bf", "metadata": {}, "source": [ "### Reference\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "4cb369e3", + "id": "a7c2d58e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bubble-maps.ipynb b/bubble-maps.ipynb index 0f40afc7a..ca8240c94 100644 --- a/bubble-maps.ipynb +++ b/bubble-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6c2ed82d", + "id": "9f7868a9", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1aab1f4", + "id": "f0d96f43", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "01028894", + "id": "b11154aa", "metadata": {}, "source": [ "### Bubble Map with animation" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de31a8ab", + "id": "7ee9217d", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "8722ac6a", + "id": "be1a6919", "metadata": {}, "source": [ "### Bubble Map with go.Scattergeo\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46679215", + "id": "3085b09d", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "2503b586", + "id": "185dc889", "metadata": {}, "source": [ "#### Ebola Cases in West Africa" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "266a7612", + "id": "17e60739", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "783125b2", + "id": "aa51df41", "metadata": {}, "source": [ "#### Reference\n", @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "181d8e69", + "id": "b5d8c6a8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/builtin-colorscales.ipynb b/builtin-colorscales.ipynb index f0d464195..4fab6f05d 100644 --- a/builtin-colorscales.ipynb +++ b/builtin-colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "17ea2bcc", + "id": "b8ecd01e", "metadata": {}, "source": [ "### Using Built-In Continuous Color Scales\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a5c00ea", + "id": "d9c9b898", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "fa01286d", + "id": "265489e5", "metadata": {}, "source": [ "Built-in color scales are stored as lists of CSS colors:" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38095c68", + "id": "9276c98c", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "427537ee", + "id": "a51eb4e9", "metadata": {}, "source": [ "### Continuous Color Scales in Dash\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8539d18e", + "id": "a4ee421c", "metadata": { "hide_code": true }, @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "54b1fbab", + "id": "0edf6466", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "d47aed08", + "id": "00d7474c", "metadata": {}, "source": [ "### Built-In Sequential Color scales\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56e575eb", + "id": "7b612930", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "c42e2722", + "id": "21bb5ff6", "metadata": {}, "source": [ "Note: `RdBu` was included in the `sequential` module by mistake, even though it is a diverging color scale.\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67177ac8", + "id": "a3953b0f", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "c03d4f88", + "id": "7c15b560", "metadata": {}, "source": [ "### Built-In Cyclical Color scales\n", @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af5f7f3f", + "id": "895b689e", "metadata": { "lines_to_next_cell": 2 }, @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "870bc0d3", + "id": "bebaf894", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/bullet-charts.ipynb b/bullet-charts.ipynb index 99021e2f9..e9c103c06 100644 --- a/bullet-charts.ipynb +++ b/bullet-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1c9dcff1", + "id": "9a65aa11", "metadata": {}, "source": [ "#### Basic Bullet Charts\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09169bac", + "id": "da1f3f3c", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "676849ce", + "id": "78ee0a92", "metadata": {}, "source": [ "#### Add Steps, and Threshold\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5254da2c", + "id": "8bed44c0", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "a40c9046", + "id": "b29ae351", "metadata": {}, "source": [ "#### Custom Bullet\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36521b4f", + "id": "1798390a", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "5507ed08", + "id": "6120ef8d", "metadata": {}, "source": [ "#### Multi Bullet\n", @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfa31935", + "id": "af120c0b", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "71b32970", + "id": "68dbf5b2", "metadata": {}, "source": [ "#### Reference\n", @@ -193,14 +193,14 @@ { "cell_type": "code", "execution_count": null, - "id": "141b131c", + "id": "cda99645", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "0d452bdb", + "id": "273856cc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/candlestick-charts.ipynb b/candlestick-charts.ipynb index e2e0e9dac..f256fe042 100644 --- a/candlestick-charts.ipynb +++ b/candlestick-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "658525d5", + "id": "2a21d086", "metadata": {}, "source": [ "The [candlestick chart](https://en.wikipedia.org/wiki/Candlestick_chart) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00a441c1", + "id": "954445ad", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "1f4e68b6", + "id": "1258123c", "metadata": {}, "source": [ "#### Candlestick without Rangeslider" @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4244507a", + "id": "6b27b3bb", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "e9657502", + "id": "deee5872", "metadata": {}, "source": [ "#### Candlestick in Dash\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd0cd809", + "id": "a735ae41", "metadata": { "hide_code": true }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "3ce2b3f3", + "id": "3e23c46e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "5451ae58", + "id": "34d0601d", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bba2f34", + "id": "895ea221", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "a50dc408", + "id": "3b5ab034", "metadata": {}, "source": [ "#### Custom Candlestick Colors" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72e29033", + "id": "fc4f6a7a", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ }, { "cell_type": "markdown", - "id": "c182304b", + "id": "ff0e7b0c", "metadata": {}, "source": [ "#### Simple Example with `datetime` Objects" @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "896bf8cf", + "id": "a6f453aa", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "c23dc177", + "id": "81e0d65e", "metadata": {}, "source": [ "#### Reference\n", @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "3c081507", + "id": "fd770034", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-contour.ipynb b/carpet-contour.ipynb index acc963a88..c01df7878 100644 --- a/carpet-contour.ipynb +++ b/carpet-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cc35a220", + "id": "020bc23e", "metadata": {}, "source": [ "### Basic Carpet Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "effa9dc5", + "id": "3527240f", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "a5ebd8dd", + "id": "2ba7552f", "metadata": {}, "source": [ "### Add Contours" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fa823bd", + "id": "4fd2e65a", "metadata": { "inputHidden": false, "outputHidden": false @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "4fd4c38a", + "id": "d3485507", "metadata": {}, "source": [ "### Add Multiple Traces" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af29ad36", + "id": "afd0d6f5", "metadata": { "inputHidden": false, "outputHidden": false @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "318aae2d", + "id": "f469271b", "metadata": {}, "source": [ "### Reference\n", @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "459a54d3", + "id": "06c83837", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-plot.ipynb b/carpet-plot.ipynb index ca18a1428..4bb18e95d 100644 --- a/carpet-plot.ipynb +++ b/carpet-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "035ceacf", + "id": "e78ac83a", "metadata": {}, "source": [ "### Set X and Y Coordinates\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d585a0fb", + "id": "898cdfc4", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "8cd2619d", + "id": "b7293fa9", "metadata": {}, "source": [ "### Add Parameter Values\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e48d3a78", + "id": "bf1f8937", "metadata": { "inputHidden": false, "outputHidden": false @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "b1897e5c", + "id": "f402961f", "metadata": {}, "source": [ "### Add A and B axis\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90841d03", + "id": "50111585", "metadata": { "inputHidden": false, "outputHidden": false @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "20d87ddd", + "id": "cadf51f7", "metadata": {}, "source": [ "### Alternate input format\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27e7b6f9", + "id": "f5f79e7d", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "17aa2438", + "id": "48d7020c", "metadata": {}, "source": [ "### Cheater plot layout" @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "ba36e2a4", + "id": "26d20b12", "metadata": {}, "source": [ "The layout of cheater plots is not unique and depends upon the `cheaterslope` and axis `cheatertype` parameters. If `x` is not specified, each row of the `x` array is constructed based on the the formula `a + cheaterslope * b`, where `a` and `b` are either the value or the integer index of `a` and `b` respectively, depending on the corresponding axis `cheatertype`. Although the layout of the axis below is different than the plots above, it represents the same data as the axes above." @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "450d6163", + "id": "59a8a27f", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "75d3a68b", + "id": "912b5df6", "metadata": {}, "source": [ "### Style A and B axis" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27a99b77", + "id": "794b4ae4", "metadata": { "inputHidden": false, "outputHidden": false @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "1e3900e1", + "id": "1521ee60", "metadata": {}, "source": [ "### Add Points and Contours\n", @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "dee2d0a5", + "id": "371d324a", "metadata": {}, "source": [ "### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "4501a430", + "id": "97d231dd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/carpet-scatter.ipynb b/carpet-scatter.ipynb index 12685bd3b..e49da152e 100644 --- a/carpet-scatter.ipynb +++ b/carpet-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2b409b42", + "id": "800a6add", "metadata": {}, "source": [ "### Basic Carpet Plot" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c39e8327", + "id": "b747f760", "metadata": { "inputHidden": false, "outputHidden": false @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "4720ea7d", + "id": "70cda0ae", "metadata": {}, "source": [ "### Add Carpet Scatter Trace" @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7258756", + "id": "c6eafac4", "metadata": { "inputHidden": false, "outputHidden": false @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "21780234", + "id": "53edc2ce", "metadata": {}, "source": [ "### Add Multiple Scatter Traces" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d6be570", + "id": "2bb5c916", "metadata": { "inputHidden": false, "outputHidden": false @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "79f18f53", + "id": "037e93dc", "metadata": {}, "source": [ "### Reference" @@ -203,7 +203,7 @@ }, { "cell_type": "markdown", - "id": "83766706", + "id": "d3e5fc0c", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattercarpet/ for more information and chart attribute options!" @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "8dd06714", + "id": "cb6f617f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/categorical-axes.ipynb b/categorical-axes.ipynb index 28ed47902..8cf38efe1 100644 --- a/categorical-axes.ipynb +++ b/categorical-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a1515439", + "id": "3d1de547", "metadata": {}, "source": [ "\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbec68c3", + "id": "bd9951f3", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "b910dd6b", + "id": "7eddfb31", "metadata": {}, "source": [ "### Categorical Axes and Trace Types\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab2e78a7", + "id": "0fa8f8da", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "56bdbb1a", + "id": "b00f5797", "metadata": {}, "source": [ "[Box plots]() and [violin plots]() are often shown with one categorical and one continuous axis." @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b024ca8", + "id": "7bf9ad36", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f7cdf26", + "id": "fb2b0cf4", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "3d0db0fd", + "id": "6cf5aa6f", "metadata": {}, "source": [ "### Controlling the Category Order with Plotly Express\n", @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3144c7e8", + "id": "d584348d", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "579e18f4", + "id": "1d38484d", "metadata": {}, "source": [ "### Automatically Sorting Categories by Name or Total Value\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d421f420", + "id": "90b9a954", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "6cf0855c", + "id": "11ea1120", "metadata": {}, "source": [ "This example orders the categories **by total value** with `categoryorder: 'total descending'`" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e63ddbfd", + "id": "011ca160", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "a5a731e5", + "id": "0f7d5bfd", "metadata": {}, "source": [ "This example shows how to control category order when using `plotly.graph_objects` by defining `categoryorder` to \"array\" to derive the ordering from the attribute `categoryarray`." @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5b2cc14", + "id": "7425ce07", "metadata": { "lines_to_next_cell": 0 }, @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "a42feee6", + "id": "9b6015df", "metadata": {}, "source": [ "### Gridlines, Ticks and Tick Labels" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "c98fc68a", + "id": "829c2ce4", "metadata": {}, "source": [ "By default, gridlines and ticks are not shown on categorical axes but they can be activated:" @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3532c026", + "id": "ffadf297", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "1f11f69b", + "id": "efbebe0d", "metadata": {}, "source": [ "By default, ticks and gridlines appear on the categories but the `tickson` attribute can be used to move them to the category boundaries:" @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f172692", + "id": "3ab6fdc6", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "2e24ad26", + "id": "85acfa6f", "metadata": {}, "source": [ "### Multi-categorical Axes\n", @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0cbfc26", + "id": "8b2308a8", "metadata": { "lines_to_next_cell": 0 }, @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "ef9d3d9e", + "id": "1838adef", "metadata": {}, "source": [ "### Reference\n", @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "93d4e0f2", + "id": "682798ed", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/choropleth-maps.ipynb b/choropleth-maps.ipynb index b46c5dc4f..756b61ecc 100644 --- a/choropleth-maps.ipynb +++ b/choropleth-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4d4b5840", + "id": "3a956a88", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).\n", @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60d3f375", + "id": "070732c1", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "e6884c4b", + "id": "1055b157", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb6d589c", + "id": "c55b0a99", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "cb58d0dc", + "id": "eafe420d", "metadata": {}, "source": [ "### Choropleth map using GeoJSON\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16bce5d1", + "id": "bbfa0d29", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "33c1cd98", + "id": "8d29bf27", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9eca91f3", + "id": "cd52af8f", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "2ef6a87b", + "id": "40de78a5", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron.\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5bec732", + "id": "0fc4dd16", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "0b589a49", + "id": "a2efe2d6", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4387d305", + "id": "065fa049", "metadata": { "hide_code": true }, @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "0b5e254f", + "id": "a0542fce", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "35e67253", + "id": "b6924150", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2eedfced", + "id": "a77fb36a", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "16f29a93", + "id": "07d5d536", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c770933d", + "id": "561fade6", "metadata": { "lines_to_next_cell": 2 }, @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "faca2fcf", + "id": "1aaf547a", "metadata": {}, "source": [ "### Using Built-in Country and State Geometries\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71779de4", + "id": "fa83eff6", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "809f23b2", + "id": "d518a333", "metadata": {}, "source": [ "To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes):" @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a86393f", + "id": "d188d265", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "33ecba8e", + "id": "d1a3aea9", "metadata": {}, "source": [ "### Choropleth Maps with go.Choropleth\n", @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a76c3612", + "id": "86326221", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "083e0144", + "id": "c081b39e", "metadata": {}, "source": [ "#### Customize choropleth chart" @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de9a94ce", + "id": "c6d9fc4e", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "35360ffb", + "id": "b7b17d5c", "metadata": {}, "source": [ "#### World Choropleth Map" @@ -437,7 +437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d4ef819", + "id": "5ae7de1f", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "d797e7f8", + "id": "0ffd39c3", "metadata": {}, "source": [ "#### County Choropleth Figure Factory\n", @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01f6ec73", + "id": "c1f9250e", "metadata": {}, "outputs": [], "source": [ @@ -531,7 +531,7 @@ }, { "cell_type": "markdown", - "id": "e29434fc", + "id": "a29d00df", "metadata": {}, "source": [ "#### Reference\n", @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "5d9d18f1", + "id": "528af9fa", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/click-events.ipynb b/click-events.ipynb index ceb42c241..e197b7e41 100644 --- a/click-events.ipynb +++ b/click-events.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f9a04654", + "id": "4789e09e", "metadata": {}, "source": [ "#### Update Points Using a Click Callback" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4a2717d", + "id": "d7774359", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "12ba8cc7", + "id": "7f78ebf4", "metadata": {}, "source": [ "" @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "11fe4ff7", + "id": "594b9e3d", "metadata": {}, "source": [ "#### Reference" @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "3e32bc08", + "id": "e432a09d", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b273f0d7", + "id": "641962c7", "metadata": { "lines_to_next_cell": 2 }, @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "6af60b75", + "id": "49a877a3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/colorscales.ipynb b/colorscales.ipynb index 22c4380a8..d17a9cd9d 100644 --- a/colorscales.ipynb +++ b/colorscales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "df441cc5", + "id": "a23d68aa", "metadata": {}, "source": [ "### Continuous vs Discrete Color\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51ccd434", + "id": "e3f2fcbe", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "d0ef801b", + "id": "f2a1cfca", "metadata": {}, "source": [ "Converting this column to strings is very straightforward:" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c9b0ceb", + "id": "6dcc1920", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "45b5b348", + "id": "284e3858", "metadata": {}, "source": [ "If you have stringified numbers you can convert back just as easily:" @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a43dbfbe", + "id": "53346524", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "9382843d", + "id": "44c7e0ee", "metadata": {}, "source": [ "### Colorscales in Dash\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb205289", + "id": "c7ca3b64", "metadata": { "hide_code": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "bb1c8c86", + "id": "8f6f0000", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "23744e57", + "id": "da004289", "metadata": {}, "source": [ "### Color Scales in Plotly Express\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69a80627", + "id": "745ce404", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "f26aeb2c", + "id": "b07718c5", "metadata": {}, "source": [ "It is also possible to specify color scales by name. Here is an example that specifies the `Inferno` color scale by name, as a string" @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3aec6f9", + "id": "e9f59cf8", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "2cb2da36", + "id": "02a2ac16", "metadata": {}, "source": [ "### Reversing a built-in color scale\n", @@ -187,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de03c54f", + "id": "b38f8e6d", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f777ac5", + "id": "85279d10", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "9a9c0666", + "id": "3bcf31cf", "metadata": {}, "source": [ "### Explicitly Constructing a Color scale\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d952414b", + "id": "d018fdd4", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "cf98d2a5", + "id": "45512f3b", "metadata": {}, "source": [ "The example above provided a list of CSS colors to construct a scale, which inferred the reference points to be evenly spaced, but specific reference points can be provided as well. The following example has the same result:" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13944495", + "id": "d105e2e6", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "2f064036", + "id": "10dd482a", "metadata": {}, "source": [ "### Constructing a Discrete or Discontinuous Color Scale\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf41d221", + "id": "44f1bdbc", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "29edcd60", + "id": "5ea493e3", "metadata": {}, "source": [ "### Explicitly setting a Color Range\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5cff787", + "id": "bdd8ce9c", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "57305eec", + "id": "4bd4da0e", "metadata": {}, "source": [ "### Setting the Midpoint of a Color Range for a Diverging Color scale\n", @@ -327,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dfa06f9", + "id": "e5dbe516", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "fad8b88c", + "id": "cbb080de", "metadata": {}, "source": [ "### Hiding or Customizing the Plotly Express Color Bar\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524c32e8", + "id": "c4fa8e5c", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "e55541f7", + "id": "02a1e8e4", "metadata": {}, "source": [ "You can also configure the title, size, placement and tick marks and labels on a color bar:" @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86e8fb3f", + "id": "d79688da", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "2275a741", + "id": "12a8f2ca", "metadata": {}, "source": [ "### Customizing Tick Text on Discrete Color Bars\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3ee6115", + "id": "ece3c9af", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "33e51038", + "id": "9c186a4b", "metadata": {}, "source": [ "### Customizing Tick Text on Logarithmic Color Bars\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1a4332a", + "id": "e3bcdaec", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "b3e630f9", + "id": "74a97c04", "metadata": {}, "source": [ "### Using Label Aliases on Colorbars\n", @@ -480,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1539f567", + "id": "286d58e6", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "32916909", + "id": "4825f63d", "metadata": {}, "source": [ "### Custom Discretized Heatmap Color scale with Graph Objects" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37426bc0", + "id": "d17e02fa", "metadata": {}, "outputs": [], "source": [ @@ -582,7 +582,7 @@ }, { "cell_type": "markdown", - "id": "b3a2456e", + "id": "d28a4b75", "metadata": {}, "source": [ "### Color scale for Scatter Plots with Graph Objects" @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b06f911", + "id": "ed1a03a4", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "01fdf392", + "id": "a59e8d34", "metadata": {}, "source": [ "### Color scale for Contour Plot with Graph Objects" @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "487321c4", + "id": "15dc87b2", "metadata": {}, "outputs": [], "source": [ @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "d2cf5c61", + "id": "2a18fec6", "metadata": {}, "source": [ "### Custom Heatmap Color scale with Graph Objects" @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4d45e52", + "id": "586c0aca", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "12cd4b5b", + "id": "9c0051f2", "metadata": {}, "source": [ "### Setting the Midpoint of a Diverging Color scale with Graph Objects\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "959d0173", + "id": "cba8d5a5", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "6e0cbf7c", + "id": "09fb6d85", "metadata": {}, "source": [ "The heatmap chart uses [marker.zmid](https://plotly.com/python/reference/scatter/#scatter-marker-zmid) attribute to set the mid-point of the color domain." @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14393beb", + "id": "b1147d41", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "e8f762c6", + "id": "a02230fa", "metadata": {}, "source": [ "### Custom Contour Plot Color scale with Graph Objects" @@ -764,7 +764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ff408f8", + "id": "b4f64480", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "d012e114", + "id": "d1419654", "metadata": {}, "source": [ "### Custom Color bar Title, Labels, and Ticks with Graph Objects\n", @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b5fd2d2", + "id": "06d08260", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "520d2f11", + "id": "0a0ad3b9", "metadata": {}, "source": [ "### Color Bar Displayed Horizontally\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc35d822", + "id": "68f17fb1", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "d2897fc7", + "id": "69a4a763", "metadata": {}, "source": [ "### Sharing a Color Axis with Graph Objects\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a14d34c", + "id": "aeb8dbaa", "metadata": {}, "outputs": [], "source": [ @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "6072d60b", + "id": "812cfb87", "metadata": {}, "source": [ "### Logarithmic Color scale with Graph Objects" @@ -916,7 +916,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2a7c67d", + "id": "670a3bae", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "e1fdd34d", + "id": "340d1ecc", "metadata": {}, "source": [ "### Positioning Colorbars\n", @@ -962,7 +962,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19974d5b", + "id": "9521b047", "metadata": {}, "outputs": [], "source": [ @@ -991,7 +991,7 @@ }, { "cell_type": "markdown", - "id": "aeab83a3", + "id": "fca0f0bd", "metadata": {}, "source": [ "### Reference\n", @@ -1001,7 +1001,7 @@ }, { "cell_type": "markdown", - "id": "1c761089", + "id": "9896da28", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/cone-plot.ipynb b/cone-plot.ipynb index 673b1419d..b6c922c42 100644 --- a/cone-plot.ipynb +++ b/cone-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8fb22a9e", + "id": "456ebebc", "metadata": {}, "source": [ "A cone plot is the 3D equivalent of a 2D [quiver plot](/python/quiver-plots/), i.e., it represents a 3D vector field using cones to represent the direction and norm of the vectors. 3-D coordinates are given by `x`, `y` and `z`, and the coordinates of the vector field by `u`, `v` and `w`.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1ebd674", + "id": "1ae9fe57", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "d239ec98", + "id": "7dd3dc0a", "metadata": {}, "source": [ "### Multiple 3D Cones" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57b8f735", + "id": "8d9c1271", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "3f56b696", + "id": "68a60b48", "metadata": {}, "source": [ "### 3D Cone Lighting" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c38229a3", + "id": "736b4d7f", "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "24e6b6fe", + "id": "35532c46", "metadata": {}, "source": [ "### 3D Cone Vortex" @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcb7c2fc", + "id": "5acc4963", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "700e651e", + "id": "8d9e9a75", "metadata": {}, "source": [ "### Sizemode\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55a3a72a", + "id": "fabb8966", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "a1f840b0", + "id": "9a6600f7", "metadata": {}, "source": [ "#### Reference\n", @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "d9db5e9e", + "id": "3953dd95", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/configuration-options.ipynb b/configuration-options.ipynb index 60798f38d..0224b69da 100644 --- a/configuration-options.ipynb +++ b/configuration-options.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7812ace0", + "id": "4f1537a7", "metadata": {}, "source": [ "## Configuration Options\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55a18f40", + "id": "c85eb1d8", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "fe088e72", + "id": "ab5d3f31", "metadata": {}, "source": [ "### Turning Off Responsiveness\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6108fa21", + "id": "570d3ccf", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "3b8a7660", + "id": "14005a43", "metadata": {}, "source": [ "### Making A Static Chart" @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43580d02", + "id": "41e3a21c", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "ea092923", + "id": "a0996f6e", "metadata": {}, "source": [ "### Forcing The Modebar to Always Be Visible\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0b2401b", + "id": "3fe45293", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "9a0ebdf4", + "id": "e6cd0384", "metadata": {}, "source": [ "### Preventing the Modebar from Appearing\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed493379", + "id": "d6813cc9", "metadata": { "lines_to_next_cell": 2 }, @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "d5a2c624", + "id": "b283a0b1", "metadata": {}, "source": [ "### Hiding the Plotly Logo on the Modebar" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3220f2c9", + "id": "c649d2ac", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "ee19980b", + "id": "40a19cf0", "metadata": {}, "source": [ "### Customizing Modebar \"Download Plot\" Button\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0bce1b8", + "id": "6a50cf6c", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "7e5e82ab", + "id": "9a38e81a", "metadata": {}, "source": [ "Figures can be set to download at the currently-rendered size by setting `height` and `width` to `None`:\n" @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aed97567", + "id": "cb6440bf", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "eb32141c", + "id": "93c19168", "metadata": {}, "source": [ "### Removing Modebar Buttons\n", @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4a272df", + "id": "6b48d75e", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ }, { "cell_type": "markdown", - "id": "833c8b94", + "id": "da20d455", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bdc35f8", + "id": "331a0cfd", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "49c45f73", + "id": "813aa051", "metadata": {}, "source": [ "### Add optional shape-drawing buttons to modebar\n", @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b3d5d51", + "id": "a2fbb7bc", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "7fec56d1", + "id": "87608f07", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17fa53c4", + "id": "ac54ba87", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "19519f00", + "id": "594dc79e", "metadata": {}, "source": [ "### Double-Click Delay\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "904e6210", + "id": "f67b7bfe", "metadata": {}, "outputs": [], "source": [ @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "ac1f59af", + "id": "1e45b83b", "metadata": {}, "source": [ "### Disabling Buttons for Specific Axes\n", @@ -460,7 +460,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4e27495", + "id": "13ae3cd2", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "a3115e48", + "id": "9e8b3d01", "metadata": {}, "source": [ "### Configuring Figures in Dash Apps\n", @@ -509,7 +509,7 @@ }, { "cell_type": "markdown", - "id": "36b216e8", + "id": "6b018492", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/continuous-error-bars.ipynb b/continuous-error-bars.ipynb index 2d445114c..dee132f53 100644 --- a/continuous-error-bars.ipynb +++ b/continuous-error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5708dd88", + "id": "6e017770", "metadata": {}, "source": [ "Continuous error bands are a graphical representation of error or uncertainty as a shaded region around a main trace, rather than as discrete whisker-like error bars. They can be implemented in a manner similar to [filled area plots](/python/filled-area-plots/) using `scatter` traces with the `fill` attribute.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5359f880", + "id": "a87180ff", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "c21a432f", + "id": "977cba87", "metadata": {}, "source": [ "#### Filling between two traces\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24f2cb99", + "id": "bbd4d01e", "metadata": { "lines_to_next_cell": 2 }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "a117408f", + "id": "43d4497d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/contour-plots.ipynb b/contour-plots.ipynb index a8eff7134..6dca57064 100644 --- a/contour-plots.ipynb +++ b/contour-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e3b8f719", + "id": "2160cef0", "metadata": {}, "source": [ "### Basic Contour Plot\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c57da4c", + "id": "262b542a", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "0ccbdde0", + "id": "5e0f4984", "metadata": {}, "source": [ "### Setting X and Y Coordinates in a Contour Plot ###" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d5bfbf5", + "id": "fbbe1d1f", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "6c84ed66", + "id": "3c828b22", "metadata": {}, "source": [ "### Colorscale for Contour Plot ###" @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "328ade4f", + "id": "85e81cbe", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "61c0be9f", + "id": "6b242ad5", "metadata": {}, "source": [ "### Customizing Size and Range of a Contour Plot's Contours ###" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abea0191", + "id": "75a743a2", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "d8a16183", + "id": "6624521b", "metadata": {}, "source": [ "### Customizing Spacing Between X and Y Axis Ticks ###" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aed02ec8", + "id": "c8ecefc2", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "b67c71ac", + "id": "12a625e0", "metadata": {}, "source": [ "### Connect the Gaps Between None Values in the Z Matrix ###" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ac511d7", + "id": "ac3116b1", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "d36ead3b", + "id": "a277935f", "metadata": {}, "source": [ "### Smoothing the Contour lines ###" @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0f7dff2", + "id": "cc5b976f", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "704bdbbc", + "id": "40feed66", "metadata": {}, "source": [ "### Smooth Contour Coloring ###" @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0a7845d", + "id": "5e3847a6", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "4e6473c5", + "id": "6e144154", "metadata": {}, "source": [ "### Contour Line Labels ###" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2c5a103", + "id": "4f7f60bf", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "54b5b6ee", + "id": "bed34ff6", "metadata": {}, "source": [ "### Contour Lines ###" @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "228b2ca5", + "id": "78a42431", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "13d2ac02", + "id": "21fc542b", "metadata": {}, "source": [ "### Custom Contour Plot Colorscale ###" @@ -344,7 +344,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95a79804", + "id": "1dafd937", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "93643d85", + "id": "db7d6b3e", "metadata": {}, "source": [ "### Color Bar Title ###" @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "375397ed", + "id": "a4af11c2", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "fbf8f552", + "id": "b4020016", "metadata": {}, "source": [ "### Color Bar Size for Contour Plots\n", @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23f34075", + "id": "cbd1e662", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ }, { "cell_type": "markdown", - "id": "83e098f8", + "id": "d9341dac", "metadata": {}, "source": [ "### Styling Color Bar Ticks for Contour Plots" @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46d4eb42", + "id": "e563701b", "metadata": {}, "outputs": [], "source": [ @@ -477,7 +477,7 @@ }, { "cell_type": "markdown", - "id": "9f650575", + "id": "57cf6e40", "metadata": {}, "source": [ "#### Reference\n", @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "c89a9130", + "id": "787f66d0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/county-choropleth.ipynb b/county-choropleth.ipynb index bd553cf46..dee5af9f6 100644 --- a/county-choropleth.ipynb +++ b/county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d378a551", + "id": "8e2e1b1c", "metadata": {}, "source": [ "### Deprecation warning" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "4afdfcbb", + "id": "e4e8ab40", "metadata": {}, "source": [ "This page describes a [legacy \"figure factory\" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth)." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "ae8c4c09", + "id": "bc02b468", "metadata": {}, "source": [ "#### Required Packages\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8c7158a", + "id": "766b3e0e", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "9f6e145a", + "id": "66c7cecb", "metadata": {}, "source": [ "If you are using Windows, follow this post to properly install geopandas and dependencies: http://geoffboeing.com/2014/09/using-geopandas-windows/. If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:" @@ -50,7 +50,7 @@ }, { "cell_type": "raw", - "id": "ea86b517", + "id": "297020db", "metadata": {}, "source": [ "conda install plotly\n", @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "50fe6460", + "id": "4fbc3284", "metadata": {}, "source": [ "#### FIPS and Values\n", @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "85fdc602", + "id": "863febda", "metadata": {}, "source": [ "#### Simple Example\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb06cfb0", + "id": "04c7bef7", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "640e3a50", + "id": "7cdb712c", "metadata": {}, "source": [ "#### Change the Scope\n", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4e2a8bb", + "id": "98f5e018", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "10a6bc9f", + "id": "9193655d", "metadata": {}, "source": [ "#### Single State" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4634d914", + "id": "11378ed0", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "d73f25ab", + "id": "cf78dbd2", "metadata": {}, "source": [ "#### Multiple States" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1465ea4", + "id": "1b01602f", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "1ac4f316", + "id": "051ef4f7", "metadata": {}, "source": [ "#### Simplify County, State Lines\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f19f42a5", + "id": "22cabca0", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "5f41f240", + "id": "241bfc74", "metadata": {}, "source": [ "#### The Entire USA" @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f566fb0", + "id": "38e6c0cc", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "2b045b07", + "id": "39b54869", "metadata": {}, "source": [ "Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)\n", @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "46a033dd", + "id": "0dac8b5e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/creating-and-updating-figures.ipynb b/creating-and-updating-figures.ipynb index 1760017f0..5bc7aeedd 100644 --- a/creating-and-updating-figures.ipynb +++ b/creating-and-updating-figures.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fb3a7bd5", + "id": "53830d8e", "metadata": {}, "source": [ "The `plotly` Python package exists to create, manipulate and [render](/python/renderers/) graphical figures (i.e. charts, plots, maps and diagrams) represented by [data structures also referred to as figures](/python/figure-structure/). The rendering process uses the [Plotly.js JavaScript library](https://plotly.com/javascript/) under the hood although Python developers using this module very rarely need to interact with the Javascript library directly, if ever. Figures can be represented in Python either as dicts or as instances of the `plotly.graph_objects.Figure` class, and are serialized as text in [JavaScript Object Notation (JSON)](https://json.org/) before being passed to Plotly.js.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85d6d5a3", + "id": "afea74dd", "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "62ce44f8", + "id": "db7c9b9b", "metadata": {}, "source": [ "### Figures as Graph Objects\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "1328213b", + "id": "8d0c419e", "metadata": {}, "source": [ "Below you can find an example of one way that the figure in the example above could be specified using a graph object instead of a dictionary." @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a31657c1", + "id": "462c42e7", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "b90c398c", + "id": "71f57e86", "metadata": {}, "source": [ "You can also create a graph object figure from a dictionary representation by passing the dictionary to the `go.Figure` constructor." @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a148635", + "id": "b7e0447b", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "a687041d", + "id": "ad5beb8c", "metadata": {}, "source": [ "##### Converting Graph Objects To Dictionaries and JSON\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76935a95", + "id": "e0bc77d0", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "3908238e", + "id": "91969787", "metadata": {}, "source": [ "### Representing Figures in Dash\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "736f6d14", + "id": "c5eded88", "metadata": { "hide_code": true }, @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "ab7f0f83", + "id": "d49960b4", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "8d2cfa8e", + "id": "2019e68c", "metadata": {}, "source": [ "### Creating Figures\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "511bac7c", + "id": "c587e845", "metadata": {}, "source": [ "#### Plotly Express\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ba9626f", + "id": "07e19c31", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "a0be7bfd", + "id": "bac6994e", "metadata": {}, "source": [ "#### Graph Objects `Figure` Constructor\n", @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "022962a5", + "id": "8df128dc", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "bf754a63", + "id": "ad9eaf52", "metadata": {}, "source": [ "#### Figure Factories\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba7778c5", + "id": "92ccdb3d", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +278,7 @@ }, { "cell_type": "markdown", - "id": "04e380bd", + "id": "4718ad42", "metadata": {}, "source": [ "#### Make Subplots\n", @@ -289,7 +289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eacb0244", + "id": "9faaabff", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "9838345b", + "id": "944e0c4f", "metadata": {}, "source": [ "### Updating Figures\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8594d132", + "id": "3cc20d6b", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "001e995a", + "id": "d811d6fb", "metadata": {}, "source": [ "You can also add traces to a figure produced by a figure factory or Plotly Express." @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96c979d2", + "id": "6762dd2a", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "eef8c5af", + "id": "5ac263ba", "metadata": {}, "source": [ "#### Adding Traces To Subplots\n", @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "249c90f6", + "id": "9453ea34", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "6eb47fc1", + "id": "e1356339", "metadata": {}, "source": [ "This also works for figures created by Plotly Express using the `facet_row` and or `facet_col` arguments." @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0133a528", + "id": "53dcc7b0", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ }, { "cell_type": "markdown", - "id": "b7745a9d", + "id": "e24261b0", "metadata": {}, "source": [ "#### Add Trace Convenience Methods\n", @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9dd07dc", + "id": "207e8cd9", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "79eedbee", + "id": "11df3a09", "metadata": {}, "source": [ "#### Magic Underscore Notation\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec811fc7", + "id": "993765f8", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "92709525", + "id": "710af771", "metadata": {}, "source": [ "With magic underscore notation, you can accomplish the same thing by passing the figure constructor a keyword argument named `layout_title_text`, and by passing the `go.Scatter` constructor a keyword argument named `line_color`." @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a35ad05", + "id": "fd5ebd5c", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "fc6a7174", + "id": "d5d1d9c3", "metadata": {}, "source": [ "Magic underscore notation is supported throughout the graph objects API, and it can often significantly simplify operations involving deeply nested properties.\n", @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42d72c0e", + "id": "e1a11eba", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +553,7 @@ }, { "cell_type": "markdown", - "id": "b0a87ee8", + "id": "a0aa0550", "metadata": {}, "source": [ "Note that the following `update_layout()` operations are equivalent:" @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ce47051", + "id": "4993690f", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "7376b566", + "id": "4635d3cf", "metadata": {}, "source": [ "#### Updating Traces\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36a96d72", + "id": "2dd24206", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "ed070146", + "id": "388cfb7d", "metadata": {}, "source": [ "Note that both `scatter` and `bar` traces have a `marker.color` property to control their coloring. Here is an example of using `update_traces()` to modify the color of all traces." @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "197f7ddd", + "id": "9416186b", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "5516ba87", + "id": "92219224", "metadata": {}, "source": [ "The `update_traces()` method supports a `selector` argument to control which traces should be updated. Only traces with properties that match the selector will be updated. Here is an example of using a selector to only update the color of the `bar` traces." @@ -676,7 +676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aaa8396d", + "id": "65ab9949", "metadata": {}, "outputs": [], "source": [ @@ -708,7 +708,7 @@ }, { "cell_type": "markdown", - "id": "1cfc940b", + "id": "6907bab6", "metadata": {}, "source": [ "Magic underscore notation can be used in the selector to match nested properties. Here is an example of updating the color of all traces that were formally colored `\"MediumPurple\"`." @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d4d6f14", + "id": "35b8c0c1", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "9fca6684", + "id": "30375296", "metadata": {}, "source": [ "For figures with subplots, the `update_traces()` method also supports `row` and `col` arguments to control which traces should be updated. Only traces in the specified subplot row and column will be updated. Here is an example of updating the color of all traces in the second subplot column." @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88e50979", + "id": "fa6fc982", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "ba1a04d5", + "id": "b0be7d1c", "metadata": {}, "source": [ "The `update_traces()` method can also be used on figures produced by figure factories or Plotly Express. Here's an example of updating the regression lines produced by Plotly Express to be dotted." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7dfc7dc", + "id": "c1fe914b", "metadata": {}, "outputs": [], "source": [ @@ -820,7 +820,7 @@ }, { "cell_type": "markdown", - "id": "ad119fa3", + "id": "48387653", "metadata": {}, "source": [ "### Overwrite Existing Properties When Using Update Methods\n", @@ -833,7 +833,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89156bd9", + "id": "4d816aee", "metadata": {}, "outputs": [], "source": [ @@ -849,7 +849,7 @@ }, { "cell_type": "markdown", - "id": "0d4d9046", + "id": "69e53663", "metadata": {}, "source": [ "#### Conditionally Updating Traces\n", @@ -866,7 +866,7 @@ { "cell_type": "code", "execution_count": null, - "id": "631509ed", + "id": "5269adc4", "metadata": {}, "outputs": [], "source": [ @@ -887,7 +887,7 @@ }, { "cell_type": "markdown", - "id": "5f03737a", + "id": "e84731cc", "metadata": {}, "source": [ "#### Updating Figure Axes\n", @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dddf2c0", + "id": "21475d92", "metadata": {}, "outputs": [], "source": [ @@ -917,7 +917,7 @@ }, { "cell_type": "markdown", - "id": "4b6b5921", + "id": "ffff3d31", "metadata": {}, "source": [ "There are also `for_each_xaxis()` and `for_each_yaxis()` methods that are analogous to the `for_each_trace()` method described above. For non-cartesian subplot types (e.g. polar), there are additional `update_{type}` and `for_each_{type}` methods (e.g. `update_polar()`, `for_each_polar()`).\n", @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12013c85", + "id": "965dae9c", "metadata": {}, "outputs": [], "source": [ @@ -967,7 +967,7 @@ }, { "cell_type": "markdown", - "id": "5624c154", + "id": "c6990e9f", "metadata": {}, "source": [ "#### Property Assignment\n", @@ -978,7 +978,7 @@ { "cell_type": "code", "execution_count": null, - "id": "255973d5", + "id": "a9113ce6", "metadata": {}, "outputs": [], "source": [ @@ -990,7 +990,7 @@ }, { "cell_type": "markdown", - "id": "8c80b090", + "id": "ab568d07", "metadata": {}, "source": [ "And here is an example of updating the bar outline using property assignment." @@ -999,7 +999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54718bea", + "id": "44f4d28b", "metadata": { "lines_to_next_cell": 2 }, @@ -1017,7 +1017,7 @@ }, { "cell_type": "markdown", - "id": "c35f67fc", + "id": "2e196c6a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/custom-buttons.ipynb b/custom-buttons.ipynb index ba66596b0..986f18107 100644 --- a/custom-buttons.ipynb +++ b/custom-buttons.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1fd26b45", + "id": "065db5af", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "c880aded", + "id": "d28021ee", "metadata": {}, "source": [ "#### Restyle Button\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "941ef5b7", + "id": "db756d35", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "ffaa7b1b", + "id": "12949efd", "metadata": {}, "source": [ "**Update Several Data Attributes**
\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "776f1da6", + "id": "ab59fddc", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "c720be5d", + "id": "7eb76a66", "metadata": {}, "source": [ "#### Relayout Button\n", @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2acac3f", + "id": "f5491dd3", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "17292886", + "id": "74c904e4", "metadata": {}, "source": [ "#### Update Button\n", @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "334043df", + "id": "7233b97c", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "4bc92aaa", + "id": "e527c8dc", "metadata": {}, "source": [ "#### Animate Button\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "04230bd4", + "id": "4c3e0400", "metadata": {}, "source": [ "#### Reference\n", @@ -503,7 +503,7 @@ }, { "cell_type": "markdown", - "id": "2f9a44c4", + "id": "5bdb8dda", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dash.ipynb b/dash.ipynb index 437f7fe72..95bba9733 100644 --- a/dash.ipynb +++ b/dash.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1bb31f35", + "id": "7dc8fe0b", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "f5239b0f", + "id": "2497dd4f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dendrogram.ipynb b/dendrogram.ipynb index e24d2f465..770156d2e 100644 --- a/dendrogram.ipynb +++ b/dendrogram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "910c259c", + "id": "af6b3b43", "metadata": {}, "source": [ "#### Basic Dendrogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52a553fa", + "id": "37dfeaf5", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "5bb73323", + "id": "15cb19ba", "metadata": {}, "source": [ "#### Set Color Threshold" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44a49151", + "id": "caefd316", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "67416456", + "id": "d5bb2552", "metadata": {}, "source": [ "#### Set Orientation and Add Labels" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "038e2873", + "id": "43f668be", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "dc0a7265", + "id": "20e9d0aa", "metadata": {}, "source": [ "#### Plot a Dendrogram with a Heatmap\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a52e9adc", + "id": "980232ca", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "744b4aae", + "id": "41bf2eec", "metadata": {}, "source": [ "### Reference\n", @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "b07029c2", + "id": "95748447", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/density-heatmaps.ipynb b/density-heatmaps.ipynb index 316e0b170..69126935a 100644 --- a/density-heatmaps.ipynb +++ b/density-heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "870e7ae0", + "id": "86537530", "metadata": {}, "source": [ "### Density map with `plotly.express`\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f86c7e8e", + "id": "ac26946f", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "797de2e1", + "id": "6bc81641", "metadata": {}, "source": [ "### Density map with `plotly.graph_objects`\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f77c0aef", + "id": "43cede00", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "e7fc4715", + "id": "65053726", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "4cd5eb13", + "id": "70c5306b", "metadata": {}, "source": [ "#### Stamen Terrain base map with Mapbox (Stadia Maps token needed): density heatmap with `plotly.express`\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "89f53c4e", + "id": "16efc307", "metadata": {}, "source": [ "#### Reference\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "d95c5024", + "id": "6c2f1ccc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/discrete-color.ipynb b/discrete-color.ipynb index f932af0be..d595c4ec9 100644 --- a/discrete-color.ipynb +++ b/discrete-color.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "627471cb", + "id": "67aa81a4", "metadata": {}, "source": [ "### Discrete vs Continuous Color\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10aa9f58", + "id": "03fcb056", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "9cd8e82c", + "id": "f063f206", "metadata": {}, "source": [ "The `size` column, however, contains numbers:" @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8460dabb", + "id": "db77de95", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "8d66643d", + "id": "3f49e26a", "metadata": {}, "source": [ "Converting this column to strings is very straightforward, but note that the ordering in the legend is not sequential by default (see below for how to control discrete order):" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74377585", + "id": "0fd50598", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "0e3ef6f0", + "id": "dc5c8d5f", "metadata": {}, "source": [ "Converting a string column to a numeric one is also quite straightforward:" @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32b1caf7", + "id": "51b8cb8d", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "e3c58d42", + "id": "d2b587db", "metadata": {}, "source": [ "### Discrete Colors in Dash\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34fef4b1", + "id": "856a77da", "metadata": { "hide_code": true }, @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "8e4e473b", + "id": "4eb54dca", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "1ac4f305", + "id": "7b67aec3", "metadata": {}, "source": [ "### Color Sequences in Plotly Express\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdb31f37", + "id": "6350cb1e", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "4e46bc49", + "id": "8dfe1674", "metadata": {}, "source": [ "Color sequences in the `px.colors.qualitative` module are stored as lists of CSS colors:" @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3d98b22", + "id": "f99e4570", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "cd376ea1", + "id": "11401a1b", "metadata": {}, "source": [ "Here is an example that creates a scatter plot using Plotly Express, with points colored using the built-in qualitative `G10` color sequence." @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45afb2a2", + "id": "2a7e3136", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "ea7e3a1f", + "id": "3bd9ada2", "metadata": {}, "source": [ "### Explicitly Constructing a Color Sequence\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "844051ec", + "id": "e82acd44", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "3689accc", + "id": "ccb6d4da", "metadata": {}, "source": [ "**_Warning_**: If your color sequence has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:" @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "383c7020", + "id": "24e19226", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +268,7 @@ }, { "cell_type": "markdown", - "id": "958ad083", + "id": "56a7484f", "metadata": {}, "source": [ "### Directly Mapping Colors to Data Values\n", @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3986044", + "id": "3d87fb2f", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "e727b05c", + "id": "80d37e65", "metadata": {}, "source": [ "If your data set already contains valid CSS colors which you wish to use directly, you can pass the special value `\"identity\"` to `color_discrete_map`, in which case the legend is hidden by default, and the color does not appear in the hover label:" @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac68ea6a", + "id": "3476e134", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "eb296b17", + "id": "55c9acf0", "metadata": {}, "source": [ "### Controlling Discrete Color Order\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77c9fd90", + "id": "505d4c51", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe50fe71", + "id": "34d1d179", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "02aaa235", + "id": "587eaa8f", "metadata": {}, "source": [ "### Using Sequential Scales as Discrete Sequences\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7926934", + "id": "a277b6c6", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "0882b85a", + "id": "aae078f2", "metadata": {}, "source": [ "This works because just like in `px.colors.qualitative`, all [built-in continuous color scales](/python/builtin-colorscales/) are stored as lists of CSS colors:" @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05135323", + "id": "be9d1014", "metadata": { "lines_to_next_cell": 2 }, @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "61137dcf", + "id": "81297e26", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/distplot.ipynb b/distplot.ipynb index c80894f09..e113e45a9 100644 --- a/distplot.ipynb +++ b/distplot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8a86e526", + "id": "e8a16d5d", "metadata": {}, "source": [ "## Combined statistical representations with px.histogram\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35c9d237", + "id": "aa41af91", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ea40eae", + "id": "88ef8ed5", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "e1b98c2a", + "id": "e22c16f4", "metadata": {}, "source": [ "### Combined statistical representations in Dash\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b28659a", + "id": "11a79eb7", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "d578c9a0", + "id": "b1dcf2c2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "e99a0749", + "id": "2933833e", "metadata": {}, "source": [ "## Combined statistical representations with distplot figure factory\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3979ddc", + "id": "18bad584", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "695a1634", + "id": "36f558b5", "metadata": {}, "source": [ "#### Plot Multiple Datasets" @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9d927f6", + "id": "3c9cfc17", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "7808ec43", + "id": "90496d1b", "metadata": {}, "source": [ "#### Use Multiple Bin Sizes\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ba46941", + "id": "38a2e3bf", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "23dc156a", + "id": "2224e515", "metadata": {}, "source": [ "#### Customize Rug Text, Colors & Title" @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c5f30ec", + "id": "b4b7cd1e", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "384c7c73", + "id": "8d09b4b2", "metadata": {}, "source": [ "#### Plot Normal Curve" @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c5af094", + "id": "30dcc5e1", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "e0332002", + "id": "ea577f03", "metadata": {}, "source": [ "#### Plot Only Curve and Rug" @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6117af2d", + "id": "5e5813ce", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "35be9fba", + "id": "fef337ea", "metadata": {}, "source": [ "#### Plot Only Hist and Rug" @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73557b70", + "id": "13224d1d", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "41bc8516", + "id": "eb404a2f", "metadata": {}, "source": [ "#### Plot Hist and Rug with Different Bin Sizes" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c93a8d4", + "id": "d0d550e2", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "f3a9be4b", + "id": "c19e33c6", "metadata": {}, "source": [ "#### Plot Only Hist and Curve" @@ -374,7 +374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1809f910", + "id": "8a5ea96c", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "f4dd47aa", + "id": "aa2bdb5d", "metadata": {}, "source": [ "#### Distplot with Pandas" @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5474ee85", + "id": "ab572beb", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "ec7838da", + "id": "a259c559", "metadata": {}, "source": [ "#### Reference" @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "cff875f7", + "id": "1e8f4cb0", "metadata": {}, "source": [ "For more info on `ff.create_distplot()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_distplot.html)\n" @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "ef892a87", + "id": "c0e7f1cf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dot-plots.ipynb b/dot-plots.ipynb index 818c404c2..9ebd7d3c9 100644 --- a/dot-plots.ipynb +++ b/dot-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6dcbe6fa", + "id": "80cf3b4f", "metadata": {}, "source": [ "#### Basic Dot Plot\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b1ec2ce", + "id": "8d3d9c2c", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5936345f", + "id": "be058b46", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c46ee2e", + "id": "20ff788b", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "d46e0436", + "id": "5463b410", "metadata": {}, "source": [ "#### Styled Categorical Dot Plot" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d194622", + "id": "625bac66", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "f9183734", + "id": "60c4cc01", "metadata": {}, "source": [ "### Reference\n", @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "16f039a8", + "id": "49be1ef2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dropdowns.ipynb b/dropdowns.ipynb index 54543c4e5..a32be6d2f 100644 --- a/dropdowns.ipynb +++ b/dropdowns.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4c351edf", + "id": "1056a749", "metadata": {}, "source": [ "#### Methods\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "311e8ec8", + "id": "0fd83970", "metadata": {}, "source": [ "## Restyle Dropdown\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1ffaec8", + "id": "88c9bd4a", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "a722e79c", + "id": "3aaf449b", "metadata": {}, "source": [ "### Update Several Data Attributes\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4296f6b3", + "id": "e5497307", "metadata": {}, "outputs": [], "source": [ @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "fb1cc227", + "id": "85f65675", "metadata": {}, "source": [ "## Relayout Dropdown\n", @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7273f3a4", + "id": "0ae35495", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "02350bc1", + "id": "55da8c8c", "metadata": {}, "source": [ "### Update Dropdown\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9726d0cd", + "id": "23652ee7", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "feed5d66", + "id": "28bc4f7b", "metadata": {}, "source": [ "### Graph Selection Dropdowns in Jinja\n", @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "157f673c", + "id": "a884182b", "metadata": {}, "source": [ "\n", @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "4d4ad7b0", + "id": "8b16fdbf", "metadata": {}, "source": [ "#### Reference\n", @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "52b2de6e", + "id": "80e49e33", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/dumbbell-plots.ipynb b/dumbbell-plots.ipynb index 707a108c8..80c96a309 100644 --- a/dumbbell-plots.ipynb +++ b/dumbbell-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "210f65b1", + "id": "c5a49479", "metadata": {}, "source": [ "## Basic Dumbbell Plot" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "7e4b03f0", + "id": "e4aa6fb2", "metadata": {}, "source": [ "Dumbbell plots are useful for demonstrating change between two sets of data points, for example, the population change for a selection of countries for two different years.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a23dd1aa", + "id": "0d85d289", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "75c4d386", + "id": "98393b5e", "metadata": {}, "source": [ "## Dumbbell Plot with Arrow Markers\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d5a8d07", + "id": "6a3887b6", "metadata": { "lines_to_next_cell": 2 }, @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "0c6a0fd5", + "id": "66bdbb5f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ecdf-plots.ipynb b/ecdf-plots.ipynb index 09ac2ed53..aeac3c6a0 100644 --- a/ecdf-plots.ipynb +++ b/ecdf-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "faccf6dc", + "id": "27be32ca", "metadata": {}, "source": [ "### Overview\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4474493", + "id": "b1b69c56", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "1ad7f3e6", + "id": "58e1aeec", "metadata": {}, "source": [ "Providing multiple columns leverage's Plotly Express' [wide-form data support](https://plotly.com/python/wide-form/) to show multiple variables on the same plot." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aa1cc6d", + "id": "6d59a82c", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "2ef1ff13", + "id": "a347a00d", "metadata": {}, "source": [ "It is also possible to map another variable to the color dimension of a plot." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56115a52", + "id": "ce651e79", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "73221eb1", + "id": "d98159ca", "metadata": {}, "source": [ "### Configuring the Y axis\n", @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1125508a", + "id": "c052748d", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "de990e5f", + "id": "abdab6fb", "metadata": {}, "source": [ "If a `y` value is provided, the Y axis is set to the sum of `y` rather than counts." @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "604a3727", + "id": "c69f2822", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "eead349b", + "id": "acb043ca", "metadata": {}, "source": [ "### Reversed and Complementary CDF plots\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3998cb39", + "id": "40f61a35", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "78c1bcc3", + "id": "10d5beab", "metadata": {}, "source": [ "In `reversed` mode, the right-most point is at 1 (or the total count/sum, depending on `ecdfnorm`) and the left-most point is above 0." @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d760ca79", + "id": "7887a616", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "33343ea5", + "id": "d434458a", "metadata": {}, "source": [ "In `complementary` mode, the right-most point is at 0 and no points are at 1 (or the total count/sum) per the definition of the CCDF as 1-ECDF, which has no point at 0." @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08684165", + "id": "669edd9b", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "e9c52ca4", + "id": "f04c22ec", "metadata": {}, "source": [ "### Orientation\n", @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb126618", + "id": "cc6192c6", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "6d4b0e29", + "id": "f4626053", "metadata": {}, "source": [ "### Markers and/or Lines\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1308a37", + "id": "463c0f1a", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9466ee62", + "id": "40ce2f3f", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "e1c9fac8", + "id": "584de510", "metadata": {}, "source": [ "### Marginal Plots\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26d26945", + "id": "455680c9", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97614b22", + "id": "565e1b0e", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "11cea6b0", + "id": "f0e43336", "metadata": {}, "source": [ "### Facets\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "369d2603", + "id": "0da6639e", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08d5315a", + "id": "21eac759", "metadata": { "lines_to_next_cell": 2 }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "5cb05a6c", + "id": "a1b1e78d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/error-bars.ipynb b/error-bars.ipynb index 9a8cf5a34..c9b35a987 100644 --- a/error-bars.ipynb +++ b/error-bars.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "17913385", + "id": "853312a0", "metadata": {}, "source": [ "### Error Bars with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cca33bab", + "id": "7910be38", "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "73d60ea8", + "id": "6eeeaed3", "metadata": {}, "source": [ "#### Asymmetric Error Bars with Plotly Express" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "124ac0cf", + "id": "7c06c87f", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "1ae9aee5", + "id": "a3fa1b6a", "metadata": {}, "source": [ "### Error Bars with graph_objects\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "304023b4", + "id": "9f95b50a", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "3d94a552", + "id": "ca5ca4f2", "metadata": {}, "source": [ "#### Asymmetric Error Bars" @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67cb9561", + "id": "19298d2d", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "531bc248", + "id": "9a1910b9", "metadata": {}, "source": [ "#### Error Bars as a Percentage of the y Value" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a309bcb", + "id": "e4f24a4e", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "b07c5442", + "id": "b82fb51a", "metadata": {}, "source": [ "#### Asymmetric Error Bars with a Constant Offset" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f82832d2", + "id": "3aef7652", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "4647befd", + "id": "17cf6ab5", "metadata": {}, "source": [ "#### Horizontal Error Bars" @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70c102a2", + "id": "c3749648", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ }, { "cell_type": "markdown", - "id": "6a3aca71", + "id": "dcfa61b6", "metadata": {}, "source": [ "#### Bar Chart with Error Bars" @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88b5e643", + "id": "1940659e", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "b97ce141", + "id": "e521732c", "metadata": {}, "source": [ "#### Colored and Styled Error Bars" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42743087", + "id": "279c2bcf", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "e5cce8d4", + "id": "aa1dafc3", "metadata": {}, "source": [ "#### Reference\n", @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "1f00e37b", + "id": "f5604a81", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/facet-plots.ipynb b/facet-plots.ipynb index 9f1198941..f7ce57497 100644 --- a/facet-plots.ipynb +++ b/facet-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "998e97ab", + "id": "0ebafa02", "metadata": {}, "source": [ "### Facet and Trellis Plots\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecce31a4", + "id": "2bc01d60", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "b39fd3a2", + "id": "6371abae", "metadata": {}, "source": [ "### Bar Chart Row Facets\n", @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3587333f", + "id": "93302c50", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "9d618d28", + "id": "8c19a53e", "metadata": {}, "source": [ "### Wrapping Column Facets\n", @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d91c5a7", + "id": "631d83e9", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "c59dad6d", + "id": "bbc72e90", "metadata": {}, "source": [ "### Histogram Facet Grids" @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c6090a1", + "id": "863e01a1", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "8ca73dc4", + "id": "c8aa8715", "metadata": {}, "source": [ "### Choropleth Column Facets\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ceea4edf", + "id": "d06cea61", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "de26bc2b", + "id": "179387fe", "metadata": {}, "source": [ "### Adding Lines and Rectangles to Facet Plots\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6535b4f3", + "id": "e631be6f", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "20fbc530", + "id": "0a5bab18", "metadata": {}, "source": [ "### Adding the Same Trace to All Facets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07c138b0", + "id": "d55377e1", "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "markdown", - "id": "53719df1", + "id": "3967356d", "metadata": {}, "source": [ "### Facets With Independent Axes\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1a54e26", + "id": "39636571", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97b6a73d", + "id": "5219fd1b", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "0caf7974", + "id": "1b8454ee", "metadata": {}, "source": [ "### Customizing Subplot Figure Titles\n", @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb2981be", + "id": "7caa1ac9", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "5f7ede8b", + "id": "de60d00b", "metadata": {}, "source": [ "### Controlling Facet Ordering\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57a524c2", + "id": "12bf2086", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "12084b6d", + "id": "512964c5", "metadata": {}, "source": [ "### Controlling Facet Spacing\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c0ac572", + "id": "3c894f8b", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "3e64ba1e", + "id": "337fdc3a", "metadata": {}, "source": [ "### Synchronizing axes in subplots with `matches`\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9c695a5", + "id": "4d4d8a89", "metadata": { "lines_to_next_cell": 2 }, @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "39123d4d", + "id": "9216388c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factories.ipynb b/figure-factories.ipynb index 3a65ef1d1..02ce50fed 100644 --- a/figure-factories.ipynb +++ b/figure-factories.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c18078aa", + "id": "800c50eb", "metadata": {}, "source": [ "#### `plotly.figure_factory`\n", @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "b0d20f28", + "id": "75de7861", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-subplots.ipynb b/figure-factory-subplots.ipynb index f2100e40f..dde6d408d 100644 --- a/figure-factory-subplots.ipynb +++ b/figure-factory-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d2e5d7a6", + "id": "2a3365fb", "metadata": {}, "source": [ "#### Plotly's Figure Factory Module\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "e91cbf84", + "id": "0c0a39cb", "metadata": {}, "source": [ "#### Vertical Figure Factory Charts\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f469eff6", + "id": "ca224c69", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "43b09aea", + "id": "4c2beb1e", "metadata": {}, "source": [ "Edit the figures' x and y axes attributes to create subplots:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0c52617", + "id": "e7631197", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "8d64a481", + "id": "11337b2b", "metadata": {}, "source": [ "Combine the data and layout objects to create a figure" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4cd3cd4", + "id": "7ad3a0f9", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "0efaaa05", + "id": "9a0914fa", "metadata": {}, "source": [ "#### Horizontal Table and Chart" @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91385cd6", + "id": "72228420", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "8f69af68", + "id": "8a1e0894", "metadata": {}, "source": [ "#### Vertical Table and Chart" @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c4c7963", + "id": "9dae0527", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "f5a64e05", + "id": "10823876", "metadata": {}, "source": [ "#### Reference\n", @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "cd140734", + "id": "0fd9d54e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-factory-table.ipynb b/figure-factory-table.ipynb index 098a12b4b..12d6de2cf 100644 --- a/figure-factory-table.ipynb +++ b/figure-factory-table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "440a8fe0", + "id": "22d115a8", "metadata": {}, "source": [ "Tables can be created using a [`table` trace type](/python/table/), or by using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89d186f0", + "id": "f4dce066", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "09c4d65f", + "id": "8597b9dd", "metadata": {}, "source": [ "#### Add Links" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b7a7dce", + "id": "bab54c3a", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "80aacb7f", + "id": "c8f16c95", "metadata": {}, "source": [ "### Use LaTeX" @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b302e22", + "id": "6fc196d4", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "a5b8fe15", + "id": "52f63077", "metadata": {}, "source": [ "### Use a Pandas Dataframe" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c39c609", + "id": "30c49f8e", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "5ccaa3d8", + "id": "1f235a1a", "metadata": {}, "source": [ "### Modify Row Height\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72019ea4", + "id": "b91c3239", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "31682e32", + "id": "d328ee98", "metadata": {}, "source": [ "### Custom Table Colors\n" @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d5e40cf", + "id": "7408b6d8", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "a3c7e6e4", + "id": "1df38845", "metadata": {}, "source": [ "### Custom Font Colors" @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0b32286", + "id": "13c4acfa", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "4ee2d489", + "id": "dd69b1b7", "metadata": {}, "source": [ "### Change Font Size" @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3701aa1f", + "id": "868bb462", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "19bd802f", + "id": "e0eced37", "metadata": {}, "source": [ "#### Tables with Graphs" @@ -259,7 +259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75c1c373", + "id": "c7723de5", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "377abbe7", + "id": "c7ffdb08", "metadata": { "lines_to_next_cell": 2 }, @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "697aa340", + "id": "25866998", "metadata": {}, "source": [ "#### Reference\n", @@ -367,7 +367,7 @@ }, { "cell_type": "markdown", - "id": "6dab7097", + "id": "041269e8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-introspection.ipynb b/figure-introspection.ipynb index 626a0ac0e..9701b8aa5 100644 --- a/figure-introspection.ipynb +++ b/figure-introspection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e3b47c1c", + "id": "85a3a636", "metadata": {}, "source": [ "### The Figure Lifecycle\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "5ee0ba2a", + "id": "b55c0b74", "metadata": {}, "source": [ "### Introspecting Plotly Express Figures\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dd924e3", + "id": "4f3e890a", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "264626ae", + "id": "ed3f7bf7", "metadata": {}, "source": [ "We can learn more about the attributes Plotly Express has set for us with the Python `help()` function:" @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "596b3092", + "id": "a83b72fa", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "e40fceab", + "id": "858d57c4", "metadata": {}, "source": [ "### Accessing Javascript-Computed Defaults\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99aa7466", + "id": "0d02a6b9", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "439941aa", + "id": "47301056", "metadata": {}, "source": [ "Let's print this figure to see the very small JSON object that is passed to Plotly.js as input:" @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a2b9338", + "id": "86b38346", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "d758b668", + "id": "78c84804", "metadata": {}, "source": [ "Now let's look at the \"full\" figure after Plotly.js has computed the default values for every necessary attribute.\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32f4fcd1", + "id": "700c0818", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "4c1d66fc", + "id": "8d6f5141", "metadata": {}, "source": [ "As you can see, Plotly.js does a lot of work filling things in for us! Let's look at the examples described at the top of the page of static and dynamic defaults. If we look just at `layout.font` and `layout.xaxis.range` we can see that the static default font size is 12 and that the dynamic default range is computed to be a bit beyond the data range which was 10-20:" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3789c611", + "id": "3362da1e", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "a5bb8c05", + "id": "037d0ffb", "metadata": {}, "source": [ "### Learning About Attributes" @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "9e25ce92", + "id": "a86479c2", "metadata": {}, "source": [ "What else can we use this `full_fig` for? Let's start by looking at the first entry of the `data`" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b98cbd36", + "id": "27fa896f", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "b202a4dd", + "id": "a3558543", "metadata": {}, "source": [ "We see that this is an instance of `go.Scatter` (as expected, given the input) and that it has an attribute we've maybe never heard of called `cliponaxis` which by default seems to be set to `True` in this case. Let's find out more about this attribute using the built-in Python `help()` function" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d56e7f0a", + "id": "cc27a3b9", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "9a2c66f3", + "id": "6f566232", "metadata": {}, "source": [ "Aha! This explains why in our original figure above, the text was cut off by the edge of the plotting area! Let's try forcing that to `False`, and let's also use the attribute `textposition` which we see in the full figure is by default set to `\"middle center\"` to get our text off of our markers:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d67c0b86", + "id": "06f2cfe6", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "a3a9453b", + "id": "f5924aac", "metadata": {}, "source": [ "We can use this technique (of making a figure, and querying Plotly.js for the \"full\" version of that figure, and then exploring the attributes that are automatically set for us) to learn more about the range of possibilities that the figure schema makes available. We can drill down into `layout` attributes also:" @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "628151b2", + "id": "93ef00a7", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "205a20a2", + "id": "2e807812", "metadata": {}, "source": [ "### More about Layout\n", @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ccd3c10", + "id": "a3314ba6", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "a1f4de1d", + "id": "e4a0b17f", "metadata": {}, "source": [ "If I then set `showrivers=True` and re-query the full figure, I see that new keys have appeared in the `layout.geo` object for `rivercolor` and `riverwidth`, showing the dynamic nature of these defaults." @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65acecf5", + "id": "b88603fe", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "e5a1514b", + "id": "8d11b9fd", "metadata": {}, "source": [ "### Reference\n", @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3d17285", + "id": "b12f6a24", "metadata": { "lines_to_next_cell": 2 }, @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "abc14cd4", + "id": "a729a80c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-labels.ipynb b/figure-labels.ipynb index aab564678..748549080 100644 --- a/figure-labels.ipynb +++ b/figure-labels.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "67226107", + "id": "d3dcbb32", "metadata": {}, "source": [ "### Automatic Labelling with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96507ca7", + "id": "a93c07a4", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f13ee046", + "id": "94e24896", "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "e86bde9d", + "id": "8b8752ce", "metadata": {}, "source": [ "### Global and Local Font Specification\n", @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06dd97cf", + "id": "c4255195", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "27042c32", + "id": "344962df", "metadata": {}, "source": [ "### Set Automargin on the Plot Title\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4bfe3a8", + "id": "4b7b07b3", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "1ac535eb", + "id": "ad283589", "metadata": {}, "source": [ "### Fonts and Labels in Dash\n", @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "730e837b", + "id": "b4bc8c0f", "metadata": { "hide_code": true }, @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "20fabc09", + "id": "89fdb268", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "a37c5ac7", + "id": "4aac742a", "metadata": {}, "source": [ "### Manual Labelling with Graph Objects\n", @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e7b27fa", + "id": "d269fbe5", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "e730c8d5", + "id": "c8ecd422", "metadata": {}, "source": [ "### Configuring Font Variant, Style, and Weight\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd927f0a", + "id": "d31c5f17", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "7054de45", + "id": "0b83179f", "metadata": {}, "source": [ "The configuration of the legend is discussed in detail in the [Legends](/python/legend/) page.\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f86d5d45", + "id": "44a37631", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ }, { "cell_type": "markdown", - "id": "2200a2a6", + "id": "05eeaaf9", "metadata": {}, "source": [ "### Adding a Plot Subtitle\n", @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "742b6dc1", + "id": "4cbae90d", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "c9994d1f", + "id": "a6d3850e", "metadata": {}, "source": [ "#### Reference\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "084ad1d7", + "id": "db09e6d9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figure-structure.ipynb b/figure-structure.ipynb index c7056ac73..141039dd1 100644 --- a/figure-structure.ipynb +++ b/figure-structure.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e0c80e4e", + "id": "ed0226aa", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab5a1fbd", + "id": "73cdc28b", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "f89300d5", + "id": "3c43df98", "metadata": {}, "source": [ "### Accessing figure structures in Dash\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d682143", + "id": "9a5955ad", "metadata": { "hide_code": true }, @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "a2ccfa3c", + "id": "c5dc2137", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "4be7424b", + "id": "17e3bee4", "metadata": {}, "source": [ "### Figures as Trees of Attributes\n", @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "d0fb55b1", + "id": "b178dbf2", "metadata": {}, "source": [ "### The Top-Level `layout` Attribute\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc4ed5d6", + "id": "74311261", "metadata": { "lines_to_next_cell": 2 }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "20df417b", + "id": "21cda877", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget-app.ipynb b/figurewidget-app.ipynb index 69366b3fe..b56460e1c 100644 --- a/figurewidget-app.ipynb +++ b/figurewidget-app.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "defa1f6c", + "id": "57ccd481", "metadata": {}, "source": [ "#### NYC Flights Database" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fabd6a5", + "id": "74d16fa8", "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "50f1b02c", + "id": "65415f33", "metadata": {}, "source": [ "We'll be making an application to take a look at delays from all flights out of NYC in the year 2013." @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0ba2742", + "id": "b858884a", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "646b518d", + "id": "930ce3f0", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "e1a183ca", + "id": "f2db9505", "metadata": {}, "source": [ "Let's get the set of all the `airlines`, so that we can type the right things into the search box later." @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bfe40fe", + "id": "f913137e", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "7cb54a07", + "id": "76bbacd6", "metadata": {}, "source": [ "Let's assign the widgets that we're going to be using in our app. In general all these widgets will be used to filter the data set, and thus what we visualize." @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a92e7ef0", + "id": "d6fff98d", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "df3f9bb7", + "id": "2e0b73eb", "metadata": {}, "source": [ "Let now write a function that will handle the input from the widgets, and alter the state of the graph." @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1efa4c50", + "id": "34a2c847", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "adecfa86", + "id": "9a2840bf", "metadata": {}, "source": [ "Time to try the app out!!" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abdbb0ea", + "id": "9f0fd908", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e56ec5e", + "id": "1ccb72b9", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "5d467196", + "id": "cb6245d2", "metadata": {}, "source": [ "#### Reference" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a531166", + "id": "605f4008", "metadata": { "lines_to_next_cell": 2 }, @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "7a9ae87c", + "id": "522220d5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/figurewidget.ipynb b/figurewidget.ipynb index 56734321e..5fa90ae8d 100644 --- a/figurewidget.ipynb +++ b/figurewidget.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "542e051c", + "id": "2573b896", "metadata": {}, "source": [ "The Plotly FigureWidget allows you to add Plotly charts as interactive widgets in Jupyter and other compatible notebooks. To use the FigureWidget, you'll need to install `anywidget`: " @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c9b890b", + "id": "9e4a6c5e", "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "fc2470b7", + "id": "df7add8e", "metadata": {}, "source": [ "#### Create a Simple FigureWidget\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66fd5264", + "id": "9421cb31", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "46f859c2", + "id": "faa75e6e", "metadata": {}, "source": [ "" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "d39b9d5e", + "id": "78c0aeed", "metadata": {}, "source": [ "Add traces or update the layout and then watch the output above update in real time." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5546609", + "id": "ee8ec241", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "490a9474", + "id": "de7e5e12", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1317c42", + "id": "751f1f58", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "459bd53a", + "id": "34495e92", "metadata": {}, "source": [ "" @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "ac265561", + "id": "95234060", "metadata": {}, "source": [ "#### Update the Data and the Layout" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed5aba18", + "id": "3e217c7d", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b208f62e", + "id": "82508d66", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3604df4", + "id": "e73c3382", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "a008d24d", + "id": "46749200", "metadata": {}, "source": [ "#### Construct a FigureWidget from a Figure graph object" @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "2caceb27", + "id": "f9f4ac0c", "metadata": {}, "source": [ "A standard `Figure` object can be passed to the `FigureWidget` constructor." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "796a5ee6", + "id": "4efd77c2", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "28e47968", + "id": "d500168b", "metadata": {}, "source": [ "#### Reference" @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "47a5f25b", + "id": "060d2def", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples." @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9071552f", + "id": "c3d2aec9", "metadata": { "lines_to_next_cell": 2 }, @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "4629ff20", + "id": "9ba73314", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-plots.ipynb b/filled-area-plots.ipynb index 2dbcfa40c..edc908ae6 100644 --- a/filled-area-plots.ipynb +++ b/filled-area-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a7c36528", + "id": "5542c4e3", "metadata": {}, "source": [ "This example shows how to fill the area enclosed by traces.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f5a9249", + "id": "b2133485", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "3a36a9fc", + "id": "6b8e73ca", "metadata": {}, "source": [ "## Filled area plot in Dash\n", @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e53df734", + "id": "8bdfcf83", "metadata": { "hide_code": true }, @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "175072cd", + "id": "25a6bcd7", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "b4e7b63d", + "id": "c0720d3b", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa31334e", + "id": "3a48d086", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "72b3cf1a", + "id": "4d397d34", "metadata": {}, "source": [ "### Filled area chart with plotly.graph_objects\n", @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5285bff", + "id": "47e663a5", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "2e4a49af", + "id": "20aeb51b", "metadata": {}, "source": [ "#### Overlaid Area Chart Without Boundary Lines" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb9936d1", + "id": "96396678", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "1d945d7c", + "id": "e19f6f37", "metadata": {}, "source": [ "#### Interior Filling for Area Chart" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80ff40a9", + "id": "1a1e59f9", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "06db1d9d", + "id": "bf03ac62", "metadata": {}, "source": [ "#### Gradient Fill\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "577c260a", + "id": "90956253", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "2e6b7e4b", + "id": "22fff60a", "metadata": {}, "source": [ "#### Stacked Area Chart\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62911a17", + "id": "323cc489", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "5b9fbcda", + "id": "5421788c", "metadata": {}, "source": [ "### Stacked Area Chart with Normalized Values" @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a861586b", + "id": "b698e074", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "c86643a4", + "id": "169083be", "metadata": {}, "source": [ "#### Select Hover Points" @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bfe5693", + "id": "20c4ae35", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "b0ddde05", + "id": "26fdc724", "metadata": {}, "source": [ "#### Reference\n", @@ -383,7 +383,7 @@ }, { "cell_type": "markdown", - "id": "02261183", + "id": "e9c515d2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/filled-area-tile-maps.ipynb b/filled-area-tile-maps.ipynb index 2da8345fd..e53f3f5a8 100644 --- a/filled-area-tile-maps.ipynb +++ b/filled-area-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f73bee22", + "id": "ef15e7e4", "metadata": {}, "source": [ "There are three different ways to show a filled area on a tile-based map:\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f14775a6", + "id": "f925ad89", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "5844dd54", + "id": "e70c54fa", "metadata": {}, "source": [ "### Multiple Filled Areas with a `Scattermap` trace\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b1965dc", + "id": "d2126749", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "01e16407", + "id": "7ea4e968", "metadata": {}, "source": [ "### GeoJSON Layers\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c4e0618", + "id": "b3e73548", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "36a619a6", + "id": "3336e313", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "ae83577d", + "id": "ad47765b", "metadata": {}, "source": [ "#### Reference\n", @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "015268bc", + "id": "494d4bd4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/funnel-charts.ipynb b/funnel-charts.ipynb index e77727452..cde5b2cf1 100644 --- a/funnel-charts.ipynb +++ b/funnel-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d8d640ef", + "id": "ce019e3e", "metadata": {}, "source": [ "### Introduction\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4ac04e0", + "id": "4035a304", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "e08efa78", + "id": "1abdc29e", "metadata": {}, "source": [ "### Stacked Funnel Plot with plotly.express" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0b4ae3f", + "id": "4807496e", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "d32613f5", + "id": "b6f0955c", "metadata": {}, "source": [ "### Basic Funnel Chart with graph_objects trace go.Funnel\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f72e702d", + "id": "419e6871", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "cba67b35", + "id": "778d7e22", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44b4b29c", + "id": "24f4d2a1", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "0a8255f8", + "id": "11bb7db4", "metadata": {}, "source": [ "### Stacked Funnel Plot with go.Funnel" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e431f4b1", + "id": "755aa19e", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "e6ae7aec", + "id": "c2d3f40a", "metadata": {}, "source": [ "### Basic Area Funnel Plot with plotly.express\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "636015c9", + "id": "7e28f0ae", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "691575e6", + "id": "6a0a826f", "metadata": {}, "source": [ "### Basic Area Funnel Plot with go.Funnelarea\n", @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75b89ae4", + "id": "67436b38", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "1bd1841d", + "id": "be421f30", "metadata": {}, "source": [ "#### Set Marker Size and Color in Area Funnel Plots" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15e8821b", + "id": "e6d5e614", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "f7189258", + "id": "aac20018", "metadata": {}, "source": [ "#### Multiple Area Funnels" @@ -246,7 +246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "593beb84", + "id": "e12f14e0", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "dba1003b", + "id": "d5a573be", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06759ba3", + "id": "6526b443", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "f4a49734", + "id": "5ecfbee0", "metadata": {}, "source": [ "#### Reference\n", @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "12234029", + "id": "a4322f3d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gantt.ipynb b/gantt.ipynb index 7f2b65bb6..5a8643552 100644 --- a/gantt.ipynb +++ b/gantt.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2782d034", + "id": "a4d7d6a8", "metadata": {}, "source": [ "A [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) is a type of bar chart that illustrates a project schedule. The chart lists the tasks to be performed on the vertical axis, and time intervals on the horizontal axis. The width of the horizontal bars in the graph shows the duration of each activity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "38ce75f7", + "id": "bd272cef", "metadata": {}, "source": [ "### Gantt Charts and Timelines with plotly.express\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57b8a770", + "id": "c5ed8394", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "3830083f", + "id": "de662c6b", "metadata": {}, "source": [ "`px.timeline` supports [discrete color](/python/discrete-color/) as above, or [continuous color](/python/colorscales/) as follows." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26f96b30", + "id": "8256e481", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c59eb307", + "id": "ba0d32cf", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "0647cd83", + "id": "856f6a77", "metadata": {}, "source": [ "It is also possible to have multiple bars on the same horizontal line, say by resource:\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1371b2a", + "id": "e4b630e5", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "588d6ee7", + "id": "8f05abb5", "metadata": {}, "source": [ "#### Deprecated Figure Factory\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94252e7e", + "id": "e4d3132a", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "fa4fd3b3", + "id": "a257449a", "metadata": {}, "source": [ "#### Group Tasks Together\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "feab7453", + "id": "acc85888", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "f85ee767", + "id": "71243e2f", "metadata": {}, "source": [ "#### Color by Numeric Variable\n", @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b97642bb", + "id": "4ff687e8", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "2eeffe2a", + "id": "687b3848", "metadata": {}, "source": [ "#### Reference" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "654aaf2e", + "id": "f1725adc", "metadata": {}, "source": [ "For more info on `ff.create_gantt()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_gantt.html)\n" @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "bba5b7ec", + "id": "7aff1ed5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/gauge-charts.ipynb b/gauge-charts.ipynb index bcb256d86..56558f6d6 100644 --- a/gauge-charts.ipynb +++ b/gauge-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2e11feb3", + "id": "3b323319", "metadata": {}, "source": [ "#### Basic Gauge\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99232581", + "id": "602ec8dc", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "2724887a", + "id": "1f03b219", "metadata": {}, "source": [ "#### Add Steps, Threshold, and Delta\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec80d2d5", + "id": "4ad90d74", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "90298213", + "id": "b04d10cb", "metadata": {}, "source": [ "#### Custom Gauge Chart\n", @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b082bdb3", + "id": "04f1e392", "metadata": { "lines_to_next_cell": 2 }, @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "6d2f24d2", + "id": "c378c86b", "metadata": {}, "source": [ "#### Reference\n", @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "a766cefd", + "id": "e56e5baa", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/getting-started.ipynb b/getting-started.ipynb index 1a5d6d608..046586f4d 100644 --- a/getting-started.ipynb +++ b/getting-started.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "41bef25e", + "id": "229a4d39", "metadata": {}, "source": [ "\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa46b7d", + "id": "116192d6", "metadata": { "hide_code": true }, @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "94b2b82e", + "id": "0efe1137", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "6414348b", + "id": "44533a3c", "metadata": {}, "source": [ "#### JupyterLab Support\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ac58d9f", + "id": "924165f0", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "632d0ceb", + "id": "d72f2701", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7edf6a98", + "id": "c56bddf1", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "87203da4", + "id": "148c3b85", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`.\n", @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "40b0c8bb", + "id": "2352247b", "metadata": {}, "source": [ "#### Jupyter Notebook Support\n", @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdb44954", + "id": "6a2e4fc5", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "216730f9", + "id": "3bd39099", "metadata": {}, "source": [ "or using `FigureWidget` objects." @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1dfd792", + "id": "9bafe1b3", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "de4c00a8", + "id": "fa55379b", "metadata": {}, "source": [ "See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`." @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "7cd5a6d5", + "id": "1035dd30", "metadata": {}, "source": [ "### Static Image Export\n", @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "60ffe6bb", + "id": "64982fbc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graph-objects.ipynb b/graph-objects.ipynb index 0c19655e6..780dbf6d2 100644 --- a/graph-objects.ipynb +++ b/graph-objects.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ece4f2ec", + "id": "630383b6", "metadata": {}, "source": [ "### What Are Graph Objects?\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8660ded7", + "id": "1249f35d", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74b7f63f", + "id": "0e52db10", "metadata": { "lines_to_next_cell": 2 }, @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "0178a0ef", + "id": "6a6a89f7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/graphing-multiple-chart-types.ipynb b/graphing-multiple-chart-types.ipynb index eb2fd4e48..5458db4f0 100644 --- a/graphing-multiple-chart-types.ipynb +++ b/graphing-multiple-chart-types.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8e664269", + "id": "31a333cf", "metadata": {}, "source": [ "### Chart Types versus Trace Types\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "55e45d3d", + "id": "8358d22a", "metadata": {}, "source": [ "### Multiple Trace Types with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "125ff2d9", + "id": "7629047d", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "48906762", + "id": "21029dca", "metadata": {}, "source": [ "#### Grouped Bar and Scatter Chart\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "587f0ca0", + "id": "53b59042", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "02eb6cd8", + "id": "6f7413f6", "metadata": {}, "source": [ "#### Line Chart and a Bar Chart" @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "332f3fc4", + "id": "909b1c0f", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "3cfbbf45", + "id": "db3a3b1b", "metadata": {}, "source": [ "#### A Contour and Scatter Plot of the Method of Steepest Descent" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c56d6490", + "id": "aa30522b", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "1c2cf8b6", + "id": "c14d4f3b", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46353dea", + "id": "2039c332", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "df0ea455", + "id": "f9bc3402", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "9ed7f3db", + "id": "d805a823", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/heatmaps.ipynb b/heatmaps.ipynb index da92b9e73..e45f43c3b 100644 --- a/heatmaps.ipynb +++ b/heatmaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a1caf71b", + "id": "af1f5817", "metadata": {}, "source": [ "The term \"heatmap\" usually refers to a Cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/tile-density-heatmaps/).\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "1e3d5f76", + "id": "33b3b7d8", "metadata": {}, "source": [ "### Heatmaps with Plotly Express\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "0739cf0e", + "id": "a002e50b", "metadata": {}, "source": [ "The `px.imshow()` function can be used to display heatmaps (as well as full-color images, as its name suggests). It accepts both array-like objects like lists of lists and `numpy` or `xarray` arrays, as well as supported [DataFrame objects](/python/px-arguments#supported-dataframes).\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f12ad06", + "id": "d25e5194", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdd8cb9d", + "id": "dd493032", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "932fcde5", + "id": "8ff57846", "metadata": {}, "source": [ "### Displaying Text on Heatmaps\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "454d60ce", + "id": "1a7e8a4c", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "bb720ded", + "id": "04e9731c", "metadata": {}, "source": [ "#### Heatmaps in Dash\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11c3190e", + "id": "8b33d711", "metadata": { "hide_code": true }, @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "49e62d0e", + "id": "0fd8c6f2", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "abe49e95", + "id": "b77982b3", "metadata": {}, "source": [ "### Controlling Aspect Ratio\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "619ec5cc", + "id": "e66f5b59", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "fea7570e", + "id": "0b552c49", "metadata": {}, "source": [ "### Customizing the axes and labels on a heatmap\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "600e217e", + "id": "17d03111", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "6a3807de", + "id": "164781e1", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40544238", + "id": "12dd0cea", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "93638bb2", + "id": "8d87fdbe", "metadata": {}, "source": [ "### Basic Heatmap with `plotly.graph_objects`\n", @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea97cfb8", + "id": "cd138ef6", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "b60a6c16", + "id": "11ae6852", "metadata": {}, "source": [ "### Heatmap with Categorical Axis Labels\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e8e0b1d", + "id": "12bb9774", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "c4af7819", + "id": "f2fdd9c7", "metadata": {}, "source": [ "### Heatmap with Unequal Block Sizes\n" @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f309ac7c", + "id": "5b98fc0e", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "f908db23", + "id": "cd2a3cdf", "metadata": {}, "source": [ "### Heatmap with Datetime Axis" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29f6798e", + "id": "25da3510", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "31457b24", + "id": "4667176a", "metadata": {}, "source": [ "### Text on Heatmap Points\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae8cec50", + "id": "3209250d", "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "93e36a66", + "id": "f2c06c6e", "metadata": {}, "source": [ "### Heatmap and datashader\n", @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "6aa6ac76", + "id": "8f41212e", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hexbin-mapbox.ipynb b/hexbin-mapbox.ipynb index b2bbcf1af..bb0d89134 100644 --- a/hexbin-mapbox.ipynb +++ b/hexbin-mapbox.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f63eb21e", + "id": "2dd0f39d", "metadata": {}, "source": [ "#### Simple Count Hexbin\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b21b98c4", + "id": "045860dc", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "296b9f85", + "id": "3d5f6a6e", "metadata": {}, "source": [ "#### Count Hexbin with Minimum Count and Opacity" @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cb59055", + "id": "e1e4d280", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "045c493e", + "id": "c24dcb75", "metadata": {}, "source": [ "#### Display the Underlying Data" @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "306df7a3", + "id": "701c1750", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "cee4394a", + "id": "88790c00", "metadata": {}, "source": [ "#### Compute the Mean Value per Hexbin" @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a79cb8f1", + "id": "60d13a7b", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "e84be0ca", + "id": "823d60f2", "metadata": {}, "source": [ "#### Compute the Sum Value per Hexbin" @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7917c83d", + "id": "871c0a3d", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "c09355a7", + "id": "4c7aeda9", "metadata": {}, "source": [ "#### Hexbin with Animation" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb14bbc9", + "id": "470857de", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "7dc4abeb", + "id": "7a799dab", "metadata": {}, "source": [ "#### Reference\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "94903f36", + "id": "47bfcb17", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/histograms.ipynb b/histograms.ipynb index 61a5b80a6..f8e0dc007 100644 --- a/histograms.ipynb +++ b/histograms.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ec30d471", + "id": "2ebb2da4", "metadata": {}, "source": [ "In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in Plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...) which can be used to visualize data on categorical and date axes as well as linear axes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eca79844", + "id": "00487665", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14d05cdf", + "id": "1042f8a1", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "2002a2dd", + "id": "07dbabdd", "metadata": {}, "source": [ "#### Choosing the number of bins\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "489e394e", + "id": "2c87e248", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "5c429a31", + "id": "183785de", "metadata": {}, "source": [ "### Histograms on Date Data\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0684b7d7", + "id": "1a40bf13", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "1d5c6000", + "id": "57736d18", "metadata": {}, "source": [ "### Histograms on Categorical Data\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff64c5fd", + "id": "b3a7d349", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "78713355", + "id": "05dd849b", "metadata": {}, "source": [ "#### Histograms in Dash\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cfdc3ac", + "id": "8d462a2c", "metadata": { "hide_code": true }, @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "2d3b868e", + "id": "6b6dfc59", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "d82d0176", + "id": "8f3b905d", "metadata": {}, "source": [ "#### Accessing the counts (y-axis) values\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57065e51", + "id": "7b8751e3", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "markdown", - "id": "0a3c33dc", + "id": "dff6a40f", "metadata": {}, "source": [ "#### Type of normalization\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4735b47b", + "id": "a0301b5b", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "8727214b", + "id": "f0b56f5d", "metadata": {}, "source": [ "#### Aspect of the histogram plot" @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b36cbe3", + "id": "de0ff0b7", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "31f25bad", + "id": "6efa79d7", "metadata": {}, "source": [ "#### Several histograms for the different values of one column" @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52ec9e17", + "id": "067059bb", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "6810ae3f", + "id": "389098c4", "metadata": {}, "source": [ "#### Aggregating with other functions than `count`\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "002324c3", + "id": "a5296701", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "61d9eee4", + "id": "edfa651d", "metadata": {}, "source": [ "The default `histfunc` is `sum` if `y` is given, and works with categorical as well as binned numeric data on the `x` axis:" @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06c60067", + "id": "e90eff2e", "metadata": { "lines_to_next_cell": 0 }, @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "bdbc67f3", + "id": "61068303", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1bb93b9", + "id": "5ea6ff0e", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "026c0414", + "id": "d3991773", "metadata": {}, "source": [ "#### Visualizing the distribution\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba10a088", + "id": "2da3b630", "metadata": {}, "outputs": [], "source": [ @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "92351b2f", + "id": "340f1b1b", "metadata": {}, "source": [ "### Adding text labels\n", @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0a7dc35", + "id": "276562cb", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "6d744578", + "id": "05fa4686", "metadata": {}, "source": [ "## Histograms with go.Histogram\n", @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79282213", + "id": "2c43413c", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "c1faf8fa", + "id": "9b54f7e3", "metadata": {}, "source": [ "### Normalized Histogram" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42378156", + "id": "c92cf8a4", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ }, { "cell_type": "markdown", - "id": "dc42fb75", + "id": "b8c6df2f", "metadata": {}, "source": [ "### Horizontal Histogram" @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bdf1e96", + "id": "4b5b8a52", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "def832c3", + "id": "3837a609", "metadata": {}, "source": [ "### Overlaid Histogram" @@ -462,7 +462,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bb8e2c1", + "id": "e4b43f73", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "42a8331b", + "id": "e5ce35c5", "metadata": {}, "source": [ "### Stacked Histograms" @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68be5b9e", + "id": "aae01aca", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "bbf114c6", + "id": "68211dde", "metadata": {}, "source": [ "### Styled Histogram" @@ -527,7 +527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55f78239", + "id": "5bfec58f", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "a6ceaf3e", + "id": "73a19f53", "metadata": {}, "source": [ "### Histogram Bar Text\n", @@ -587,7 +587,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b9a2de6", + "id": "5b6cc938", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ }, { "cell_type": "markdown", - "id": "baef7dd6", + "id": "f09ae084", "metadata": {}, "source": [ "### Cumulative Histogram" @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bef00ff3", + "id": "daed3caa", "metadata": {}, "outputs": [], "source": [ @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "48b50806", + "id": "958c47c5", "metadata": {}, "source": [ "### Specify Aggregation Function" @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d28fc75c", + "id": "471f23b3", "metadata": {}, "outputs": [], "source": [ @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "3a7515d5", + "id": "4beb9715", "metadata": {}, "source": [ "### Custom Binning\n", @@ -666,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1da614f4", + "id": "0d51e2ad", "metadata": {}, "outputs": [], "source": [ @@ -715,7 +715,7 @@ }, { "cell_type": "markdown", - "id": "87eabd60", + "id": "e600dcba", "metadata": {}, "source": [ "### See also: Bar Charts\n", @@ -726,7 +726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7761dfa", + "id": "2d9934e7", "metadata": {}, "outputs": [], "source": [ @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "5f091163", + "id": "d5b249a6", "metadata": {}, "source": [ "### Share bins between histograms\n", @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce304b16", + "id": "bdb01f23", "metadata": {}, "outputs": [], "source": [ @@ -777,7 +777,7 @@ }, { "cell_type": "markdown", - "id": "08f469e7", + "id": "3ca62828", "metadata": {}, "source": [ "### Sort Histogram by Category Order\n", @@ -788,7 +788,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0cba7c4", + "id": "b70c0d3a", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70ffaa35", + "id": "4e58e5f1", "metadata": {}, "outputs": [], "source": [ @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "ab361096", + "id": "511ab63b", "metadata": {}, "source": [ "#### Reference\n", @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "f39f8595", + "id": "b1f32209", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-bar-charts.ipynb b/horizontal-bar-charts.ipynb index f338e86e0..2f702f5f6 100644 --- a/horizontal-bar-charts.ipynb +++ b/horizontal-bar-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b2756011", + "id": "3d98947c", "metadata": {}, "source": [ "See more examples of bar charts (including vertical bar charts) and styling options [here](https://plotly.com/python/bar-charts/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34a0de37", + "id": "21087171", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "ce558994", + "id": "e7d72894", "metadata": {}, "source": [ "#### Configure horizontal bar chart\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "184f3c09", + "id": "44b93ee8", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "3e860e1b", + "id": "0c541807", "metadata": {}, "source": [ "### Horizontal Bar Chart with go.Bar\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "872692f4", + "id": "1df4c3d3", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "c90ce9af", + "id": "d9cef438", "metadata": {}, "source": [ "### Colored Horizontal Bar Chart" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e02ac88", + "id": "cb304056", "metadata": { "lines_to_next_cell": 0 }, @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "0f5e70bf", + "id": "c34f6fde", "metadata": { "lines_to_next_cell": 0 }, @@ -142,7 +142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d184c226", + "id": "93a07683", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "7dc56720", + "id": "be80a695", "metadata": {}, "source": [ "### Color Palette for Bar Chart\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "695b0046", + "id": "e0b283bf", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "3ac177d1", + "id": "8795ad5f", "metadata": {}, "source": [ "### Diverging Bar (or Butterfly) Chart\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae2fa2c4", + "id": "1d9497a4", "metadata": {}, "outputs": [], "source": [ @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "207f1d01", + "id": "773802cd", "metadata": {}, "source": [ "### Bar Chart with Line Plot" @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c14e282", + "id": "f757e5eb", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "50988fd9", + "id": "167141e0", "metadata": {}, "source": [ "### Reference\n", @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "17974fdd", + "id": "33638e3f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/horizontal-vertical-shapes.ipynb b/horizontal-vertical-shapes.ipynb index 188c0bf80..c92887805 100644 --- a/horizontal-vertical-shapes.ipynb +++ b/horizontal-vertical-shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "43c762ca", + "id": "af60df5a", "metadata": {}, "source": [ "### Horizontal and Vertical Lines and Rectangles\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38a3d5f0", + "id": "dd79957a", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "93d163a2", + "id": "d3190d22", "metadata": {}, "source": [ "These shapes can be styled by passing the same arguments as are accepted by `add_shape`:" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "131cf5de", + "id": "441315f2", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "12b65818", + "id": "fdc10265", "metadata": {}, "source": [ "#### Horizontal and vertical lines in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e61f79d", + "id": "f712324b", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "190d534b", + "id": "e7b75b29", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "96ed3a66", + "id": "dedfa505", "metadata": {}, "source": [ "#### Adding Text Annotations\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c7e5b5e", + "id": "22d79df0", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "c5bc0ba1", + "id": "bfe1df24", "metadata": {}, "source": [ "Extra formatting of the annotation can be done using magic-underscores prefixed by `annotation_` or by passing a `dict` or `go.layout.Annotation` instance to the `annotation` argument:" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91a5a7ca", + "id": "adeddb1b", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "00f489b4", + "id": "566f052c", "metadata": { "lines_to_next_cell": 0 }, @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "001fe02e", + "id": "2136842f", "metadata": { "lines_to_next_cell": 0 }, @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "0e2d488c", + "id": "bb73f18a", "metadata": {}, "source": [ "#### Text Labels on Shapes\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3850fbef", + "id": "5b87c553", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "f13557ae", + "id": "75fa060e", "metadata": {}, "source": [ "With [text labels on shapes](/python/shapes/#adding-text-labels-to-shapes), you can also add text labels to shapes other than lines and rectangles, and the labels can be added automatically to shapes drawn by the user." @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "6a557b6e", + "id": "91a6d1f4", "metadata": {}, "source": [ "### Reference\n", @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "0a6f1ccf", + "id": "55d9496c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/hover-text-and-formatting.ipynb b/hover-text-and-formatting.ipynb index ae05196bf..125a1c686 100644 --- a/hover-text-and-formatting.ipynb +++ b/hover-text-and-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "54266f13", + "id": "84dc64c8", "metadata": {}, "source": [ "### Hover Labels\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ff5b32e", + "id": "68b51fa3", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "54eb244f", + "id": "5a7ce15b", "metadata": {}, "source": [ "#### Hovermode `x` or `y`\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "595a83f7", + "id": "9c303b88", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "4cf61428", + "id": "5e0cc969", "metadata": {}, "source": [ "#### Unified hovermode\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ddafd42", + "id": "9f2b5a12", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "a12830ee", + "id": "206280b9", "metadata": {}, "source": [ "#### Customize Title in Unified Hovermode\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff1792ae", + "id": "b16a0597", "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "markdown", - "id": "6ef05730", + "id": "ae9f01c3", "metadata": {}, "source": [ "#### Control hovermode with Dash\n", @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11df7b70", + "id": "38aa2569", "metadata": { "hide_code": true }, @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "6a85fa93", + "id": "050650e6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "240c1f85", + "id": "2844040c", "metadata": {}, "source": [ "#### Selecting a hovermode in a figure created with `plotly.graph_objects`\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3bb62e0", + "id": "f012296b", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "22265a57", + "id": "995e3016", "metadata": {}, "source": [ "#### Hover on Subplots\n", @@ -228,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "527a0bd2", + "id": "1948cf50", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "66e04e5b", + "id": "5a4b3873", "metadata": {}, "source": [ "### Customizing Hover Label Appearance\n", @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa96f99b", + "id": "01a5d5a3", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "ac4342a0", + "id": "6a30394e", "metadata": {}, "source": [ "### Customizing Hover text with Plotly Express\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7502f505", + "id": "46f7cb1a", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "cc58d033", + "id": "d7fa33ca", "metadata": {}, "source": [ "### Disabling or customizing hover of columns in plotly express\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b2979da", + "id": "b539b7ef", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "5f1c14ce", + "id": "26f93146", "metadata": {}, "source": [ "### Customizing hover text with a hovertemplate\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a1d6d77", + "id": "8b21dd83", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3feccdac", + "id": "335840ed", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "2f2a8974", + "id": "8730f495", "metadata": {}, "source": [ "### Modifying the hovertemplate of a plotly express figure\n", @@ -441,7 +441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a13a15a", + "id": "5b67c28f", "metadata": {}, "outputs": [], "source": [ @@ -460,7 +460,7 @@ }, { "cell_type": "markdown", - "id": "f3c0aa5d", + "id": "ab9a849b", "metadata": {}, "source": [ "### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate\n", @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93fd9674", + "id": "8a309ffd", "metadata": { "lines_to_next_cell": 2 }, @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "47212fee", + "id": "5765215d", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5452406", + "id": "3a1c7e4f", "metadata": {}, "outputs": [], "source": [ @@ -571,7 +571,7 @@ }, { "cell_type": "markdown", - "id": "216f3d89", + "id": "dd5df2c6", "metadata": {}, "source": [ "### Advanced Hover Template\n", @@ -582,7 +582,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29debfcc", + "id": "394bddde", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "981a470d", + "id": "76f56fe7", "metadata": {}, "source": [ "### Adding other data to the hover with customdata and a hovertemplate\n", @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62c7e021", + "id": "bd0836c5", "metadata": {}, "outputs": [], "source": [ @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "d8f1ac17", + "id": "796a73ea", "metadata": {}, "source": [ "### Setting the Hover Template in Tile Maps" @@ -698,7 +698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f798ea1", + "id": "b07092df", "metadata": {}, "outputs": [], "source": [ @@ -725,7 +725,7 @@ }, { "cell_type": "markdown", - "id": "72c8e9ef", + "id": "864884be", "metadata": {}, "source": [ "### Controlling Hover Text with `graph_objects` and `hoverinfo`\n", @@ -736,7 +736,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5d958be", + "id": "c24c6997", "metadata": {}, "outputs": [], "source": [ @@ -760,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "6d267c9f", + "id": "07fc6e6b", "metadata": {}, "source": [ "### Spike lines\n", @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49c8aca3", + "id": "91f13ea7", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "cfe695f9", + "id": "e3351c73", "metadata": {}, "source": [ "Spike lines can be styled per axis as well, and the cursor distance setting can be controlled via `layout.spikedistance`." @@ -799,7 +799,7 @@ { "cell_type": "code", "execution_count": null, - "id": "820e74a8", + "id": "e14dd760", "metadata": {}, "outputs": [], "source": [ @@ -819,7 +819,7 @@ }, { "cell_type": "markdown", - "id": "1a55dc53", + "id": "dc2b116c", "metadata": {}, "source": [ "#### Reference\n", @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "3dd15790", + "id": "07f3d34a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/icicle-charts.ipynb b/icicle-charts.ipynb index 29446095c..00a0067d0 100644 --- a/icicle-charts.ipynb +++ b/icicle-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3bfcec19", + "id": "23074720", "metadata": {}, "source": [ "*New in v5.0*\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57c478e9", + "id": "647740d5", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "dc6001aa", + "id": "6a26018f", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with plotly.express\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1fe1bad", + "id": "2b603402", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "baea631a", + "id": "9cbf3587", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with continuous color argument in px.icicle\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c787c8b0", + "id": "a5f9d3b0", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "31f89c87", + "id": "e8012770", "metadata": {}, "source": [ "### Icicle of a rectangular DataFrame with discrete color argument in px.icicle\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3db677c0", + "id": "e6ea3ea6", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "56ce11d6", + "id": "95c207a0", "metadata": {}, "source": [ "In the example below the color of **Saturday** and **Sunday** sectors is the same as **Dinner** because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7b23ff3", + "id": "08edb6fc", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "e7685ed8", + "id": "e8fd6051", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38c48fac", + "id": "7930fd9a", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "05252308", + "id": "9f818a23", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70ed63b4", + "id": "7aaf2e31", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "41e3f44e", + "id": "53cd7512", "metadata": {}, "source": [ "### Basic Icicle Plot with go.Icicle\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e792e689", + "id": "980bc1cb", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "4ea0c847", + "id": "7fa778df", "metadata": {}, "source": [ "### Icicle with Repeated Labels" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b186e24a", + "id": "00513b0d", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ }, { "cell_type": "markdown", - "id": "641e881b", + "id": "b11b350d", "metadata": {}, "source": [ "### Branchvalues\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc5a2283", + "id": "dc6e386f", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "17ba0fac", + "id": "36c13693", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3fafecc", + "id": "9ad1ac36", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "1eab2cb3", + "id": "7d8cf027", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eef130f7", + "id": "a6a89255", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "3fe8ab27", + "id": "b8d2da9c", "metadata": {}, "source": [ "### Icicle chart with a continuous colorscale\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4df5ea20", + "id": "39ff047a", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "28d9eb0d", + "id": "774ec3f2", "metadata": {}, "source": [ "### Set Color of Icicle Sectors" @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6350770d", + "id": "1cc9c5ce", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "c72a8cf5", + "id": "ef6a5867", "metadata": {}, "source": [ "This example uses iciclecolorway attribute, which should be set in layout." @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8fda0b3", + "id": "d34eb1ac", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba325c8a", + "id": "3eaa5414", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "ceb81b76", + "id": "56daafc0", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2be3673a", + "id": "eb16d1b7", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "d175a13b", + "id": "20787864", "metadata": {}, "source": [ "### Set the Direction of Icicle charts\n", @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "236d989d", + "id": "659384b2", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ }, { "cell_type": "markdown", - "id": "e393395b", + "id": "98e46e19", "metadata": {}, "source": [ "**Down Direction (Icicle)**" @@ -658,7 +658,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d48b3404", + "id": "24fb0815", "metadata": {}, "outputs": [], "source": [ @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "be2bb42d", + "id": "d3361092", "metadata": {}, "source": [ "**Right Direction**" @@ -693,7 +693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2757fd7e", + "id": "70ec19c6", "metadata": {}, "outputs": [], "source": [ @@ -719,7 +719,7 @@ }, { "cell_type": "markdown", - "id": "8578753d", + "id": "74bce030", "metadata": {}, "source": [ "**Left Direction**" @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e40597d", + "id": "b95a006c", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "216c46eb", + "id": "9b62953c", "metadata": {}, "source": [ "#### Reference\n", @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "3c2d3f39", + "id": "f953f5d3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/images.ipynb b/images.ipynb index 7f6a6042b..3a9c0bfb9 100644 --- a/images.ipynb +++ b/images.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5eaf6ebd", + "id": "9e7fa9ed", "metadata": {}, "source": [ "#### Add a Background Image\n", @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66bcc2cc", + "id": "7d1c751f", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "070301d2", + "id": "14d15468", "metadata": {}, "source": [ "#### Add a Logo\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e33a7bb9", + "id": "05485009", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "3c10567f", + "id": "cb95fea7", "metadata": {}, "source": [ "#### Label Spectroscopy Data by Adding Multiple Images" @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a7ada3e", + "id": "5a53ef7d", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "fd54bacf", + "id": "48c0d6f1", "metadata": {}, "source": [ "#### Zoom on Static Images" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dc4fc38", + "id": "93cfc502", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "1b4227c7", + "id": "7b530d0e", "metadata": {}, "source": [ "### Annotating layout image with shapes\n", @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b438632c", + "id": "f5f38595", "metadata": { "lines_to_next_cell": 2 }, @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "f92c7d77", + "id": "b05ee8ef", "metadata": {}, "source": [ "### Images Placed Relative to Axes\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4d683c0", + "id": "fdc0a1d0", "metadata": {}, "outputs": [], "source": [ @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "a8f5e20b", + "id": "78a0da5a", "metadata": {}, "source": [ "#### Reference\n", @@ -447,7 +447,7 @@ }, { "cell_type": "markdown", - "id": "bccc1b9f", + "id": "4024e6ee", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/imshow.ipynb b/imshow.ipynb index f56d7fc7b..44f4deac9 100644 --- a/imshow.ipynb +++ b/imshow.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "11f7624e", + "id": "3629bc30", "metadata": {}, "source": [ "This tutorial shows how to display and explore image data. If you would like\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "597f38a8", + "id": "a8c5fcc0", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "a3382b97", + "id": "b03ca0fc", "metadata": {}, "source": [ "### Read image arrays from image files\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51fdbbbf", + "id": "10d42adc", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0e04eb5", + "id": "4a212ee5", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "759fb6bc", + "id": "b0f0236c", "metadata": {}, "source": [ "### Display single-channel 2D data as a heatmap\n", @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d086c081", + "id": "5c67fd90", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "c469983f", + "id": "45e56fcc", "metadata": {}, "source": [ "### Choose the colorscale to display a single-channel image\n", @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0f7e990", + "id": "f26a9104", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "bba3a1a2", + "id": "964ec90b", "metadata": {}, "source": [ "You can use this to make the image grayscale as well:" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "130e7bd1", + "id": "16c38d0c", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "1dd33ca2", + "id": "afda8081", "metadata": {}, "source": [ "### Hiding the colorbar and axis labels\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64b1797c", + "id": "44032188", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "eca6d094", + "id": "95197e76", "metadata": {}, "source": [ "### Customizing the axes and labels on a single-channel image\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0f8c0b0", + "id": "19f1825b", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "4ddfcc14", + "id": "2a287c34", "metadata": {}, "source": [ "### Display an xarray image with px.imshow\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fc62298", + "id": "19daadc6", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "f924d6f7", + "id": "22152ed7", "metadata": {}, "source": [ "### Display an xarray image with square pixels\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b15d6ae", + "id": "3e88357e", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "66cc75e7", + "id": "c648f14f", "metadata": {}, "source": [ "### Display multichannel image data with go.Image\n", @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14356f95", + "id": "40ea2273", "metadata": {}, "outputs": [], "source": [ @@ -271,7 +271,7 @@ }, { "cell_type": "markdown", - "id": "749f5b2d", + "id": "1640d713", "metadata": {}, "source": [ "### Passing image data as a binary string to `go.Image`\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f4cda94", + "id": "24c9f97b", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "67709c87", + "id": "9f4b463e", "metadata": {}, "source": [ "### Defining the data range covered by the color range with zmin and zmax\n", @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "feb025b8", + "id": "bb90b475", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ffe3a91", + "id": "54536204", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "markdown", - "id": "352b5e15", + "id": "8e7b5d32", "metadata": {}, "source": [ "### Automatic contrast rescaling in `px.imshow`\n", @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18eec3ef", + "id": "8963d46c", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "f158a88b", + "id": "ec2ee934", "metadata": {}, "source": [ "### Ticks and margins around image data" @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0a06baa", + "id": "d2aad19d", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "fa59af62", + "id": "293dea60", "metadata": {}, "source": [ "### Combining image charts and other traces" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8aa3ed4", + "id": "964ef93c", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "78c37c0f", + "id": "050b8860", "metadata": {}, "source": [ "### Displaying an image and the histogram of color values" @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2720a074", + "id": "b56671bd", "metadata": {}, "outputs": [], "source": [ @@ -458,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "3f42c971", + "id": "7243e6cc", "metadata": {}, "source": [ "### imshow and datashader\n", @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "9f9f0f3e", + "id": "61f0aaab", "metadata": {}, "source": [ "### Annotating image traces with shapes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44ebe82e", + "id": "e57a8462", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "d80b26fa", + "id": "b2418051", "metadata": {}, "source": [ "### Passing image data as a binary string\n", @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12085da0", + "id": "75b071d8", "metadata": {}, "outputs": [], "source": [ @@ -555,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "e0dba7b8", + "id": "e8640258", "metadata": {}, "source": [ "### Contrast rescaling im imshow with binary string\n", @@ -566,7 +566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7274aca8", + "id": "bb54ac9f", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "e47b2897", + "id": "9ee4a879", "metadata": {}, "source": [ "You can set `binary_string=False` if you want the intensity value to appear in the hover even for a rescaled image. In the example below we also modify the hovertemplate to display both `z` (the data of the original image array) and `color` (the pixel value displayed in the figure)." @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cfa3ada", + "id": "f7812f68", "metadata": {}, "outputs": [], "source": [ @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "f900ee09", + "id": "237458d5", "metadata": {}, "source": [ "### Changing the level of compression of the binary string in `px.imshow`\n", @@ -620,7 +620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f9adf96", + "id": "d848fe7c", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "e81b8e79", + "id": "b7e1c8a8", "metadata": {}, "source": [ "### Exploring 3-D images, timeseries and sequences of images with `facet_col`\n", @@ -652,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "315ab0ef", + "id": "e6dff84f", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "5645544a", + "id": "c3e546ff", "metadata": {}, "source": [ "Facets can also be used to represent several images of equal shape, like in the example below where different values of the blurring parameter of a Gaussian filter are compared." @@ -675,7 +675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65b863e8", + "id": "b99deac0", "metadata": {}, "outputs": [], "source": [ @@ -695,7 +695,7 @@ }, { "cell_type": "markdown", - "id": "ee47f11d", + "id": "feaa51df", "metadata": {}, "source": [ "### Exploring 3-D images and timeseries with `animation_frame`\n", @@ -708,7 +708,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed324520", + "id": "57b3b5cc", "metadata": {}, "outputs": [], "source": [ @@ -722,7 +722,7 @@ }, { "cell_type": "markdown", - "id": "0ee61768", + "id": "f81514ea", "metadata": {}, "source": [ "### Animations of xarray datasets\n", @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e2f44d8", + "id": "48d52f97", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "e405e590", + "id": "a013f2c6", "metadata": {}, "source": [ "### Combining animations and facets\n", @@ -760,7 +760,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb7b6f11", + "id": "9c1728b6", "metadata": {}, "outputs": [], "source": [ @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "28bc12fc", + "id": "302ca1ff", "metadata": {}, "source": [ "#### Reference\n", @@ -784,7 +784,7 @@ }, { "cell_type": "markdown", - "id": "5362882a", + "id": "8e648c0d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/indicator.ipynb b/indicator.ipynb index 7ea9bf3ca..03ab09969 100644 --- a/indicator.ipynb +++ b/indicator.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cc7f6670", + "id": "0a00ebb4", "metadata": {}, "source": [ "#### Overview\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f568da55", + "id": "3370a6ae", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "a3f6fd7b", + "id": "bdb2d8ef", "metadata": {}, "source": [ "#### A Single Angular Gauge Chart" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f820dca", + "id": "b4d547a3", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "b73ac64b", + "id": "f1fe36e3", "metadata": {}, "source": [ "##### Bullet Gauge\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "786634cb", + "id": "b4c914f9", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "3a8e7cd3", + "id": "04378ff0", "metadata": {}, "source": [ "#### Showing Information above Your Chart\n", @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "752083f6", + "id": "849dc982", "metadata": { "lines_to_next_cell": 0 }, @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "c6121988", + "id": "b1f8d4f8", "metadata": {}, "source": [ "#### Data Cards / Big Numbers\n", @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38eff2b9", + "id": "f5f64048", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "a011e7d9", + "id": "212c9635", "metadata": {}, "source": [ "#### It's possible to display several numbers" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "638fc99e", + "id": "83598b7e", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "f1a071d2", + "id": "928ea03f", "metadata": {}, "source": [ "#### Adding a Prefix and Suffix" @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "b3624b6c", + "id": "1f771fef", "metadata": {}, "source": [ "On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`. \n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "453fd974", + "id": "119970c0", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "2e6fa2fe", + "id": "9ece8987", "metadata": {}, "source": [ "#### Reference\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7fa44e9", + "id": "e91a4269", "metadata": { "lines_to_next_cell": 2 }, @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "40206632", + "id": "69719c41", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/interactive-html-export.ipynb b/interactive-html-export.ipynb index 0c3f06cb6..a841015f7 100644 --- a/interactive-html-export.ipynb +++ b/interactive-html-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f5d18bf0", + "id": "65559ca5", "metadata": {}, "source": [ "### Interactive vs Static Export\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "0f0bbea2", + "id": "ba34e7fa", "metadata": {}, "source": [ "### Saving to an HTML file\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "03e1d083", + "id": "f8e63f1b", "metadata": {}, "source": [ "### Controlling the size of the HTML file\n", @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "6b1460b3", + "id": "c85a8a79", "metadata": {}, "source": [ "\n", @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "fb766266", + "id": "83dbb665", "metadata": {}, "source": [ "### HTML export in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10b9c077", + "id": "6a26ad7e", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "2eccee08", + "id": "af3df179", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "2ad56226", + "id": "2e867076", "metadata": {}, "source": [ "### Full Parameter Documentation" @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d3a233c", + "id": "ff9b5ff5", "metadata": { "lines_to_next_cell": 2 }, @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "a5af9969", + "id": "414aa160", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ipython-vs-python.ipynb b/ipython-vs-python.ipynb index 4cebeb3f3..ab737247e 100644 --- a/ipython-vs-python.ipynb +++ b/ipython-vs-python.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "70049cc0", + "id": "8f1b34f8", "metadata": {}, "source": [ "#### What is the difference between IPython and Python?\n", @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "fcb76ae8", + "id": "6ffbfdcb", "metadata": {}, "source": [ "![IPython terminal](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/ipython-console.png)" @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "8aaf8331", + "id": "bcf712d4", "metadata": {}, "source": [ "In other words, IPython is a powerful *interface* to the Python language. But it is certainly not the only one. Besides IPython, the most common way to use Python is to write *scripts*, files with the `.py` extension.
\n", @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "a1051931", + "id": "c43a5073", "metadata": {}, "source": [ "#### Jupyter Notebook" @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "34af951b", + "id": "c9637415", "metadata": {}, "source": [ "In 2011, IPython introduced a new tool named the **Notebook**. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python." @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "4f0c865d", + "id": "18862bc3", "metadata": {}, "source": [ "![IPython Notebook](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/notebook.png)" @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "054cf057", + "id": "f25c2bd5", "metadata": {}, "source": [ "Compared to the original IPython terminal, the Notebook offers a more convenient text editor, the possibility to write rich text, and improved graphical capabilities. Also, since it is a web interface, it can integrate many of the existing web libraries for data visualization, including *plotly.js*.
\n", @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "cbd9f033", + "id": "173a2fc2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/jupyter-lab-tools.ipynb b/jupyter-lab-tools.ipynb index 0ec6fd36a..c289df798 100644 --- a/jupyter-lab-tools.ipynb +++ b/jupyter-lab-tools.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "349b93c7", + "id": "2f4edb1e", "metadata": {}, "source": [ "#### Create a New View for Output" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "b3bfc932", + "id": "d7dae95b", "metadata": {}, "source": [ "Display a FigureWidget and then create a new window to display it in so that you can scroll through your code but still keep an eye on what you're doing." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "832c758d", + "id": "2181dcb6", "metadata": {}, "source": [ "\n", @@ -32,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "57065030", + "id": "0b5c679e", "metadata": {}, "source": [ "#### Reference" @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "b5a41b0f", + "id": "e07f35c4", "metadata": {}, "source": [ "See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples.\n" @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "2f71203c", + "id": "c6bd6ef3", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/legend.ipynb b/legend.ipynb index c83b88901..e11e120ab 100644 --- a/legend.ipynb +++ b/legend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7b5908d6", + "id": "3b63ce74", "metadata": {}, "source": [ "### Trace Types, Legends and Color Bars\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "c92c342d", + "id": "428d0771", "metadata": {}, "source": [ "### Legends with Plotly Express\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d83fdbf9", + "id": "4899b07b", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "6bb8ddff", + "id": "b8c858a8", "metadata": {}, "source": [ "### Legend Order\n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b7995f3", + "id": "abc93819", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "e0fa01f7", + "id": "bb9b0cf4", "metadata": {}, "source": [ "When using stacked bars, the bars are stacked from the bottom in the same order as they appear in the legend, so it can make sense to set `layout.legend.traceorder` to `\"reversed\"` to get the legend and stacks to match:" @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e11d355", + "id": "799a383c", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "e96bca6e", + "id": "5dba9ea7", "metadata": {}, "source": [ "When using [`plotly.graph_objects`](/python/graph-objects/) rather than Plotly Express, legend items will appear in the order that traces appear in the `data`:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d432f32", + "id": "8d1e497a", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "48107ed0", + "id": "5751df75", "metadata": {}, "source": [ "*New in 5.16*\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76e5adac", + "id": "8e2dbfa3", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "7aa42b96", + "id": "63389be9", "metadata": {}, "source": [ "The `legendrank` attribute of a trace or shape can be used to control its placement in the legend.\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f566d46b", + "id": "1d61af75", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "fb5b2531", + "id": "1fc71580", "metadata": {}, "source": [ "#### Showing and Hiding the Legend\n", @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b378004", + "id": "6f7d495d", "metadata": { "lines_to_next_cell": 2 }, @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "f2281cdd", + "id": "ec210cf8", "metadata": {}, "source": [ "### Legend Positioning\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "265a045e", + "id": "dbfe2a87", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "94ed8919", + "id": "bf4d1ba3", "metadata": {}, "source": [ "#### Legends in Dash\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39609dce", + "id": "efb92094", "metadata": { "hide_code": true }, @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "c87e04c5", + "id": "e32ec06e", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "b2cf128f", + "id": "05f08214", "metadata": {}, "source": [ "#### Horizontal Legends\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49184708", + "id": "2026b58b", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "1a39112f", + "id": "4af5f0bc", "metadata": {}, "source": [ "#### Horizontal Legend Entry Width\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "402038b5", + "id": "9cd4fd77", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "b5c5b037", + "id": "658813c1", "metadata": {}, "source": [ "#### Legend Max Height\n", @@ -379,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "813a2e32", + "id": "e7e4ef5e", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "854b2103", + "id": "ab8b5c08", "metadata": {}, "source": [ "#### Styling Legends\n", @@ -429,7 +429,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1caa7ab", + "id": "62f0a116", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "26e7b4bc", + "id": "20155008", "metadata": {}, "source": [ "### Legends with Graph Objects\n", @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "d0dd7799", + "id": "c8379b8e", "metadata": {}, "source": [ "#### Legend Item Names\n", @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd7d9ced", + "id": "b7ca3711", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "daf27831", + "id": "87aac808", "metadata": {}, "source": [ "By default, for shapes, legend items are disabled. Set `showlegend=True` on a shape for it to display a legend item.\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55d817cd", + "id": "ded1bdf6", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "6cca0ab6", + "id": "c3067129", "metadata": {}, "source": [ "#### Legend titles" @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6d6205b", + "id": "218b8b13", "metadata": {}, "outputs": [], "source": [ @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "b9072906", + "id": "fcfb4766", "metadata": {}, "source": [ "### Hiding Legend Items" @@ -596,7 +596,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a8b30da", + "id": "24247d76", "metadata": {}, "outputs": [], "source": [ @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "b2e10552", + "id": "8fa7693d", "metadata": {}, "source": [ "#### Hiding the Trace Initially\n", @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91cc4121", + "id": "2acac54f", "metadata": {}, "outputs": [], "source": [ @@ -658,7 +658,7 @@ }, { "cell_type": "markdown", - "id": "94987d7b", + "id": "76ee0a58", "metadata": {}, "source": [ "#### Size of Legend Items\n", @@ -669,7 +669,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c69872d9", + "id": "4c038dd5", "metadata": {}, "outputs": [], "source": [ @@ -698,7 +698,7 @@ }, { "cell_type": "markdown", - "id": "723cfade", + "id": "4ceb8d78", "metadata": {}, "source": [ "#### Grouped Legend Items\n", @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68a6fd76", + "id": "21e71171", "metadata": {}, "outputs": [], "source": [ @@ -762,7 +762,7 @@ }, { "cell_type": "markdown", - "id": "6242ba2a", + "id": "c2325198", "metadata": {}, "source": [ "You can also hide entries in grouped legends, preserving the grouped show/hide behaviour. This is what Plotly Express does with its legends." @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d4483af", + "id": "3eca237d", "metadata": {}, "outputs": [], "source": [ @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "65d773d0", + "id": "fa425510", "metadata": {}, "source": [ "#### Indent Legend Entries\n", @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7de52684", + "id": "ebfcda19", "metadata": {}, "outputs": [], "source": [ @@ -871,7 +871,7 @@ }, { "cell_type": "markdown", - "id": "9f096741", + "id": "18f6c97d", "metadata": {}, "source": [ "#### Group click toggle behavior\n", @@ -884,7 +884,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b6edc64", + "id": "1728e6e2", "metadata": {}, "outputs": [], "source": [ @@ -938,7 +938,7 @@ }, { "cell_type": "markdown", - "id": "fa01ab36", + "id": "bbfe2679", "metadata": {}, "source": [ "### Legend items for continuous fields (2D and 3D)\n", @@ -951,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95893d03", + "id": "b464cab3", "metadata": {}, "outputs": [], "source": [ @@ -994,7 +994,7 @@ }, { "cell_type": "markdown", - "id": "36d6c2f3", + "id": "1c739c6c", "metadata": {}, "source": [ "### Adding Multiple Legends\n", @@ -1009,7 +1009,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ccd170f", + "id": "98771039", "metadata": {}, "outputs": [], "source": [ @@ -1079,7 +1079,7 @@ }, { "cell_type": "markdown", - "id": "9b283883", + "id": "5010edc2", "metadata": {}, "source": [ "### Positioning Legends\n", @@ -1090,7 +1090,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8656fc6f", + "id": "b785429d", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "cd8884e8", + "id": "fa00701d", "metadata": {}, "source": [ "### Legend Title Click Behavior\n", @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8ede885", + "id": "03af2813", "metadata": {}, "outputs": [], "source": [ @@ -1182,7 +1182,7 @@ }, { "cell_type": "markdown", - "id": "8eb6f76e", + "id": "5fdaaaf6", "metadata": {}, "source": [ "To disable title click behavior, set `titleclick` and `titledoubleclick` to `False`:\n", @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "991e9394", + "id": "660abea2", "metadata": {}, "source": [ "#### Reference\n", @@ -1209,7 +1209,7 @@ }, { "cell_type": "markdown", - "id": "6a315382", + "id": "a8d2be33", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-and-scatter.ipynb b/line-and-scatter.ipynb index d4b3f88a6..3902c6fe1 100644 --- a/line-and-scatter.ipynb +++ b/line-and-scatter.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b4a364b5", + "id": "4305313c", "metadata": {}, "source": [ "## Scatter plots with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ddd17d80", + "id": "81363dbf", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "162649e7", + "id": "e883569b", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "3dd37260", + "id": "de8c2eb5", "metadata": {}, "source": [ "#### Setting size and color with column names\n", @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9665736a", + "id": "fb4e7062", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "06a89bfe", + "id": "ee0bdc40", "metadata": {}, "source": [ "Color can be [continuous](https://plotly.com/python/colorscales/) as follows, or [discrete/categorical](https://plotly.com/python/discrete-color/) as above." @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a05a94a6", + "id": "e5139e07", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "db4dce24", + "id": "872e0928", "metadata": {}, "source": [ "The `symbol` argument can be mapped to a column as well. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3755b9f9", + "id": "b9ba101f", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "fc0159aa", + "id": "e9e4eca3", "metadata": {}, "source": [ "## Scatter plots in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff9487dd", + "id": "aecca24e", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "3d791198", + "id": "8e53b1f1", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "05100f96", + "id": "7dd0d152", "metadata": {}, "source": [ "### Scatter plots and Categorical Axes\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2343b7d", + "id": "75004cc3", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "813d4683", + "id": "6feb452c", "metadata": {}, "source": [ "### Grouped Scatter Points\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3629ef0d", + "id": "5a85e8cd", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "c176155f", + "id": "ed1108bd", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70646e90", + "id": "29003752", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "fde3d69b", + "id": "3cac9029", "metadata": {}, "source": [ "### Error Bars\n", @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4854018", + "id": "492e5237", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "b2a4a674", + "id": "ee8107ef", "metadata": {}, "source": [ "### Marginal Distribution Plots\n", @@ -261,7 +261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7926a24", + "id": "02d0f5f5", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "24495213", + "id": "43ed558f", "metadata": {}, "source": [ "### Facetting\n", @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcb17bb3", + "id": "3a59cbaf", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "87b85974", + "id": "54dac5c0", "metadata": {}, "source": [ "### Linear Regression and Other Trendlines\n", @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "650469de", + "id": "1d7ee005", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "37bf7b78", + "id": "693a9123", "metadata": {}, "source": [ "## Line plots with Plotly Express" @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3376b4fc", + "id": "1628bbdd", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e50d2bb", + "id": "c99de43e", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "9233b4c8", + "id": "9f17e5c2", "metadata": {}, "source": [ "The `markers` argument can be set to `True` to show markers on lines." @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff8e4ae8", + "id": "40eb0062", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "22b98368", + "id": "e03a6a9e", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f65eb36", + "id": "5dbcfa86", "metadata": {}, "outputs": [], "source": [ @@ -399,7 +399,7 @@ }, { "cell_type": "markdown", - "id": "b91fd286", + "id": "8235993a", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "136ef729", + "id": "f7c62df5", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "f17be766", + "id": "d07dd138", "metadata": {}, "source": [ "### Data Order in Scatter and Line Charts\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "286f258c", + "id": "3abb41ae", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "87366c34", + "id": "a6159258", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -470,7 +470,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa973115", + "id": "60d354d2", "metadata": {}, "outputs": [], "source": [ @@ -485,7 +485,7 @@ }, { "cell_type": "markdown", - "id": "488f6bfb", + "id": "1335af62", "metadata": {}, "source": [ "### Swarm (or Beeswarm) Plots\n", @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64a47831", + "id": "94a885c0", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "19661305", + "id": "93250fb3", "metadata": {}, "source": [ "## Scatter and line plots with go.Scatter\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97f401c1", + "id": "3d7c91a0", "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "c124b301", + "id": "57535ee4", "metadata": {}, "source": [ "#### Line and Scatter Plots\n", @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2c01aad", + "id": "2863d1ed", "metadata": {}, "outputs": [], "source": [ @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "4a26e334", + "id": "7a3cacbe", "metadata": {}, "source": [ "#### Bubble Scatter Plots\n", @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8e5cde1", + "id": "2ea603d1", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "b07cf7c4", + "id": "85406a7b", "metadata": {}, "source": [ "#### Style Scatter Plots" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5940cde", + "id": "66fc5b04", "metadata": {}, "outputs": [], "source": [ @@ -786,7 +786,7 @@ }, { "cell_type": "markdown", - "id": "671a77ba", + "id": "4c11a005", "metadata": {}, "source": [ "#### Data Labels on Hover" @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6fda9c4", + "id": "6b8e8cbc", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "84a77d41", + "id": "bd9b3c3d", "metadata": {}, "source": [ "#### Scatter with a Color Dimension" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e816ea04", + "id": "38866d3d", "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ }, { "cell_type": "markdown", - "id": "904304fb", + "id": "38d90fa8", "metadata": {}, "source": [ "#### Trace Zorder\n", @@ -861,7 +861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "539206a3", + "id": "f6b82d3f", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "b5da0ed3", + "id": "2dfec821", "metadata": {}, "source": [ "#### Large Data Sets\n", @@ -914,7 +914,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01d7c1f9", + "id": "9b935f4c", "metadata": {}, "outputs": [], "source": [ @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "644fc4fb", + "id": "5d9957b9", "metadata": {}, "outputs": [], "source": [ @@ -966,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "2f47350d", + "id": "6a23dd53", "metadata": {}, "source": [ "### Reference\n", @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "07c0371a", + "id": "20a0e317", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/line-charts.ipynb b/line-charts.ipynb index dd2c85881..32b094b40 100644 --- a/line-charts.ipynb +++ b/line-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6e02f256", + "id": "8fd6918f", "metadata": {}, "source": [ "### Line Plots with plotly.express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af6705ee", + "id": "e57f1c58", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "44970043", + "id": "88aabc2b", "metadata": {}, "source": [ "### Line Plots with column encoding color" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95b529cb", + "id": "01663516", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "8667cfc6", + "id": "33ef7509", "metadata": {}, "source": [ "### Line charts in Dash\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "532d5bed", + "id": "3c5ce69d", "metadata": { "hide_code": true, "tags": [] @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "d17767ef", + "id": "83d816cf", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "400e65f9", + "id": "003e43fb", "metadata": {}, "source": [ "### Data Order in Line Charts\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56992555", + "id": "f91760da", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "1fcc2144", + "id": "7ed82a0a", "metadata": {}, "source": [ "### Connected Scatterplots\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eac3ba7", + "id": "0cdfb890", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "7870c555", + "id": "8ab45b33", "metadata": {}, "source": [ "### Line charts with markers\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8694cfc3", + "id": "04189b38", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "ba61ec93", + "id": "18183f02", "metadata": {}, "source": [ "The `symbol` argument can be used to map a data field to the marker symbol. A [wide variety of symbols](https://plotly.com/python/marker-style/) are available." @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5604a4af", + "id": "aeaf6a66", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "097013b3", + "id": "021dfe80", "metadata": {}, "source": [ "### Line plots on Date axes\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e3e7b80", + "id": "559c8d60", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "d3db0612", + "id": "f05049e2", "metadata": {}, "source": [ "### Sparklines with Plotly Express\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abaff052", + "id": "023480f3", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "d8dcf67d", + "id": "3d9a4625", "metadata": {}, "source": [ "### Line Plot with go.Scatter\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "99d841a8", + "id": "2fafb08a", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "accb525e", + "id": "38d5e2c0", "metadata": {}, "source": [ "#### Line Plot Modes" @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a84527d7", + "id": "565c9053", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "f7d99575", + "id": "ec8b09ae", "metadata": {}, "source": [ "#### Style Line Plots\n", @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00aee4bf", + "id": "fb927ba7", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "5a778fd3", + "id": "e66e69bb", "metadata": {}, "source": [ "#### Connect Data Gaps\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2437123", + "id": "7fd7b6e6", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "f30da8dc", + "id": "7409fcf2", "metadata": {}, "source": [ "#### Interpolation with Line Plots" @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4dc9a37b", + "id": "8c1ac2ec", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "059d8905", + "id": "d48527b3", "metadata": {}, "source": [ "#### Label Lines with Annotations" @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc3889ec", + "id": "1c100356", "metadata": {}, "outputs": [], "source": [ @@ -596,7 +596,7 @@ }, { "cell_type": "markdown", - "id": "aa383d32", + "id": "135acdd2", "metadata": {}, "source": [ "#### Filled Lines" @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b372476e", + "id": "b6367165", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +687,7 @@ }, { "cell_type": "markdown", - "id": "da1cd32c", + "id": "b5891997", "metadata": {}, "source": [ "#### Reference\n", @@ -697,7 +697,7 @@ }, { "cell_type": "markdown", - "id": "323a97ac", + "id": "a0731056", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/linear-fits.ipynb b/linear-fits.ipynb index 2fa231d19..6a6c6921d 100644 --- a/linear-fits.ipynb +++ b/linear-fits.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8fb3d76e", + "id": "f6533c0b", "metadata": {}, "source": [ "### Linear fit trendlines with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aefbc69f", + "id": "71b33ee3", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "6b9533cb", + "id": "3a72e718", "metadata": {}, "source": [ "### Fitting multiple lines and retrieving the model parameters\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d314cf92", + "id": "3fa9601f", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "a6ef4b32", + "id": "84483bee", "metadata": {}, "source": [ "### Displaying a single trendline with multiple traces\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35844a49", + "id": "2b7c515f", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "498f67b3", + "id": "4af8c300", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "e180094b", + "id": "2b67199b", "metadata": {}, "source": [ "### OLS Parameters\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84c611f9", + "id": "485a29d2", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad67c75b", + "id": "a81f0174", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "e18ece28", + "id": "caa68918", "metadata": {}, "source": [ "### Locally Weighted Scatterplot Smoothing (LOWESS)\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ebae978", + "id": "7369eb48", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "3777be12", + "id": "1d9840af", "metadata": {}, "source": [ "_new in v5.2_\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17cc2526", + "id": "ce19afa8", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "5101f54e", + "id": "4d6f7b7d", "metadata": {}, "source": [ "### Moving Averages\n", @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c050c73", + "id": "44445cc4", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55603373", + "id": "73586464", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cde91b64", + "id": "eaf7cfec", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "076cf8b9", + "id": "53243721", "metadata": {}, "source": [ "### Other Functions\n", @@ -257,7 +257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a154dcbb", + "id": "f4c4d672", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6df18774", + "id": "b1a1f4ad", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "fd312f14", + "id": "b6f152cc", "metadata": {}, "source": [ "In some cases, it is necessary to pass options into the underying Pandas function, for example the `std` parameter must be provided if the `win_type` argument to `rolling` is `\"gaussian\"`. This is possible with the `function_args` trendline option." @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ea9bc51", + "id": "3722cdde", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "7fe2c9a2", + "id": "74a5e346", "metadata": {}, "source": [ "### Displaying only the trendlines\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "365d5f16", + "id": "a3cdd6e0", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d126cac", + "id": "db31b882", "metadata": { "lines_to_next_cell": 2 }, @@ -347,7 +347,7 @@ }, { "cell_type": "markdown", - "id": "6a2fee79", + "id": "9713bad2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-maps.ipynb b/lines-on-maps.ipynb index 84bd9cd81..f4d249a8b 100644 --- a/lines-on-maps.ipynb +++ b/lines-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f3cc7d3f", + "id": "283813d8", "metadata": {}, "source": [ "Below we show how to create geographical line plots using either Plotly Express with `px.line_geo` function or the lower-level `go.Scattergeo` object.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c08ba2b5", + "id": "0f711708", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "db92d461", + "id": "cba51cad", "metadata": {}, "source": [ "### Lines on Maps from GeoPandas\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "791c893b", + "id": "06bcbcba", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "ffa69e5e", + "id": "f4e0cb10", "metadata": {}, "source": [ "## Lines on Maps with plotly.graph_objects\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d63b5034", + "id": "1bb5750a", "metadata": { "lines_to_next_cell": 0 }, @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "a0a27603", + "id": "bddccf79", "metadata": {}, "source": [ "### Performance improvement: put many lines in the same trace\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d4a79af", + "id": "fd8306a7", "metadata": { "lines_to_next_cell": 2 }, @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "90f53d57", + "id": "ebb261cd", "metadata": {}, "source": [ "### London to NYC Great Circle" @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e28f6164", + "id": "97066955", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "b27943e2", + "id": "9138c9ac", "metadata": {}, "source": [ "### Contour lines on globe" @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6435e2dd", + "id": "6908c95c", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +371,7 @@ }, { "cell_type": "markdown", - "id": "dd0586c7", + "id": "834d82c9", "metadata": {}, "source": [ "#### Reference\n", @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "25b2ba32", + "id": "683010dd", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/lines-on-tile-maps.ipynb b/lines-on-tile-maps.ipynb index b46c7aeb4..c15d555c5 100644 --- a/lines-on-tile-maps.ipynb +++ b/lines-on-tile-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "da1900b5", + "id": "652423f3", "metadata": {}, "source": [ "### Lines on tile maps using Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82aeaf9f", + "id": "2695fa83", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "1b521185", + "id": "e5cfec07", "metadata": {}, "source": [ "### Lines on maps from GeoPandas\n", @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8995c0ff", + "id": "37594d8a", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "a45c2a40", + "id": "9bc45f47", "metadata": {}, "source": [ "### Lines on maps using `Scattermap` traces\n", @@ -100,7 +100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bec7e6aa", + "id": "3324f8df", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "62c0c551", + "id": "c14723c5", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98496115", + "id": "71376258", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "890dab77", + "id": "1d79a187", "metadata": {}, "source": [ "#### Reference\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "43244f73", + "id": "d93dba57", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/location-mode.ipynb b/location-mode.ipynb index 9d397d0b1..8f548f8a1 100644 --- a/location-mode.ipynb +++ b/location-mode.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "df46b706", + "id": "1200470d", "metadata": {}, "source": [ "# Locations for Outline-based Maps\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "863e1b99", + "id": "0426f14b", "metadata": {}, "source": [ "## locationmode='ISO-3'\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4d010ef", + "id": "74295ff7", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "1deb4786", + "id": "4efa8ddf", "metadata": {}, "source": [ "## Supported ISO Codes\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "7cc59bee", + "id": "0e85ee25", "metadata": {}, "source": [ "## locationmode='USA-states'\n", @@ -345,7 +345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27459639", + "id": "a1e2ce93", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "bb95d473", + "id": "bdc59d15", "metadata": {}, "source": [ "## Supported US State Codes\n", @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "be28cf71", + "id": "eff02e86", "metadata": {}, "source": [ "## locationmode='country names'\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bf7a12a", + "id": "2e556539", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "36d1bd02", + "id": "cd1e4316", "metadata": {}, "source": [ "> How Plotly matches 'country names' will change in a future version. Matching will become stricter and some country names may no longer match. We recommend using `locationmode='ISO-3'` with ISO codes for `locations` to ensure consistent behavior across versions." @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfda6fda", + "id": "1085e6de", "metadata": {}, "outputs": [], "source": [ @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "3e716648", + "id": "d902d885", "metadata": {}, "source": [ "## Using Different Data Types with `locations`\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d0fe253", + "id": "c9e62556", "metadata": { "lines_to_next_cell": 2 }, @@ -523,7 +523,7 @@ }, { "cell_type": "markdown", - "id": "7304f0e0", + "id": "bf454401", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/log-plot.ipynb b/log-plot.ipynb index 1e365b6f5..e63229942 100644 --- a/log-plot.ipynb +++ b/log-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e6c698b9", + "id": "bbe05b1c", "metadata": {}, "source": [ "This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots) to follow a logarithmic rather than linear progression. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/).\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6020ed10", + "id": "1515cb69", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "43e13e2f", + "id": "1084e948", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with Plotly Express works the same was as with linear axes: using the `range_x` and `range_y` keywords. Note that you cannot set the range to include 0 or less." @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0976bc35", + "id": "37b9aa53", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "fa3e4a0a", + "id": "755274e0", "metadata": {}, "source": [ "#### Adding minor ticks\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcf31997", + "id": "a35a5716", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "ccb4c8fb", + "id": "d8d534bf", "metadata": {}, "source": [ "#### Controlling Minor Log Labels\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "675710c9", + "id": "eb3984df", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "59a3a0f2", + "id": "dcd89942", "metadata": {}, "source": [ "### Logarithmic Axes with Graph Objects\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1abd47da", + "id": "7e0f4eba", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "cc08ffcd", + "id": "283cd245", "metadata": {}, "source": [ "Setting the range of a logarithmic axis with `plotly.graph_objects` is *very different* than setting the range of linear axes: the range is set using the exponent rather than the actual value:\n" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74ae6a6f", + "id": "ee906066", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "5e3d906c", + "id": "d151fdd7", "metadata": {}, "source": [ "#### Reference\n", @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "5a7c92ec", + "id": "f3a86d17", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-configuration.ipynb b/map-configuration.ipynb index 85d11362f..ccc98b67d 100644 --- a/map-configuration.ipynb +++ b/map-configuration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4268b470", + "id": "e2f5131f", "metadata": {}, "source": [ "### Tile Maps vs Outline Maps\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dfe3e8b", + "id": "d61abff8", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "81daba51", + "id": "3597327c", "metadata": {}, "source": [ "Here is a map with all physical features enabled and styled, at a larger-scale 1:50m resolution:" @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "397e8e95", + "id": "f6904906", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "8ef85018", + "id": "c1a5407b", "metadata": {}, "source": [ "### Disabling Base Maps\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c625eab", + "id": "3436941c", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "dab9bc15", + "id": "e8a1a363", "metadata": {}, "source": [ "### Cultural Base Maps\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf9b1663", + "id": "9482a3c0", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "a29e370a", + "id": "a86f97eb", "metadata": {}, "source": [ "### Map Projections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bbc8489", + "id": "be7b3cf3", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d37e4d20", + "id": "2e36eb12", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "f4d37a1f", + "id": "ab570605", "metadata": {}, "source": [ "Map projections can be rotated using the `layout.geo.projection.rotation` attribute, and maps can be translated using the `layout.geo.center` attributed, as well as truncated to a certain longitude and latitude range using the `layout.geo.lataxis.range` and `layout.geo.lonaxis.range`.\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd7a3ed5", + "id": "562866cc", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "c3dc63be", + "id": "23123246", "metadata": {}, "source": [ "### Automatic Zooming or Bounds Fitting\n", @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6292d5c5", + "id": "c2a21cd6", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "9b3c7ed4", + "id": "4727d28e", "metadata": {}, "source": [ "### Named Map Scopes and Country Sub-Units\n", @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9bb20d1", + "id": "5be4d690", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "6204a95c", + "id": "2dc7c299", "metadata": {}, "source": [ "The `\"usa\"` scope contains state boundaries at both resolutions, and uses the special `'albers usa'` projection which moves Alaska and Hawaii closer to the \"lower 48 states\" to reduce projection distortion and produce a more compact map." @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0979e425", + "id": "35af70c9", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "63663ed1", + "id": "ad2c29ba", "metadata": {}, "source": [ "### Graticules (Latitude and Longitude Grid Lines)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9af66238", + "id": "c30387a4", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "a2675172", + "id": "558478f9", "metadata": {}, "source": [ "### Reference\n", @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "46892681", + "id": "71969a7d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/map-subplots-and-small-multiples.ipynb b/map-subplots-and-small-multiples.ipynb index 77a7703e9..e46c5ff19 100644 --- a/map-subplots-and-small-multiples.ipynb +++ b/map-subplots-and-small-multiples.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f6ef7df0", + "id": "c22ad891", "metadata": {}, "source": [ "### US map small multiples" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a06cc7a2", + "id": "3f1686b6", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "4615f75e", + "id": "d086d926", "metadata": {}, "source": [ "#### Reference\n", @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "626e52e9", + "id": "a0bddf88", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marginal-plots.ipynb b/marginal-plots.ipynb index fda678e66..dee87f08e 100644 --- a/marginal-plots.ipynb +++ b/marginal-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ea908914", + "id": "e79444f9", "metadata": {}, "source": [ "### Overview\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b3bb20", + "id": "daa99e43", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84b34258", + "id": "d994db3a", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "bcf094cf", + "id": "58d479ee", "metadata": {}, "source": [ "### Marginal Plots and Color\n", @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09d9fae5", + "id": "79bd4be2", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "8d735adc", + "id": "66678e3c", "metadata": {}, "source": [ "### Marginal Plots on Histograms\n", @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a6c3aa3", + "id": "e6332f9a", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "f477f6e0", + "id": "fa321bad", "metadata": {}, "source": [ "Try hovering over the rug plot points to identify individual country values in the histogram below:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c2d7b77", + "id": "f8fbc2f0", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ }, { "cell_type": "markdown", - "id": "68284bf2", + "id": "dd0102a2", "metadata": {}, "source": [ "### Marginal Plots and Facets\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8cf3afe", + "id": "f396aed2", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4be7a827", + "id": "1a77b0e2", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "768dc8ab", + "id": "cf196a38", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "112d6e50", + "id": "d150ba7c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/marker-style.ipynb b/marker-style.ipynb index c8988b1e1..4e9f935b6 100644 --- a/marker-style.ipynb +++ b/marker-style.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "32190b6c", + "id": "49bb25ba", "metadata": {}, "source": [ "### Add Marker Border\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "019dfe56", + "id": "f926e606", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "637f4d5e", + "id": "9e160a35", "metadata": {}, "source": [ "Here is an example that creates an empty graph object figure, and then adds two scatter traces with a marker border." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20ae747e", + "id": "6a697890", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "63d612cc", + "id": "119f9f38", "metadata": {}, "source": [ "Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density.\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b9f1b26", + "id": "18ae8794", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "d85ae6e0", + "id": "15c3f750", "metadata": {}, "source": [ "You can also pass an array of dash styles to set different styles per marker:" @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b673d3a2", + "id": "210c2528", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ }, { "cell_type": "markdown", - "id": "2e3b97bf", + "id": "8ebf42c7", "metadata": {}, "source": [ "The `marker.line.dash` attribute is available on `go.Scatter`, `go.Scatterpolar`, `go.Scattergeo`, `go.Scatterternary`, `go.Scattercarpet`, and `go.Scattersmith` traces.\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce11d581", + "id": "29294d42", "metadata": { "hide_code": true }, @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "437dae37", + "id": "23db2121", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "dd471a52", + "id": "bea191f5", "metadata": {}, "source": [ "### Opacity\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42f5ed34", + "id": "28281bf3", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "e74bcdea", + "id": "79ae60d7", "metadata": {}, "source": [ "### Marker Opacity\n", @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc051a9e", + "id": "66d431ca", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "c18641c1", + "id": "100a95a8", "metadata": {}, "source": [ "### Color Opacity\n", @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "097d35b3", + "id": "00c4f449", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ }, { "cell_type": "markdown", - "id": "89c2c4a1", + "id": "0d5b558e", "metadata": {}, "source": [ "### Custom Marker Symbols\n", @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "733a4231", + "id": "d5a10995", "metadata": { "lines_to_next_cell": 2 }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "c6e58d9a", + "id": "88ac87d3", "metadata": {}, "source": [ "### Using a Custom Marker\n", @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5821ab6", + "id": "83c51845", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "94f9cf94", + "id": "d7a74735", "metadata": {}, "source": [ "#### Open Marker Colors\n", @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fd115c4", + "id": "ab432547", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "2696b70e", + "id": "5431e5e9", "metadata": {}, "source": [ "### Setting Marker Angles" @@ -560,7 +560,7 @@ }, { "cell_type": "markdown", - "id": "169b6b9c", + "id": "c03a5e6d", "metadata": {}, "source": [ "*New in 5.11*\n", @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a553ffea", + "id": "bf4e99c2", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "8f265c0f", + "id": "faa5c319", "metadata": {}, "source": [ "### Setting Angle Reference\n", @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8fe7d2f", + "id": "a45675ef", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "b71342e2", + "id": "fd4ad3b0", "metadata": {}, "source": [ "### Using Standoff to Position a Marker\n", @@ -651,7 +651,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3840c516", + "id": "5a20298e", "metadata": {}, "outputs": [], "source": [ @@ -723,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "1017aae8", + "id": "dc3d4fa2", "metadata": {}, "source": [ "### Reference\n", @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "a2895158", + "id": "89cd0241", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/migrate-to-maplibre.ipynb b/migrate-to-maplibre.ipynb index c30d057a5..ed130fef2 100644 --- a/migrate-to-maplibre.ipynb +++ b/migrate-to-maplibre.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2bb7b3d2", + "id": "a06a042d", "metadata": {}, "source": [ "## Migrating from Mapbox traces to MapLibre traces\n", @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "2bb11afe", + "id": "e5af3973", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/mixed-subplots.ipynb b/mixed-subplots.ipynb index ddc5271b8..1e72a338a 100644 --- a/mixed-subplots.ipynb +++ b/mixed-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9cd8d9ff", + "id": "e6c707dc", "metadata": {}, "source": [ "### Mixed Subplots and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "4c02854e", + "id": "3df2f98a", "metadata": {}, "source": [ "#### Mixed Subplot" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61c2beeb", + "id": "debc85ee", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "9f0274c8", + "id": "1bcdd0df", "metadata": {}, "source": [ "#### Reference\n", @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "5fa2c86e", + "id": "99c96caa", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-knn.ipynb b/ml-knn.ipynb index 71b5a459c..430d93b6e 100644 --- a/ml-knn.ipynb +++ b/ml-knn.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e2833d52", + "id": "efbfa656", "metadata": {}, "source": [ "## Basic binary classification with kNN\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "84f3a45c", + "id": "1c41a055", "metadata": {}, "source": [ "### Display training and test splits\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c67ed46", + "id": "5ce793e8", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "85eff416", + "id": "2b24d812", "metadata": {}, "source": [ "### Visualize predictions on test split with [`plotly.express`](https://plotly.com/python/plotly-express/)" @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "9277e8cb", + "id": "74076c3d", "metadata": {}, "source": [ "Now, we train the kNN model on the same training data displayed in the previous graph. Then, we predict the confidence score of the model for each of the data points in the test set. We will use shapes to denote the true labels, and the color will indicate the confidence of the model for assign that score.\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f733ffe", + "id": "8cf0692c", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "8d7fbaa8", + "id": "e604a35e", "metadata": {}, "source": [ "## Probability Estimates with `go.Contour`\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "202fe8cf", + "id": "f7a7ee6d", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "46cf2951", + "id": "e14beab8", "metadata": {}, "source": [ "Now, let's try to combine our `go.Contour` plot with the first scatter plot of our data points, so that we can visually compare the confidence of our model with the true labels." @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a819c4e7", + "id": "810c74a9", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "6891955b", + "id": "89adbe8d", "metadata": {}, "source": [ "## k-NN classification in Dash\n", @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb189fe5", + "id": "8b44a639", "metadata": { "hide_code": true }, @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "fa029028", + "id": "5cbed25a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "c9252d22", + "id": "942f18c5", "metadata": {}, "source": [ "## Multi-class prediction confidence with [`go.Heatmap`](https://plotly.com/python/heatmaps/)\n", @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9882565a", + "id": "8cca470d", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "aff2ff2c", + "id": "2e4d75b1", "metadata": {}, "source": [ "### Reference\n", @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "2a881ad4", + "id": "dacb43c1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-pca.ipynb b/ml-pca.ipynb index 0213bac50..782ddf390 100644 --- a/ml-pca.ipynb +++ b/ml-pca.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ee986c82", + "id": "fa25188a", "metadata": {}, "source": [ "This page first shows how to visualize higher dimension data using various Plotly figures combined with dimensionality reduction (aka projection). Then, we dive into the specific details of our projection algorithm.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "06de2260", + "id": "cea4f6fd", "metadata": {}, "source": [ "## High-dimensional PCA Analysis with `px.scatter_matrix`\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "26cbb6eb", + "id": "80f3efcd", "metadata": {}, "source": [ "### Visualize all the original dimensions\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd650956", + "id": "ecda6ea6", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "eee5f9ad", + "id": "1c80c9e6", "metadata": {}, "source": [ "### Visualize all the principal components\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "553279dd", + "id": "9a8f787c", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "d1de61e8", + "id": "a07e815f", "metadata": {}, "source": [ "### Visualize a subset of the principal components\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31dc9430", + "id": "89a8d60e", "metadata": { "lines_to_next_cell": 2 }, @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "2fb11fcc", + "id": "20e328e9", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "10e02fe3", + "id": "7428d036", "metadata": {}, "source": [ "## 2D PCA Scatter Plot\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "911fec10", + "id": "d9ae510e", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "63447e59", + "id": "0fb54652", "metadata": {}, "source": [ "## Visualize PCA with `px.scatter_3d`\n", @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9371cc58", + "id": "c6e24169", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "943d139a", + "id": "cfb70b63", "metadata": {}, "source": [ "## Plotting explained variance\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae3b8c61", + "id": "d573abd4", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "5be22629", + "id": "5395e637", "metadata": {}, "source": [ "## Visualize Loadings\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f34f43cb", + "id": "f888965d", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "7394d264", + "id": "23af2f46", "metadata": {}, "source": [ "## References\n", @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "4d37dc7d", + "id": "cacf4cb1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-regression.ipynb b/ml-regression.ipynb index 0eee131ab..e5b8bf1fb 100644 --- a/ml-regression.ipynb +++ b/ml-regression.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4b6e1b49", + "id": "ec02f956", "metadata": {}, "source": [ "This page shows how to use Plotly charts for displaying various types of regression models, starting from simple models like [Linear Regression](https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html), and progressively move towards models like [Decision Tree][tree] and [Polynomial Features][poly]. We highlight various capabilities of plotly, such as comparative analysis of the same model with different parameters, displaying Latex, [surface plots](https://plotly.com/python/3d-surface-plots/) for 3D data, and enhanced prediction error analysis with [Plotly Express](https://plotly.com/python/plotly-express/).\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "154d84b9", + "id": "90136b72", "metadata": {}, "source": [ "## Basic linear regression plots\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7675dd9", + "id": "7a39d193", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "7107bb36", + "id": "6abad7dc", "metadata": {}, "source": [ "### Linear Regression with scikit-learn\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2e18977", + "id": "4e31ee37", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "3862d472", + "id": "a8d5e8d3", "metadata": {}, "source": [ "### ML Regression in Dash\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9daaa08", + "id": "6514bb6f", "metadata": { "hide_code": true }, @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "a9e17f25", + "id": "0dd26a5a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "4628f38c", + "id": "dd927086", "metadata": {}, "source": [ "## Model generalization on unseen data\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23fa10f0", + "id": "0a00192e", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "9ca71f11", + "id": "e1558ede", "metadata": {}, "source": [ "## Comparing different kNN models parameters\n", @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46dca038", + "id": "679579d1", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "63c74116", + "id": "53a8e337", "metadata": {}, "source": [ "## Displaying `PolynomialFeatures` using $\\LaTeX$\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8446333", + "id": "1355741c", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "e0f5865e", + "id": "a10664bf", "metadata": {}, "source": [ "## 3D regression surface with `px.scatter_3d` and `go.Surface`\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e6c1702", + "id": "da0e8bb9", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "2a663bf9", + "id": "74bfb9c3", "metadata": {}, "source": [ "## Visualizing coefficients for multiple linear regression (MLR)\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d55547f2", + "id": "a660b465", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "6cb1a950", + "id": "df83102b", "metadata": {}, "source": [ "## Prediction Error Plots\n", @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "de82c746", + "id": "06dd7708", "metadata": {}, "source": [ "### Simple actual vs predicted plot\n", @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afbd0627", + "id": "85470c01", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +412,7 @@ }, { "cell_type": "markdown", - "id": "93c21445", + "id": "85186357", "metadata": {}, "source": [ "### Enhanced prediction error analysis using `plotly.express`\n", @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acdd70e2", + "id": "f8904f8e", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "0d9d2096", + "id": "f9faf378", "metadata": {}, "source": [ "## Residual plots\n", @@ -477,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ac071ff", + "id": "438a8e01", "metadata": {}, "outputs": [], "source": [ @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "2b7f2a81", + "id": "76e58bc9", "metadata": {}, "source": [ "## Visualize regularization across cross-validation folds" @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "96171311", + "id": "a44d4273", "metadata": {}, "source": [ "In this example, we show how to plot the results of various $\\alpha$ penalization values from the results of cross-validation using scikit-learn's `LassoCV`. This is useful to see how much the error of the optimal alpha actually varies across CV folds." @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9854b15b", + "id": "0dc431bc", "metadata": {}, "outputs": [], "source": [ @@ -598,7 +598,7 @@ }, { "cell_type": "markdown", - "id": "8d0c9eb2", + "id": "3b4bd874", "metadata": {}, "source": [ "## Grid search visualization using `px.density_heatmap` and `px.box`\n", @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b2173e9", + "id": "e9f8afb4", "metadata": {}, "outputs": [], "source": [ @@ -686,7 +686,7 @@ }, { "cell_type": "markdown", - "id": "63577d1a", + "id": "defa1e93", "metadata": {}, "source": [ "### Reference\n", @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "73e4e8f5", + "id": "a575b6a7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-roc-pr.ipynb b/ml-roc-pr.ipynb index 86c72875c..4059abb88 100644 --- a/ml-roc-pr.ipynb +++ b/ml-roc-pr.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2f6ac0c3", + "id": "0eecb1a8", "metadata": {}, "source": [ "## Preliminary plots\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eaf37ecf", + "id": "c8d88b25", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "eef4c6ed", + "id": "15a18d7f", "metadata": {}, "source": [ "## Basic binary ROC curve\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f21a3d5c", + "id": "21dad285", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "5f1c2d44", + "id": "c518ff80", "metadata": {}, "source": [ "## ROC curve in Dash\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e1c1006", + "id": "65740eba", "metadata": { "hide_code": true }, @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "d9419730", + "id": "e8e46175", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "3fcf6a36", + "id": "886a27f3", "metadata": {}, "source": [ "## Multiclass ROC Curve\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96e54518", + "id": "337b9eb1", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "fe42d22b", + "id": "d51b5cc9", "metadata": {}, "source": [ "## Precision-Recall Curves\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7dfb9bd", + "id": "9c079ca8", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "db19bf75", + "id": "a4a36a44", "metadata": {}, "source": [ "In this example, we use the [average precision](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html) metric, which is an alternative scoring method to the area under the PR curve." @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0164842e", + "id": "e880add2", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "f9614bb8", + "id": "060b3cd4", "metadata": {}, "source": [ "## References\n", @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "dfc07f33", + "id": "984b4dc8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml-tsne-umap-projections.ipynb b/ml-tsne-umap-projections.ipynb index 99048e28f..3975dd499 100644 --- a/ml-tsne-umap-projections.ipynb +++ b/ml-tsne-umap-projections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cec87c8b", + "id": "8f34b610", "metadata": {}, "source": [ "This page presents various ways to visualize two popular dimensionality reduction techniques, namely the [t-distributed stochastic neighbor embedding](https://lvdmaaten.github.io/tsne/) (t-SNE) and [Uniform Manifold Approximation and Projection](https://umap-learn.readthedocs.io/en/latest/index.html) (UMAP). They are needed whenever you want to visualize data with more than two or three features (i.e. dimensions).\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "d711a5aa", + "id": "8683efd6", "metadata": {}, "source": [ "## Basic t-SNE projections\n", @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "96010165", + "id": "fdff2499", "metadata": {}, "source": [ "### Visualizing high-dimensional data with `px.scatter_matrix`\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abd59434", + "id": "8b94cfa5", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "3872f70f", + "id": "562f5b08", "metadata": {}, "source": [ "### Project data into 2D with t-SNE and `px.scatter`\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e58d780a", + "id": "6d76f9f7", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "6e7154fb", + "id": "d3677883", "metadata": {}, "source": [ "### Project data into 3D with t-SNE and `px.scatter_3d`\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f973f92", + "id": "4e427575", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "f7728f85", + "id": "913db37e", "metadata": {}, "source": [ "## Projections with UMAP\n", @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "398de277", + "id": "b415fe1d", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "9a07649b", + "id": "5d360a8b", "metadata": {}, "source": [ "## Visualizing image datasets\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abab14ff", + "id": "73f7cd16", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "5215da3a", + "id": "ba2c02eb", "metadata": { "lines_to_next_cell": 2 }, @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "d2fd31d2", + "id": "1a443ac7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ml_apps.ipynb b/ml_apps.ipynb index e64435c9e..ca12117f7 100644 --- a/ml_apps.ipynb +++ b/ml_apps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3b07039d", + "id": "922e06ed", "metadata": { "lines_to_next_cell": 0 }, @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "50da3998", + "id": "29f00378", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/multiple-axes.ipynb b/multiple-axes.ipynb index b9068d572..3708bdf7e 100644 --- a/multiple-axes.ipynb +++ b/multiple-axes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4676c791", + "id": "41ddb25f", "metadata": {}, "source": [ "### Multiple Y Axes and Plotly Express\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "2690ab3e", + "id": "fbe06e35", "metadata": {}, "source": [ "#### Two Y Axes" @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6ba37bb", + "id": "b4ab2e44", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "13003f1f", + "id": "5311733d", "metadata": {}, "source": [ "### Multiple axes in Dash\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e408d11", + "id": "81b4ef48", "metadata": { "hide_code": true }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "f2818414", + "id": "56efb6a7", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "741e400a", + "id": "27680a2e", "metadata": {}, "source": [ "#### Multiple Y-Axes Subplots" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dbc7a2b", + "id": "a959bddb", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "8bba4ac1", + "id": "1c3f198d", "metadata": {}, "source": [ "#### Multiple Axes\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39c417c2", + "id": "9884d8b5", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "a3b84f0e", + "id": "e1b2e701", "metadata": {}, "source": [ "#### Automatically Shifting Axes\n", @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf932c6e", + "id": "808abbb4", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "d5c80861", + "id": "ded34042", "metadata": {}, "source": [ "### Shift Axes by a Specific Number of Pixels\n", @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0e1ef53", + "id": "46887b77", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "5a5c17d0", + "id": "d77eeaf0", "metadata": {}, "source": [ "### Sync Axes Ticks" @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "61c536f0", + "id": "10c24832", "metadata": {}, "source": [ "*New in 5.13*\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c1803d3", + "id": "4fa8f520", "metadata": {}, "outputs": [], "source": [ @@ -506,7 +506,7 @@ }, { "cell_type": "markdown", - "id": "ca22c1f3", + "id": "ed24cb05", "metadata": {}, "source": [ "#### Reference\n", @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "afd72a3d", + "id": "d637246f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/network-graphs.ipynb b/network-graphs.ipynb index f95c636a1..d3b8fa26e 100644 --- a/network-graphs.ipynb +++ b/network-graphs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b194860e", + "id": "12095217", "metadata": {}, "source": [ "In this example we show how to visualize a network graph created using `networkx`.\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "03f91baa", + "id": "18771813", "metadata": {}, "source": [ "### Create random graph" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13359042", + "id": "70f27280", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "5a9ee9d9", + "id": "19ab66f7", "metadata": {}, "source": [ "#### Create Edges\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ba02225", + "id": "53e23636", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "9f60e7ae", + "id": "b9366817", "metadata": {}, "source": [ "#### Color Node Points\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "302b56a4", + "id": "cf2f73df", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "1567751e", + "id": "8a273a72", "metadata": {}, "source": [ "#### Create Network Graph" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1eb9dca", + "id": "d9c80b0d", "metadata": { "lines_to_next_cell": 2 }, @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "03815234", + "id": "4d0cc48a", "metadata": {}, "source": [ "### Network graphs in Dash\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63c7358d", + "id": "70b3d3f5", "metadata": { "hide_code": true }, @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "d70c0e86", + "id": "6d6f7336", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "9279b489", + "id": "9899a106", "metadata": {}, "source": [ "#### Reference\n", @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "2159c3f9", + "id": "04dcc004", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ohlc-charts.ipynb b/ohlc-charts.ipynb index 6dc9c67af..15bafc59f 100644 --- a/ohlc-charts.ipynb +++ b/ohlc-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e1b704ac", + "id": "968c8814", "metadata": {}, "source": [ "The [OHLC](https://en.wikipedia.org/wiki/Open-high-low-close_chart) chart (for open, high, low and close) is a style of financial chart describing open, high, low and close values for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. 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.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00c29dd0", + "id": "b803f821", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "bd44a87f", + "id": "4af3973e", "metadata": {}, "source": [ "#### OHLC Chart without Rangeslider" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28f9d5ea", + "id": "e8e06f28", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "72390755", + "id": "a0105761", "metadata": {}, "source": [ "#### Adding Customized Text and Annotations" @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca78d456", + "id": "40cde705", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "f4efad5a", + "id": "26e70555", "metadata": {}, "source": [ "#### Custom OHLC Colors" @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc761c0e", + "id": "a76ba2a7", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "7937195b", + "id": "ead05fea", "metadata": {}, "source": [ "#### Simple OHLC with `datetime` Objects" @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1347c1d", + "id": "63314fd7", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "850fee76", + "id": "b50ab1b7", "metadata": {}, "source": [ "### Custom Hovertext" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7cb62f6", + "id": "5249f056", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "f511a519", + "id": "e0de9a2c", "metadata": {}, "source": [ "#### Reference\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "cb900323", + "id": "8c34285b", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/orca-management.ipynb b/orca-management.ipynb index 032dfc718..f3e892fc0 100644 --- a/orca-management.ipynb +++ b/orca-management.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "08741e98", + "id": "d17affc6", "metadata": { "lines_to_next_cell": 0 }, @@ -28,7 +28,7 @@ }, { "cell_type": "raw", - "id": "ea39ea6c", + "id": "d48b93b9", "metadata": {}, "source": [ "$ conda install -c plotly plotly-orca==1.2.1 psutil requests" @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "83988ce0", + "id": "7222c667", "metadata": {}, "source": [ "**Note:** Even if you do not want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca==1.2.1` and the orca executable will be available system wide.\n", @@ -47,7 +47,7 @@ }, { "cell_type": "raw", - "id": "4e856fd7", + "id": "a897cc1c", "metadata": {}, "source": [ "$ npm install -g electron@1.8.4 orca\n", @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "14af8853", + "id": "4cd845c6", "metadata": {}, "source": [ "##### Standalone Binaries + pip\n", @@ -65,7 +65,7 @@ }, { "cell_type": "raw", - "id": "6ab4a86d", + "id": "2bb38815", "metadata": {}, "source": [ "$ pip install psutil requests" @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "aefde83a", + "id": "2e6a841a", "metadata": {}, "source": [ "### Install orca on Google Colab\n", @@ -104,7 +104,7 @@ }, { "cell_type": "markdown", - "id": "85add710", + "id": "27febffd", "metadata": {}, "source": [ "### Create a Figure\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1b07cdd", + "id": "eb3bbc68", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "c7b84283", + "id": "f218c278", "metadata": {}, "source": [ "### config\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36eab49e", + "id": "f9cc2822", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "532f0aae", + "id": "0260dd97", "metadata": {}, "source": [ "### status\n", @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c78588bc", + "id": "e6b4a405", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "8fabce18", + "id": "7a5ead45", "metadata": {}, "source": [ "Since no image export operations have been performed yet, the orca server is not yet running.\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b519658b", + "id": "74980adb", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "ff2f694c", + "id": "b0608d53", "metadata": {}, "source": [ "By checking the `status` object again, we see that the orca server is now running" @@ -221,7 +221,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c42483e4", + "id": "b81e3efa", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "f853fd06", + "id": "c9fb0931", "metadata": {}, "source": [ "Let's perform this same export operation again, now that the server is already running." @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a073116e", + "id": "261ebaa7", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "6b12734a", + "id": "135919c8", "metadata": {}, "source": [ "The difference in runtime is dramatic. Starting the server and exporting the first image takes a couple seconds, while exporting an image with a running server is much faster." @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "1ec946db", + "id": "ecb2d38b", "metadata": {}, "source": [ "### Shutdown the Server\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dabdc2f8", + "id": "f9aa418f", "metadata": {}, "outputs": [], "source": [ @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28e6b44b", + "id": "279973ad", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc49c125", + "id": "815e2d28", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "41be68da", + "id": "32a7f59c", "metadata": {}, "source": [ "### Configuring the Executable\n", @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "8acceff0", + "id": "94c8ba96", "metadata": {}, "source": [ "### Other Configuration Settings\n", @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "072866f1", + "id": "4599f79f", "metadata": {}, "source": [ "### Saving Configuration Settings\n", @@ -387,7 +387,7 @@ }, { "cell_type": "markdown", - "id": "720998b6", + "id": "1d4568fc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pandas-backend.ipynb b/pandas-backend.ipynb index 1ece9af90..23fff78f5 100644 --- a/pandas-backend.ipynb +++ b/pandas-backend.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c344fbf7", + "id": "90993017", "metadata": {}, "source": [ "### Introduction\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4f8fa67", + "id": "707a4506", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "d3039c00", + "id": "3e7752a6", "metadata": {}, "source": [ "This functionality wraps [Plotly Express](/python/plotly-express/) and so you can use any of the [styling options available to Plotly Express methods](/python/styling-plotly-express/). Since what you get back is a regular `Figure` object, you can use any of the update mechanisms supported by these objects to apply [templates](/python/templates/) or further customize [axes](/python/axes/), [colors](/python/colorscales/), [legends](/python/legend/), [fonts](/python/figure-labels/), [hover labels](/python/hover-text-and-formatting/) etc. [Faceting](/python/facet-plots/) is also supported." @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10b0e65e", + "id": "5d538991", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "f3ffcf2e", + "id": "3c48549a", "metadata": {}, "source": [ "### A Note on API Compatibility\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78796079", + "id": "dd56622f", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "c048b96a", + "id": "8d2cb3b5", "metadata": {}, "source": [ "To achieve a similar effect to `subplots=True`, for example, the [Plotly Express `facet_row` and `facet_col` options](/python/facet-plots/) can be used, the same was as they work when directly calling [Plotly Express with wide-form data](/python/wide-form/):" @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a128d90f", + "id": "59b0984e", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "152f8580", + "id": "bfcdd1b4", "metadata": {}, "source": [ "### Supported Methods\n", @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "248d25fe", + "id": "661abed2", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4151be30", + "id": "7bc6124c", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e78f580", + "id": "e3821bf0", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41ff965a", + "id": "08c521c9", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90eb65f4", + "id": "d9bc8eff", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e96ace8e", + "id": "c4c56cd8", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e645b43", + "id": "9b9404ad", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "b963e39d", + "id": "eb3344f4", "metadata": {}, "source": [ "### `Series` and `DataFrame` functions: `hist` and `boxplot`\n", @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9180d382", + "id": "be6be199", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "cf79d998", + "id": "04aa200a", "metadata": {}, "source": [ "### What about Cufflinks?\n", @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "df2a75b1", + "id": "05aaf8d5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-categories-diagram.ipynb b/parallel-categories-diagram.ipynb index 5ce3cb968..a07cf4020 100644 --- a/parallel-categories-diagram.ipynb +++ b/parallel-categories-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ec056573", + "id": "18c84414", "metadata": {}, "source": [ "#### Parallel Categories Diagram\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6582a62e", + "id": "c8e3a431", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "9b18a987", + "id": "a59ad8cc", "metadata": {}, "source": [ "#### Style Diagram\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "439e6015", + "id": "da4da984", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "0071cd9a", + "id": "3bfe027e", "metadata": {}, "source": [ "### Basic Parallel Categories Diagram with `graph_objects`\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c076c3b", + "id": "defe625b", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "2dd81e73", + "id": "2bd1aadf", "metadata": {}, "source": [ "#### Basic Parallel Categories Diagram with Counts\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b2ad49c", + "id": "706a85da", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "a9f2a381", + "id": "b1ded422", "metadata": {}, "source": [ "#### Multi-Color Parallel Categories Diagram\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ad56d8b", + "id": "597f9e6d", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "375a9946", + "id": "049fe027", "metadata": {}, "source": [ "#### Parallel Categories Linked Brushing\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93fc915f", + "id": "ed2efd8d", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "1682a0a0", + "id": "a04bc918", "metadata": {}, "source": [ "![Single-color brushing](https://user-images.githubusercontent.com/15064365/48087050-4a3eae80-e1cc-11e8-94c9-c0ffcedd3aa9.gif)\n", @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef0bc0f0", + "id": "4f51a4e8", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "f4c3b237", + "id": "ad82b435", "metadata": {}, "source": [ "![Multi-color brushing](https://user-images.githubusercontent.com/15064365/48087055-4e6acc00-e1cc-11e8-8f0c-c8316eb4def2.gif)\n", @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "102d9322", + "id": "3936651d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/parallel-coordinates-plot.ipynb b/parallel-coordinates-plot.ipynb index 79d12ca63..44d13e693 100644 --- a/parallel-coordinates-plot.ipynb +++ b/parallel-coordinates-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6682cb6f", + "id": "74afeb37", "metadata": {}, "source": [ "## Parallel Coordinates plot with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfd2d299", + "id": "5062a68c", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "619e1594", + "id": "30a48717", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions.\n", @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aa2280c", + "id": "9fce3977", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "d44a1af1", + "id": "a4f4cd88", "metadata": {}, "source": [ "## Parallel Coordinates Chart with go.Parcoords" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29dc2418", + "id": "957ef940", "metadata": { "inputHidden": false, "outputHidden": false @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "d613eeaf", + "id": "71e0e5e3", "metadata": {}, "source": [ "Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions and drag the axis names across the plot to rearrange variables.\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8172852", + "id": "619f810c", "metadata": { "inputHidden": false, "outputHidden": false @@ -152,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "1b6d942d", + "id": "a0b0885a", "metadata": {}, "source": [ "### Advanced Parallel Coordinates Plot" @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85eb1e88", + "id": "9248bd7e", "metadata": { "inputHidden": false, "outputHidden": false @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "24f23dd5", + "id": "83c6c7b1", "metadata": {}, "source": [ "### Unselected Line Color and Opacity" @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "f0659b23", + "id": "5c88d76a", "metadata": {}, "source": [ "*New in 5.10*\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f6b963c", + "id": "e2548234", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "7aadcebb", + "id": "ead0213b", "metadata": {}, "source": [ "#### Reference\n", @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "79877271", + "id": "6ce39dfb", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pattern-hatching-texture.ipynb b/pattern-hatching-texture.ipynb index f5f3f884b..f9ece9936 100644 --- a/pattern-hatching-texture.ipynb +++ b/pattern-hatching-texture.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d42ac114", + "id": "27fa10f3", "metadata": {}, "source": [ "*New in 5.0, with support for pie, sunburst, icicle, funnelarea, and treemap charts in 5.15*\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "36bc21ca", + "id": "63db063a", "metadata": {}, "source": [ "### Patterned Charts with Plotly Express\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24dda7bf", + "id": "938dafc3", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54f67fd3", + "id": "9cb9aa1e", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "9046fa56", + "id": "0f0b1505", "metadata": {}, "source": [ "In the chart below we use `px.histogram()` instead of `px.bar()` to aggregate multiple values together, and encode one variable (sex) using both color and x-position and another (smoker) using patterns:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0eb1296e", + "id": "b7517e7c", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "08741d71", + "id": "f7cf73d8", "metadata": {}, "source": [ "### Controlling Pattern Assignment\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71b64aff", + "id": "e5746d89", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "075172bd", + "id": "6b54cf31", "metadata": {}, "source": [ "Here we use `pattern_shape_map` to explictly assign a shape to each value of `nation`, regardless of order:" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6aa6a2c", + "id": "895bc2aa", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "64e64a64", + "id": "df2b576e", "metadata": {}, "source": [ "### Black on White Patterns for Print\n", @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa9f1754", + "id": "31518032", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "72b7276b", + "id": "03cbd83e", "metadata": {}, "source": [ "Of course, this setting can be used without making the figure monochrome as well:" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f480172", + "id": "e5d61e3c", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "96fea0ce", + "id": "bd753d81", "metadata": {}, "source": [ "### Patterns using Graph Objects\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b74d74bd", + "id": "7c7111d3", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "22baa902", + "id": "9277362c", "metadata": {}, "source": [ "### Patterns Using SVG Paths\n", @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2001d65d", + "id": "72c022cf", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "0660f6ca", + "id": "696f46f7", "metadata": {}, "source": [ "#### Reference\n", @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "c4e8f48b", + "id": "c330ebb2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/peak-finding.ipynb b/peak-finding.ipynb index ad96300c8..69b690b24 100644 --- a/peak-finding.ipynb +++ b/peak-finding.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2d399a82", + "id": "4ed593a9", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0efb05af", + "id": "1df5aebb", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "328e31da", + "id": "5bf2ed69", "metadata": {}, "source": [ "#### Import Data\n", @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a2af384", + "id": "25f6b919", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "63f4af25", + "id": "a1f6831d", "metadata": {}, "source": [ "#### Peak Detection\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed9c0b3c", + "id": "072b892d", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "d4c4d0ba", + "id": "7462812e", "metadata": {}, "source": [ "#### Only Highest Peaks\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "503bbfd8", + "id": "ba20b389", "metadata": { "lines_to_next_cell": 2 }, @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "4a28b978", + "id": "40c249e2", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/performance.ipynb b/performance.ipynb index ac49bd042..4b46ed3ad 100644 --- a/performance.ipynb +++ b/performance.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "14ea2585", + "id": "a61a8ac9", "metadata": {}, "source": [ "## DataFrame Types\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86e47d34", + "id": "cda83463", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "4626efb5", + "id": "ed36d178", "metadata": {}, "source": [ "## WebGL\n", @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "8e7b3399", + "id": "90eed72e", "metadata": {}, "source": [ "```\n", @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "4b065862", + "id": "170fde32", "metadata": {}, "source": [ "### WebGL for Scatter Performance\n", @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ded2510", + "id": "13334333", "metadata": { "lines_to_next_cell": 2 }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "012281b3", + "id": "df3766f8", "metadata": {}, "source": [ "#### WebGL with 1,000,000 points with Graph Objects\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "529b18f7", + "id": "ec4b9560", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ }, { "cell_type": "markdown", - "id": "cfabc0d0", + "id": "f542ac8c", "metadata": {}, "source": [ "See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81aa426a", + "id": "05e78f10", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "942b9aec", + "id": "d8748938", "metadata": {}, "source": [ "### Exploring Correlations of a Large Dataset\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "780ac4a3", + "id": "91aec3a2", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d071098c", + "id": "95cf8593", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "a07c81e3", + "id": "2e5dedca", "metadata": {}, "source": [ "Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.\n" @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "fea58afc", + "id": "637fdd82", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/pie-charts.ipynb b/pie-charts.ipynb index 7bee4cb92..b4425074c 100644 --- a/pie-charts.ipynb +++ b/pie-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "88cd47b3", + "id": "61418033", "metadata": {}, "source": [ "A pie chart is a circular statistical chart, which is divided into sectors to illustrate numerical proportion.\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecbbca28", + "id": "b6dda9fc", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "dab64472", + "id": "adb1b7dc", "metadata": {}, "source": [ "### Pie chart with repeated labels\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c3823c8", + "id": "43f3ad4a", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "863da6be", + "id": "21341a8d", "metadata": {}, "source": [ "### Pie chart in Dash\n", @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95e72676", + "id": "bd504bc3", "metadata": { "hide_code": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "9bc99a61", + "id": "907710ad", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "c7e5d064", + "id": "50529b9b", "metadata": {}, "source": [ "### Setting the color of pie sectors with px.pie" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a4c3998", + "id": "928b949d", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "b5a302a7", + "id": "30ff7c08", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efdc3332", + "id": "82b26ace", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "0f3189dd", + "id": "71ebb151", "metadata": {}, "source": [ "### Customizing a pie chart created with px.pie\n", @@ -151,7 +151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b670b109", + "id": "46074a22", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "3b3dbddc", + "id": "534a217c", "metadata": {}, "source": [ "### Basic Pie Chart with go.Pie\n", @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "165a9c12", + "id": "0187d46d", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "071fa6dc", + "id": "3d810521", "metadata": {}, "source": [ "### Styled Pie Chart\n", @@ -208,7 +208,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59068551", + "id": "fc7c0dbd", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "a07f2387", + "id": "dc39dbad", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "515699cb", + "id": "85d0d563", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "cc131773", + "id": "71348fc4", "metadata": {}, "source": [ "#### Controlling text orientation inside pie sectors\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1daaed7", + "id": "28b6984a", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "ff9686d1", + "id": "e780b6fa", "metadata": {}, "source": [ "### Donut Chart" @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d707a94", + "id": "b45f6ee2", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "b435f265", + "id": "97f6e8e9", "metadata": {}, "source": [ "### Pulling sectors out from the center\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54fb1ffd", + "id": "92576a23", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "6a805d8c", + "id": "ad18dfa2", "metadata": {}, "source": [ "### Pie Charts in subplots" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42430f4e", + "id": "b195122c", "metadata": {}, "outputs": [], "source": [ @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a962053b", + "id": "f8450eb3", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "943d38b8", + "id": "6c041c3e", "metadata": {}, "source": [ "#### Plot chart with area proportional to total count\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "066147ab", + "id": "2625fd95", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "58429213", + "id": "a22df5f4", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd8a2290", + "id": "483ff642", "metadata": {}, "outputs": [], "source": [ @@ -491,7 +491,7 @@ }, { "cell_type": "markdown", - "id": "a57c881f", + "id": "65538f1d", "metadata": {}, "source": [ "### See Also: Sunburst charts\n", @@ -502,7 +502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "811fecd5", + "id": "abda14ac", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "bb5a8ff6", + "id": "4092f4a3", "metadata": {}, "source": [ "#### Reference\n", @@ -530,7 +530,7 @@ }, { "cell_type": "markdown", - "id": "8a5461f6", + "id": "7efe44cf", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plot-data-from-csv.ipynb b/plot-data-from-csv.ipynb index b2d028383..f1c34b21f 100644 --- a/plot-data-from-csv.ipynb +++ b/plot-data-from-csv.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d93b7a6b", + "id": "21d343a0", "metadata": {}, "source": [ "CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b40a1b39", + "id": "0e152eda", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "7061bebd", + "id": "1489d58d", "metadata": {}, "source": [ "### Plot from CSV with Plotly Express" @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47da48c4", + "id": "4d82befb", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "d33dd1b2", + "id": "c0efefbc", "metadata": {}, "source": [ "### Plot from CSV in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23494d28", + "id": "2152397b", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "7ba5d08b", + "id": "350e96e6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "ef67e4fb", + "id": "c4c523e9", "metadata": {}, "source": [ "### Plot from CSV with `graph_objects`" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a97399b0", + "id": "1d3ac307", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "92830e02", + "id": "b289eba7", "metadata": {}, "source": [ "#### Reference\n", @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "b8d2a999", + "id": "b1d14253", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/plotly-express.ipynb b/plotly-express.ipynb index d9563b6e9..030dbb5a3 100644 --- a/plotly-express.ipynb +++ b/plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ca12dbe5", + "id": "6fb6847f", "metadata": {}, "source": [ "### Overview\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96aa5e1f", + "id": "0cd6368f", "metadata": { "hide_code": true }, @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "56b167a3", + "id": "cc95431f", "metadata": {}, "source": [ "Plotly Express currently includes the following functions:\n", @@ -73,7 +73,7 @@ }, { "cell_type": "markdown", - "id": "4ee41cd3", + "id": "448c4749", "metadata": {}, "source": [ "### Plotly Express in Dash\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a38dcee", + "id": "86d255bd", "metadata": { "hide_code": true }, @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "ad2bd838", + "id": "02d1a804", "metadata": {}, "source": [ "### Gallery\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6f40b45", + "id": "05d630aa", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "477e3c41", + "id": "222f3615", "metadata": {}, "source": [ "**Read more about [trendlines](/python/linear-fits/) and [templates](/python/templates/) and [marginal distribution plots](https://plotly.com/python/marginal-plots/).**" @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e395289", + "id": "b8514ce0", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "78ae79f8", + "id": "1c9862c1", "metadata": {}, "source": [ "**Read more about [error bars](/python/error-bars/).**" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a7af91f", + "id": "593ab6d4", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "c803927c", + "id": "86f15fa3", "metadata": {}, "source": [ "**Read more about [bar charts](/python/bar-charts/).**" @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0da66a34", + "id": "92b3d3be", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1786cb29", + "id": "9b4ae7c7", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "df7f6c38", + "id": "589de399", "metadata": {}, "source": [ "**Read more about [facet plots](/python/facet-plots/).**" @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c467dc8b", + "id": "9427ab7c", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "09a9048a", + "id": "0d8c93a2", "metadata": {}, "source": [ "**Read more about [scatterplot matrices (SPLOMs)](/python/splom/).**\n" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e86eafaf", + "id": "b04bf5ac", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ }, { "cell_type": "markdown", - "id": "fabf591a", + "id": "2c2413e8", "metadata": {}, "source": [ "**Read more about [parallel coordinates](/python/parallel-coordinates-plot/) and [parallel categories](/python/parallel-categories-diagram/), as well as [continuous color](/python/colorscales/).**" @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52e85e71", + "id": "ca9efcc4", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b591aea", + "id": "de4f7f15", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "ca985bb9", + "id": "615ae74a", "metadata": {}, "source": [ "**Read more about [hover labels](/python/hover-text-and-formatting/).**" @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96daf76d", + "id": "537347a8", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "79d2dbfa", + "id": "894ef333", "metadata": {}, "source": [ "**Read more about [animations](/python/animations/).**" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3db1cf0", + "id": "0b18e324", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "1e57164a", + "id": "0234e382", "metadata": {}, "source": [ "**Read more about [line charts](/python/line-charts/).**" @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "521ddd0e", + "id": "3e03ff54", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "18ed2ef5", + "id": "1b0d8093", "metadata": {}, "source": [ "**Read more about [area charts](/python/filled-area-plots/).**" @@ -362,7 +362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f5ff1bb", + "id": "1297fb96", "metadata": {}, "outputs": [], "source": [ @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "7980dc75", + "id": "3d9e91f7", "metadata": {}, "source": [ "**Read more about [timeline/Gantt charts](/python/gantt/).**" @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0fb0b6a", + "id": "6e2a50a1", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "d1e0320d", + "id": "5031f587", "metadata": {}, "source": [ "**Read more about [funnel charts](/python/funnel-charts/).**" @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cca95c85", + "id": "95755365", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "ce787967", + "id": "b06cec98", "metadata": {}, "source": [ "### Part to Whole Charts\n", @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f56dc2e", + "id": "77b6291a", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "e29d86a2", + "id": "c2a16c2e", "metadata": {}, "source": [ "**Read more about [sunburst charts](/python/sunburst-charts/).**" @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f0527b2", + "id": "b8308d2f", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "88d95fc3", + "id": "d8c808fd", "metadata": {}, "source": [ "**Read more about [treemaps](/python/treemaps/).**" @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8930adc", + "id": "23c1116f", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "0e041714", + "id": "29225ad6", "metadata": {}, "source": [ "**Read more about [icicle charts](/python/icicle-charts/).**" @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba0318fb", + "id": "e39e318e", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "1c4bc4b9", + "id": "05b17640", "metadata": {}, "source": [ "#### Distributions\n", @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2cf63fe1", + "id": "b701d117", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "173cb78c", + "id": "95048980", "metadata": {}, "source": [ "**Read more about [box plots](/python/box-plots/).**" @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6bcb447", + "id": "798cb475", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "b9ebdfe1", + "id": "cc2b62f0", "metadata": {}, "source": [ "**Read more about [violin plots](/python/violin/).**" @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e594b3c2", + "id": "5f33f5b6", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "96daceac", + "id": "6b556c1e", "metadata": {}, "source": [ "**Read more about [Empirical Cumulative Distribution Function (ECDF) charts](https://plotly.com/python/ecdf-plots/).**" @@ -592,7 +592,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc0af6fb", + "id": "e62757d5", "metadata": {}, "outputs": [], "source": [ @@ -604,7 +604,7 @@ }, { "cell_type": "markdown", - "id": "1f497b61", + "id": "f3f62ba3", "metadata": {}, "source": [ "**Read more about [strip charts](https://plotly.com/python/strip-charts/).**" @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe5f042b", + "id": "f9ffc1e0", "metadata": {}, "outputs": [], "source": [ @@ -625,7 +625,7 @@ }, { "cell_type": "markdown", - "id": "1cf683a0", + "id": "cc44e0ab", "metadata": {}, "source": [ "**Read more about [density contours, also known as 2D histogram contours](/python/2d-histogram-contour/).**" @@ -634,7 +634,7 @@ { "cell_type": "code", "execution_count": null, - "id": "276c63e7", + "id": "1e87e87a", "metadata": {}, "outputs": [], "source": [ @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "4334171d", + "id": "4cb780ec", "metadata": {}, "source": [ "**Read more about [density heatmaps, also known as 2D histograms](/python/2D-Histogram/).**" @@ -655,7 +655,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a7fa435", + "id": "b50f6341", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "4b76691c", + "id": "630e3379", "metadata": {}, "source": [ "### Images and Heatmaps\n", @@ -678,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80fe84b0", + "id": "213edc08", "metadata": {}, "outputs": [], "source": [ @@ -696,7 +696,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3f459cf", + "id": "427a16ac", "metadata": {}, "outputs": [], "source": [ @@ -709,7 +709,7 @@ }, { "cell_type": "markdown", - "id": "8d9f6aaa", + "id": "d18e8b9b", "metadata": {}, "source": [ "#### Tile Maps\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "673b76ba", + "id": "e58f33f8", "metadata": {}, "outputs": [], "source": [ @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "5d953171", + "id": "d95eafcb", "metadata": {}, "source": [ "**Read more about [tile map GeoJSON choropleths](/python/tile-county-choropleth/).**" @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d529fd92", + "id": "286abb9d", "metadata": {}, "outputs": [], "source": [ @@ -761,7 +761,7 @@ }, { "cell_type": "markdown", - "id": "ae849c17", + "id": "efb3e6d8", "metadata": {}, "source": [ "### Outline Maps\n", @@ -772,7 +772,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c1a7c73", + "id": "0277c060", "metadata": { "lines_to_next_cell": 2 }, @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "81c887e9", + "id": "b6cc2006", "metadata": {}, "source": [ "**Read more about [choropleth maps](/python/choropleth-maps/).**" @@ -796,7 +796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a34a9226", + "id": "2354ced8", "metadata": { "lines_to_next_cell": 2 }, @@ -810,7 +810,7 @@ }, { "cell_type": "markdown", - "id": "520c043d", + "id": "e6cdf29a", "metadata": {}, "source": [ "#### Polar Coordinates\n", @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65ec9f8a", + "id": "09be6797", "metadata": {}, "outputs": [], "source": [ @@ -834,7 +834,7 @@ }, { "cell_type": "markdown", - "id": "73ef1bb4", + "id": "a7a74f03", "metadata": {}, "source": [ "**Read more about [radar charts](https://plotly.com/python/radar-chart/).**" @@ -843,7 +843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e879bf39", + "id": "ef7918c5", "metadata": {}, "outputs": [], "source": [ @@ -856,7 +856,7 @@ }, { "cell_type": "markdown", - "id": "685ae02e", + "id": "fd8583b4", "metadata": {}, "source": [ "**Read more about [polar bar charts](/python/wind-rose-charts/).**" @@ -865,7 +865,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8f368a7", + "id": "dcc5069a", "metadata": {}, "outputs": [], "source": [ @@ -878,7 +878,7 @@ }, { "cell_type": "markdown", - "id": "ec3a741c", + "id": "34f52299", "metadata": {}, "source": [ "#### 3D Coordinates\n", @@ -889,7 +889,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c310ee3f", + "id": "83d2a26f", "metadata": {}, "outputs": [], "source": [ @@ -902,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "9de4b537", + "id": "8e7fa871", "metadata": {}, "source": [ "#### Ternary Coordinates\n", @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aec0e87e", + "id": "4057d7ac", "metadata": { "lines_to_next_cell": 2 }, @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "c0f11f03", + "id": "7dee77f8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/polar-chart.ipynb b/polar-chart.ipynb index 4aaced33a..1b3aa32db 100644 --- a/polar-chart.ipynb +++ b/polar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d156dc04", + "id": "208fd1e5", "metadata": {}, "source": [ "## Polar chart with Plotly Express\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fadd7641", + "id": "c7b5b6b3", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "10eedbf3", + "id": "b99be7e1", "metadata": {}, "source": [ "The \"strength\" column corresponds to strength categories of the wind, and there is a frequency value for each direction and strength. Below we use the strength column to encode the color, symbol and size of the markers." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e38a64b2", + "id": "4bef2a58", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "397d2f3e", + "id": "c685a425", "metadata": {}, "source": [ "For a line polar plot, use `px.line_polar`:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39d22705", + "id": "14952152", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "ad675899", + "id": "f33d8e3f", "metadata": {}, "source": [ "See also the [wind rose page](https://plotly.com/python/wind-rose-charts/) for more wind rose visualizations in polar coordinates.\n", @@ -88,7 +88,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3d72901", + "id": "0a660c70", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "6403dc3f", + "id": "fa41b01b", "metadata": {}, "source": [ "## Polar Scatter Plot with go.Scatterpolar\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39fe5d45", + "id": "93855e8e", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "3bc0c22f", + "id": "06932d24", "metadata": {}, "source": [ "#### Line Polar Chart" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d90e13f0", + "id": "baf9d0ca", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "49af91a4", + "id": "796d9a93", "metadata": {}, "source": [ "#### Polar Bar Chart\n", @@ -196,7 +196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0d36296", + "id": "e38f9751", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "198bf187", + "id": "2fdab3b9", "metadata": {}, "source": [ "#### Categorical Polar Chart" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "955736f0", + "id": "bb02a01e", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "4a71bffb", + "id": "ee5453b6", "metadata": {}, "source": [ "#### Polar Chart Sector" @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79e0e3ef", + "id": "22bc9d6b", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "a71bfe4d", + "id": "68bc573f", "metadata": {}, "source": [ "#### Polar Chart Directions" @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b27303f9", + "id": "f525bd72", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "23284bb8", + "id": "db0fb1af", "metadata": {}, "source": [ "#### Webgl Polar Chart\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c799a04", + "id": "1dc4ed29", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "d7372f49", + "id": "1a6f02df", "metadata": {}, "source": [ "#### Polar Chart Subplots" @@ -492,7 +492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc57fd7c", + "id": "ba6fe783", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "8aeac167", + "id": "dbd0c046", "metadata": {}, "source": [ "#### Reference\n", @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "49ae7ecd", + "id": "a3137e5d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/px-arguments.ipynb b/px-arguments.ipynb index 89fdea091..2727c3912 100644 --- a/px-arguments.ipynb +++ b/px-arguments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f3a78d32", + "id": "21e25c4b", "metadata": {}, "source": [ "Plotly Express (`px`) is the high-level interface to Plotly and provides functions for generating charts. `px` functions support data provided in a number of different formats (long, wide, and mixed) and as different types of objects, including pandas and Polars dataframes.\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39385c44", + "id": "d76415c4", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "d058b982", + "id": "2163cf56", "metadata": {}, "source": [ "By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types." @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3be43b5", + "id": "4de4ac53", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "03b92067", + "id": "bb9b27da", "metadata": {}, "source": [ "## Long, Wide, and Mixed-Form Data\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13d699f0", + "id": "a394dbbf", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cfb24d3", + "id": "032ebebe", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "markdown", - "id": "3bc09e93", + "id": "0637cc73", "metadata": {}, "source": [ "Plotly Express can produce the same plot from either form:" @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3331fb29", + "id": "41f70e1d", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec083725", + "id": "fcc536a4", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "6aa0a38b", + "id": "7eb77b2d", "metadata": {}, "source": [ "You might notice that y-axis and legend labels are slightly different for the second plot: they are \"value\" and \"variable\", respectively, and this is also reflected in the hoverlabel text. Note that the labels \"medal\" and \"count\" do not appear in the wide-form data frame, so in this case, you must supply these yourself, or [you can use a data frame with named row- and column-indexes](/python/wide-form/). You can [rename these labels with the `labels` argument](/python/styling-plotly-express/):" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bd556f3", + "id": "7ce62083", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "e052826a", + "id": "7b5ea278", "metadata": {}, "source": [ "Many more examples of wide-form and messy data input can be found in our [detailed wide-form support documentation](/python/wide-form/)." @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "baf6e6b3", + "id": "1c1a11f6", "metadata": {}, "source": [ "## Dataframe Input\n", @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d912416", + "id": "fd9ddaaa", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "99b74742", + "id": "759bc5ca", "metadata": {}, "source": [ "### Example: Polars DataFrame with `px.bar`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9fdb6d3", + "id": "9d5cbe96", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "51ad130f", + "id": "98055746", "metadata": {}, "source": [ "### Using the Index of a Dataframe\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e3a86e7", + "id": "8e3c91f0", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "markdown", - "id": "69c26dc6", + "id": "0f9cd441", "metadata": {}, "source": [ "### Using Columns from Multiple Dataframes\n", @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b485be94", + "id": "686728b3", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "824e849d", + "id": "67fec185", "metadata": {}, "source": [ "### Using labels to pass names\n", @@ -290,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef16c8d1", + "id": "ec3f0e6a", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d1aca9a", + "id": "426ca1ae", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "a9e35a54", + "id": "eb8a1e8c", "metadata": {}, "source": [ "### Input Data as array-like columns: NumPy arrays, lists...\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bfc6130", + "id": "b4ded84c", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "d0635063", + "id": "1985da21", "metadata": {}, "source": [ "List arguments can also be passed in as a list of lists, which triggers [wide-form data processing](/python/wide-form/), with the downside that the resulting traces will need to be manually renamed via `fig.data[].name = \"name\"`." @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d221c84", + "id": "e5754ffe", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "48d8a33e", + "id": "74dab156", "metadata": {}, "source": [ "### Passing dictionaries or array-likes as the data_frame argument\n", @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cad5c148", + "id": "50a00664", "metadata": {}, "outputs": [], "source": [ @@ -392,7 +392,7 @@ }, { "cell_type": "markdown", - "id": "20d74353", + "id": "d70fde2b", "metadata": {}, "source": [ "To pass a `dict` or an array (such as a NumPy `ndarray`) to the `data_frame` parameter, you'll need to have pandas installed, because `plotly.express` internally converts the `dict` or array to a pandas DataFrame.\n", @@ -405,7 +405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "908ac11e", + "id": "be42dba9", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "9d590b91", + "id": "87869244", "metadata": {}, "source": [ "### Mixing dataframes and other types\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78d629c4", + "id": "7e0333c7", "metadata": { "lines_to_next_cell": 2 }, @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "e34f2a81", + "id": "e989ba57", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/quiver-plots.ipynb b/quiver-plots.ipynb index fb7fd8cfb..8b1b57046 100644 --- a/quiver-plots.ipynb +++ b/quiver-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3674a219", + "id": "e50bd7b2", "metadata": {}, "source": [ "Quiver plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7063a5cb", + "id": "84053756", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "c6bb1321", + "id": "f7025351", "metadata": {}, "source": [ "#### Quiver Plot with Points" @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83590d4a", + "id": "850fc8db", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "798ff940", + "id": "23a7bb02", "metadata": {}, "source": [ "#### See also\n", @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "0221d617", + "id": "fdab7df0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/radar-chart.ipynb b/radar-chart.ipynb index c0c4483bc..1a32e8881 100644 --- a/radar-chart.ipynb +++ b/radar-chart.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0bd71bd3", + "id": "c3ae1752", "metadata": {}, "source": [ "A [Radar Chart](https://en.wikipedia.org/wiki/Radar_chart) (also known as a spider plot or star plot) displays multivariate data in the form of a two-dimensional chart of quantitative variables represented on axes originating from the center. The relative position and angle of the axes is typically uninformative. It is equivalent to a [parallel coordinates plot](/python/parallel-coordinates-plot/) with the axes arranged radially.\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa47996f", + "id": "267f30ef", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "ddb774a6", + "id": "191be815", "metadata": {}, "source": [ "For a filled line in a Radar Chart, update the figure created with `px.line_polar` with `fig.update_traces`." @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94dfbdbe", + "id": "3c483832", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "944fa2b6", + "id": "869970b3", "metadata": {}, "source": [ "### Basic Radar Chart with go.Scatterpolar" @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a853f14b", + "id": "41a5add7", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "f648bd2a", + "id": "b6936f06", "metadata": {}, "source": [ "#### Multiple Trace Radar Chart" @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3f915e8", + "id": "56cadb26", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "bac28bc8", + "id": "b469b31d", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "08d52d72", + "id": "8ca82a55", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/random-walk.ipynb b/random-walk.ipynb index f4eb6041f..9da4a6de5 100644 --- a/random-walk.ipynb +++ b/random-walk.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "556d31e5", + "id": "f5cf6330", "metadata": {}, "source": [ "A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\\mathbb{Z}$), two dimensions ($\\mathbb{Z}^2$) or three dimensions ($\\mathbb{Z}^3$) in Cartesian space, where $\\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plotly.com/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "009cd551", + "id": "547a096a", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "a6953f52", + "id": "dce51f91", "metadata": {}, "source": [ "#### Random Walk in 2D" @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b4bf69", + "id": "cd52c8c3", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "24c1ccaa", + "id": "31f50020", "metadata": {}, "source": [ "#### Random walk and diffusion\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5128f3b6", + "id": "1ffdb020", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c37349e", + "id": "797eeebb", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "42af76cb", + "id": "134dd2f2", "metadata": {}, "source": [ "#### Advanced Tip\n", @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "7a9c5e09", + "id": "c36592b8", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/range-slider.ipynb b/range-slider.ipynb index 7ecdd2637..4bacd400e 100644 --- a/range-slider.ipynb +++ b/range-slider.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "75d1d04b", + "id": "3bff1b27", "metadata": {}, "source": [ "#### Basic Range Slider and Range Selectors" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6612f76f", + "id": "ed16727c", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "24eae2b4", + "id": "8d472a26", "metadata": {}, "source": [ "#### Range Slider with Vertically Stacked Subplots" @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47198965", + "id": "a9e4f624", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "adb9500d", + "id": "841fcefa", "metadata": {}, "source": [ "#### Reference\n", @@ -362,7 +362,7 @@ }, { "cell_type": "markdown", - "id": "420fec2a", + "id": "e9ec55c6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/renderers.ipynb b/renderers.ipynb index 0d254c217..f99e47626 100644 --- a/renderers.ipynb +++ b/renderers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c0f12918", + "id": "6a964548", "metadata": {}, "source": [ "# Displaying Figures\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0db99ef", + "id": "b082f611", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "d6175592", + "id": "a1f348fd", "metadata": {}, "source": [ "In most situations, you can omit the call to `.show()` and allow the figure to display itself." @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f19a9e13", + "id": "64284143", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "b80e7811", + "id": "d5e46e38", "metadata": {}, "source": [ "> To be precise, figures will display themselves using the current default renderer when the two following conditions are true. First, the last expression in a cell must evaluate to a figure. Second, `plotly.py` must be running from within an `IPython` kernel.\n", @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "517655d1", + "id": "557c121e", "metadata": {}, "source": [ "#### Setting The Default Renderer\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08fc0ead", + "id": "5bc1031c", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "01ee23c6", + "id": "5cf4f1b7", "metadata": {}, "source": [ "The default renderer that you see when you display `pio.renderers` might be different than what is shown here. This is because `plotly.py` attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of an available renderer to the `pio.renderers.default` property. For example, to switch to the `'browser'` renderer, which opens figures in a tab of the default web browser, you would run the following." @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "915386ca", + "id": "6f780042", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "240058be", + "id": "7f07887e", "metadata": {}, "source": [ "> Note: Default renderers persist for the duration of a single session. For example, if you set a default renderer in an `IPython` kernel, that default won't persist across kernel restarts.\n", @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20a1c7c9", + "id": "511faee1", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "80396819", + "id": "eb7516d9", "metadata": {}, "source": [ "#### Built-in Renderers\n", @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "97571f36", + "id": "189eaaf6", "metadata": {}, "source": [ "###### `plotly_mimetype`\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eb90b1c", + "id": "6dffe017", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "f63096ae", + "id": "8e330ef9", "metadata": {}, "source": [ "###### PDF\n", @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffc5d0c1", + "id": "5e5fdc4e", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "bc738272", + "id": "73402050", "metadata": {}, "source": [ "From this output, you can see that the `png` renderer supports 3 properties: `width`, `height`, and `scale`. You can customize these properties by assigning new values to them.\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f27b7150", + "id": "1dc4c717", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "b972b209", + "id": "b5b1b36d", "metadata": {}, "source": [ "You can also override the values of renderer parameters temporarily by passing them as keyword arguments to the `show()` method. For example" @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23767b8f", + "id": "11467c09", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "d0b6b76d", + "id": "77bd746d", "metadata": {}, "source": [ "### Displaying figures in Plotly Studio\n", @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce193b5e", + "id": "f643c984", "metadata": { "hide_code": true }, @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "596a9c7a", + "id": "546d61d0", "metadata": {}, "source": [ "### Displaying figures in Dash\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4d8e29e", + "id": "e6ea0e02", "metadata": { "hide_code": true }, @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "d2abf8c2", + "id": "e8f759a0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "f5b6f16f", + "id": "27a3c2e6", "metadata": {}, "source": [ "## Displaying Figures Using `ipywidgets`\n", @@ -388,7 +388,7 @@ }, { "cell_type": "markdown", - "id": "cb309d01", + "id": "0d881457", "metadata": {}, "source": [ "## Performance\n", @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "0aa7d8c2", + "id": "1ccb8df1", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sankey-diagram.ipynb b/sankey-diagram.ipynb index 20b13588c..b95a28f51 100644 --- a/sankey-diagram.ipynb +++ b/sankey-diagram.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d853fa6b", + "id": "defb7893", "metadata": {}, "source": [ "A [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram) is a flow diagram, in which the width of arrows is proportional to the flow quantity." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "e15250e8", + "id": "38e8fa68", "metadata": {}, "source": [ "### Basic Sankey Diagram\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77a557f7", + "id": "44ebb576", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "705cdd79", + "id": "41707194", "metadata": {}, "source": [ "### More complex Sankey diagram with colored links" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d261836", + "id": "27f461e9", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "1e6f95d5", + "id": "f77f8575", "metadata": {}, "source": [ "### Sankey Diagram in Dash\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f5e5e8d", + "id": "258af543", "metadata": { "hide_code": true }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "29813667", + "id": "b452d8a6", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "046b6424", + "id": "286c219b", "metadata": {}, "source": [ "### Style Sankey Diagram\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30eb173b", + "id": "a4d70d47", "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "e2639648", + "id": "ec198a55", "metadata": {}, "source": [ "### Link Hover Color\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "076073b8", + "id": "b78d79eb", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "db63a175", + "id": "90b97efe", "metadata": {}, "source": [ "### Hovertemplate and customdata of Sankey diagrams\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f27bc85", + "id": "316180bc", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "781ebf05", + "id": "939cfcdc", "metadata": {}, "source": [ "### Define Node Position\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f7f1112", + "id": "88cbab17", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "93a67577", + "id": "d9bdb25f", "metadata": {}, "source": [ "### Sankey Diagram with Arrow Links\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72abadcd", + "id": "ef20ea6c", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "5fcbb1b1", + "id": "8987ae4a", "metadata": {}, "source": [ "### Node Alignment\n", @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70ace748", + "id": "5be48cab", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30e4204b", + "id": "e9c4d841", "metadata": {}, "outputs": [], "source": [ @@ -410,7 +410,7 @@ }, { "cell_type": "markdown", - "id": "a55a1553", + "id": "1c2aeca0", "metadata": {}, "source": [ "### Reference\n", @@ -420,7 +420,7 @@ }, { "cell_type": "markdown", - "id": "55b242d7", + "id": "897f9613", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/scatter-plots-on-maps.ipynb b/scatter-plots-on-maps.ipynb index 5f027e568..50f370408 100644 --- a/scatter-plots-on-maps.ipynb +++ b/scatter-plots-on-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cbd34a03", + "id": "eb022522", "metadata": {}, "source": [ "#### Base Map Configuration\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14ff96a0", + "id": "6fb3ddb4", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "18dc787a", + "id": "263ebb71", "metadata": {}, "source": [ "#### Customize geographical scatter plot" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af4529b0", + "id": "b90217f5", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "5ac74941", + "id": "e36b3194", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbbbb91b", + "id": "1e3d0f19", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "1d091b8f", + "id": "5c226eab", "metadata": {}, "source": [ "### U.S. Airports Map\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d0fdb3f", + "id": "79520a5b", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "3a9066d2", + "id": "fcffcc8f", "metadata": {}, "source": [ "#### Styled U.S. Airports Map" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34fd0531", + "id": "038b9c8f", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "958f891a", + "id": "97eacb7b", "metadata": {}, "source": [ "### North American Precipitation Map" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2021abae", + "id": "12564233", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "7e4d324b", + "id": "2f78cecf", "metadata": {}, "source": [ "#### Reference\n", @@ -286,7 +286,7 @@ }, { "cell_type": "markdown", - "id": "12be24a2", + "id": "049f5925", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/selections.ipynb b/selections.ipynb index 31d2fc28b..14c41c948 100644 --- a/selections.ipynb +++ b/selections.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d3e87189", + "id": "552a75a6", "metadata": {}, "source": [ "## Adding Selections to Cartesian Subplots\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "1ac74a9f", + "id": "70deef1e", "metadata": {}, "source": [ "You can also add selections to a figure that displays when it renders using `fig.add_selection`.\n", @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4955cc9b", + "id": "bb768467", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "99662fbc", + "id": "8764023b", "metadata": {}, "source": [ "## Selections Using a Custom SVG" @@ -50,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "2a4d241e", + "id": "c5bf41a7", "metadata": {}, "source": [ "In the above example, we added a rectangular selection. You can also render a custom SVG for a selection by defining a `path` that can include single or multiple polygons. Here, we create a selection with a single polygon path \"M2,6.5L4,7.5L4,6Z\".\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce46f87a", + "id": "047a40c8", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "markdown", - "id": "3556be16", + "id": "4e9a5960", "metadata": {}, "source": [ "## Styling Selections" @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "9bff1023", + "id": "9969b9ce", "metadata": {}, "source": [ "In the above example, we added a selection to the figure that is displayed when the figure renders.\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7317f1e4", + "id": "e4cb5ce5", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "20b5ef77", + "id": "3c1ed85f", "metadata": {}, "source": [ "## Styling New Selections\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6dfec7ff", + "id": "030339cc", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "6ae4194b", + "id": "c7d7233a", "metadata": {}, "source": [ "## Fill Color for Active Selections\n", @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6f0461e", + "id": "2af9ee2c", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "fda87cac", + "id": "89615fac", "metadata": {}, "source": [ "## Selections with Time Series\n", @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81daf57c", + "id": "55995f47", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ }, { "cell_type": "markdown", - "id": "b244f009", + "id": "74d90aa2", "metadata": {}, "source": [ "## Referencing Selections on Multiple Cartesian Subplots" @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "a591d356", + "id": "0075124c", "metadata": {}, "source": [ "You can add selections to multiple Cartesian subplots by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x` and `y2` and two selections to the the plot with axis ids `x` and `y`." @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f5e5861", + "id": "15c29c55", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "fc2ffc4f", + "id": "525f34e5", "metadata": {}, "source": [ "## Referencing Selections on a Scatterplot Matrix" @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "1f14caf2", + "id": "1cdbc875", "metadata": {}, "source": [ "You can add selections to a scatterplot matrix by specifying `xref` and/or `yref`. Here, we add one selection on the plot with axis ids `x2` and `y2` and another on the plot with ids `x3` and `y`." @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df550d80", + "id": "c6f1746a", "metadata": { "lines_to_next_cell": 0 }, @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "e54e6a68", + "id": "b713c136", "metadata": {}, "source": [ "\n" @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "2cd79d14", + "id": "c205eefa", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/setting-graph-size.ipynb b/setting-graph-size.ipynb index bedbf7f18..bd1e3fbe8 100644 --- a/setting-graph-size.ipynb +++ b/setting-graph-size.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "52d70106", + "id": "05cf00eb", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins with Plotly Express\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce9fd645", + "id": "ea6063f6", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "381aa320", + "id": "a92f609c", "metadata": {}, "source": [ "### Adjusting graph size with Dash\n", @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "244d245e", + "id": "daaf058f", "metadata": { "hide_code": true }, @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "cbe0d30c", + "id": "88b6a4eb", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "bc612333", + "id": "5f0220f4", "metadata": {}, "source": [ "### Adjusting Height, Width, & Margins With Graph Objects\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59bb469e", + "id": "c1bbdb6d", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "23c89daf", + "id": "cb8698e1", "metadata": {}, "source": [ "### Automatically Adjust Margins\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b32d634f", + "id": "41848d56", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ }, { "cell_type": "markdown", - "id": "46540750", + "id": "dd95d0d9", "metadata": {}, "source": [ "### Automatically Adjust Specific Margins\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "576017e7", + "id": "93f91b82", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "247232bd", + "id": "b9fc6c15", "metadata": {}, "source": [ "### Setting a Minimum Plot Size with Automargins\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eab50e2d", + "id": "da4c4e90", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "27acf944", + "id": "0ab328bd", "metadata": {}, "source": [ "#### Reference\n", @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "8634cf11", + "id": "a370d3fc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/shapes.ipynb b/shapes.ipynb index 5949b4756..2c09fe7bc 100644 --- a/shapes.ipynb +++ b/shapes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1f668317", + "id": "79959f24", "metadata": {}, "source": [ "### Adding Lines and Polygons to Figures\n", @@ -22,7 +22,7 @@ }, { "cell_type": "markdown", - "id": "94d84647", + "id": "e9ec1677", "metadata": {}, "source": [ "### Shape-drawing with Scatter traces\n", @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "455fe0e9", + "id": "1441751b", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "5bdf8180", + "id": "33cad2e5", "metadata": {}, "source": [ "You can have more shapes either by adding [more traces](https://plotly.com/python/filled-area-plots/) or interrupting the series with `None`." @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5e7802b", + "id": "401c7d28", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ }, { "cell_type": "markdown", - "id": "22dab3c4", + "id": "3f8965c4", "metadata": {}, "source": [ "#### Shapes in Dash\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bde674e5", + "id": "03d0d5c9", "metadata": { "hide_code": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "b796d2a6", + "id": "763ae978", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "ead91626", + "id": "147c7573", "metadata": {}, "source": [ "#### Vertical and Horizontal Lines Positioned Relative to the Axis Data" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a857a111", + "id": "1d9a0000", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "9a5c6eac", + "id": "0c11f457", "metadata": {}, "source": [ "#### Lines Positioned Relative to the Plot & to the Axis Data" @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b5eb91e", + "id": "4ccd3a17", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "6915eb8b", + "id": "3f0ced0f", "metadata": {}, "source": [ "#### Rectangles Positioned Relative to the Axis Data" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81bdd587", + "id": "d2044c9d", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "92a6e366", + "id": "4c8ba79e", "metadata": {}, "source": [ "#### Rectangle Positioned Relative to the Plot & to the Axis Data" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61c5ba6d", + "id": "d0731ede", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "7656eb40", + "id": "ea9466ae", "metadata": {}, "source": [ "#### A Rectangle Placed Relative to the Axis Position and Length\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2782797", + "id": "c74b4fd0", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "91e8bcf6", + "id": "88dac6b2", "metadata": {}, "source": [ "#### Highlighting Time Series Regions with Rectangle Shapes\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85d504d5", + "id": "54012141", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "7fbe4753", + "id": "6c868841", "metadata": {}, "source": [ "#### Circles Positioned Relative to the Axis Data" @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "565fc9c7", + "id": "02a5b152", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ }, { "cell_type": "markdown", - "id": "c3620e12", + "id": "3cdbef13", "metadata": {}, "source": [ "#### Highlighting Clusters of Scatter Points with Circle Shapes" @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc4b81e7", + "id": "39465a6a", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ }, { "cell_type": "markdown", - "id": "b78c0e76", + "id": "ffc77f32", "metadata": {}, "source": [ "#### Venn Diagram with Circle Shapes" @@ -525,7 +525,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9487de45", + "id": "9fc88cb0", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "01aac33a", + "id": "feae131e", "metadata": {}, "source": [ "#### Adding Shapes to Subplots\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44e48bed", + "id": "d81f9b58", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "6a024140", + "id": "15f2a4cb", "metadata": {}, "source": [ "#### Subplot-Spanning Shapes\n", @@ -635,7 +635,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd2c8d9d", + "id": "c7e15800", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "8006a149", + "id": "5288d3c7", "metadata": {}, "source": [ "For `path` shapes, the array must have one entry for each coordinate in the path string. Each coordinate in the path maps to the corresponding element in the `xref`/`yref` array, in order." @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a2069e5", + "id": "ad925eec", "metadata": {}, "outputs": [], "source": [ @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "40899fbf", + "id": "f78927bf", "metadata": {}, "source": [ "**Note:** When using arrays with `xref` and `yref`, `xsizemode=\"pixel\"` and `ysizemode=\"pixel\"` are not supported." @@ -710,7 +710,7 @@ }, { "cell_type": "markdown", - "id": "66751f0b", + "id": "88f6d4ff", "metadata": { "lines_to_next_cell": 0 }, @@ -723,7 +723,7 @@ { "cell_type": "code", "execution_count": null, - "id": "291bf2b0", + "id": "7e9cc4bd", "metadata": { "lines_to_next_cell": 2 }, @@ -753,7 +753,7 @@ }, { "cell_type": "markdown", - "id": "b9fe3473", + "id": "026ef71a", "metadata": {}, "source": [ "#### SVG Paths" @@ -762,7 +762,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fe85ab0", + "id": "9fa7f3f9", "metadata": {}, "outputs": [], "source": [ @@ -829,7 +829,7 @@ }, { "cell_type": "markdown", - "id": "a23ce724", + "id": "eaa5ad17", "metadata": {}, "source": [ "#### Shifting Shapes on Categorical Axes\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beddcd94", + "id": "89e7f96c", "metadata": {}, "outputs": [], "source": [ @@ -916,7 +916,7 @@ }, { "cell_type": "markdown", - "id": "46aec64a", + "id": "9e7dfed9", "metadata": {}, "source": [ "### Drawing shapes with a Mouse on Cartesian plots\n", @@ -940,7 +940,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65b6ba69", + "id": "77f7570c", "metadata": {}, "outputs": [], "source": [ @@ -973,7 +973,7 @@ }, { "cell_type": "markdown", - "id": "971623e3", + "id": "22ee07e5", "metadata": {}, "source": [ "### Style of user-drawn shapes\n", @@ -986,7 +986,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09a42622", + "id": "17e5bd3b", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ }, { "cell_type": "markdown", - "id": "3438a18c", + "id": "a78ecfcd", "metadata": {}, "source": [ "### Adding Text Labels to Shapes\n", @@ -1039,7 +1039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23653804", + "id": "e731f90c", "metadata": {}, "outputs": [], "source": [ @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "58cbaf34", + "id": "5055df3c", "metadata": {}, "source": [ "#### Styling Text Labels\n", @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "496b2a9e", + "id": "8c490425", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "fff5544a", + "id": "17acfdbc", "metadata": {}, "source": [ "#### Setting Label Position\n", @@ -1137,7 +1137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60992a3f", + "id": "f081018c", "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1194,7 @@ }, { "cell_type": "markdown", - "id": "0eb0157a", + "id": "49534c32", "metadata": {}, "source": [ "#### Setting Label Angle\n", @@ -1205,7 +1205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbf790c8", + "id": "18fc5d14", "metadata": {}, "outputs": [], "source": [ @@ -1238,7 +1238,7 @@ }, { "cell_type": "markdown", - "id": "f6d00e0f", + "id": "da63f383", "metadata": {}, "source": [ "#### Setting Label Padding\n", @@ -1249,7 +1249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1683f8ed", + "id": "d1ac79f0", "metadata": {}, "outputs": [], "source": [ @@ -1284,7 +1284,7 @@ }, { "cell_type": "markdown", - "id": "eedbd184", + "id": "ff08472b", "metadata": {}, "source": [ "#### Setting Label Anchors\n", @@ -1298,7 +1298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e614fee1", + "id": "6bcdf2d3", "metadata": {}, "outputs": [], "source": [ @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "29233459", + "id": "6bf15c2a", "metadata": {}, "source": [ "#### Variables in Shape Label Text\n", @@ -1366,7 +1366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e401897", + "id": "6a7df44d", "metadata": {}, "outputs": [], "source": [ @@ -1426,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "9ff506ef", + "id": "fe92af6a", "metadata": {}, "source": [ "#### Variables in Shape Label Text for New Shapes\n", @@ -1441,7 +1441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc59a45d", + "id": "ae22de51", "metadata": {}, "outputs": [], "source": [ @@ -1479,7 +1479,7 @@ }, { "cell_type": "markdown", - "id": "9a7bc923", + "id": "02eac2b2", "metadata": {}, "source": [ "#### Shapes in the Legend\n", @@ -1492,7 +1492,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30e572bd", + "id": "3f94c40a", "metadata": {}, "outputs": [], "source": [ @@ -1536,7 +1536,7 @@ }, { "cell_type": "markdown", - "id": "14fe6c46", + "id": "1a7a301b", "metadata": {}, "source": [ "`newshape` also supports `showlegend`. In this example, each new line drawn on the graph appears in the legend." @@ -1545,7 +1545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "981b3d4d", + "id": "adbe50f6", "metadata": {}, "outputs": [], "source": [ @@ -1584,7 +1584,7 @@ }, { "cell_type": "markdown", - "id": "092ab642", + "id": "38865b08", "metadata": {}, "source": [ "#### Shape Layer\n", @@ -1595,7 +1595,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7aa4a5a9", + "id": "b9aa488a", "metadata": {}, "outputs": [], "source": [ @@ -1649,7 +1649,7 @@ }, { "cell_type": "markdown", - "id": "e4b566af", + "id": "9eccced1", "metadata": {}, "source": [ "### Reference\n", @@ -1658,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "54282e3c", + "id": "2c3e721c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sliders.ipynb b/sliders.ipynb index 39726c6c2..02cafa0d9 100644 --- a/sliders.ipynb +++ b/sliders.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f27e4e74", + "id": "9a6dc657", "metadata": {}, "source": [ "### Simple Slider Control\n", @@ -12,7 +12,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa563eb", + "id": "d1832125", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "3b5d5f13", + "id": "0bca8fda", "metadata": {}, "source": [ "#### Methods\n", @@ -75,7 +75,7 @@ }, { "cell_type": "markdown", - "id": "b1081dff", + "id": "450897ea", "metadata": {}, "source": [ "### Sliders in Plotly Express\n", @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf95be36", + "id": "5469a287", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "12ea6bef", + "id": "6f41a546", "metadata": {}, "source": [ "#### Reference\n", @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "aefc1546", + "id": "be6b50b7", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smith-charts.ipynb b/smith-charts.ipynb index 5147b4f42..7d30ff1df 100644 --- a/smith-charts.ipynb +++ b/smith-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2c13ed74", + "id": "7522a0e5", "metadata": {}, "source": [ "*New in v5.4*\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "cba5fd75", + "id": "38fc95f9", "metadata": {}, "source": [ "### Smith Charts with Plotly Graph Objects" @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3b663a2", + "id": "9119d318", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "97bb9d92", + "id": "7d79608a", "metadata": {}, "source": [ "### Smith Chart Subplots and Styling" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72968841", + "id": "1314e971", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "1e589a2e", + "id": "0f5fbf03", "metadata": {}, "source": [ "#### Reference\n", @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e820c180", + "id": "566e0d56", "metadata": { "lines_to_next_cell": 2 }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "054bc3e0", + "id": "d699d0dc", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/smoothing.ipynb b/smoothing.ipynb index 7b3ba2457..e4f9717bd 100644 --- a/smoothing.ipynb +++ b/smoothing.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "45b14a14", + "id": "e12aaeb8", "metadata": {}, "source": [ "#### Imports\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afc692eb", + "id": "b8fd0f20", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "babd77d5", + "id": "e3dcc4c2", "metadata": {}, "source": [ "#### Savitzky-Golay Filter\n", @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5146d1bc", + "id": "d21cfce8", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "28d2afe5", + "id": "097f5c88", "metadata": {}, "source": [ "#### Triangular Moving Average\n", @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e6cc55e", + "id": "100a92fe", "metadata": { "lines_to_next_cell": 2 }, @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "5c080e0d", + "id": "8f24f02a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/splom.ipynb b/splom.ipynb index 88f996f1f..5c372073d 100644 --- a/splom.ipynb +++ b/splom.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3b3099f0", + "id": "5a9f137e", "metadata": {}, "source": [ "### Scatter matrix with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38f902c3", + "id": "61455707", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "bd28915b", + "id": "627ab90a", "metadata": {}, "source": [ "Specify the columns to be represented with the `dimensions` argument, and set colors using a column of the dataframe:" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b95d622", + "id": "673bd3e6", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "0aab3ce1", + "id": "18d59c58", "metadata": {}, "source": [ "#### Styled Scatter Matrix with Plotly Express\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce361b8f", + "id": "3c2bc6de", "metadata": { "lines_to_next_cell": 2 }, @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "c0feaab2", + "id": "b694f4c7", "metadata": {}, "source": [ "### Scatter matrix (splom) with go.Splom\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "dbe331e7", + "id": "8cf34bf0", "metadata": {}, "source": [ "#### Splom of the Iris data set" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db5746a3", + "id": "27142571", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "8ebab27a", + "id": "d3e67cc9", "metadata": {}, "source": [ "The scatter plots on the principal diagonal can be removed by setting `diagonal_visible=False`:" @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eaa106f", + "id": "5d224500", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ }, { "cell_type": "markdown", - "id": "c5019db4", + "id": "630e7bc3", "metadata": {}, "source": [ "To plot only the lower/upper half of the splom we switch the default `showlowerhalf=True`/`showupperhalf=True` to `False`:" @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa4fcd8f", + "id": "0c42842d", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "bdeccc95", + "id": "c69b9611", "metadata": {}, "source": [ "Each dict in the list dimensions has a key, visible, set by default on True. We can choose to remove a variable from splom, by setting `visible=False` in its corresponding dimension. In this case the default grid associated to the scatterplot matrix keeps its number of cells, but the cells in the row and column corresponding to the visible false dimension are empty:" @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c384ffb2", + "id": "582b1cb7", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ }, { "cell_type": "markdown", - "id": "c3605243", + "id": "b9745d3f", "metadata": {}, "source": [ "#### Splom for the diabetes dataset\n", @@ -318,7 +318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "472d5669", + "id": "476c5c61", "metadata": { "lines_to_next_cell": 0 }, @@ -360,7 +360,7 @@ }, { "cell_type": "markdown", - "id": "57d4a500", + "id": "34d099d1", "metadata": {}, "source": [ "#### Hover Effects\n", @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81b4bd6e", + "id": "ea056e7d", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "caefccbd", + "id": "f3009402", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "7ecc6f1c", + "id": "e916ef88", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-export.ipynb b/static-image-export.ipynb index 9dd1d3112..301a90e0f 100644 --- a/static-image-export.ipynb +++ b/static-image-export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "122b082e", + "id": "9041780a", "metadata": {}, "source": [ "This page demonstrates how to export interactive Plotly figures to static image formats like PNG, JPEG, SVG, and PDF. If you want to export Plotly figures to HTML to retain interactivity, see the [Interactive HTML Export page](/python/interactive-html-export/)" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "f176a25a", + "id": "f2461cb4", "metadata": {}, "source": [ "## Install Dependencies\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "9b07a42c", + "id": "2e8885e1", "metadata": {}, "source": [ "## Write Image to a File\n", @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "878516e0", + "id": "ed4d276b", "metadata": {}, "source": [ "### Raster Formats\n", @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "6c4885bc", + "id": "2b0cc723", "metadata": {}, "source": [ "**Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image." @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "437290ec", + "id": "ec91e126", "metadata": {}, "source": [ "### Specify a Format\n", @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "42507902", + "id": "ab3cbc1e", "metadata": {}, "source": [ "### Write Multiple Images\n", @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "29067c99", + "id": "3400aa79", "metadata": {}, "source": [ "## Get Image as Bytes\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5456eec7", + "id": "937a3ca8", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "bb1e147a", + "id": "7c80b73e", "metadata": {}, "source": [ "Here's the bytes object displayed using `IPython.display.Image`:" @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33850206", + "id": "8d41099f", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "0d17ae18", + "id": "1e2b09b6", "metadata": {}, "source": [ "## Specify Image Dimensions and Scale\n", @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2636f28", + "id": "4d3d6d95", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "b9bc4bf4", + "id": "87fa265c", "metadata": {}, "source": [ "## Specify Image Export Engine\n", @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "4463a17e", + "id": "b80b0e99", "metadata": {}, "source": [ "## plotly.io Functions\n", @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "d4541562", + "id": "ef77c2e3", "metadata": {}, "source": [ "## Image Export Settings (Kaleido)\n", @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "22ac3fb0", + "id": "1fe3cd81", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/static-image-generation-migration.ipynb b/static-image-generation-migration.ipynb index eca95f7c5..e90a6c0b7 100644 --- a/static-image-generation-migration.ipynb +++ b/static-image-generation-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cf6e9180", + "id": "a64c4c6c", "metadata": { "lines_to_next_cell": 2 }, @@ -52,12 +52,12 @@ "\n", "## Multiple Image Export\n", "\n", - "Plotly.py 6.1 includes a `write_images` function (`plotly.io.write_images`), which we recommend over `write_image` when exporting more than one figure. Calling `write_images` with a list of figures (or dicts representing figures) to export provides better performance than multiple calls with `write_image`. See the [Write Multiple Images](/python/static-image-export#write-multiple-images) section for more details." + "Plotly.py 6.1 includes a `write_images` function (`plotly.io.write_images`), which we recommend over `write_image` when exporting more than one figure. Calling `write_images` with a list of figures (or dicts representing figures) to export provides better performance than multiple calls with `write_image`. See the [Write Multiple Images](/python/static-image-export#write-multiple-images) section for more details.\n" ] }, { "cell_type": "markdown", - "id": "6e4d42b5", + "id": "f70f7c8d", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamline-plots.ipynb b/streamline-plots.ipynb index 9d583ac9d..35a618f26 100644 --- a/streamline-plots.ipynb +++ b/streamline-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ae3b5ce7", + "id": "7a8ea7c8", "metadata": {}, "source": [ "A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to the velocity field. In the case of a stationary velocity field, streamlines coincide with trajectories (see also the [Wikipedia page on streamlines, streaklines and pathlines](https://en.wikipedia.org/wiki/Streamlines,_streaklines,_and_pathlines)).\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dbb8f0c", + "id": "71ee158f", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "e2ed9821", + "id": "8d5994fa", "metadata": {}, "source": [ "#### Streamline and Source Point Plot" @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fa157f3", + "id": "17d86985", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "27a6ae6f", + "id": "895e8a9b", "metadata": {}, "source": [ "#### See also\n", @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "14272821", + "id": "d8aaa1fd", "metadata": {}, "source": [ "#### Reference\n", @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "0390e802", + "id": "dd16033a", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/streamtube-plot.ipynb b/streamtube-plot.ipynb index 208b0151e..a8c25a740 100644 --- a/streamtube-plot.ipynb +++ b/streamtube-plot.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a01e5f62", + "id": "b4156b2f", "metadata": {}, "source": [ "### Introduction" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "f64f201b", + "id": "8b925769", "metadata": {}, "source": [ "In streamtube plots, attributes include `x`, `y`, and `z`, which set the coordinates of the vector field, and `u`, `v`, and `w`, which set the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position." @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "fc2fde90", + "id": "b2a1af05", "metadata": {}, "source": [ "### Basic Streamtube Plot" @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3df2e802", + "id": "17ac2295", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "4a5323e7", + "id": "c7607b1d", "metadata": {}, "source": [ "### Starting Position and Segments\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcbbcabb", + "id": "be1b258e", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "72979a30", + "id": "04efaeeb", "metadata": {}, "source": [ "### Tube color and diameter\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "993a825c", + "id": "c419d965", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "2efb5c9b", + "id": "38ae2986", "metadata": {}, "source": [ "#### Reference\n", @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "57585b2d", + "id": "958b15e5", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/strip-charts.ipynb b/strip-charts.ipynb index 56bdf554d..d5865585f 100644 --- a/strip-charts.ipynb +++ b/strip-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8ba7e5dc", + "id": "afa7bc82", "metadata": {}, "source": [ "### Strip Charts with Plotly Express\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0766fea", + "id": "fa3a10dc", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "6e9bece7", + "id": "3ea18bac", "metadata": {}, "source": [ "Strip charts support [faceting](/python/facet-plots/) and [discrete color](/python/discrete-color/):" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17ae8847", + "id": "454da70d", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "17249cd5", + "id": "c69aecd3", "metadata": {}, "source": [ "#### Reference\n", @@ -62,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "69053d14", + "id": "55b70675", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/styling-plotly-express.ipynb b/styling-plotly-express.ipynb index ea6ae5c47..d0181ba7f 100644 --- a/styling-plotly-express.ipynb +++ b/styling-plotly-express.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "10167b5f", + "id": "4c510f91", "metadata": {}, "source": [ "### Styling Figures made with Plotly Express\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4a2963a", + "id": "09ae09b3", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "095afa88", + "id": "5da6a6a1", "metadata": {}, "source": [ "Here is the same figure, restyled by adding some extra parameters to the initial Plotly Express call:" @@ -57,7 +57,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12ca141e", + "id": "7d3e5839", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "1e877093", + "id": "79e3d2a0", "metadata": {}, "source": [ "### Updating or Modifying Figures made with Plotly Express\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "130093c1", + "id": "31c9b458", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "d9f59296", + "id": "49588ba2", "metadata": {}, "source": [ "### How Plotly Express Works with Templates\n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da33d48d", + "id": "62f1aecf", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "8186eafa", + "id": "49af0dcb", "metadata": {}, "source": [ "### Setting Plotly Express Styling Defaults\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29d8820b", + "id": "ae0aed3a", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "05ab416e", + "id": "c4b2eb62", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/subplots.ipynb b/subplots.ipynb index fc3f4b5ff..6c145ec13 100644 --- a/subplots.ipynb +++ b/subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9ae9fced", + "id": "d472d270", "metadata": {}, "source": [ "### Subplots and Plotly Express\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "f4d9bc7a", + "id": "06c71154", "metadata": {}, "source": [ "#### Simple Subplot\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "def8ad5c", + "id": "a80fd7c3", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "fa6c299e", + "id": "b085d1fd", "metadata": {}, "source": [ "#### Stacked Subplots\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e9cc691", + "id": "62324e0c", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "e286f3fd", + "id": "a3d53672", "metadata": {}, "source": [ "#### Multiple Subplots\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c75b1064", + "id": "ab36bbb0", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "d77d2159", + "id": "e8d1df2d", "metadata": {}, "source": [ "#### Multiple Subplots with Titles\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "644c20c8", + "id": "8de9cd8c", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "9f009b5e", + "id": "2b5ba1c3", "metadata": {}, "source": [ "#### Subplots with Annotations" @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0774e5cb", + "id": "a4e3b3c7", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "c190ecb6", + "id": "a9ad6a58", "metadata": {}, "source": [ "#### Customize Subplot Column Widths and Row Heights\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b360e1b", + "id": "973b9a66", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "36e9cd41", + "id": "5f652ea2", "metadata": {}, "source": [ "#### Subplots in Dash\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05dcb443", + "id": "63c8c724", "metadata": { "hide_code": true }, @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "63332f64", + "id": "98fbc22a", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "c3ab0a61", + "id": "151a3e02", "metadata": {}, "source": [ "#### Customizing Subplot Axes\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43632ce9", + "id": "15084f23", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "8ccf025a", + "id": "57d8de37", "metadata": {}, "source": [ "#### Subplots with Shared X-Axes\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bcccfac", + "id": "0772fb64", "metadata": {}, "outputs": [], "source": [ @@ -379,7 +379,7 @@ }, { "cell_type": "markdown", - "id": "f11bd6d1", + "id": "05a4027e", "metadata": {}, "source": [ "#### Subplots with Shared Y-Axes\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ce4bb7c", + "id": "bf4c37a9", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ }, { "cell_type": "markdown", - "id": "10d3ae06", + "id": "64dc285f", "metadata": {}, "source": [ "### Subplots with Shared Colorscale\n", @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d9cdd13", + "id": "de00e362", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "d6aa283b", + "id": "0cded939", "metadata": {}, "source": [ "#### Custom Sized Subplot with Subplot Titles\n", @@ -465,7 +465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6da0d1e9", + "id": "cd4d7da1", "metadata": {}, "outputs": [], "source": [ @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "0b880597", + "id": "2a7bfb88", "metadata": {}, "source": [ "#### Multiple Custom Sized Subplots\n", @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c809129c", + "id": "473bc2e8", "metadata": {}, "outputs": [], "source": [ @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "346b936a", + "id": "78d69784", "metadata": {}, "source": [ "#### Subplots Types\n", @@ -555,7 +555,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd4706ca", + "id": "76f72255", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "2450b328", + "id": "f952c26d", "metadata": {}, "source": [ "As an alternative to providing the name of a subplot type (e.g. `\"xy\"`, `\"polar\"`, `\"domain\"`, `\"scene\"`, etc), the `type` option may also be set to a string containing the name of a trace type (e.g. `\"bar\"`, `\"barpolar\"`, `\"pie\"`, `\"scatter3d\"`, etc.), which will be used to determine the subplot type that is compatible with that trace.\n", @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8688b6fc", + "id": "cac5b1db", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +632,7 @@ }, { "cell_type": "markdown", - "id": "8b815e11", + "id": "d318a4ca", "metadata": {}, "source": [ "#### Side by Side Subplot (low-level API)" @@ -641,7 +641,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52aba398", + "id": "06b16b24", "metadata": {}, "outputs": [], "source": [ @@ -675,7 +675,7 @@ }, { "cell_type": "markdown", - "id": "2f8f1554", + "id": "e4c24cb7", "metadata": {}, "source": [ "#### Subplots with shared axes (low-level API)" @@ -684,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55b6b632", + "id": "844efd10", "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "markdown", - "id": "9b0009fd", + "id": "61c2209f", "metadata": {}, "source": [ "#### Stacked Subplots with a Shared X-Axis (low-level API)" @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d875848e", + "id": "c1a5ed04", "metadata": {}, "outputs": [], "source": [ @@ -791,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "bf5d47d7", + "id": "e1e4931d", "metadata": {}, "source": [ "#### Setting Subplots on a Figure Directly\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0dc767c", + "id": "3a52ff7e", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "8274355e", + "id": "8f4b7f67", "metadata": {}, "source": [ "is equivalent to:" @@ -825,7 +825,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88cb4110", + "id": "4c0cc8ca", "metadata": {}, "outputs": [], "source": [ @@ -835,7 +835,7 @@ }, { "cell_type": "markdown", - "id": "cb96c62c", + "id": "b1100b0d", "metadata": {}, "source": [ "#### Reference\n", @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a58658d", + "id": "bf26a28f", "metadata": { "lines_to_next_cell": 2 }, @@ -858,7 +858,7 @@ }, { "cell_type": "markdown", - "id": "6730c82b", + "id": "ccf0f538", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/sunburst-charts.ipynb b/sunburst-charts.ipynb index 0e986de1e..2530ca9a9 100644 --- a/sunburst-charts.ipynb +++ b/sunburst-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4f713130", + "id": "b10521b6", "metadata": {}, "source": [ "Sunburst plots visualize hierarchical data spanning outwards radially from root to leaves. Similar to [Icicle charts](https://plotly.com/python/icicle-charts/) and [Treemaps](https://plotly.com/python/treemaps/), the hierarchy is defined by `labels` (`names` for `px.icicle`) and `parents` attributes. The root starts from the center and children are added to the outer rings.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f778718", + "id": "94adc971", "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "a3c1a623", + "id": "481cb7fd", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with plotly.express\n", @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78b896a3", + "id": "6591274c", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "0d08bef1", + "id": "e9588c10", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with continuous color argument in px.sunburst\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a220aad6", + "id": "3436b548", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "a347c6d4", + "id": "9171e6c3", "metadata": {}, "source": [ "### Sunburst of a rectangular DataFrame with discrete color argument in px.sunburst\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64bfa902", + "id": "cd4864b1", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "c788d8b1", + "id": "d5c0cf4c", "metadata": {}, "source": [ "In the example below the color of `Saturday` and `Sunday` sectors is the same as `Dinner` because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cbbd5e6e", + "id": "153032d4", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "99a477bb", + "id": "59e6222b", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "354cbb51", + "id": "4af61cd0", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "ccf6ea78", + "id": "3a97ab10", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df0b1a7c", + "id": "5f0aeae6", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "801e2fef", + "id": "2cc545b3", "metadata": {}, "source": [ "### Basic Sunburst Plot with go.Sunburst\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63dd275d", + "id": "e6cbe4b2", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "856317c5", + "id": "d164827c", "metadata": {}, "source": [ "### Sunburst with Repeated Labels" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "385b06e0", + "id": "017ec7fa", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "1a43c035", + "id": "1140a66f", "metadata": {}, "source": [ "### Branchvalues\n", @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8add3101", + "id": "efc10bd6", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "b84403bf", + "id": "30bdf151", "metadata": {}, "source": [ "### Large Number of Slices\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a72d2b35", + "id": "84c1aec7", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "c49ba905", + "id": "31e0f594", "metadata": {}, "source": [ "#### Controlling text orientation inside sunburst sectors\n", @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ba94e5e", + "id": "5ca624cd", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "02ba4ff9", + "id": "00dc9dd5", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8407b10", + "id": "3534ef62", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ }, { "cell_type": "markdown", - "id": "85797a11", + "id": "958a7ca7", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c46bfbb", + "id": "1b266446", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "92c50a02", + "id": "c8cffb84", "metadata": {}, "source": [ "### Sunburst chart with a continuous colorscale\n", @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa72dd8b", + "id": "f6735d30", "metadata": {}, "outputs": [], "source": [ @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "25da0c67", + "id": "677b70b3", "metadata": {}, "source": [ "#### Reference\n", @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "a72894d2", + "id": "a1c49330", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/supported-colors.ipynb b/supported-colors.ipynb index 41a14d8e6..8f9861caf 100644 --- a/supported-colors.ipynb +++ b/supported-colors.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e05a504e", + "id": "8c63cebc", "metadata": {}, "source": [ "# Supported CSS Colors\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91fb436e", + "id": "2afd4848", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "7bfc396b", + "id": "69dd5838", "metadata": {}, "source": [ "These colors are supported in Plotly.py when a property accepts a [named CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color)." @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "225476ac", + "id": "99d23f8f", "metadata": { "hide_code": true, "lines_to_next_cell": 2 @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "54d9e5cd", + "id": "2c6b3a03", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table-subplots.ipynb b/table-subplots.ipynb index 48f7eefbb..48ed84c97 100644 --- a/table-subplots.ipynb +++ b/table-subplots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e368ba5c", + "id": "6d596022", "metadata": {}, "source": [ "#### Import CSV Data" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28dd0ac3", + "id": "b0c508f0", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "dbbef732", + "id": "93643fb8", "metadata": {}, "source": [ "#### Reference\n", @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "959b51e9", + "id": "49266e8c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/table.ipynb b/table.ipynb index 65eeead72..cb3d791fb 100644 --- a/table.ipynb +++ b/table.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ac37ad41", + "id": "de4ec01c", "metadata": {}, "source": [ "`go.Table` provides a Table object for detailed data viewing. The data are arranged in\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f8bec91", + "id": "e2b988ad", "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "markdown", - "id": "2f5f47da", + "id": "f20cc627", "metadata": {}, "source": [ "#### Styled Table" @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed6e6a6d", + "id": "c0af6160", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "90bcecba", + "id": "57ee0ebf", "metadata": {}, "source": [ "#### Use a Pandas Dataframe" @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c51b872", + "id": "319abcbc", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "6affa15a", + "id": "b534c072", "metadata": {}, "source": [ "#### Tables in Dash\n", @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "749da5d7", + "id": "65d07198", "metadata": { "hide_code": true }, @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "4a0e6d0f", + "id": "29c612aa", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "9d39196f", + "id": "3e1bbd41", "metadata": {}, "source": [ "#### Changing Row and Column Size" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eec91688", + "id": "c4aeddb1", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "fb3e7843", + "id": "04e2628d", "metadata": {}, "source": [ "#### Alternating Row Colors" @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c174ddb7", + "id": "5fabc61d", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ }, { "cell_type": "markdown", - "id": "83042364", + "id": "7fde0b60", "metadata": {}, "source": [ "#### Row Color Based on Variable" @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adfe136d", + "id": "ddadf89a", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "c45f56f2", + "id": "c88a853d", "metadata": {}, "source": [ "#### Cell Color Based on Variable" @@ -275,7 +275,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2743217", + "id": "21993ab7", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "63d24d94", + "id": "bf218990", "metadata": {}, "source": [ "#### Reference\n", @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "ce6cd473", + "id": "a6215982", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/templates.ipynb b/templates.ipynb index 93f672e23..2976dd6f6 100644 --- a/templates.ipynb +++ b/templates.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1afca1c3", + "id": "ea556483", "metadata": {}, "source": [ "### Theming and templates\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "212c83fe", + "id": "08ed5e4a", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "d32745f4", + "id": "45d6e0a2", "metadata": {}, "source": [ "From this, we can see that the default theme is `\"plotly\"`, and we can see the names of several additional themes that we can choose from.\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "109057d7", + "id": "d43bea98", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "4ef3423a", + "id": "e2b19e5c", "metadata": {}, "source": [ "#### Specifying themes in graph object figures\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eaa322b0", + "id": "4902b1ec", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "01fb4daa", + "id": "c8bcf37c", "metadata": {}, "source": [ "#### Specifying a default themes\n", @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "814dc6f2", + "id": "e643ce62", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ }, { "cell_type": "markdown", - "id": "49cff384", + "id": "aa4315b1", "metadata": {}, "source": [ "#### Disable default theming\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d17acfd", + "id": "d20094bc", "metadata": {}, "outputs": [], "source": [ @@ -155,7 +155,7 @@ }, { "cell_type": "markdown", - "id": "e16de82b", + "id": "6e2f630c", "metadata": {}, "source": [ "### Creating themes\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da4a79cd", + "id": "7a861ab5", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "9e244d66", + "id": "bbf864f6", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.Layout(title=dict(font=dict(...)))` as `go.Layout(title_font=dict(...))`\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b3e6130", + "id": "ae6110ef", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "cee949ae", + "id": "517c0b11", "metadata": {}, "source": [ "If a trace type property is set to a list of more than one trace, then the default properties are cycled as more traces are added to the figure. Here is an example that creates a template that cycles the default marker symbol for scatter traces, and then constructs a figure that uses this template." @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "817d8f31", + "id": "78e057da", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "e07eee93", + "id": "b1aee303", "metadata": {}, "source": [ "Note that because we built the template with a list of 3 scatter trace [graph objects](/python/graph-objects/) (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "712e8cb8", + "id": "4db79cef", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "2d03cc48", + "id": "f8a69ef8", "metadata": {}, "source": [ "#### Including tuple elements in a theme\n", @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8dae7439", + "id": "653a4769", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "ff72aeb7", + "id": "019c185b", "metadata": {}, "source": [ "#### Customizing theme tuple elements in a figure\n", @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ffefc3e", + "id": "d0377cd5", "metadata": {}, "outputs": [], "source": [ @@ -390,7 +390,7 @@ }, { "cell_type": "markdown", - "id": "b55773d0", + "id": "8e611b42", "metadata": {}, "source": [ "#### Registering themes as named templates\n", @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ba4487d", + "id": "2f2921f1", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "4cb0a180", + "id": "389c3695", "metadata": {}, "source": [ "> Note: this example uses magic underscore notation to write `go.layout.Template(layout=dict(annotations=[...]))` as ``go.layout.Template(layout_annotations=[...])`\n", @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "78931621", + "id": "d6647317", "metadata": {}, "outputs": [], "source": [ @@ -476,7 +476,7 @@ }, { "cell_type": "markdown", - "id": "cf6c86e2", + "id": "b82d142a", "metadata": {}, "source": [ "#### Combining themes\n", @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97ebf68e", + "id": "d466f9c6", "metadata": {}, "outputs": [], "source": [ @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "16b836ae", + "id": "86e177fe", "metadata": {}, "source": [ "Combining themes is also supported by Plotly Express" @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0088498f", + "id": "5400cca3", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "060b5996", + "id": "5f7d6397", "metadata": {}, "source": [ "\n", @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "c8908228", + "id": "7b887c16", "metadata": {}, "source": [ "#### Examining built-in themes\n", @@ -630,7 +630,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70f09eb5", + "id": "1cdfda74", "metadata": {}, "outputs": [], "source": [ @@ -641,7 +641,7 @@ }, { "cell_type": "markdown", - "id": "f3517fcb", + "id": "791a59ad", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-contour.ipynb b/ternary-contour.ipynb index 3c8557dbe..a0c755de4 100644 --- a/ternary-contour.ipynb +++ b/ternary-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "639b3748", + "id": "6d58e387", "metadata": {}, "source": [ "## Ternary contour plots" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "5d712275", + "id": "f826ea67", "metadata": {}, "source": [ "A ternary contour plots represents isovalue lines of a quantity defined inside a [ternary diagram](https://en.wikipedia.org/wiki/Ternary_plot), i.e. as a function of three variables which sum is constant. Coordinates of the ternary plot often correspond to concentrations of three species, and the quantity represented as contours is some property (e.g., physical, chemical, thermodynamical) varying with the composition.\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6de9d329", + "id": "680db198", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "2a172a43", + "id": "677a049f", "metadata": {}, "source": [ "#### Customized ternary contour plot" @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17c8c0c4", + "id": "a9aeff65", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "0678852d", + "id": "295d8d73", "metadata": {}, "source": [ "#### Ternary contour plot with lines only" @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e275f88c", + "id": "1f0eb8b1", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +111,7 @@ }, { "cell_type": "markdown", - "id": "d24eeb24", + "id": "3bf36bca", "metadata": {}, "source": [ "#### Ternary contour plot with data points\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f514c87", + "id": "7d2e6730", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "1fd99b59", + "id": "7d12b718", "metadata": {}, "source": [ "#### Interpolation mode\n", @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2296c3f7", + "id": "4db1e161", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b85939dc", + "id": "4bd3ad79", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "f56534b0", + "id": "af194bfe", "metadata": {}, "source": [ "#### Reference\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "d30688e7", + "id": "fca5f2d0", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-plots.ipynb b/ternary-plots.ipynb index b398426fd..2ba1251cb 100644 --- a/ternary-plots.ipynb +++ b/ternary-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "363d7b88", + "id": "423ff201", "metadata": {}, "source": [ "## Ternary Plots\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0567070", + "id": "2e6e1633", "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "be57d055", + "id": "45635285", "metadata": {}, "source": [ "We can scale and color the markers to produce a ternary bubble chart." @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67465e44", + "id": "00770238", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "97d6f439", + "id": "dfa94674", "metadata": {}, "source": [ "### Ternary scatter plot with Plotly Graph Objects" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9755362d", + "id": "3882f198", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "32f9d4ab", + "id": "c1fcfb40", "metadata": {}, "source": [ "#### Reference\n", @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "0646cc4a", + "id": "231b52c4", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/ternary-scatter-contour.ipynb b/ternary-scatter-contour.ipynb index a542d8ef2..432d8d0f1 100644 --- a/ternary-scatter-contour.ipynb +++ b/ternary-scatter-contour.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "70c74520", + "id": "340b56e7", "metadata": {}, "source": [ "#### Load and Process Data Files" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dacd084", + "id": "ac84bef0", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "54f7c457", + "id": "1f51a17e", "metadata": {}, "source": [ "#### Create Ternary Scatter Plot:" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35fe0128", + "id": "61ec48df", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "494ff491", + "id": "9ea28463", "metadata": {}, "source": [ "#### Create Ternary Contour Plot:" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd03c120", + "id": "cfcc2318", "metadata": {}, "outputs": [], "source": [ @@ -155,14 +155,14 @@ { "cell_type": "code", "execution_count": null, - "id": "d5a1b16e", + "id": "9f15027c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "d8e72e0a", + "id": "0ec9e9d9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/text-and-annotations.ipynb b/text-and-annotations.ipynb index c0f9062fa..43063fb19 100644 --- a/text-and-annotations.ipynb +++ b/text-and-annotations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5df17373", + "id": "3917ff46", "metadata": {}, "source": [ "### Adding Text to Figures\n", @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "id": "d1271051", + "id": "f7022943", "metadata": {}, "source": [ "### Text on scatter plots with Plotly Express\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03302c05", + "id": "e74c6770", "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "71353f48", + "id": "12b29007", "metadata": {}, "source": [ "### Text on scatter plots with Graph Objects" @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5243f1d5", + "id": "4ed084b5", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "c47fe6d1", + "id": "8a97e0fa", "metadata": {}, "source": [ "### Text positioning in Dash\n", @@ -115,7 +115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "048d2840", + "id": "08395ec1", "metadata": { "hide_code": true }, @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "7ef5fac8", + "id": "b4954ffc", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "4edcb4fd", + "id": "71e35fee", "metadata": {}, "source": [ "### Controlling Text Size with `uniformtext`\n", @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "9dcfb3e2", + "id": "461bdc65", "metadata": {}, "source": [ "Here is a bar chart with the default behavior which will scale down text to fit." @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54c28981", + "id": "9d3208a9", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ }, { "cell_type": "markdown", - "id": "94795757", + "id": "b76429a5", "metadata": {}, "source": [ "Here is the same figure with uniform text applied: the text for all bars is the same size, with a minimum size of 8. Any text at the minimum size which does not fit in the bar is hidden." @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aea7c9c3", + "id": "b2e267ce", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15d67a10", + "id": "b64e4aa3", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "markdown", - "id": "10196112", + "id": "4baa090f", "metadata": {}, "source": [ "### Controlling Maximum Text Size\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62710979", + "id": "a33a78bc", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "cb7c9b1e", + "id": "4d112034", "metadata": {}, "source": [ "### Text Annotations\n", @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61ff9408", + "id": "4829701b", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "5d2285a2", + "id": "7241439d", "metadata": {}, "source": [ "#### Text Annotations with Log Axes\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af1c543c", + "id": "75d2517d", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "e8c9e8d6", + "id": "6d0a9911", "metadata": {}, "source": [ "### 3D Annotations" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8cd38fe7", + "id": "64ab5b79", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "b836fd0d", + "id": "1ac575bb", "metadata": {}, "source": [ "### Font Color, Size, and Familiy\n", @@ -418,7 +418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c24762a1", + "id": "07945182", "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ }, { "cell_type": "markdown", - "id": "ae7aeb87", + "id": "46f675ba", "metadata": {}, "source": [ "### Font Style, Variant, and Weight\n", @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b32dff0", + "id": "5e18ebfa", "metadata": {}, "outputs": [], "source": [ @@ -518,7 +518,7 @@ }, { "cell_type": "markdown", - "id": "630c4e25", + "id": "4f886841", "metadata": {}, "source": [ "## Numeric Font Weight\n", @@ -533,7 +533,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1db99832", + "id": "0be9f2c3", "metadata": {}, "outputs": [], "source": [ @@ -577,7 +577,7 @@ }, { "cell_type": "markdown", - "id": "daa53da1", + "id": "8dac6921", "metadata": {}, "source": [ "[scattergl](https://plotly.com/python/reference/scattergl) traces do not support all numeric font weights. When you specify a numeric font weight on `scattergl`, weights up to 500 are mapped to the keyword font weight \"normal\", while weights above 500 are mapped to \"bold\"." @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "325d5244", + "id": "77c81507", "metadata": {}, "source": [ "## Text Case\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93ddc7b9", + "id": "c545a223", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "14367c72", + "id": "d4abbcf8", "metadata": {}, "source": [ "## Text Lines\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7605c64", + "id": "abfd24a8", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ }, { "cell_type": "markdown", - "id": "bb2664d8", + "id": "88f3cbe3", "metadata": {}, "source": [ "## Text Shadow\n", @@ -694,7 +694,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4d0b84e", + "id": "844277c4", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "c8c4185e", + "id": "235dd1cd", "metadata": {}, "source": [ "### Styling and Coloring Annotations" @@ -735,7 +735,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f24132af", + "id": "2a15f79f", "metadata": {}, "outputs": [], "source": [ @@ -785,7 +785,7 @@ }, { "cell_type": "markdown", - "id": "e929fb68", + "id": "ef29dd2e", "metadata": {}, "source": [ "### Text Font as an Array - Styling Each Text Element" @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b46b91b6", + "id": "f803bb19", "metadata": {}, "outputs": [], "source": [ @@ -852,7 +852,7 @@ }, { "cell_type": "markdown", - "id": "30888860", + "id": "c6634937", "metadata": {}, "source": [ "### HTML Tags in Text\n", @@ -864,7 +864,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ce04664", + "id": "2e3e418f", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ }, { "cell_type": "markdown", - "id": "4acb7498", + "id": "5343cd0a", "metadata": {}, "source": [ "### Positioning Text Annotations Absolutely\n", @@ -924,7 +924,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39508a83", + "id": "4ef32cdd", "metadata": {}, "outputs": [], "source": [ @@ -941,7 +941,7 @@ }, { "cell_type": "markdown", - "id": "152141d5", + "id": "09b74287", "metadata": {}, "source": [ "### Adding Annotations Referenced to an Axis\n", @@ -954,7 +954,7 @@ { "cell_type": "code", "execution_count": null, - "id": "520a597b", + "id": "9e96a87f", "metadata": {}, "outputs": [], "source": [ @@ -983,7 +983,7 @@ }, { "cell_type": "markdown", - "id": "8e627c93", + "id": "a21f6dcb", "metadata": {}, "source": [ "### Specifying the Text's Position Absolutely\n", @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74411aab", + "id": "a0c98d11", "metadata": { "lines_to_next_cell": 0 }, @@ -1031,7 +1031,7 @@ }, { "cell_type": "markdown", - "id": "1197fe37", + "id": "28ca6b14", "metadata": {}, "source": [ "### Specifying Source Lines or Figure Notes on the Bottom of a Figure\n", @@ -1042,7 +1042,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f373aec5", + "id": "936b8a84", "metadata": { "lines_to_next_cell": 2 }, @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "0417f41b", + "id": "582850f7", "metadata": {}, "source": [ "### Customize Displayed Text with a Text Template\n", @@ -1123,7 +1123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6c00340", + "id": "64ca6d47", "metadata": {}, "outputs": [], "source": [ @@ -1140,7 +1140,7 @@ }, { "cell_type": "markdown", - "id": "be41ca64", + "id": "52f65b83", "metadata": {}, "source": [ "### Customize Text Template\n", @@ -1151,7 +1151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ec63f12", + "id": "61ede49d", "metadata": {}, "outputs": [], "source": [ @@ -1173,7 +1173,7 @@ }, { "cell_type": "markdown", - "id": "c2d89abf", + "id": "a32375fe", "metadata": {}, "source": [ "### Set Date in Text Template\n", @@ -1185,7 +1185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "432c01ba", + "id": "c7ce6966", "metadata": {}, "outputs": [], "source": [ @@ -1216,7 +1216,7 @@ }, { "cell_type": "markdown", - "id": "eff994b2", + "id": "eeee3eb8", "metadata": {}, "source": [ "#### Reference\n", @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "4baf4171", + "id": "25ca422c", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tick-formatting.ipynb b/tick-formatting.ipynb index 896b5a146..87cf83aef 100644 --- a/tick-formatting.ipynb +++ b/tick-formatting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8f321c3e", + "id": "3ce96627", "metadata": {}, "source": [ "#### Tickmode - Linear" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "0c2e121e", + "id": "2741f645", "metadata": {}, "source": [ "If `\"linear\"`, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`" @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0436c361", + "id": "770298b2", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "cddb5ed0", + "id": "2fdcb314", "metadata": {}, "source": [ "#### Tickmode - Array" @@ -51,7 +51,7 @@ }, { "cell_type": "markdown", - "id": "33e5e3da", + "id": "cbce8706", "metadata": {}, "source": [ "If `\"array\"`, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`." @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7a9287f", + "id": "75272e4e", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "7da78950", + "id": "7a8b14c5", "metadata": {}, "source": [ "### Dynamic tickmode in Dash\n", @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "648882d2", + "id": "d64ddf90", "metadata": { "hide_code": true }, @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "970e59b8", + "id": "92216e30", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -119,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "3de8ce64", + "id": "af1310d1", "metadata": {}, "source": [ "#### Using Tickformat Attribute" @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "e74f1f85", + "id": "a8443d31", "metadata": {}, "source": [ "For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f5b1d586", + "id": "99183788", "metadata": {}, "outputs": [], "source": [ @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "65636627", + "id": "19aab2a6", "metadata": {}, "source": [ "#### Using Tickformat Attribute - Date/Time" @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "84fd708c", + "id": "6df9ac0d", "metadata": {}, "source": [ "For more date/time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "147da80a", + "id": "099901b5", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "b9745e00", + "id": "ef28950b", "metadata": {}, "source": [ "#### Using Exponentformat Attribute" @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eba9c032", + "id": "2631a6ad", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "bf74eb8e", + "id": "cf2a9228", "metadata": {}, "source": [ "#### Tickformatstops to customize for different zoom levels" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30a48156", + "id": "76b1b274", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "c90c04b7", + "id": "da19b017", "metadata": {}, "source": [ "#### Placing ticks and gridlines between categories" @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7cbd7430", + "id": "bc1895aa", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "bbc7570c", + "id": "1cacdefa", "metadata": {}, "source": [ "#### Reference\n", @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "d5fc47ae", + "id": "9b086273", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-county-choropleth.ipynb b/tile-county-choropleth.ipynb index 81b7da640..cdae59bbe 100644 --- a/tile-county-choropleth.ipynb +++ b/tile-county-choropleth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5f1860ce", + "id": "7b0c4225", "metadata": {}, "source": [ "A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **tile-map** choropleth maps, but you can also build [**outline** choropleth maps](/python/choropleth-maps).\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0e2aa03", + "id": "655a738f", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "2c67dce5", + "id": "7ca5188b", "metadata": {}, "source": [ "#### Data indexed by `id`\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b8d7dc", + "id": "f28c71a0", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "32f16cfb", + "id": "33537d8a", "metadata": {}, "source": [ "### Choropleth map using plotly.express and carto base map\n", @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3614ddb", + "id": "5e601bee", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "4aaf081a", + "id": "c59ee3e5", "metadata": {}, "source": [ "### Choropleth maps in Dash\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edbffc14", + "id": "72464c98", "metadata": { "hide_code": true }, @@ -133,7 +133,7 @@ }, { "cell_type": "markdown", - "id": "84524443", + "id": "537618e0", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "96c5c5d7", + "id": "30d9cb69", "metadata": {}, "source": [ "### Indexing by GeoJSON Properties\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4aa41fb", + "id": "61d59a27", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "fb1129d0", + "id": "159f50ff", "metadata": {}, "source": [ "To use them together, we set `locations` to `district` and `featureidkey` to `\"properties.district\"`. The `color` is set to the number of votes by the candidate named Bergeron." @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d69ac1f6", + "id": "6f266f03", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "e52003e5", + "id": "c4065577", "metadata": {}, "source": [ "### Discrete Colors\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cddef5b", + "id": "2c9d2877", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "06888c05", + "id": "0f0d0f7d", "metadata": {}, "source": [ "### Using GeoPandas Data Frames\n", @@ -239,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e32523fd", + "id": "9658644f", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "cfa1fc9e", + "id": "34b1e176", "metadata": {}, "source": [ "### Choropleth map using plotly.graph_objects and carto base map\n", @@ -274,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "645c44fd", + "id": "21cf3da7", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ }, { "cell_type": "markdown", - "id": "1b780822", + "id": "bcfc4d5e", "metadata": {}, "source": [ "### Mapbox Maps\n", @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25c0eb8d", + "id": "a98f45e1", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "4cef3847", + "id": "25bbfa03", "metadata": {}, "source": [ "#### Reference\n", @@ -356,7 +356,7 @@ }, { "cell_type": "markdown", - "id": "d6cab45f", + "id": "acd85f14", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-map-layers.ipynb b/tile-map-layers.ipynb index e0048148e..0303792f9 100644 --- a/tile-map-layers.ipynb +++ b/tile-map-layers.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "40a78c80", + "id": "a95a0f15", "metadata": {}, "source": [ "\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5934f503", + "id": "75f94605", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "334e7302", + "id": "4c1553b0", "metadata": {}, "source": [ "#### Using `layout.map.layers` to Specify a Base Map\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a582ce3f", + "id": "7e78c79f", "metadata": { "lines_to_next_cell": 2 }, @@ -138,7 +138,7 @@ }, { "cell_type": "markdown", - "id": "e24c97fb", + "id": "eda6e300", "metadata": {}, "source": [ "#### Base Tiles from the USGS, radar overlay from Environment Canada\n", @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2873694b", + "id": "478b744c", "metadata": { "lines_to_next_cell": 2 }, @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "e2a94cc3", + "id": "21189009", "metadata": {}, "source": [ "#### Dark tiles example\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d1849a8", + "id": "c4415ff7", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "5ec87328", + "id": "cb2b845b", "metadata": {}, "source": [ "#### Stamen Watercolor using a Custom Style URL\n", @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "06c79e47", + "id": "4e55dfad", "metadata": {}, "source": [ "### Mapbox\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4a45cd0", + "id": "b6884f02", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "684a88a5", + "id": "c7ce0fed", "metadata": {}, "source": [ "#### Using `layout.mapbox.layers` to Specify a Base Map\n", @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "198022ae", + "id": "ec1b7df1", "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "ef7adec6", + "id": "f37258b4", "metadata": {}, "source": [ "#### Dark tiles from Mapbox service: free token needed\n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e105f334", + "id": "f463bf70", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "307fab4f", + "id": "b4dc6e48", "metadata": {}, "source": [ "## Setting Map Bounds\n", @@ -389,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ebb4236", + "id": "59b9fb9b", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "b6593480", + "id": "ecb18e23", "metadata": {}, "source": [ "#### Reference\n", @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "f4b2f2b0", + "id": "c02d88b6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tile-scatter-maps.ipynb b/tile-scatter-maps.ipynb index 4dd297d48..9ac94151a 100644 --- a/tile-scatter-maps.ipynb +++ b/tile-scatter-maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "831fe31c", + "id": "81a2c2e4", "metadata": {}, "source": [ "### Basic example with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "379648cc", + "id": "807f9b74", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "7073f873", + "id": "bc01dd72", "metadata": {}, "source": [ "### Basic Example with GeoPandas\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5af1052f", + "id": "63ef337c", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "687dc837", + "id": "6e4787de", "metadata": {}, "source": [ "#### Basic Example" @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b04e2ccf", + "id": "6be8e4d3", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "110a8267", + "id": "c7f3b4b0", "metadata": {}, "source": [ "#### Multiple Markers" @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b819393d", + "id": "67fe50c9", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "2a3da9db", + "id": "d936b40c", "metadata": {}, "source": [ "#### Nuclear Waste Sites on Campuses" @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c676a65", + "id": "83be2704", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "markdown", - "id": "f5a5349c", + "id": "0072f9c3", "metadata": {}, "source": [ "### Set Marker Symbols\n", @@ -238,7 +238,7 @@ { "cell_type": "code", "execution_count": null, - "id": "278f73a3", + "id": "26457ac5", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "8eaaa50d", + "id": "f873420c", "metadata": {}, "source": [ "#### Supported Symbols\n", @@ -293,7 +293,7 @@ }, { "cell_type": "markdown", - "id": "ca8ec5d6", + "id": "7ee44149", "metadata": {}, "source": [ "#### Add Clusters\n", @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55b06819", + "id": "3fa145d3", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "c3731858", + "id": "9b4f4a6b", "metadata": {}, "source": [ "#### Font Customization\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0610a605", + "id": "e603e811", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "92567a03", + "id": "4ad59751", "metadata": {}, "source": [ "`go.Scattermap` supports the following values for `textfont.family`:\n", @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "d669054e", + "id": "2eed756e", "metadata": {}, "source": [ "##### Font Weight\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8c1e8d2", + "id": "eb0b714b", "metadata": {}, "outputs": [], "source": [ @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "903de600", + "id": "8829c711", "metadata": {}, "source": [ "## Mapbox Maps\n", @@ -422,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5353e3e", + "id": "1783f014", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "9cd6acd0", + "id": "1de283b5", "metadata": {}, "source": [ "And here's an example using Graph Objects:" @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14ac4873", + "id": "ccb0fc39", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "3c723ffd", + "id": "442f5342", "metadata": {}, "source": [ "#### Reference\n", @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "15e84f70", + "id": "fe5721d6", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/time-series.ipynb b/time-series.ipynb index 3ffbbd9e2..092a58da7 100644 --- a/time-series.ipynb +++ b/time-series.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5a885c65", + "id": "09e19360", "metadata": {}, "source": [ "### Time Series using Axes of type `date`\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b538d0b8", + "id": "1cc79a6d", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdaca6ea", + "id": "4e20d425", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "67b3a22d", + "id": "3d2801c8", "metadata": {}, "source": [ "### Time Series in Dash\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95e20a6b", + "id": "2c30e67d", "metadata": { "hide_code": true }, @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "b7752a8b", + "id": "0a4cfbb5", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "cb87f4ea", + "id": "76313ac7", "metadata": {}, "source": [ "### Different Chart Types on Date Axes\n", @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e623ce8", + "id": "1ad07585", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "bdf2e3d1", + "id": "9600d781", "metadata": {}, "source": [ "Or this [facetted](/python/facet-plots/) area plot:" @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "408e40d3", + "id": "c3c322e4", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "b00645ee", + "id": "2263dc73", "metadata": {}, "source": [ "### Configuring Tick Labels\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed8871d2", + "id": "8b3c7593", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "6fd99c16", + "id": "dcd34fac", "metadata": {}, "source": [ "### Moving Tick Labels to the Middle of the Period\n", @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "082711b5", + "id": "866f323a", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "markdown", - "id": "8b0d50ea", + "id": "386b6278", "metadata": {}, "source": [ "### Adding Minor Ticks\n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7d14fa5", + "id": "244504cb", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "853e2f53", + "id": "2387734d", "metadata": {}, "source": [ "#### Monthly Period Labels With Weekly Minor Ticks\n", @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c331977", + "id": "be49c5be", "metadata": {}, "outputs": [], "source": [ @@ -265,7 +265,7 @@ }, { "cell_type": "markdown", - "id": "50060d26", + "id": "e6fd6349", "metadata": {}, "source": [ "### Summarizing Time-series Data with Histograms\n", @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11ee276a", + "id": "e7410fa0", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ }, { "cell_type": "markdown", - "id": "5ee8e3b4", + "id": "64eb6a5b", "metadata": {}, "source": [ "### Displaying Period Data\n", @@ -309,7 +309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48b5a7c6", + "id": "efadfbd5", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "beb3fa52", + "id": "b1ca36ac", "metadata": {}, "source": [ "### Hover Templates with Mixtures of Period data\n", @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39042632", + "id": "1ed8be42", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "561644a9", + "id": "cf30b458", "metadata": { "tags": [] }, @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bedc61fd", + "id": "2a21e60e", "metadata": {}, "outputs": [], "source": [ @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e14add3", + "id": "6f6dd30e", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eaa80868", + "id": "b49b7368", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "d8389948", + "id": "1264f550", "metadata": {}, "source": [ "### Time Series With Range Slider\n", @@ -485,7 +485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a5eb807", + "id": "c3e85cc2", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ }, { "cell_type": "markdown", - "id": "0e57110f", + "id": "c54bf6c9", "metadata": {}, "source": [ "### Time Series with Range Selector Buttons\n", @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb957af5", + "id": "bbe6c2e2", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "b638b2f0", + "id": "10bf2f84", "metadata": {}, "source": [ "### Customizing Tick Label Formatting by Zoom Level\n", @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "667e2d8a", + "id": "74d60c8f", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ }, { "cell_type": "markdown", - "id": "4383665b", + "id": "cb1b7a3a", "metadata": {}, "source": [ "### Hiding Weekends and Holidays\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "120c095b", + "id": "ea5ce4ad", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f796f368", + "id": "18c3ecde", "metadata": {}, "outputs": [], "source": [ @@ -637,7 +637,7 @@ }, { "cell_type": "markdown", - "id": "60ff34f1", + "id": "7d8b8cf2", "metadata": {}, "source": [ "### Hiding Non-Business Hours\n", @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c30678fc", + "id": "70a3e7fd", "metadata": {}, "outputs": [], "source": [ @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85d253e8", + "id": "aa137864", "metadata": { "lines_to_next_cell": 2 }, @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "318d6782", + "id": "bc918613", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/tree-plots.ipynb b/tree-plots.ipynb index 5148af7b5..dd5016133 100644 --- a/tree-plots.ipynb +++ b/tree-plots.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f7f2de89", + "id": "2143770c", "metadata": {}, "source": [ "#### Set Up Tree with [igraph](http://igraph.org/python/)\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68072a1a", + "id": "2a80b39e", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48323399", + "id": "c0f89de2", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "markdown", - "id": "506f4376", + "id": "23529c5e", "metadata": {}, "source": [ "#### Create Plotly Traces" @@ -64,7 +64,7 @@ { "cell_type": "code", "execution_count": null, - "id": "368aff16", + "id": "7873b192", "metadata": {}, "outputs": [], "source": [ @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "5efce6d5", + "id": "b2a2b9c0", "metadata": {}, "source": [ "#### Create Text Inside the Circle via Annotations" @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "147d6ade", + "id": "57c932bd", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "194e7859", + "id": "0c6ca3e7", "metadata": {}, "source": [ "#### Add Axis Specifications and Create the Layout" @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c69f0f9", + "id": "41266967", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "markdown", - "id": "e2369a71", + "id": "769852fb", "metadata": {}, "source": [ "#### Reference\n", @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "d901306f", + "id": "4535e0c9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/treemaps.ipynb b/treemaps.ipynb index a9622614b..ac462c0b0 100644 --- a/treemaps.ipynb +++ b/treemaps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1f7a1fcc", + "id": "11125d8a", "metadata": {}, "source": [ "[Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. The input data format is the same as for [Sunburst Charts](https://plotly.com/python/sunburst-charts/) and [Icicle Charts](https://plotly.com/python/icicle-charts/): the hierarchy is defined by [labels](https://plotly.com/python/reference/treemap/#treemap-labels) (`names` for `px.treemap`) and [parents](https://plotly.com/python/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16f69fdf", + "id": "057f709b", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "9bb32507", + "id": "3ca6952d", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with plotly.express\n", @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af3c6644", + "id": "413eee8f", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "21fd6ae3", + "id": "02a32011", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with continuous color argument in px.treemap\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4693b09d", + "id": "db58dc97", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "82a19159", + "id": "37e0df9b", "metadata": {}, "source": [ "### Treemap of a rectangular DataFrame with discrete color argument in px.treemap\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea3bef27", + "id": "832afa61", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "064b897d", + "id": "f2891847", "metadata": {}, "source": [ "In the example below the color of Saturday and Sunday sectors is the same as Dinner because there are only Dinner entries for Saturday and Sunday. However, for Female -> Friday there are both lunches and dinners, hence the \"mixed\" color (blue here) is used." @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e56b9763", + "id": "f3cf052a", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "9ecb361b", + "id": "e46d4d74", "metadata": {}, "source": [ "### Using an explicit mapping for discrete colors\n", @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63cbf6fe", + "id": "1344582e", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "8a44214c", + "id": "74eca004", "metadata": {}, "source": [ "### Rectangular data with missing values\n", @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59661b6d", + "id": "a63c0ca0", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "f4943f69", + "id": "29db85f7", "metadata": {}, "source": [ "### Treemap with Rounded Corners" @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "e2e10135", + "id": "f6b21452", "metadata": {}, "source": [ "*New in 5.12*\n", @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62e7afbc", + "id": "98c537e3", "metadata": {}, "outputs": [], "source": [ @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "c1499c6e", + "id": "97ff0c78", "metadata": {}, "source": [ "### Basic Treemap with go.Treemap\n", @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13652172", + "id": "d71fae4f", "metadata": {}, "outputs": [], "source": [ @@ -261,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "50e4fad0", + "id": "1546bf87", "metadata": {}, "source": [ "### Set Different Attributes in Treemap\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77c8e538", + "id": "91e45606", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +318,7 @@ }, { "cell_type": "markdown", - "id": "96265fcf", + "id": "fd7e4820", "metadata": {}, "source": [ "### Set Color of Treemap Sectors\n", @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "023e5c0f", + "id": "7d6ae211", "metadata": {}, "outputs": [], "source": [ @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "9dd828ed", + "id": "a6b84010", "metadata": {}, "source": [ "This example uses `treemapcolorway` attribute, which should be set in layout." @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b94918c2", + "id": "c6818cae", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6c153e0", + "id": "f029fec7", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "markdown", - "id": "a3ef9ced", + "id": "21c44197", "metadata": {}, "source": [ "### Treemap chart with a continuous colorscale\n", @@ -428,7 +428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58693055", + "id": "05ba0062", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "27253d6b", + "id": "9422a7e6", "metadata": {}, "source": [ "### Nested Layers in Treemap\n", @@ -519,7 +519,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a52125e2", + "id": "5006b472", "metadata": {}, "outputs": [], "source": [ @@ -546,7 +546,7 @@ }, { "cell_type": "markdown", - "id": "65718220", + "id": "2eb0c1f4", "metadata": {}, "source": [ "### Controlling text fontsize with uniformtext\n", @@ -559,7 +559,7 @@ { "cell_type": "code", "execution_count": null, - "id": "797e1140", + "id": "b0ce4df2", "metadata": {}, "outputs": [], "source": [ @@ -584,7 +584,7 @@ }, { "cell_type": "markdown", - "id": "2381b34a", + "id": "1ca563bf", "metadata": {}, "source": [ "### Pattern Fills\n", @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e39c976", + "id": "ad81509a", "metadata": {}, "outputs": [], "source": [ @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "aa4f4352", + "id": "5c6054f5", "metadata": {}, "source": [ "#### Reference\n", @@ -628,7 +628,7 @@ }, { "cell_type": "markdown", - "id": "6a7158b8", + "id": "e7d1f18f", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/trisurf.ipynb b/trisurf.ipynb index 5c0ff351b..f35e1380b 100644 --- a/trisurf.ipynb +++ b/trisurf.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4d2a1095", + "id": "26c643a3", "metadata": {}, "source": [ "Trisurf plots can be made using a [figure factory](/python/figure-factories/) as detailed in this page.\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e81ff416", + "id": "96b56a2b", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "02c18695", + "id": "9a9a31c0", "metadata": {}, "source": [ "#### Mobius Band\n" @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9ea7cbe", + "id": "19bc8a80", "metadata": { "lines_to_next_cell": 2 }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "833f1581", + "id": "ef08f74e", "metadata": {}, "source": [ "#### Boy's Surface\n" @@ -97,7 +97,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d0c3dde", + "id": "a08f06ca", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "f8117ad1", + "id": "b9aac49e", "metadata": {}, "source": [ "#### Reference\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "16557624", + "id": "8e3b8617", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/troubleshooting.ipynb b/troubleshooting.ipynb index bfb035b5b..b10ae2401 100644 --- a/troubleshooting.ipynb +++ b/troubleshooting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "55cdec65", + "id": "9ad786a3", "metadata": {}, "source": [ "### Version Problems\n", @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "619d298b", + "id": "a56cd4a3", "metadata": { "hide_code": true }, @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "4b6a1cf6", + "id": "4d38d7fb", "metadata": {}, "source": [ "

Sign up for Dash Club → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.\n", @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "64f3c609", + "id": "af715ac1", "metadata": {}, "source": [ "### VSCode Notebook, Nteract and Streamlit Problems\n", @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "992b72d1", + "id": "ef3b0ad9", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v4-migration.ipynb b/v4-migration.ipynb index b4afd1cb1..ea4ae356d 100644 --- a/v4-migration.ipynb +++ b/v4-migration.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "28327b59", + "id": "1f7e98c6", "metadata": {}, "source": [ "### Upgrading to Version 4\n", @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "d3fc94a2", + "id": "7838e6e9", "metadata": {}, "source": [ "### Online features (`plotly.plotly`) moved to `chart-studio` package\n", @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "43888257", + "id": "582041b0", "metadata": {}, "source": [ "### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export\n", @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "7a0ce64d", + "id": "1e16a012", "metadata": {}, "source": [ "### New default theme\n", @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5da2c35a", + "id": "ce1e5418", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "804d2b26", + "id": "2090b364", "metadata": {}, "source": [ "You can revert to the version 3 figure appearance by disabling the default theme as follows:" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eebd5d59", + "id": "e73e1e57", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "626f264b", + "id": "e2f32e58", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "aeabc8ad", + "id": "4b949640", "metadata": {}, "source": [ "See [Theming and templates](/python/templates) for more information on theming in plotly.py version 4.\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40cfd6a3", + "id": "bfa982c9", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "9b09c2f8", + "id": "3bd0717e", "metadata": {}, "source": [ "Code that relied on the `add_*` methods to return a reference to the newly created trace will need to be updated to access the trace from the returned figure. This can be done by appending `.data[-1]` to the add trace expression.\n", @@ -229,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "4fafb35c", + "id": "2fbce83c", "metadata": {}, "source": [ "### `make_subplots` updates\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b699d63", + "id": "ce33c5e9", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "78932bf0", + "id": "92c02090", "metadata": {}, "source": [ "And here is the equivalent, version 4 example. Note how the order to the height list is reversed compared to the example above." @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da39b2d3", + "id": "e97c3b66", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "d8ec1b30", + "id": "9ae1c91d", "metadata": {}, "source": [ "#### Implementation of shared axes with `make_subplots`\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15f5b944", + "id": "02b4aecc", "metadata": {}, "outputs": [], "source": [ @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "94cf0a56", + "id": "90fcdd1f", "metadata": {}, "source": [ "### Trace UIDs\n", @@ -339,7 +339,7 @@ }, { "cell_type": "markdown", - "id": "3bb1d440", + "id": "7fe85be7", "metadata": {}, "source": [ "### Headless image export on Linux with Xvfb.\n", @@ -355,7 +355,7 @@ }, { "cell_type": "markdown", - "id": "aad90423", + "id": "57c10ee1", "metadata": {}, "source": [ "### Removals\n", @@ -374,7 +374,7 @@ }, { "cell_type": "markdown", - "id": "a30cc4e9", + "id": "6625a955", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/v6-changes.ipynb b/v6-changes.ipynb index 6d1c07017..c501f6198 100644 --- a/v6-changes.ipynb +++ b/v6-changes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f66f7c28", + "id": "6f6dcff3", "metadata": {}, "source": [ "This page outlines the changes in Plotly.py version 6 and cases where you may need to update your charts or tools that you use for working with Plotly.py." @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "a8d436b2", + "id": "8c28896b", "metadata": {}, "source": [ "## Jupyter Notebook Support\n", @@ -95,7 +95,7 @@ }, { "cell_type": "markdown", - "id": "79d27d69", + "id": "6b01e105", "metadata": { "lines_to_next_cell": 2 }, @@ -126,7 +126,7 @@ }, { "cell_type": "markdown", - "id": "a9421dd6", + "id": "a9b96845", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/violin.ipynb b/violin.ipynb index cdead159f..df490005b 100644 --- a/violin.ipynb +++ b/violin.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "49fb2ad6", + "id": "5969d5d4", "metadata": {}, "source": [ "## Violin Plot with Plotly Express\n", @@ -20,7 +20,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e34c5fb8", + "id": "a97ad47c", "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "markdown", - "id": "0b9f13a2", + "id": "a70ccad8", "metadata": {}, "source": [ "### Violin plot with box and data points" @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "025a4c3b", + "id": "6598d2c9", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "01d64041", + "id": "922227b9", "metadata": {}, "source": [ "### Multiple Violin Plots" @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd69aa52", + "id": "fc74e78f", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53ed72d9", + "id": "390add19", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "e1ed73ef", + "id": "de5082e1", "metadata": {}, "source": [ "## Violin Plot with go.Violin\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a99dc61", + "id": "107bb70b", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "b207956f", + "id": "4565dd4a", "metadata": {}, "source": [ "#### Multiple Traces" @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7132bc40", + "id": "c0216c86", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "1a994a96", + "id": "bc7dc009", "metadata": {}, "source": [ "#### Grouped Violin Plot" @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc4b21dc", + "id": "bd2c7b10", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "33bb2e53", + "id": "b6dec34e", "metadata": {}, "source": [ "#### Split Violin Plot" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae00f040", + "id": "68c5c253", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "1e3c3bed", + "id": "e14fa374", "metadata": {}, "source": [ "#### Advanced Violin Plot" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34128116", + "id": "39b5ac1f", "metadata": {}, "outputs": [], "source": [ @@ -304,7 +304,7 @@ }, { "cell_type": "markdown", - "id": "b65033a4", + "id": "7c7ab61f", "metadata": {}, "source": [ "#### Ridgeline plot\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e613863a", + "id": "cc6409b2", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "544cc94e", + "id": "704b82f6", "metadata": {}, "source": [ "### Violin Plot With Only Points\n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1236245e", + "id": "15752c99", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "e46ef089", + "id": "d964d1b5", "metadata": {}, "source": [ "### Choosing The Algorithm For Computing Quartiles\n", @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fece51bf", + "id": "98795d65", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "810ecf46", + "id": "6db008c4", "metadata": {}, "source": [ "#### Reference\n", @@ -408,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "571e66fe", + "id": "5fdbd066", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/waterfall-charts.ipynb b/waterfall-charts.ipynb index 9ba35c14d..92f9df581 100644 --- a/waterfall-charts.ipynb +++ b/waterfall-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cfb34ea9", + "id": "dfa41ad0", "metadata": {}, "source": [ "### Simple Waterfall Chart" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c0ab5e6", + "id": "3436c451", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "78f6aa9c", + "id": "6802a2c3", "metadata": {}, "source": [ "### Multi Category Waterfall Chart\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e9a5f01", + "id": "ae4e9b9b", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "294c05d1", + "id": "5a0b39f8", "metadata": {}, "source": [ "### Setting Marker Size and Color\n", @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d058977", + "id": "a68c2612", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "e6aea1da", + "id": "3d33fdcc", "metadata": {}, "source": [ "### Horizontal Waterfall Chart" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "755c01b0", + "id": "239c9099", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "24875ed0", + "id": "99c3ccab", "metadata": {}, "source": [ "#### Reference\n", @@ -154,7 +154,7 @@ }, { "cell_type": "markdown", - "id": "55d72fd2", + "id": "3e7fc596", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wide-form.ipynb b/wide-form.ipynb index 2e5f75262..d4f138c38 100644 --- a/wide-form.ipynb +++ b/wide-form.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "480d6634", + "id": "bd8e7f46", "metadata": {}, "source": [ "### Plotly Express works with Column-oriented, Matrix or Geographic Data\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6403455f", + "id": "d16d1831", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "314886bc", + "id": "1238666d", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "98662a61", + "id": "10a2cc49", "metadata": {}, "source": [ "Plotly Express can produce **the same plot from either form**. For the long-form input, `x` and `y` are set to the respective column names." @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e5b28ce", + "id": "ceae336b", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "0e487bad", + "id": "f4a59aee", "metadata": {}, "source": [ "For the wide-form input, we **pass in a list of column-names `y`**, which is enough to trigger the wide-form processing mode. Wide-form mode is also the default if neither `x` nor `y` are specified, see section at bottom regarding Wide-Form Defaults." @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acb2c86a", + "id": "697ebf7f", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "f020806d", + "id": "cb17fc70", "metadata": {}, "source": [ "### Labeling axes, legends and hover text\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9df7ab7e", + "id": "568ccfa3", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "857368c4", + "id": "5cc40ed2", "metadata": {}, "source": [ "Plotly Express figures created using wide-form data can be [styled just like any other Plotly Express figure](/python/styling-plotly-express/):" @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "563449d5", + "id": "1260f0db", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "c58820ac", + "id": "38cb687c", "metadata": {}, "source": [ "### Data Frames with Named Indexes\n", @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03ed17c1", + "id": "bb6c4ac8", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "a5cc3bc6", + "id": "2a948204", "metadata": {}, "source": [ "When working with a data frame like the one above, you can pass the index references directly as arguments, to benefit from automatic labelling for everything except the y axis label, which will default to \"values\", but this can be overridden with the `labels` argument as above:" @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "064dd6c9", + "id": "0ae762bc", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "e6f41db5", + "id": "4b96409b", "metadata": {}, "source": [ "If you transpose `x` and `y`, thereby assigning the columns to `x`, the orientation will be switched to horizontal:" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e070a33", + "id": "943fc6dc", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "bdd5a299", + "id": "52d57407", "metadata": {}, "source": [ "### Assigning Inferred Columns to Non-Default Arguments" @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "03f98fbb", + "id": "c8fbec42", "metadata": {}, "source": [ "In the examples above, the columns of the wide data frame are assigned by default as an \"inferred\" column named `variable` to the `color` argument (see section below for documentation of the default behaviours), but this is not a hard constraint. The `variable` column can be assigned to any Plotly Express argument, for example to accomplish faceting, and `color` can be reassigned to any other value. More generally, when plotting with a data frame without named indexes, you can reassign the inferred column named `variable` and `value` to any argument:" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dffb839", + "id": "59c7614e", "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "232dc501", + "id": "81da81c6", "metadata": {}, "source": [ "You can also prevent `color` from getting assigned if you're mapping `variable` to some other argument:" @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40a14570", + "id": "018d749f", "metadata": {}, "outputs": [], "source": [ @@ -269,7 +269,7 @@ }, { "cell_type": "markdown", - "id": "33f073bf", + "id": "7424b425", "metadata": {}, "source": [ "If using a data frame's named indexes, either explicitly or relying on the defaults, the row-index references (i.e. `df.index`) or column-index names (i.e. the value of `df.columns.name`) must be used:" @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f02b0d50", + "id": "c462bafb", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "1969dd24", + "id": "0a192481", "metadata": {}, "source": [ "### Mixed-Form Data\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d39132d", + "id": "d3931ad7", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "82e132c6", + "id": "e6a630c0", "metadata": {}, "source": [ "We can visualize just the wide-form portion of the data frame easily with a [violin chart](/python/violin/). As a special note, we'll assign the index, which is the participant ID, to the `hover_data`, so that hovering over outlier points will identify their row." @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd023431", + "id": "ea5271ec", "metadata": { "lines_to_next_cell": 0 }, @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "f486b5be", + "id": "5da025ee", "metadata": {}, "source": [ "\n" @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "8e2d095b", + "id": "09ab8fff", "metadata": {}, "source": [ "We are not limited to visualizing only the wide-form portion of the data, however. We can also leverage the long-form portion of the data frame, for example to color by participant `gender` and facet by participant `group`, all without having to manipulate the data frame:" @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eca6e85d", + "id": "c821bd7b", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "f68bf7e7", + "id": "ef12ab28", "metadata": {}, "source": [ "In the plots above, the column names provided to `y` are internally mapped to long-form column called `variable`, as is apparent in the x-axis labels. We can reassign `variable` to another argument as well, in this case we'll assign it to `facet_col` and reassign `group` to the `x` axis. We'll switch to a [box plot](/python/box-plots/) for variety." @@ -377,7 +377,7 @@ { "cell_type": "code", "execution_count": null, - "id": "491f8343", + "id": "44a103d7", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ }, { "cell_type": "markdown", - "id": "74fb42c7", + "id": "d0eedcb9", "metadata": {}, "source": [ "One interesting thing about a mixed-form data frame like this is that it remains easy to plot, say, one experiment against another, which would require some preliminary data wrangling if this was represented as a pure long-form dataset:" @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36acf699", + "id": "024c9c61", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ }, { "cell_type": "markdown", - "id": "db78d262", + "id": "7509d983", "metadata": {}, "source": [ "In fact, we can even visualize the results of every experiment against every other, using a [scatterplot matrix](/python/splom/):" @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "712384f3", + "id": "4b114a0a", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "7e3a2241", + "id": "6102a1e1", "metadata": {}, "source": [ "### Wide-Form Defaults\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f4974c4", + "id": "1e991300", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "739c94d9", + "id": "0a0bd536", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "5b6ee4f1", + "id": "9bb2d110", "metadata": {}, "source": [ "### Orientation Control When Using Defaults\n", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8973472", + "id": "c0f162af", "metadata": { "lines_to_next_cell": 2 }, @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "af1dda48", + "id": "5680e909", "metadata": {}, "source": [ "### What About Dash?\n", diff --git a/wind-rose-charts.ipynb b/wind-rose-charts.ipynb index c045dd8fd..0dd7f6d8a 100644 --- a/wind-rose-charts.ipynb +++ b/wind-rose-charts.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cba84955", + "id": "41ffe577", "metadata": {}, "source": [ "### Wind Rose Chart with Plotly Express\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9aad5ccb", + "id": "90a30d14", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "e2a18d70", + "id": "aa3d7c0b", "metadata": {}, "source": [ "#### Basic Wind Rose Chart" @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6b213af", + "id": "ab91ddd1", "metadata": {}, "outputs": [], "source": [ @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "34a863d7", + "id": "fe075075", "metadata": {}, "source": [ "#### Reference\n", @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "d26ad4e0", + "id": "9ef40e41", "metadata": {}, "source": [ "### What About Dash?\n",