Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/python/LaTeX.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jupyter:

#### LaTeX Typesetting

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 `<script>` tag pointing to a content-delivery network (CDN). Versions 2 and 3 are supported.
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 `<script>` tag pointing to a content-delivery network (CDN). Version 7 supports MathJax versions 3 and 4. Earlier versions support MathJax versions 2 and 3.

```python
import plotly.express as px
Expand Down
2 changes: 1 addition & 1 deletion doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Axes
order: 14
order: 15
permalink: python/axes/
thumbnail: thumbnail/axes.png
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/builtin-colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Built-in Continuous Color Scales
order: 28
order: 29
permalink: python/builtin-colorscales/
thumbnail: thumbnail/heatmap_colorscale.jpg
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion doc/python/colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Continuous Color Scales and Color Bars
order: 21
order: 22
permalink: python/colorscales/
redirect_from: python/logarithmic-color-scale/
thumbnail: thumbnail/heatmap_colorscale.jpg
Expand Down
10 changes: 7 additions & 3 deletions doc/python/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Configuration
order: 10
order: 11
page_type: u-guide
permalink: python/configuration-options/
thumbnail: thumbnail/modebar-icons.png
Expand Down Expand Up @@ -209,10 +209,14 @@ To delete buttons from the modebar, pass an array of strings containing the name
- **High-level**: `zoom`, `pan`, `select`, `zoomIn`, `zoomOut`, `autoScale`, `resetScale`
- **2D**: `zoom2d`, `pan2d`, `select2d`, `lasso2d`, `zoomIn2d`, `zoomOut2d`, `autoScale2d`, `resetScale2d`, `v1hovermode`
- **2D Shape Drawing**: `drawline`, `drawopenpath`, `drawclosedpath`, `drawcircle`, `drawrect`, `eraseshape`
- **3D**: `zoom3d`, `pan3d`, `orbitRotation`, `tableRotation`, `handleDrag3d`, `resetCameraDefault3d`, `resetCameraLastSave3d`, `hoverClosest3d`
- **3D**: `zoom3d`, `pan3d`, `orbitRotation`, `tableRotation`, `resetCameraDefault3d`, `resetCameraLastSave3d`, `hoverClosest3d`
- **Cartesian**: `hoverClosestCartesian`, `hoverCompareCartesian`
- **Geo**: `zoomInGeo`, `zoomOutGeo`, `resetGeo`, `hoverClosestGeo`
- **Other**: `hoverClosestGl2d`, `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendDataToCloud`, `toggleSpikelines`, `resetViewMap`
- **Tile maps**: `zoomInMap`, `zoomOutMap`, `resetViewMap`
- **Sankey**: `resetSankeyGroup`
- **Other**: `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendChartToCloud`, `toggleSpikelines`

*Changed in version 7*: `handleDrag3d` and `hoverClosestGl2d` no longer exist, and `sendDataToCloud` is now named `sendChartToCloud`.

```python
import plotly.graph_objects as go
Expand Down
2 changes: 1 addition & 1 deletion doc/python/discrete-color.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Discrete Colors
order: 29
order: 30
permalink: python/discrete-color/
thumbnail: thumbnail/heatmap_colorscale.jpg
v4upgrade: true
Expand Down
5 changes: 2 additions & 3 deletions doc/python/figure-factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Figure Factories
order: 33
order: 34
permalink: python/figure-factories/
thumbnail: thumbnail/streamline.jpg
---
Expand All @@ -41,7 +41,7 @@ The following plot types can be created with Figure Factory:

* [Dendrograms](/python/dendrogram/)
* [Hexagonal Binning Tile Map](/python/hexbin-map/)
* [Quiver Plots](/python/quiver-plots/)
* [Quiver Plots](/python/quiver-plots/) — since version 7.0, quiver plots are better made with the `go.Quiver` trace type. `create_quiver` remains available for its `angle` and `scaleratio` options.
* [Streamline Plots](/python/streamline-plots/)
* [Tables](/python/figure-factory-table/)
* [Ternary Contour Plots](/python/ternary-contour/)
Expand All @@ -65,4 +65,3 @@ The following legacy Figure Factory functions have been replaced by Plotly Expre
#### Reference

