Skip to content

Make docs live for 5.23 #4689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ff4125f
update docs python version
LiamConnors Apr 25, 2024
44ffec4
dependencies update
LiamConnors Apr 25, 2024
f4d6c76
update statsmodels version
LiamConnors Apr 25, 2024
07df63d
update shapely version
LiamConnors Apr 25, 2024
7b4a8da
update numpy version
LiamConnors Apr 25, 2024
2e0654d
Update requirements.txt
LiamConnors Apr 25, 2024
589b30b
Update requirements.txt
LiamConnors Apr 25, 2024
d844cdd
update dependencies and various code updates
LiamConnors Apr 25, 2024
b4aee4b
Update requirements.txt
LiamConnors Apr 25, 2024
ee84681
Update requirements.txt
LiamConnors Apr 26, 2024
944a73a
Update requirements.txt
LiamConnors Apr 26, 2024
99e6551
Update requirements.txt
LiamConnors Apr 26, 2024
318552d
Merge branch 'master' into update-docs-build
LiamConnors May 1, 2024
b5f72fb
Update requirements.txt
LiamConnors May 1, 2024
a0c4dcb
update datashader version add specific xarray version
LiamConnors May 1, 2024
cf7cbe6
Merge branch 'master' into update-docs-build
LiamConnors May 1, 2024
b6d5ca5
update release process
LiamConnors May 1, 2024
91aa1c9
Merge pull request #4599 from plotly/LiamConnors-patch-3
LiamConnors May 1, 2024
9fdd6b6
build+docs: use Python 3.8 - 3.11 and pin pytest 8.1.1
gvwilson May 7, 2024
b1888ad
make var name clearer
LiamConnors May 13, 2024
1fef3ee
Merge pull request #4596 from plotly/update-docs-build
LiamConnors May 13, 2024
c604379
Merge pull request #4605 from gvwilson/use-python-3.11-and-pytest-8.1.1
gvwilson May 13, 2024
f1522cd
handle extras in IntegerValidator
archmoj May 17, 2024
9c83260
Update config.yml
LiamConnors May 31, 2024
d3c49ad
Update config.yml
LiamConnors Jun 3, 2024
51eb5ea
Merge pull request #4624 from plotly/specify-image
LiamConnors Jun 3, 2024
bc456cc
update plotly.js to v2.33.0
LiamConnors Jun 5, 2024
b8d67c5
update test
LiamConnors Jun 5, 2024
aab5efe
add numeric font weight example
LiamConnors Jun 6, 2024
97c85b5
Update README.md with "maintained by Plotly" badge
gvwilson Jun 7, 2024
b330b0e
add font weights example
LiamConnors Jun 11, 2024
6c8ef6d
fix issues
LiamConnors Jun 11, 2024
a2afa66
add scattermapbox font customization options
LiamConnors Jun 11, 2024
a2f9823
Update text-and-annotations.md
LiamConnors Jun 11, 2024
9bf186e
add font family
LiamConnors Jun 12, 2024
149c0b8
add shadow, case and lines examples
LiamConnors Jun 12, 2024
1aa88d9
Update text-and-annotations.md
LiamConnors Jun 12, 2024
c4c4142
Update scattermapbox.md
LiamConnors Jun 12, 2024
c0a7757
Update CHANGELOG.md
LiamConnors Jun 13, 2024
835c9cb
fix docs errors
LiamConnors Jun 17, 2024
813253b
add line_shape options to doc string
LiamConnors Jun 17, 2024
889c200
Merge pull request #4630 from plotly/gvwilson-patch-1
gvwilson Jun 26, 2024
6c64439
Merge branch 'master' into update-options
LiamConnors Jul 3, 2024
751092e
Merge branch 'master' into handle-extras-integer-validator
archmoj Jul 3, 2024
178dbad
Merge pull request #4642 from plotly/update-options
LiamConnors Jul 3, 2024
5ccf6d2
Merge branch 'master' into fix-doc-string
LiamConnors Jul 3, 2024
97def55
Merge pull request #4639 from plotly/fix-doc-string
LiamConnors Jul 3, 2024
16dd6a3
Merge pull request #4612 from plotly/handle-extras-integer-validator
gvwilson Jul 3, 2024
bb1566a
Merge branch 'master' into update-plotly-js-version
archmoj Jul 3, 2024
a63b794
fix doc string
LiamConnors Jul 5, 2024
241746e
Merge pull request #4656 from plotly/fix-doc
LiamConnors Jul 8, 2024
51256f2
Merge branch 'master' into update-plotly-js-version
archmoj Jul 8, 2024
ce7be77
add ticklabelstandoff, ticklabelshift and ticklabelindex
LiamConnors Jul 11, 2024
a1f77f0
Update doc/python/axes.md
LiamConnors Jul 15, 2024
ec108e0
add x-shift attributes exampple
LiamConnors Jul 16, 2024
b9e178d
update plotly.js to 2.34.0
LiamConnors Jul 18, 2024
059433f
add plot subtitle example
LiamConnors Jul 18, 2024
44bf20c
specify which maps require token
LiamConnors Jul 18, 2024
3de6e25
Merge pull request #4679 from plotly/fix-maps-docstring
LiamConnors Jul 18, 2024
e5fdd7c
add text annotation example
LiamConnors Jul 18, 2024
bcbc571
Merge branch 'master' into update-plotly-js-version
LiamConnors Jul 18, 2024
9b5ec6a
Merge pull request #4627 from plotly/update-plotly-js-version
LiamConnors Jul 22, 2024
a32a981
Merge branch 'master' into add-latest-docs-updates
LiamConnors Jul 22, 2024
bf78a8a
Merge pull request #4683 from plotly/add-latest-docs-updates
LiamConnors Jul 22, 2024
83c7c85
version changes for v5.23.0
LiamConnors Jul 22, 2024
a9fef47
Merge pull request #4684 from plotly/release-5.23.0
LiamConnors Jul 23, 2024
2fb9ac4
update docs Plotly.py version
LiamConnors Jul 23, 2024
bd1dd66
Merge pull request #4688 from plotly/update-docs-5-23
LiamConnors Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ jobs:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, for example, `3.9-browsers`
- image: cimg/python:3.9-browsers
- image: cimg/python:3.10-browsers

