Skip to content

Commit 171e635

Browse files
authored
Merge branch 'master' into patch-2
2 parents 535582a + 0d30d66 commit 171e635

File tree

3,270 files changed

+169462
-30424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,270 files changed

+169462
-30424
lines changed

.circleci/config.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ jobs:
234234
- test_optional:
235235
py: "39_pandas_2"
236236

237+
# No numpy
238+
python_312_no_numpy:
239+
docker:
240+
- image: cimg/python:3.12-browsers
241+
steps:
242+
- run:
243+
name: Check that numpy is not installed
244+
command: |
245+
if pip list | grep numpy > /dev/null 2>&1
246+
then exit 1
247+
else exit 0
248+
fi
249+
- test_optional:
250+
py: "312_no_numpy"
251+
237252
# Orca
238253
python_38_orca:
239254
docker:
@@ -385,6 +400,8 @@ jobs:
385400
- run:
386401
name: Create conda environment
387402
command: |
403+
conda config --remove channels defaults
404+
conda config --add channels conda-forge
388405
conda create -n env --yes python=3.9 conda-build=3.28.4 conda-verify
389406
conda install -n env -c conda-forge jupyterlab=3 nodejs=16
390407
conda init bash
@@ -448,7 +465,7 @@ jobs:
448465
docker:
449466
# specify the version you desire here
450467
# use `-browsers` prefix for selenium tests, for example, `3.9-browsers`
451-
- image: cimg/python:3.10-browsers
468+
- image: cimg/python:3.9-browsers
452469

453470
steps:
454471
- add_ssh_keys:
@@ -598,5 +615,5 @@ workflows:
598615
- python_39_pandas_2_optional
599616
- python_38_orca
600617
- python_39_percy
618+
- python_312_no_numpy
601619
- build-doc
602-

CHANGELOG.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,43 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [5.23.0] - TBD
5+
## [5.24.1] - 2024-09-12
66