For more information about the contents of `plotly.figure_factory`, please refer to our [API Reference documentation](https://plotly.com/python-api-reference/plotly.figure_factory.html).

2 changes: 1 addition & 1 deletion doc/python/figure-introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Introspecting Figures
order: 36
order: 37
page_type: u-guide
permalink: python/figure-introspection/
thumbnail: thumbnail/violin.jpg
Expand Down
2 changes: 1 addition & 1 deletion doc/python/figure-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Setting the Font, Title, Legend Entries, and Axis Titles
order: 13
order: 14
permalink: python/figure-labels/
redirect_from: python/font/
thumbnail: thumbnail/figure-labels.png
Expand Down
2 changes: 1 addition & 1 deletion doc/python/graph-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Graph Objects
order: 35
order: 36
page_type: u-guide
permalink: python/graph-objects/
thumbnail: thumbnail/horizontal-bar.jpg
Expand Down
2 changes: 1 addition & 1 deletion doc/python/graphing-multiple-chart-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Multiple Chart Types
order: 18
order: 19
page_type: u-guide
permalink: python/graphing-multiple-chart-types/
thumbnail: thumbnail/multiple-chart-type.jpg
Expand Down
2 changes: 1 addition & 1 deletion doc/python/horizontal-vertical-shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Horizontal and Vertical Lines and Rectangles
order: 37
order: 38
permalink: python/horizontal-vertical-shapes/
thumbnail: thumbnail/shape.jpg
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Hover Text and Formatting
order: 23
order: 24
permalink: python/hover-text-and-formatting/
thumbnail: thumbnail/hover-text.png
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Images
order: 24
order: 25
permalink: python/images/
thumbnail: thumbnail/images.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion doc/python/interactive-html-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Interactive HTML Export
order: 31
order: 32
page_type: u-guide
permalink: python/interactive-html-export/
thumbnail: thumbnail/static-image-export.png
Expand Down
2 changes: 1 addition & 1 deletion doc/python/ipython-vs-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: IPython vs Python
order: 26
order: 27
permalink: python/ipython-vs-python/
thumbnail: thumbnail/venn.jpg
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/legend.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Legends
order: 15
order: 16
permalink: python/legend/
redirect_from: python/horizontal-legend/
thumbnail: thumbnail/legends.gif
Expand Down
12 changes: 1 addition & 11 deletions doc/python/location-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,17 +461,7 @@ fig = px.choropleth(
fig.show()
```

> 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.

```python
import plotly.express as px

fig = px.choropleth(
locations=['USA', 'CAN', 'GBR'],
locationmode='ISO-3'
)
fig.show()
```
*Changed in version 7*: country names are matched by a different library, which accepts more forms and rejects some names that matched by accident before. See [Changes in Version 7](/python/v7-migration/#Country-Names) for details. To get identical results across versions, use [`locationmode='ISO-3'`](#locationmode='ISO-3') with ISO codes for `locations`.

## Using Different Data Types with `locations`

Expand Down
19 changes: 18 additions & 1 deletion doc/python/map-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ fig.show()

### Automatic Zooming or Bounds Fitting

The `layout.geo.fitbounds` attribute can be set to `locations` to automatically set the center and latitude and longitude range according to the data being plotted. See the [choropleth maps](/python/choropleth-maps/) documentation for more information.
The `layout.geo.fitbounds` attribute set to `locations` automatically sets the center and the latitude and longitude range according to the data being plotted. See the [choropleth maps](/python/choropleth-maps/) documentation for more information.

*Since version 7*, `fitbounds` defaults to `"locations"`, so a `geo` subplot fits its data without any configuration. Set `fitbounds=False` for the world view that earlier versions showed by default. Setting your own `center` or `projection.scale` also turns auto-fitting off.

```python
import plotly.express as px
Expand All @@ -182,6 +184,21 @@ fig.update_layout(height=300, margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
```

### Limiting the Zoom Range

*New in version 7*

`projection.minscale` and `projection.maxscale` clamp how far a user can zoom the map in or out. The two attributes are multipliers of `projection.scale`, so `minscale=0.5` allows zooming out to half the initial view and `maxscale=4` allows zooming in to four times it.

```python
import plotly.express as px

fig = px.line_geo(lat=[0,15,20,35], lon=[5,10,25,30])
fig.update_geos(projection=dict(scale=1, minscale=0.5, maxscale=4))
fig.update_layout(height=300, margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
```

### Named Map Scopes and Country Sub-Units

In addition, the named "scope" of a map defines a sub-set of the earth's surface to draw. Each scope has a _default projection type, center and roll, as well as bounds_, and certain scopes contain country sub-unit cultural layers certain resolutions, such as `scope="north america"` at `resolution=50` which contains US state and Canadian province boundaries.
Expand Down
2 changes: 1 addition & 1 deletion doc/python/marker-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Styling Markers
order: 20
order: 21
permalink: python/marker-style/
thumbnail: thumbnail/marker-style.gif
---
Expand Down
6 changes: 4 additions & 2 deletions doc/python/migrate-to-maplibre.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jupyter:

## Migrating from Mapbox traces to MapLibre traces

With the release of Plotly.py v5.24.0, we are introducing a new set of trace types for maps with tile underlays, including from Plotly Express:
Plotly.py v5.24.0 introduced a set of trace types for maps with tile underlays, including from Plotly Express:
- `px.scatter_map`
- `px.line_map`
- `px.choropleth_map`
Expand All @@ -47,7 +47,9 @@ as well as Plotly Graph Objects:
- `go.Scattermap`
- `go.Densitymap`

These traces replace the existing Mapbox traces, `px.scatter_mapbox`, `px.line_mapbox`, etc., but use [MapLibre](https://maplibre.org) as the map renderer rather than Mapbox.
These traces replaced the Mapbox traces, `px.scatter_mapbox`, `px.line_mapbox`, and the rest, and use [MapLibre](https://maplibre.org) as the map renderer rather than Mapbox.

**The Mapbox traces, the `layout.mapbox` subplot, and the `mapboxAccessToken` configuration option were removed in Plotly.py 7.** If you are upgrading to version 7, follow the steps below, then see [Changes in Version 7](/python/v7-migration/) for the rest of the upgrade.

When switching to the new traces, keep an eye out for improved rendering performance, WebGL2 support, and over time, improved features in the Plotly map traces inherited from the MapLibre renderer, including projection support, globe views, terrain support, and support for modern mapping standards.

Expand Down
6 changes: 4 additions & 2 deletions doc/python/multiple-axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Multiple Axes
order: 16
order: 17
permalink: python/multiple-axes/
thumbnail: thumbnail/multiple-axes.jpg
---
Expand Down Expand Up @@ -383,7 +383,9 @@ fig.show()

*New in 5.13*

With overlayed axes, each axis by default has its own number of ticks. You can sync the number of ticks on a cartesian axis with another one it overlays by setting `tickmode="sync"`. In this example, we sync the ticks on the `"Total bill amount"` axis with the `"Total number of diners"` axis that it overlays.
Set `tickmode="sync"` on an overlaying cartesian axis to draw its ticks and gridlines at the positions of the axis it overlays, labeled from its own range. The two axes then share one grid. In this example, the `"Total bill amount"` axis syncs its ticks with the `"Total number of diners"` axis that it overlays.

*Changed in version 7*: `tickmode` defaults to `"sync"` on an overlaying axis. Earlier versions gave each axis its own independent grid. Set `tickmode="auto"` on the overlaying axis for that behavior.

```python
import plotly.graph_objects as go
Expand Down
2 changes: 1 addition & 1 deletion doc/python/orca-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Orca Management
order: 9
order: 10
permalink: python/orca-management/
thumbnail: thumbnail/orca-management.png
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/pandas-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Pandas Plotting Backend
order: 32
order: 33
permalink: python/pandas-backend/
redirect_from: python/cufflinks/
thumbnail: thumbnail/plotly-express.png
Expand Down
4 changes: 2 additions & 2 deletions doc/python/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Each `plotly` trace type is rendered with either SVG or WebGL. The following tra
WebGL is a powerful technology for accelerating rendering but comes with some strict limitations:

1. GPU requirement: WebGL is a GPU (graphics card) technology and therefore requires specific hardware which is available in most but not all cases and is supported by most but not all browsers.
2. Rasterization: WebGL-rendered data is drawn as a grid of pixels rather than as individual shapes, so can appear pixelated or fuzz in certain cases, and when exported to static file formats will appear pixelated on zoom. In addition, text rendering will differ between SVG and WebGL-powered traces.
2. Rasterization: WebGL-rendered data is drawn as a grid of pixels rather than as individual shapes, so can appear pixelated or fuzzy in certain cases. This also applies to static export: when a figure with WebGL traces is exported to a *vector* format such as SVG or PDF, the WebGL traces are embedded as an encapsulated raster (a bitmap) rather than as true vectors, so those parts will appear pixelated on zoom. To force fully-vector output, use `render_mode="svg"` (see [WebGL with Plotly Express](#webgl-with-plotly-express) below). In addition, text rendering will differ between SVG and WebGL-powered traces.
3. Context limits: browsers impose a strict limit on the number of WebGL "contexts" that any given web document can access. WebGL-powered traces in `plotly` can use multiple contexts in some cases but as a general rule, **it may not be possible to render more than 8 WebGL-involving figures on the same page at the same time.** See the following section, Multiple WebGL Contexts, for more details.
4. Size limits: browsers impose hardware-dependent limits on the height and width of figures using WebGL which users may encounter with extremely large plots (e.g. tens of thousands of pixels of height).

Expand Down Expand Up @@ -181,7 +181,7 @@ it is also possible to use [datashader](/python/datashader/).

The `render_mode` argument to supported Plotly Express functions (e.g. `scatter` and `scatter_polar`) can be used to enable WebGL rendering.

> **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`.
> **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"`. Because WebGL traces are embedded as rasters rather than vectors when [exported to a static vector format](/python/static-image-export/) such as SVG or PDF, set `render_mode="svg"` if you need fully-vector output from a large scatter figure.

Here is an example that creates a 100,000 point scatter plot using Plotly Express with WebGL rendering explicitly enabled.

Expand Down
2 changes: 1 addition & 1 deletion doc/python/px-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Plotly Express Arguments
order: 19
order: 20
page_type: u-guide
permalink: python/px-arguments/
thumbnail: thumbnail/plotly-express.png
Expand Down
Loading
Loading