From 471be1313d7197bc2f20970bcb9db03d8859ae54 Mon Sep 17 00:00:00 2001 From: Satvik Mishra Date: Sun, 11 Oct 2026 12:40:47 +0530 Subject: [PATCH] docs: fix broken cross-page anchors and tile density heatmap links --- doc/python/axes.md | 4 ++-- doc/python/box-plots.md | 2 +- doc/python/builtin-colorscales.md | 2 +- doc/python/categorical-axes.md | 2 +- doc/python/choropleth-maps.md | 4 ++-- doc/python/colorscales.md | 4 ++-- doc/python/configuration-options.md | 2 +- doc/python/dropdowns.md | 2 +- doc/python/figure-structure.md | 4 ++-- doc/python/getting-started.md | 2 +- doc/python/graph-objects.md | 6 +++--- doc/python/heatmaps.md | 4 ++-- doc/python/horizontal-vertical-shapes.md | 4 ++-- doc/python/hover-text-and-formatting.md | 2 +- doc/python/images.md | 4 ++-- doc/python/imshow.md | 2 +- doc/python/line-charts.md | 2 +- doc/python/log-plot.md | 2 +- doc/python/performance.md | 2 +- doc/python/plotly-express.md | 4 ++-- doc/python/shapes.md | 4 ++-- doc/python/static-image-generation-migration.md | 4 ++-- doc/python/text-and-annotations.md | 2 +- doc/python/v6-changes.md | 2 +- 24 files changed, 36 insertions(+), 36 deletions(-) diff --git a/doc/python/axes.md b/doc/python/axes.md index 9d5f154e101..ac57e00687b 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -33,7 +33,7 @@ jupyter: thumbnail: thumbnail/axes.png --- -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/). +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/). Other kinds of subplots and axes are described in other tutorials: @@ -190,7 +190,7 @@ fig.show() ### Set axis title position -This example sets `standoff` attribute to cartesian axes to determine the distance between the tick labels and the axis title. Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. By default [automargin](https://plotly.com/python/setting-graph-size/#automatically-adjust-margins) is `True` in Plotly template for the cartesian axis, so the margins will be pushed to fit the axis title at given standoff distance. +This example sets `standoff` attribute to cartesian axes to determine the distance between the tick labels and the axis title. Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. By default [automargin](https://plotly.com/python/setting-graph-size/#Automatically-Adjust-Margins) is `True` in Plotly template for the cartesian axis, so the margins will be pushed to fit the axis title at given standoff distance. ```python import plotly.graph_objects as go diff --git a/doc/python/box-plots.md b/doc/python/box-plots.md index 0dff5c64ede..d6229b05d40 100644 --- a/doc/python/box-plots.md +++ b/doc/python/box-plots.md @@ -207,7 +207,7 @@ fig.show() ### Modifying The Algorithm For Computing Quartiles -For an explanation of how each algorithm works, see [Choosing The Algorithm For Computing Quartiles](#choosing-the-algorithm-for-computing-quartiles). +For an explanation of how each algorithm works, see [Choosing The Algorithm For Computing Quartiles](#Choosing-The-Algorithm-For-Computing-Quartiles). ```python import plotly.graph_objects as go diff --git a/doc/python/builtin-colorscales.md b/doc/python/builtin-colorscales.md index 01fc9ec8e12..9684517987f 100644 --- a/doc/python/builtin-colorscales.md +++ b/doc/python/builtin-colorscales.md @@ -112,7 +112,7 @@ It is intentionally left in for backwards-compatibility reasons. A collection of predefined diverging color scales is provided in the `plotly.colors.diverging` module. Diverging color scales are appropriate for continuous data that has a natural midpoint other otherwise informative special value, such as 0 altitude, or the boiling point -of a liquid. These scales are intended to be used when [explicitly setting the midpoint of the scale](/python/colorscales/#setting-the-midpoint-of-a-color-range-for-a-diverging-color-scale). +of a liquid. These scales are intended to be used when [explicitly setting the midpoint of the scale](/python/colorscales/#Setting-the-Midpoint-of-a-Color-Range-for-a-Diverging-Color-scale). Here are all the built-in scales in the `plotly.colors.diverging` module: diff --git a/doc/python/categorical-axes.md b/doc/python/categorical-axes.md index 6a732ac3d18..424888af7cf 100644 --- a/doc/python/categorical-axes.md +++ b/doc/python/categorical-axes.md @@ -34,7 +34,7 @@ jupyter: --- -This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots) to visualize categorical (i.e. qualitative, nominal or ordinal data as opposed to continuous numerical data). Such axes are a natural fit for bar charts, waterfall charts, funnel charts, heatmaps, violin charts and box plots, but can also be used with scatter plots and line charts. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/). +This page shows examples of how to configure [2-dimensional Cartesian axes](/python/figure-structure/#2D-Cartesian-Trace-Types-and-Subplots) to visualize categorical (i.e. qualitative, nominal or ordinal data as opposed to continuous numerical data). Such axes are a natural fit for bar charts, waterfall charts, funnel charts, heatmaps, violin charts and box plots, but can also be used with scatter plots and line charts. [Configuring gridlines, ticks, tick labels and axis titles](/python/axes/) on logarithmic axes is done the same was as with [linear axes](/python/axes/). ### 2-D Cartesian Axis Type and Auto-Detection diff --git a/doc/python/choropleth-maps.md b/doc/python/choropleth-maps.md index 0919535c26d..2987b2cd5f7 100644 --- a/doc/python/choropleth-maps.md +++ b/doc/python/choropleth-maps.md @@ -216,7 +216,7 @@ In **Plotly.py 6.3 and later**, the built-in countries geometry is created from In **earlier versions of Plotly.py**, the built-in countries geometry is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). -To use the built-in countries geometry, provide `locations` as [three-letter ISO country codes](/python/outline-map-locations/#supported-iso-codes). +To use the built-in countries geometry, provide `locations` as [three-letter ISO country codes](/python/outline-map-locations/#Supported-ISO-Codes). ```python import plotly.express as px @@ -229,7 +229,7 @@ fig = px.choropleth(df, locations="iso_alpha", fig.show() ``` -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) or [full state names](/python/outline-map-locations/#locationmodeusastates): +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) or [full state names](/python/outline-map-locations/#locationmode='USA-states'): ```python import plotly.express as px diff --git a/doc/python/colorscales.md b/doc/python/colorscales.md index aadef07600f..0b1c70e3830 100644 --- a/doc/python/colorscales.md +++ b/doc/python/colorscales.md @@ -159,7 +159,7 @@ fig.show() The Plotly Express `color_continuous_scale` argument accepts explicitly-constructed color scales as well. -The Graph Objects `colorscale` parameter also accepts an explicitly-constructed color scale, as shown in the example [below](#custom-heatmap-color-scale-with-graph-objects). +The Graph Objects `colorscale` parameter also accepts an explicitly-constructed color scale, as shown in the example [below](#Custom-Heatmap-Color-scale-with-Graph-Objects). ```python import plotly.express as px @@ -642,7 +642,7 @@ fig.show() Colorbars can be positioned by specifying x and y coordinates. By default, the x and y values are "paper" coordinates, which refer to the plot area. You can also use coordinates based on the "container" by setting `xref="container"` or `yref="container"`. The following example uses a container reference for the x position. -See the positioning section of [the figure data structure page](/python/figure-structure/#positioning-with-paper-container-coordinates-or-axis-domain-coordinates) for more details on "paper" vs "container" coordinates. +See the positioning section of [the figure data structure page](/python/figure-structure/#Positioning-With-Paper,-Container-Coordinates,-or-Axis-Domain-Coordinates) for more details on "paper" vs "container" coordinates. ```python import plotly.graph_objects as go diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index 2c74630c6e2..4e91e00cbda 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.md @@ -286,7 +286,7 @@ fig.show() *New in v4.7* -Some modebar buttons of Cartesian plots are optional and have to be added explicitly, using the `modeBarButtonsToAdd` config attribute. These buttons are used for drawing or erasing shapes. See [the tutorial on shapes and shape drawing](/python/shapes#drawing-shapes-with-a-mouse-on-cartesian-plots) for more details. +Some modebar buttons of Cartesian plots are optional and have to be added explicitly, using the `modeBarButtonsToAdd` config attribute. These buttons are used for drawing or erasing shapes. See [the tutorial on shapes and shape drawing](/python/shapes#Drawing-shapes-with-a-Mouse-on-Cartesian-plots) for more details. ```python import plotly.express as px diff --git a/doc/python/dropdowns.md b/doc/python/dropdowns.md index c43103a630f..f353bbbaa69 100644 --- a/doc/python/dropdowns.md +++ b/doc/python/dropdowns.md @@ -446,7 +446,7 @@ fig.show() ### Graph Selection Dropdowns in Jinja -It is straight forward to create each potential view as a separate graph and then use Jinja to insert each potential view into a div on a JavaScript enabled webpage with a dropdown that chooses which div to display. This approach produces code that requires little customization or updating as you e.g. add, drop, or reorder views or traces, so it is particularly compelling for prototyping and rapid iteration. It produces web pages that are larger than the webpages produced through the built in method which is a consideration for very large figures with hundreds or thousands of data points in traces that appear in multiple selections. This approach requires both a Python program and a Jinja template file. The documentation on [using Jinja templates with Plotly](https://plotly.com/python/interactive-html-export/#inserting-plotly-output-into-html-using-a-jinja2-template) is relevant background. +It is straight forward to create each potential view as a separate graph and then use Jinja to insert each potential view into a div on a JavaScript enabled webpage with a dropdown that chooses which div to display. This approach produces code that requires little customization or updating as you e.g. add, drop, or reorder views or traces, so it is particularly compelling for prototyping and rapid iteration. It produces web pages that are larger than the webpages produced through the built in method which is a consideration for very large figures with hundreds or thousands of data points in traces that appear in multiple selections. This approach requires both a Python program and a Jinja template file. The documentation on [using Jinja templates with Plotly](https://plotly.com/python/interactive-html-export/#Inserting-Plotly-Output-into-HTML-using-a-Jinja2-Template) is relevant background. diff --git a/doc/python/figure-structure.md b/doc/python/figure-structure.md index 495f1a4497e..e1244088b23 100644 --- a/doc/python/figure-structure.md +++ b/doc/python/figure-structure.md @@ -72,7 +72,7 @@ Plotly.js supports inputs adhering to a well-defined schema, whose overall archi Attributes are referred to in text and in the [Figure Reference](/python/reference/index/) by their full "path" i.e. the dot-delimited concatenation of their parents. For example `"layout.width"` refers to the attribute whose key is `"width"` inside a dict which is the value associated with a key `"layout"` at the root of the figure. If one of the parents is a list rather than a dict, a set of brackets is inserted in the path when referring to the attribute in the abstract, e.g. `"layout.annotations[].text"`. Finally, as explained below, the top-level "data" attribute defines a list of typed objects called "traces" with the schema dependent upon the type, and these attributes' paths are listed in the [Figure Reference](/python/reference/index/) as `"data[type=scatter].name"`. -The [`plotly.graph_objects` module contains an automatically-generated hierarchy of Python classes](/python/graph-objects/) which represent non-leaf attributes in the figure schema and provide a Pythonic API for them. When [manipulating a `plotly.graph_objects.Figure` object](/python/creating-and-updating-figures/), attributes can be set either directly using Python object attributes e.g. `fig.layout.title.font.family="Open Sans"` or using [update methods and "magic underscores"](/python/creating-and-updating-figures/#magic-underscore-notation) e.g. `fig.update_layout(title_font_family="Open Sans")` +The [`plotly.graph_objects` module contains an automatically-generated hierarchy of Python classes](/python/graph-objects/) which represent non-leaf attributes in the figure schema and provide a Pythonic API for them. When [manipulating a `plotly.graph_objects.Figure` object](/python/creating-and-updating-figures/), attributes can be set either directly using Python object attributes e.g. `fig.layout.title.font.family="Open Sans"` or using [update methods and "magic underscores"](/python/creating-and-updating-figures/#Magic-Underscore-Notation) e.g. `fig.update_layout(title_font_family="Open Sans")` When building a figure, it is *not necessary to populate every attribute* of every object. At render-time, [the JavaScript layer will compute default values](/python/figure-introspection/) for each required unspecified attribute, depending upon the ones that are specified, as documented in the [Figure Reference](/python/reference/index/). An example of this would be `layout.xaxis.range`, which may be specified explicitly, but if not will be computed based on the range of `x` values for every trace linked to that axis. The JavaScript layer will ignore unknown attributes or malformed values, although the `plotly.graph_objects` module provides Python-side validation for attribute values. Note also that if [the `layout.template` key is present (as it is by default)](/python/templates/) then default values will be drawn first from the contents of the template and only if missing from there will the JavaScript layer infer further defaults. The built-in template can be disabled by setting `layout.template="none"`. @@ -192,7 +192,7 @@ The following trace types are compatible with tile map subplots via the `map` at * [`scattermap`](/python/tile-scatter-maps/), which can be used to draw [individual markers](/python/tile-scatter-maps/), [lines and curves](/python/lines-on-tile-maps/) and [filled areas](/python/filled-area-tile-maps/) on tile maps * [`choroplethmap`](/python/tile-county-choropleth/): colored polygons on tile maps -* [`densitymap`](/python/tile-density-heatmaps/): density heatmaps on tile maps +* [`densitymap`](/python/density-heatmaps/): density heatmaps on tile maps ### Traces Which Are Their Own Subplots diff --git a/doc/python/getting-started.md b/doc/python/getting-started.md index cb68c6a010e..74c66ca235e 100644 --- a/doc/python/getting-started.md +++ b/doc/python/getting-started.md @@ -73,7 +73,7 @@ If you want to use Plotly Express, install its required dependencies with: pip install plotly[express] ``` -You'll also need to install a [supported dataframe library](/python/px-arguments#supported-dataFrame-types). +You'll also need to install a [supported dataframe library](/python/px-arguments#Supported-DataFrame-Types). ### Plotly charts in Dash diff --git a/doc/python/graph-objects.md b/doc/python/graph-objects.md index 92f34fdfb8e..c53147fac53 100644 --- a/doc/python/graph-objects.md +++ b/doc/python/graph-objects.md @@ -37,11 +37,11 @@ jupyter: The figures created, manipulated and rendered by the plotly Python library are [represented by tree-like data structures](/python/figure-structure/) which are automatically serialized to JSON for rendering by the Plotly.js JavaScript library. These trees are composed of named nodes called "attributes", with their structure defined by the Plotly.js figure schema, which is available in [machine-readable form](https://raw.githubusercontent.com/plotly/plotly.js/master/dist/plot-schema.json). **The `plotly.graph_objects` module (typically imported as `go`) contains an [automatically-generated hierarchy of Python classes](https://plotly.com/python-api-reference/plotly.graph_objects.html#graph-objects) which represent non-leaf nodes in this figure schema. The term "graph objects" refers to instances of these classes. ** -The primary classes defined in the `plotly.graph_objects` module are [`Figure`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html) and an [`ipywidgets`-compatible variant called `FigureWidget`](/python/figurewidget/), which both represent entire figures. Instances of these classes have many convenience methods for Pythonically [manipulating their attributes](/python/creating-and-updating-figures/) (e.g. `.update_layout()` or `.add_trace()`, which all accept ["magic underscore" notation](/python/creating-and-updating-figures/#magic-underscore-notation)) as well as [rendering them](/python/renderers/) (e.g. `.show()`) and [exporting them to various formats](/python/static-image-export/) (e.g. `.to_json()` or `.write_image()` or `.write_html()`). +The primary classes defined in the `plotly.graph_objects` module are [`Figure`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html) and an [`ipywidgets`-compatible variant called `FigureWidget`](/python/figurewidget/), which both represent entire figures. Instances of these classes have many convenience methods for Pythonically [manipulating their attributes](/python/creating-and-updating-figures/) (e.g. `.update_layout()` or `.add_trace()`, which all accept ["magic underscore" notation](/python/creating-and-updating-figures/#Magic-Underscore-Notation)) as well as [rendering them](/python/renderers/) (e.g. `.show()`) and [exporting them to various formats](/python/static-image-export/) (e.g. `.to_json()` or `.write_image()` or `.write_html()`). > Note: the functions in [Plotly Express](/python/plotly-express/), which is the recommended entry-point into the `plotly` library, are all built on top of graph objects, and all return instances of `plotly.graph_objects.Figure`. -Every non-leaf attribute of a figure is represented by an instance of a class in the `plotly.graph_objects` hierarchy. For example, a figure `fig` can have an attribute `layout.margin`, which contains attributes `t`, `l`, `b` and `r` which are leaves of the tree: they have no children. The field at `fig.layout` is an object of class [`plotly.graph_objects.Layout`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Layout.html) and `fig.layout.margin` is an object of class `plotly.graph_objects.layout.Margin` which represents the `margin` node, and it has fields `t`, `l`, `b` and `r`, containing the values of the respective leaf-nodes. Note that specifying all of these values can be done without creating intermediate objects using ["magic underscore" notation](/python/creating-and-updating-figures/#magic-underscore-notation): `go.Figure(layout_margin=dict(t=10, b=10, r=10, l=10))`. +Every non-leaf attribute of a figure is represented by an instance of a class in the `plotly.graph_objects` hierarchy. For example, a figure `fig` can have an attribute `layout.margin`, which contains attributes `t`, `l`, `b` and `r` which are leaves of the tree: they have no children. The field at `fig.layout` is an object of class [`plotly.graph_objects.Layout`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Layout.html) and `fig.layout.margin` is an object of class `plotly.graph_objects.layout.Margin` which represents the `margin` node, and it has fields `t`, `l`, `b` and `r`, containing the values of the respective leaf-nodes. Note that specifying all of these values can be done without creating intermediate objects using ["magic underscore" notation](/python/creating-and-updating-figures/#Magic-Underscore-Notation): `go.Figure(layout_margin=dict(t=10, b=10, r=10, l=10))`. The objects contained in the list which is the [value of the attribute `data` are called "traces"](/python/figure-structure/), and can be of one of more than 40 possible types, each of which has a corresponding class in `plotly.graph_objects`. For example, traces of type `scatter` are represented by instances of the class `plotly.graph_objects.Scatter`. This means that a figure constructed as `go.Figure(data=[go.Scatter(x=[1,2], y=[3,4)])` will have the JSON representation `{"data": [{"type": "scatter", "x": [1,2], "y": [3,4]}]}`. @@ -68,7 +68,7 @@ Note that the figures produced by Plotly Express **in a single function-call** a The figures produced by Plotly Express can always be built from the ground up using graph objects, but this approach typically takes **5-100 lines of code rather than 1**. -Here is a simple example of how to produce the same figure object from the same data, once with Plotly Express and once without. Note that [Plotly Express functions](/python-api-reference/plotly.express.html) like [`px.bar()`](/python/bar-charts/) can accept a DataFrame as their first argument with column names passed to the `x` and `y` arguments, while [Graph Objects functions](/python-api-reference/plotly.graph_objects.html) like [`go.Bar()`](/python/bar-charts/#basic-bar-charts-with-plotlygraphobjects) require the data values to be passed directly to the `x` and `y` arguments as a tuple, list, NumPy array, or Pandas Series. +Here is a simple example of how to produce the same figure object from the same data, once with Plotly Express and once without. Note that [Plotly Express functions](/python-api-reference/plotly.express.html) like [`px.bar()`](/python/bar-charts/) can accept a DataFrame as their first argument with column names passed to the `x` and `y` arguments, while [Graph Objects functions](/python-api-reference/plotly.graph_objects.html) like [`go.Bar()`](/python/bar-charts/#Basic-Bar-Charts-with-plotly.graph_objects) require the data values to be passed directly to the `x` and `y` arguments as a tuple, list, NumPy array, or Pandas Series. The data in this example is in "long form" but [Plotly Express also accepts data in "wide form"](/python/wide-form/) and the line-count savings from Plotly Express over graph objects are comparable. More complex figures such as [sunbursts](/python/sunburst-charts/), [parallel coordinates](/python/parallel-coordinates-plot/), [facet plots](/python/facet-plots/) or [animations](/python/animations/) require many more lines of figure-specific graph objects code, whereas switching from one representation to another with Plotly Express usually involves changing just a few characters. diff --git a/doc/python/heatmaps.md b/doc/python/heatmaps.md index cbbc73fa81d..55f2ec5a219 100644 --- a/doc/python/heatmaps.md +++ b/doc/python/heatmaps.md @@ -34,7 +34,7 @@ jupyter: thumbnail: thumbnail/heatmap.jpg --- -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/). +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/density-heatmaps/). Plotly supports two different types of colored-tile heatmaps: @@ -48,7 +48,7 @@ Plotly supports two different types of colored-tile heatmaps: -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). +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-DataFrame-Types). > For more examples using `px.imshow`, including examples of faceting and animations, as well as full-color image display, see the [the `imshow` documentation page](/python/imshow). diff --git a/doc/python/horizontal-vertical-shapes.md b/doc/python/horizontal-vertical-shapes.md index d533904aac4..bed29f3bdd1 100644 --- a/doc/python/horizontal-vertical-shapes.md +++ b/doc/python/horizontal-vertical-shapes.md @@ -143,7 +143,7 @@ fig.show() *New in 5.14* -[Text labels on shapes](/python/shapes/#addingtextlabelstoshapes), introduced in version 5.14, is now the recommended way to add text to shapes. The above examples using `add_hline`, `add_vrect`, `add_hrect`, and `add_vline` that add annotations can be rewritten to use `label`. +[Text labels on shapes](/python/shapes/#Adding-Text-Labels-to-Shapes), introduced in version 5.14, is now the recommended way to add text to shapes. The above examples using `add_hline`, `add_vrect`, `add_hrect`, and `add_vline` that add annotations can be rewritten to use `label`. ```python import plotly.express as px @@ -176,7 +176,7 @@ fig.show() ``` -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. +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. ### Reference diff --git a/doc/python/hover-text-and-formatting.md b/doc/python/hover-text-and-formatting.md index ccfefc85a76..65d60c3eae5 100644 --- a/doc/python/hover-text-and-formatting.md +++ b/doc/python/hover-text-and-formatting.md @@ -414,7 +414,7 @@ fig.show() *New in v5.0* -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` 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. ```python import plotly.graph_objects as go diff --git a/doc/python/images.md b/doc/python/images.md index 898a65898a8..1975163de4d 100644 --- a/doc/python/images.md +++ b/doc/python/images.md @@ -313,9 +313,9 @@ It can be useful to add shapes to a layout image, for highlighting an object, dr In order to enable shape drawing, you need to - define a dragmode corresponding to a drawing tool (`'drawline'`,`'drawopenpath'`, `'drawclosedpath'`, `'drawcircle'`, or `'drawrect'`) -- add [modebar buttons](/python/configuration-options#add-optional-shapedrawing-buttons-to-modebar) corresponding to the drawing tools you wish to use. +- add [modebar buttons](/python/configuration-options#Add-optional-shape-drawing-buttons-to-modebar) corresponding to the drawing tools you wish to use. -The style of new shapes is specified by the `newshape` layout attribute. Shapes can be selected and modified after they have been drawn. More details and examples are given in the [tutorial on shapes](/python/shapes#drawing-shapes-on-cartesian-plots). +The style of new shapes is specified by the `newshape` layout attribute. Shapes can be selected and modified after they have been drawn. More details and examples are given in the [tutorial on shapes](/python/shapes#Drawing-shapes-with-a-Mouse-on-Cartesian-plots). 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). diff --git a/doc/python/imshow.md b/doc/python/imshow.md index 271eb15284e..5b8dc402700 100644 --- a/doc/python/imshow.md +++ b/doc/python/imshow.md @@ -305,7 +305,7 @@ In order to enable shape drawing, you need to - define a dragmode corresponding to a drawing tool (`'drawline'`,`'drawopenpath'`, `'drawclosedpath'`, `'drawcircle'`, or `'drawrect'`) - add modebar buttons corresponding to the drawing tools you wish to use. -The style of new shapes is specified by the `newshape` layout attribute. Shapes can be selected and modified after they have been drawn. More details and examples are given in the [tutorial on shapes](/python/shapes#drawing-shapes-on-cartesian-plots). +The style of new shapes is specified by the `newshape` layout attribute. Shapes can be selected and modified after they have been drawn. More details and examples are given in the [tutorial on shapes](/python/shapes#Drawing-shapes-with-a-Mouse-on-Cartesian-plots). 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). diff --git a/doc/python/line-charts.md b/doc/python/line-charts.md index ad355e0af42..ec974d4a0a3 100644 --- a/doc/python/line-charts.md +++ b/doc/python/line-charts.md @@ -275,7 +275,7 @@ fig.show() #### Connect Data Gaps -[connectgaps](https://plotly.com/python/reference/scatter/#scatter-connectgaps) determines if missing values in the provided data are shown as a gap in the graph or not. In [this tutorial](https://plotly.com/python/filled-area-tile-maps/#multiple-filled-areas-with-a-scattermap-trace), we showed how to take benefit of this feature and illustrate multiple areas on a tile map. +[connectgaps](https://plotly.com/python/reference/scatter/#scatter-connectgaps) determines if missing values in the provided data are shown as a gap in the graph or not. In [this tutorial](https://plotly.com/python/filled-area-tile-maps/#Multiple-Filled-Areas-with-a-Scattermap-trace), we showed how to take benefit of this feature and illustrate multiple areas on a tile map. ```python import plotly.graph_objects as go diff --git a/doc/python/log-plot.md b/doc/python/log-plot.md index edce8eeb09b..8ee5b02f21d 100644 --- a/doc/python/log-plot.md +++ b/doc/python/log-plot.md @@ -33,7 +33,7 @@ jupyter: thumbnail: thumbnail/log.jpg --- -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/). +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/). ### Logarithmic Axes with Plotly Express diff --git a/doc/python/performance.md b/doc/python/performance.md index 842b21dd76d..79df9e12714 100644 --- a/doc/python/performance.md +++ b/doc/python/performance.md @@ -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 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"` to supported Plotly Express functions (see [WebGL with Plotly Express](#webgl-with-plotly-express) below). 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"` to supported Plotly Express functions (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). diff --git a/doc/python/plotly-express.md b/doc/python/plotly-express.md index 73f402df5e1..4557f46f6e0 100644 --- a/doc/python/plotly-express.md +++ b/doc/python/plotly-express.md @@ -60,7 +60,7 @@ Plotly Express currently includes the following functions: * **Matrix or Image Input**: [`imshow`](/python/imshow/) * **3-Dimensional**: [`scatter_3d`](/python/3d-scatter-plots/), [`line_3d`](/python/3d-line-plots/) * **Multidimensional**: [`scatter_matrix`](/python/splom/), [`parallel_coordinates`](/python/parallel-coordinates-plot/), [`parallel_categories`](/python/parallel-categories-diagram/) -* **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/) +* **Tile Maps**: [`scatter_map`](/python/tile-scatter-maps/), [`line_map`](/python/lines-on-tile-maps/), [`choropleth_map`](/python/tile-county-choropleth/), [`density_map`](/python/density-heatmaps/) * **Outline Maps**: [`scatter_geo`](/python/scatter-plots-on-maps/), [`line_geo`](/python/lines-on-maps/), [`choropleth`](/python/choropleth-maps/) * **Polar Charts**: [`scatter_polar`](/python/polar-chart/), [`line_polar`](/python/polar-chart/), [`bar_polar`](/python/wind-rose-charts/) * **Ternary Charts**: [`scatter_ternary`](/python/ternary-plots/), [`line_ternary`](/python/ternary-plots/) @@ -69,7 +69,7 @@ Plotly Express currently includes the following functions: The Plotly Express API in general offers the following features: -* **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). +* **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). * **Sensible, Overridable Defaults**: PX functions will infer sensible defaults wherever possible, and will always let you override them. * **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/). * **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). diff --git a/doc/python/shapes.md b/doc/python/shapes.md index 78beaad9a90..76cdcdd9cc6 100644 --- a/doc/python/shapes.md +++ b/doc/python/shapes.md @@ -51,7 +51,7 @@ The differences between these two approaches are that: ### Shape-drawing with Scatter traces -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, [scattermap](https://plotly.com/python/filled-area-tile-maps/#filled-scattermap-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. +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, [scattermap](https://plotly.com/python/filled-area-tile-maps/#Filled-Scattermap-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. ```python import plotly.graph_objects as go @@ -718,7 +718,7 @@ fig.show() _introduced in plotly 4.7_ -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. +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-shape-drawing-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. This shape-drawing feature is particularly interesting for annotating graphs, in particular [image traces](/python/imshow) or [layout images](/python/images). diff --git a/doc/python/static-image-generation-migration.md b/doc/python/static-image-generation-migration.md index 1ce6e8cdbbf..9d2419d7a7a 100644 --- a/doc/python/static-image-generation-migration.md +++ b/doc/python/static-image-generation-migration.md @@ -50,7 +50,7 @@ pip install --upgrade kaleido 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. -See the [Chrome section](/python/static-image-export#chrome) on the Static Image Export page for more details on Chome and Kaleido. +See the [Chrome section](/python/static-image-export#Chrome) on the Static Image Export page for more details on Chome and Kaleido. ## Engine Parameter @@ -77,5 +77,5 @@ If you are migrating from Orca, the following config settings do not apply to Ka ## Multiple Image Export -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. diff --git a/doc/python/text-and-annotations.md b/doc/python/text-and-annotations.md index 5b7992168ac..b6fa9866b1f 100644 --- a/doc/python/text-and-annotations.md +++ b/doc/python/text-and-annotations.md @@ -703,7 +703,7 @@ fig.show() ### Positioning Text Annotations Absolutely -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). +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). Try panning or zooming in the following figure: diff --git a/doc/python/v6-changes.md b/doc/python/v6-changes.md index 87c33827e86..9f9474d69b9 100644 --- a/doc/python/v6-changes.md +++ b/doc/python/v6-changes.md @@ -57,7 +57,7 @@ pip install anywidget 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. -> 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. +> 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. ## Dataframe Support