steps:
- add_ssh_keys:
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [5.23.0] - 2024-07-23

### Updated
- 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:
- Add `subtitle` attribute to `layout.title` to enable adding subtitles to plots [[#7012](https://github.com/plotly/plotly.js/pull/7012)]
- 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)]
- 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)],
with thanks to @acxz and @prabhathc for the contribution!
- Add axis property `ticklabelindex` for drawing the label for each minor tick n positions away from a major tick,
with thanks to @my-tien for the contribution! [[#7036](https://github.com/plotly/plotly.js/pull/7036)]
- Add property `ticklabelstandoff` and `ticklabelshift` to cartesian axes to adjust positioning of tick labels,
with thanks to @my-tien for the contribution! [[#7006](https://github.com/plotly/plotly.js/pull/7006)]
- Add `x0shift`, `x1shift`, `y0shift`, `y1shift` to shapes to add control over positioning of shape vertices on (multi-)category axes,
with thanks to @my-tien for the contribution! [[#7005](https://github.com/plotly/plotly.js/pull/7005)]
- Specify Python version 3.8-3.11 for development virtual environments and pin `pytest` at version 8.1.1 to match.
- 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].


## [5.22.0] - 2024-05-01

### Updated
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@
</tr>
</table>

<div align="center">
<a href="https://dash.plotly.com/project-maintenance">
<img src="https://dash.plotly.com/assets/images/maintained-by-plotly.png" width="400px" alt="Maintained by Plotly">
</a>
</div>


## Quickstart

`pip install plotly==5.22.0`
`pip install plotly==5.23.0`

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

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

```
pip install plotly==5.22.0
pip install plotly==5.23.0
```

or conda.

```
conda install -c plotly plotly=5.22.0
conda install -c plotly plotly=5.23.0
```

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

```
# JupyterLab 2.x renderer support
jupyter labextension install jupyterlab-plotly@5.22.0 @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyterlab-plotly@5.23.0 @jupyter-widgets/jupyterlab-manager
```

Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
Expand Down
8 changes: 4 additions & 4 deletions binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
jupytext
plotly==5.22.0
plotly==5.23.0
jupyter
notebook
pandas==1.2.0
statsmodels==0.12.1
pandas==2.2.2
statsmodels==0.14.2
scipy
patsy==0.5.1
patsy==0.5.6
numpy
plotly-geo
psutil
Expand Down
7 changes: 5 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ learn and become confident about git, like http://try.github.io/.

### Create a virtual environment for plotly development

You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g.
You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g.:

```bash
conda create -n plotly-dev python
conda create -n plotly-dev python=3.11
conda activate plotly-dev
```

As of May 2024 our dependencies have been tested against Python versions 3.8 to 3.11.
We will support Python 3.12 and higher versions soon.

[conda-env]: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands
[virtualenv]: http://docs.python-guide.org/en/latest/dev/virtualenvs/

Expand Down
2 changes: 1 addition & 1 deletion doc/apidoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "5.22.0"
release = "5.23.0"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/python/3d-volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ np.random.seed(0)
l = 30
X, Y, Z = np.mgrid[:l, :l, :l]
vol = np.zeros((l, l, l))
pts = (l * np.random.rand(3, 15)).astype(np.int)
pts = (l * np.random.rand(3, 15)).astype(int)
vol[tuple(indices for indices in pts)] = 1
from scipy import ndimage
vol = ndimage.gaussian_filter(vol, 4)
Expand Down
84 changes: 72 additions & 12 deletions doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.16.1
jupytext_version: 1.16.3
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.10.11
version: 3.10.14
plotly:
description: How to adjust axes properties in Python - axes titles, styling and
coloring axes and grid lines, ticks, tick labels and more.
Expand Down Expand Up @@ -367,7 +367,7 @@ fig.show()

*New in 5.19*

If `tickangle` is not explicitly set, its default value is `auto`, meaning if the label needs to be rotated to avoid labels overlapping, it will rotate by either 30 or 90 degrees. Using `autotickangles`, you can also specify a list of angles for `tickangle` to use. If `tickangle` is `auto` and you provide a list of angles to `autotickangles`, the label angle will be set to the first value in the list that prevents overlap.
If `tickangle` is not explicitly set, its default value is `auto`, meaning if the label needs to be rotated to avoid labels overlapping, it will rotate by either 30 or 90 degrees. Using `autotickangles`, you can also specify a list of angles for `tickangle` to use. If `tickangle` is `auto` and you provide a list of angles to `autotickangles`, the label angle will be set to the first value in the list that prevents overlap.

```python
import plotly.express as px
Expand All @@ -390,14 +390,18 @@ Here is an example.
import plotly.graph_objects as go
import pandas as pd

# Load and filter Apple stock data for 2016
apple_df = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv",
parse_dates=["Date"],
index_col="Date"
"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv"
)

apple_df_2016 = apple_df["2016"]
# Convert 'Date' column to datetime format
apple_df['Date'] = pd.to_datetime(apple_df['Date'])

# Set 'Date' column as index
apple_df.set_index('Date', inplace=True)

# Filter for 2016
apple_df_2016 = apple_df.loc['2016']

# Create figure and add line
fig = go.Figure()
Expand Down Expand Up @@ -444,6 +448,62 @@ fig.update_yaxes(minor_ticks="inside")
fig.show()
```

#### Adjust Tick Label Positions

*New in 5.23*

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

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

Here, `ticklabelstandoff=15` moves the labels further 15 pixels away from the x-axis. A negative value here would move them close to the axis.

```python
import plotly.express as px

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')

fig = px.line(df, x='Date', y='AAPL.High')

fig.update_layout(
xaxis=dict(
ticks='outside',
ticklen=10,
ticklabelshift=25,
ticklabelstandoff=15
)
)

fig.show()
```

#### Use Minor Tick for Label

*New in 5.23*

On date or linear axes, use `ticklabelindex` to draw a label for a minor tick instead of a major tick.

To draw the label for the minor tick before each major tick, set `ticklabelindex` -1, like in the following example.

```python
import plotly.express as px

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')

fig = px.line(df, x='Date', y='AAPL.High')

fig.update_layout(
xaxis=dict(
minor=dict(ticks='outside'),
ticks='outside',
ticklen=10,
ticklabelindex=-1
)
)

fig.show()
```

### Axis lines: grid and zerolines

##### Toggling Axis grid lines
Expand Down Expand Up @@ -599,7 +659,7 @@ fig.show()

*New in 5.17*

You can also set just a lower or upper bound manually and have autorange applied to the other bound by setting it to `None`. In the following example, we set a an upper bound of 4.5 on the x axes, while specifying `None` for the lower bound, meaning it will use autorange. On the y axes, we set the lower bound, and use `None` for the upper bound, meaning that uses autorange.
You can also set just a lower or upper bound manually and have autorange applied to the other bound by setting it to `None`. In the following example, we set a an upper bound of 4.5 on the x axes, while specifying `None` for the lower bound, meaning it will use autorange. On the y axes, we set the lower bound, and use `None` for the upper bound, meaning that uses autorange.

```python
import plotly.express as px
Expand Down Expand Up @@ -857,7 +917,7 @@ fig.show()

#### <code>nonnegative</code>, <code>tozero</code>, and <code>normal</code> Rangemode

When you don't specify a range, autorange is used. It's also used for bounds set to `None` when providing a `range`.
When you don't specify a range, autorange is used. It's also used for bounds set to `None` when providing a `range`.

The axis auto-range calculation logic can be configured using the `rangemode` axis parameter.

Expand Down Expand Up @@ -898,7 +958,7 @@ fig.update_xaxes(autorangeoptions=dict(maxallowed=5))
fig.show()
```

##### Clip Minimum and Maximum
##### Clip Minimum and Maximum

You can also clip an axis range at a specific maximum or minimum value with `autorangeoptions.clipmax` and `autorangeoptions.clipmin`.

Expand All @@ -916,7 +976,7 @@ fig.show()

##### Specify Values to be Included

Use `autorangeoptions.include` to specify a value that should always be included within the calculated autorange. In this example, we specify that for the autorange calculated on the x-axis, 5 should be included.
Use `autorangeoptions.include` to specify a value that should always be included within the calculated autorange. In this example, we specify that for the autorange calculated on the x-axis, 5 should be included.

```python
import plotly.express as px
Expand Down
12 changes: 6 additions & 6 deletions doc/python/box-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ x_data = ['Carmelo Anthony', 'Dwyane Wade',

N = 50

y0 = (10 * np.random.randn(N) + 30).astype(np.int)
y1 = (13 * np.random.randn(N) + 38).astype(np.int)
y2 = (11 * np.random.randn(N) + 33).astype(np.int)
y3 = (9 * np.random.randn(N) + 36).astype(np.int)
y4 = (15 * np.random.randn(N) + 31).astype(np.int)
y5 = (12 * np.random.randn(N) + 40).astype(np.int)
y0 = (10 * np.random.randn(N) + 30).astype(int)
y1 = (13 * np.random.randn(N) + 38).astype(int)
y2 = (11 * np.random.randn(N) + 33).astype(int)
y3 = (9 * np.random.randn(N) + 36).astype(int)
y4 = (15 * np.random.randn(N) + 31).astype(int)
y5 = (12 * np.random.randn(N) + 40).astype(int)

y_data = [y0, y1, y2, y3, y4, y5]

Expand Down
43 changes: 41 additions & 2 deletions doc/python/figure-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.16.1
jupytext_version: 1.16.3
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.10.11
version: 3.10.14
plotly:
description: How to set the global font, title, legend-entries, and axis-titles
in python.
Expand Down Expand Up @@ -236,5 +236,44 @@ fig.update_layout(
fig.show()
```

### Adding a Plot Subtitle

*New in 5.23*

Add a subtitle to a plot with `layout.title.subtitle`. In the following example, we set the subtitle's `text`, and configure the `font` `color` and `size`. By default, if you don't set a font size for the subtitle, it will be `0.7` of the `title` font size.

```python
import plotly.graph_objects as go
from plotly import data

df = data.gapminder().query("continent == 'Europe' and (year == 1952 or year == 2002)")

df_pivot = df.pivot(index="country", columns="year", values="lifeExp")

fig = go.Figure(
[
go.Bar(
x=df_pivot.index, y=df_pivot[1952], name="1952", marker_color="IndianRed"
),
go.Bar(
x=df_pivot.index, y=df_pivot[2002], name="2002", marker_color="LightSalmon"
),
],
layout=dict(
title=dict(
text="Life Expectancy",
subtitle=dict(
text="Life expectancy by European country in 1952 and in 2002",
font=dict(color="gray", size=13),
),
)
),
)


fig.show()

```

#### Reference
See https://plotly.com/python/reference/layout/ for more information!
6 changes: 3 additions & 3 deletions doc/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot
`plotly` may be installed using `pip`:

```
$ pip install plotly==5.22.0
$ pip install plotly==5.23.0
```

or `conda`:

```
$ conda install -c plotly plotly=5.22.0
$ conda install -c plotly plotly=5.23.0
```
This package contains everything you need to write figures to standalone HTML files.

Expand Down Expand Up @@ -152,7 +152,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,

```
# JupyterLab 2.x renderer support
jupyter labextension install jupyterlab-plotly@5.22.0 @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyterlab-plotly@5.23.0 @jupyter-widgets/jupyterlab-manager
```

Please check out our [Troubleshooting guide](/python/troubleshooting/) if you run into any problems with JupyterLab, particularly if you are using multiple python environments inside Jupyter.
Expand Down
Loading