Skip to content

Commit 9edc6f0

Browse files
committed
Address PR feedback, update references to new version
1 parent 6b32d18 commit 9edc6f0

13 files changed

Lines changed: 72 additions & 40 deletions

doc/apidoc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# The short X.Y version
2525
version = ""
2626
# The full version, including alpha/beta/rc tags
27-
release = "6.6.0"
27+
release = "7.0.0"
2828

2929

3030
# -- General configuration ---------------------------------------------------

doc/python/LaTeX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jupyter:
3535

3636
#### LaTeX Typesetting
3737

38-
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.
38+
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). Plotly.py v7 and above supports MathJax versions 3 and 4. Earlier Plotly.py versions support MathJax versions 2 and 3.
3939

4040
```python
4141
import plotly.express as px

doc/python/configuration-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ To delete buttons from the modebar, pass an array of strings containing the name
216216
- **Sankey**: `resetSankeyGroup`
217217
- **Other**: `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendChartToCloud`, `toggleSpikelines`
218218

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

221221
```python
222222
import plotly.graph_objects as go

doc/python/location-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ fig = px.choropleth(
461461
fig.show()
462462
```
463463

464-
*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`.
464+
*Changed in 7.0*: 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`.
465465

466466
## Using Different Data Types with `locations`
467467

doc/python/map-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fig.show()
173173

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

176-
*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.
176+
*Changed in 7.0*: `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.
177177

178178
```python
179179
import plotly.express as px
@@ -186,7 +186,7 @@ fig.show()
186186

187187
### Limiting the Zoom Range
188188

189-
*New in version 7*
189+
*New in 7.0*
190190

191191
`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.
192192

doc/python/multiple-axes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ fig.show()
385385

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

388-
*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.
388+
*Changed in 7.0*: `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.
389389

390390
```python
391391
import plotly.graph_objects as go

doc/python/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Each `plotly` trace type is rendered with either SVG or WebGL. The following tra
140140
WebGL is a powerful technology for accelerating rendering but comes with some strict limitations:
141141

142142
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.
143-
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.
143+
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.
144144
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.
145145
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).
146146

doc/python/quiver-plots.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jupyter:
3333
thumbnail: thumbnail/quiver-plot.jpg
3434
---
3535

36-
A quiver plot displays a 2D vector field as an array of arrows. Since version 7, Plotly has a `Quiver` trace type, which is the recommended way to make quiver plots. Earlier versions relied on the `create_quiver` [figure factory](/python/figure-factories/), which is still available and is described at the end of this page.
36+
A quiver plot displays a 2D vector field as an array of arrows. Since version 7.0, Plotly has a `Quiver` trace type, which is the recommended way to make quiver plots. Earlier versions relied on the `create_quiver` [figure factory](/python/figure-factories/), which is still available and is described at the end of this page.
3737

3838
A `Quiver` trace takes four arrays of the same length: `x` and `y` give the position of each arrow, and `u` and `v` give the vector components at that position. Arrow direction and length come from `(u, v)`.
3939

@@ -57,7 +57,7 @@ fig.show()
5757

5858
`anchor` sets which part of the arrow sits at its `(x, y)` position: `"tail"` (the default), `"tip"`, or `"center"`.
5959

60-
Arrow length is controlled by `sizemode` and `sizeref`. With `sizemode="scaled"` (the default), lengths are normalized against the longest vector in the field and the density of points, so a dense grid stays readable whatever the underlying values are. `sizemode="raw"` draws each arrow at its own magnitude instead. `sizeref` is a multiplier applied on top: values below 1 shorten every arrow, above 1 lengthen them.
60+
Arrow length is controlled by `lengthmode` and `lengthfactor`. With `lengthmode="scaled"` (the default), lengths are normalized against the longest vector in the field and the density of points, so a dense grid stays readable whatever the underlying values are. `lengthmode="raw"` draws each arrow at its specified magnitude determined by `u` and `v`. `lengthfactor` is a multiplier applied on top: values below 1 shorten every arrow, above 1 lengthen them.
6161

6262
```python
6363
import plotly.graph_objects as go
@@ -68,13 +68,48 @@ u, v = -y, x # rotational field
6868

6969
fig = go.Figure(go.Quiver(x=x.flatten(), y=y.flatten(),
7070
u=u.flatten(), v=v.flatten(),
71-
anchor="center", sizeref=0.8))
71+
anchor="center", lengthfactor=0.8))
7272

7373
fig.update_layout(title_text="Rotational field, arrows centered on each point",
7474
yaxis_scaleanchor="x")
7575
fig.show()
7676
```
7777