77
### Updated
8+
9+
- Updated Plotly.js from version 2.35.0 to version 2.35.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2352----2024-09-10) for more information.
10+
11+
## [5.24.0] - 2024-08-29
12+
13+
### Added
14+
- New `px` functions for maps: `scatter_map`, `line_map`, `choropleth_map`, and `density_map`.
15+
16+
### Updated
17+
18+
- Updated Plotly.js from version 2.34.0 to version 2.35.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2350----2024-08-29) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
19+
- Add new traces: scattermap, choroplethmap and densitymap and map subplots which use maplibre to render maps [[#7015](https://github.com/plotly/plotly.js/pull/7015), [#7060](https://github.com/plotly/plotly.js/pull/7060), [#7085](https://github.com/plotly/plotly.js/pull/7085), [#7088](https://github.com/plotly/plotly.js/pull/7088), [#7090](https://github.com/plotly/plotly.js/pull/7090), [#7092](https://github.com/plotly/plotly.js/pull/7092), [#7094](https://github.com/plotly/plotly.js/pull/7094), [#7134](https://github.com/plotly/plotly.js/pull/7134)]
20+
- Deprecate mapbox traces and mapbox subplot [[#7087](https://github.com/plotly/plotly.js/pull/7087)]
21+
22+
- Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
23+
24+
## [5.23.0] - 2024-07-23
25+
26+
### Updated
27+
- Updated Plotly.js from version 2.32.0 to version 2.34.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2340----2024-07-18) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
28+
- Add `subtitle` attribute to `layout.title` to enable adding subtitles to plots [[#7012](https://github.com/plotly/plotly.js/pull/7012)]
29+
- Introduce "u" and "s" pseudo html tags to add partial underline and strike-through styles to SVG text elements [[#7043](https://github.com/plotly/plotly.js/pull/7043)]
30+
- Add geometric mean functionality and 'geometric mean ascending' + 'geometric mean descending' to `category_order` on cartesian axes [[#6223](https://github.com/plotly/plotly.js/pull/6223)],
31+
with thanks to @acxz and @prabhathc for the contribution!
32+
- Add axis property `ticklabelindex` for drawing the label for each minor tick n positions away from a major tick,
33+
with thanks to @my-tien for the contribution! [[#7036](https://github.com/plotly/plotly.js/pull/7036)]
34+
- Add property `ticklabelstandoff` and `ticklabelshift` to cartesian axes to adjust positioning of tick labels,
35+
with thanks to @my-tien for the contribution! [[#7006](https://github.com/plotly/plotly.js/pull/7006)]
36+
- Add `x0shift`, `x1shift`, `y0shift`, `y1shift` to shapes to add control over positioning of shape vertices on (multi-)category axes,
37+
with thanks to @my-tien for the contribution! [[#7005](https://github.com/plotly/plotly.js/pull/7005)]
838
- Specify Python version 3.8-3.11 for development virtual environments and pin `pytest` at version 8.1.1 to match.
939
- Update `IntegerValidator` to handle `extras` option to allow supporting additional keyword values. For example, 'bold' and 'normal' as well as integers as used in font weights [#4612].
1040

41+
1142
## [5.22.0] - 2024-05-01
1243

1344
### Updated

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
## Quickstart
4242

43-
`pip install plotly==5.22.0`
43+
`pip install plotly==5.24.1`
4444

4545
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`):
4646

@@ -85,13 +85,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
8585
plotly.py may be installed using pip...
8686

8787
```
88-
pip install plotly==5.22.0
88+
pip install plotly==5.24.1
8989
```
9090

9191
or conda.
9292

9393
```
94-
conda install -c plotly plotly=5.22.0
94+
conda install -c plotly plotly=5.24.1
9595
```
9696

9797
### JupyterLab Support
@@ -113,7 +113,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
113113

114114
```
115115
# JupyterLab 2.x renderer support
116-
jupyter labextension install jupyterlab-plotly@5.22.0 @jupyter-widgets/jupyterlab-manager
116+
jupyter labextension install jupyterlab-plotly@5.24.1 @jupyter-widgets/jupyterlab-manager
117117
```
118118

119119
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.

binder/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.22.0
2+
plotly==5.24.1
33
jupyter
44
notebook
55
pandas==2.2.2

doc/apidoc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ help:
3636
# Remove files which were added only for docstring generation
3737
rm ../../packages/python/plotly/plotly/colors/diverging.py ../../packages/python/plotly/plotly/colors/sequential.py ../../packages/python/plotly/plotly/colors/qualitative.py ../../packages/python/plotly/plotly/colors/cyclical.py ../../packages/python/plotly/plotly/colors/colorbrewer.py ../../packages/python/plotly/plotly/colors/carto.py ../../packages/python/plotly/plotly/colors/cmocean.py
3838
rm ../../packages/python/plotly/plotly/express/colors/diverging.py ../../packages/python/plotly/plotly/express/colors/sequential.py ../../packages/python/plotly/plotly/express/colors/qualitative.py ../../packages/python/plotly/plotly/express/colors/cyclical.py ../../packages/python/plotly/plotly/express/colors/colorbrewer.py ../../packages/python/plotly/plotly/express/colors/carto.py ../../packages/python/plotly/plotly/express/colors/cmocean.py
39-
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
39+
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html _build/html/generated/generated/*.html
4040
mv _build/html/generated/plotly.graph_objs.html _build/html/generated/plotly.graph_objects.html
4141
sed -i 's/graph_objs/graph_objects/g' _build/html/*.html
4242
sed -i 's/graph_objs/graph_objects/g' _build/html/*.inv

doc/apidoc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ""
2828
# The full version, including alpha/beta/rc tags
29-
release = "5.22.0"
29+
release = "5.24.1"
3030

3131

3232
# -- General configuration ---------------------------------------------------

doc/apidoc/plotly.express.rst

+4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ plotly's high-level API for rapid figure generation. ::
1818
scatter_3d
1919
scatter_polar
2020
scatter_ternary
21+
scatter_map
2122
scatter_mapbox
2223
scatter_geo
2324
line
2425
line_3d
2526
line_polar
2627
line_ternary
28+
line_map
2729
line_mapbox
2830
line_geo
2931
area
@@ -45,9 +47,11 @@ plotly's high-level API for rapid figure generation. ::
4547
parallel_coordinates
4648
parallel_categories
4749
choropleth
50+
choropleth_map
4851
choropleth_mapbox
4952
density_contour
5053
density_heatmap
54+
density_map
5155
density_mapbox
5256
imshow
5357
set_mapbox_access_token

doc/apidoc/plotly.graph_objects.rst

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ Map Traces
9999

100100
Scattergeo
101101
Choropleth
102+
Scattermap
103+
Choroplethmap
104+
Densitymap
102105
Scattermapbox
103106
Choroplethmapbox
104107
Densitymapbox

doc/python/axes.md

+59-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.16.1
9+
jupytext_version: 1.16.3
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.10.11
23+
version: 3.10.14
2424
plotly:
2525
description: How to adjust axes properties in Python - axes titles, styling and
2626
coloring axes and grid lines, ticks, tick labels and more.
@@ -41,7 +41,7 @@ Other kinds of subplots and axes are described in other tutorials:
4141
- [Polar axes](/python/polar-chart/). The axis object is [`go.layout.Polar`](/python/reference/layout/polar/)
4242
- [Ternary axes](/python/ternary-plots). The axis object is [`go.layout.Ternary`](/python/reference/layout/ternary/)
4343
- [Geo axes](/python/map-configuration/). The axis object is [`go.layout.Geo`](/python/reference/layout/geo/)
44-
- [Mapbox axes](/python/mapbox-layers/). The axis object is [`go.layout.Mapbox`](/python/reference/layout/mapbox/)
44+
- [Map axes](/python/tile-map-layers/). The axis object is [`go.layout.Map`](/python/reference/layout/map/)
4545
- [Color axes](/python/colorscales/). The axis object is [`go.layout.Coloraxis`](/python/reference/layout/coloraxis/).
4646

4747
**See also** the tutorials on [facet plots](/python/facet-plots/), [subplots](/python/subplots) and [multiple axes](/python/multiple-axes/).
@@ -448,6 +448,62 @@ fig.update_yaxes(minor_ticks="inside")
448448
fig.show()
449449
```
450450

451+
#### Adjust Tick Label Positions
452+
453+
*New in 5.23*
454+
455+
You can adjust tick label positions by moving them a number of pixels away from the axis using `ticklabelstandoff` or along the axis using `ticklabelshift`.
456+
457+
In this example, `ticklabelshift=25` shifts the labels 25 pixels to the right along the x-axis. By providing a negative value, we could move the labels 25 pixels to the left, (`ticklabelshift=-25`).
458+
459+
Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-axis. A negative value here would move them closer to the axis.
460+
461+
```python
462+
import plotly.express as px
463+
464+
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
465+
466+
fig = px.line(df, x='Date', y='AAPL.High')
467+
468+
fig.update_layout(
469+
xaxis=dict(
470+
ticks='outside',
471+
ticklen=10,
472+
ticklabelshift=25,
473+
ticklabelstandoff=15
474+
)
475+
)
476+
477+
fig.show()
478+
```
479+
480+
#### Use Minor Tick for Label
481+
482+
*New in 5.23*
483+
484+
On date or linear axes, use `ticklabelindex` to draw a label for a minor tick instead of a major tick.
485+
486+
To draw the label for the minor tick before each major tick, set `ticklabelindex=-1`, like in the following example.
487+
488+
```python
489+
import plotly.express as px
490+
491+
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
492+
493+
fig = px.line(df, x='Date', y='AAPL.High')
494+
495+
fig.update_layout(
496+
xaxis=dict(
497+
minor=dict(ticks='outside'),
498+
ticks='outside',
499+
ticklen=10,
500+
ticklabelindex=-1
501+
)
502+
)
503+
504+
fig.show()
505+
```
506+
451507
### Axis lines: grid and zerolines
452508

453509
##### Toggling Axis grid lines

doc/python/bubble-maps.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.1.1
8+
format_version: '1.3'
9+
jupytext_version: 1.16.3
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,14 +20,14 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.7
23+
version: 3.10.0
2424
plotly:
2525
description: How to make bubble maps in Python with Plotly.
2626
display_as: maps
2727
language: python
2828
layout: base
2929
name: Bubble Maps
30-
order: 4
30+
order: 5
3131
page_type: example_index
3232
permalink: python/bubble-maps/
3333
thumbnail: thumbnail/bubble-map.jpg

doc/python/choropleth-maps.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.16.3
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,20 +20,20 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.0
2424
plotly:
2525
description: How to make choropleth maps in Python with Plotly.
2626
display_as: maps
2727
language: python
2828
layout: base
2929
name: Choropleth Maps
30-
order: 7
30+
order: 8
3131
page_type: u-guide
3232
permalink: python/choropleth-maps/
3333
thumbnail: thumbnail/choropleth.jpg
3434
---
3535

36-
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps** using our Mapbox trace types](/python/mapbox-county-choropleth).
36+
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).
3737

3838
Below we show how to create Choropleth Maps using either Plotly Express' `px.choropleth` function or the lower-level `go.Choropleth` graph object.
3939

doc/python/configuration-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ fig.show()
252252

253253
*New in v4.7*
254254

255-
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-on-cartesian-plots) for more details.
255+
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.
256256

257257
```python
258258
import plotly.express as px

0 commit comments

Comments
 (0)