diff --git a/doc/python/histograms.md b/doc/python/histograms.md index 3d72758005b..6e5d98f84fe 100644 --- a/doc/python/histograms.md +++ b/doc/python/histograms.md @@ -5,8 +5,8 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.1' - jupytext_version: 1.1.1 + format_version: '1.2' + jupytext_version: 1.6.0 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.3 + version: 3.7.6 plotly: description: How to make Histograms in Python with Plotly. display_as: statistical @@ -30,9 +30,9 @@ jupyter: order: 3 page_type: example_index permalink: python/histograms/ - redirect_from: - - /python/histogram-tutorial/ - - /python/histogram/ + redirect_from: + - /python/histogram-tutorial/ + - /python/histogram/ thumbnail: thumbnail/histogram.jpg --- @@ -71,6 +71,19 @@ fig = px.histogram(df, x="total_bill", nbins=20) fig.show() ``` +#### Histograms in Dash + +[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`. + +Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with Dash Enterprise.** + + +```python hide_code=true +from IPython.display import IFrame +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' +IFrame(snippet_url + 'histograms', width='100%', height=630) +``` + #### Accessing the counts (y-axis) values JavaScript calculates the y-axis (count) values on the fly in the browser, so it's not accessible in the `fig`. You can manually calculate it using `np.histogram`. diff --git a/doc/python/legend.md b/doc/python/legend.md index 65efd16c447..cdc1605d2d4 100644 --- a/doc/python/legend.md +++ b/doc/python/legend.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.2' - jupytext_version: 1.4.2 + jupytext_version: 1.6.0 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.7 + version: 3.7.6 plotly: description: How to configure and style the legend in Plotly with Python. display_as: file_settings @@ -133,6 +133,19 @@ fig.update_layout(legend=dict( fig.show() ``` +#### Legends in Dash + +[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`. + +Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with Dash Enterprise.** + + +```python hide_code=true +from IPython.display import IFrame +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' +IFrame(snippet_url + 'legend', width='100%', height=630) +``` + #### Horizontal Legends The `layout.legend.orientation` attribute can be set to `"h"` for a horizontal legend. Here we also position it above the plotting area. diff --git a/doc/python/subplots.md b/doc/python/subplots.md index 1687a2ae800..3d40b239dea 100644 --- a/doc/python/subplots.md +++ b/doc/python/subplots.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.2' - jupytext_version: 1.4.2 + jupytext_version: 1.6.0 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.7 + version: 3.7.6 plotly: description: How to make subplots in with Plotly's Python graphing library. Examples of stacked, custom-sized, gridded, and annotated subplots. @@ -211,6 +211,19 @@ fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]), fig.show() ``` +#### Subplots in Dash + +[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`. + +Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with Dash Enterprise.** + + +```python hide_code=true +from IPython.display import IFrame +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' +IFrame(snippet_url + 'subplots', width='100%', height=630) +``` + #### Customizing Subplot Axes 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. @@ -588,4 +601,4 @@ All of the y-axis properties are found here: https://plotly.com/python/reference ```python from plotly.subplots import make_subplots help(make_subplots) -``` \ No newline at end of file +``` diff --git a/doc/python/text-and-annotations.md b/doc/python/text-and-annotations.md index b3bb9b6da9b..8f9af6bed53 100644 --- a/doc/python/text-and-annotations.md +++ b/doc/python/text-and-annotations.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.2' - jupytext_version: 1.4.2 + jupytext_version: 1.6.0 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.7 + version: 3.7.6 plotly: description: How to add text labels and annotations to plots in python. display_as: file_settings @@ -103,6 +103,19 @@ fig.add_trace(go.Scatter( fig.show() ``` +### Text positioning in Dash + +[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`. + +Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with Dash Enterprise.** + + +```python hide_code=true +from IPython.display import IFrame +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' +IFrame(snippet_url + 'text-and-annotations', width='100%', height=630) +``` + ### Controlling text fontsize with uniformtext For the [pie](/python/pie-charts), [bar](/python/bar-charts), [sunburst](/python/sunburst-charts) and [treemap](/python/treemap-charts) 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. diff --git a/doc/python/time-series.md b/doc/python/time-series.md index 691cbf19e30..466f0647550 100644 --- a/doc/python/time-series.md +++ b/doc/python/time-series.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.2' - jupytext_version: 1.4.2 + jupytext_version: 1.6.0 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.7 + version: 3.7.6 plotly: description: How to plot date and time in python. display_as: financial @@ -61,6 +61,19 @@ fig = go.Figure([go.Scatter(x=df['Date'], y=df['AAPL.High'])]) fig.show() ``` +### Time Series in Dash + +[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`. + +Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with Dash Enterprise.** + + +```python hide_code=true +from IPython.display import IFrame +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' +IFrame(snippet_url + 'time-series', width='100%', height=630) +``` + ### Different Chart Types on Date Axes Any kind of cartesian chart can be placed on `date` axes, for example this bar chart of relative stock ticker values.