78+
#### Setting Arrow Reference
79+
80+
The `arrowref` property controls how the `u` and `v` vector components are interpreted, and how the vector arrows respond to zooming along a single axis.
81+
82+
By default, `arrowref="data"`, meaning that `u` and `v` are interpreted as data values. This means that the angle of the vectors depends on the relative scale of the two axes, and the apparent angle will change when zooming along one axis. This is the appropriate behavior when `u` and `v` represent data-space values, such as when illustrating a magnetic field.
83+
84+
To instead interpret `u` and `v` in pixel values, set `arrowref="paper"`, which will always draw vectors at the same angle regardless of the axis scales. This is the correct behavior when the vectors correspond to abstract values which are not linked to the data space.
85+
86+
Note that `arrowref="paper"` always scales arrow lengths, so `lengthmode="raw"` is ignored when you set it.
87+
88+
The difference is clearest on axes with different scales. Both panels below plot the same vectors, `u=1` and `v=0.1`, on a grid where x spans 10 units and y spans 1.
89+
90+
```python
91+
import plotly.graph_objects as go
92+
from plotly.subplots import make_subplots
93+
import numpy as np
94+
95+
x = np.linspace(0, 10, 6)
96+
y = np.full_like(x, 0.5)
97+
u = np.ones_like(x)
98+
v = np.full_like(x, 0.1)
99+
100+
fig = make_subplots(rows=1, cols=2,
101+
subplot_titles=['arrowref="data"', 'arrowref="paper"'])
102+
fig.add_trace(go.Quiver(x=x, y=y, u=u, v=v, arrowref="data"), row=1, col=1)
103+
fig.add_trace(go.Quiver(x=x, y=y, u=u, v=v, arrowref="paper"), row=1, col=2)
104+
105+
fig.update_xaxes(range=[-1, 11])
106+
fig.update_yaxes(range=[0, 1])
107+
fig.update_layout(showlegend=False)
108+
fig.show()
109+
```
110+
111+
With `"data"`, `v=0.1` covers a tenth of the y-axis while `u=1` covers a tenth of the x-axis, so the arrows tilt noticeably. With `"paper"`, the same components are 1 pixel across and 0.1 pixels up, so the arrows stay nearly flat whatever the axis ranges are.
112+
78113
#### Coloring Arrows by a Scalar Field
79114

80115
Pass `marker.color` an array with one value per arrow, together with the usual colorscale attributes, to color each arrow by that value. If you enable a colorscale without supplying a `marker.color` array, arrows are colored by their vector magnitude. A single (non-array) `marker.color` paints the whole field one color.
@@ -154,7 +189,7 @@ fig.add_trace(go.Scatter(x=[-.7, .75], y=[0, 0],
154189
fig.show()
155190
```
156191

157-
#### Quiver Plots with the Figure Factory
192+
#### Quiver Plots with Figure Factory
158193

159194
`create_quiver` builds a quiver plot out of `Scatter` traces rather than using the `Quiver` trace type. It remains available, and offers two options the trace type does not: `angle` sets the arrowhead angle in radians, and `scaleratio` fixes the ratio between the y-axis and x-axis scales.
160195

@@ -171,7 +206,7 @@ fig = ff.create_quiver(x, y, u, v)
171206
fig.show()
172207
```
173208

174-
Because the result is made of `Scatter` traces, the arrows cannot be colored individually by a scalar field, and the trace-level attributes described above (`anchor`, `sizemode`, `marker.arrowsize`) do not apply.
209+
Because the result is made of `Scatter` traces, the arrows cannot be colored individually by a scalar field, and the trace-level attributes described above (`anchor`, `lengthmode`, `marker.arrowsize`) do not apply.
175210

176211
#### See also
177212

doc/python/splom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ fig.show()
338338

339339
#### Linked Axes
340340

341-
*Changed in version 7*
341+
*Changed in 7.0*
342342

343343
`dimensions[].axis.matches` links the x-axis and the y-axis generated by a dimension, so every subplot in the same row and column pans and zooms together. It now defaults to `True`. Plotly Express already set it on the figures it generated, so `px.scatter_matrix` is unaffected. Set it to `False` on a dimension to zoom that dimension's row and column independently.
344344

doc/python/static-image-generation-migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jupyter:
3838

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

41-
Plotly.py 6.1 deprecated support for earlier versions of Kaleido and support for [Orca](/python/orca-management/). **Version 7.0 removed both.** If you still use Orca or Kaleido v0, update to the latest Kaleido. This page documents how to migrate your Plotly code to Kaleido v1 and outlines the changes in functionality.
41+
Plotly.py 7.0 removed support for earlier versions of Kaleido and support for [Orca](/python/orca-management/). If you still use Orca or Kaleido v0, update to the latest Kaleido. This page documents how to migrate your Plotly code to Kaleido v1 and outlines the changes in functionality.
4242

4343
To migrate from either Orca or Kaleido v0, first install the latest Kaleido with:
4444

0 commit comments

Comments
 (0)