diff --git a/doc/python/3d-bubble-charts.md b/doc/python/3d-bubble-charts.md
index 0877a6b55e4..8abaf0fbdcc 100644
--- a/doc/python/3d-bubble-charts.md
+++ b/doc/python/3d-bubble-charts.md
@@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
- format_version: '1.1'
- jupytext_version: 1.2.3
+ format_version: '1.3'
+ jupytext_version: 1.16.4
kernelspec:
- display_name: Python 3
+ display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
@@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
- version: 3.7.3
+ version: 3.11.10
plotly:
description: How to make 3D Bubble Charts in Python with Plotly. Three examples
of 3D Bubble Charts.
@@ -113,12 +113,39 @@ fig = go.Figure(data=go.Scatter3d(
)
))
-fig.update_layout(width=800, height=800, title = 'Planets!',
- scene = dict(xaxis=dict(title='Distance from Sun', titlefont_color='white'),
- yaxis=dict(title='Density', titlefont_color='white'),
- zaxis=dict(title='Gravity', titlefont_color='white'),
- bgcolor = 'rgb(20, 24, 54)'
- ))
+fig.update_layout(
+ width=800,
+ height=800,
+ title="Planets!",
+ scene=dict(
+ xaxis=dict(
+ title=dict(
+ text="Distance from Sun",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ yaxis=dict(
+ title=dict(
+ text="Density",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ zaxis=dict(
+ title=dict(
+ text="Gravity",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ bgcolor="rgb(20, 24, 54)"
+ )
+)
+
fig.show()
```
@@ -154,16 +181,42 @@ fig = go.Figure(go.Scatter3d(
)
))
-fig.update_layout(width=800, height=800, title = 'Planets!',
- scene = dict(xaxis=dict(title='Distance from Sun', titlefont_color='white'),
- yaxis=dict(title='Density', titlefont_color='white'),
- zaxis=dict(title='Gravity', titlefont_color='white'),
- bgcolor = 'rgb(20, 24, 54)'
- ))
+fig.update_layout(
+ width=800,
+ height=800,
+ title="Planets!",
+ scene=dict(
+ xaxis=dict(
+ title=dict(
+ text="Distance from Sun",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ yaxis=dict(
+ title=dict(
+ text="Density",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ zaxis=dict(
+ title=dict(
+ text="Gravity",
+ font=dict(
+ color="white"
+ )
+ )
+ ),
+ bgcolor="rgb(20, 24, 54)"
+ )
+)
fig.show()
```
#### Reference
-See https://plotly.com/python/reference/scatter3d/ and https://plotly.com/python/reference/scatter/#scatter-marker-sizeref
for more information and chart attribute options!
\ No newline at end of file
+See https://plotly.com/python/reference/scatter3d/ and https://plotly.com/python/reference/scatter/#scatter-marker-sizeref
for more information and chart attribute options!
diff --git a/doc/python/bar-charts.md b/doc/python/bar-charts.md
index 7134ab2c68f..e93439cf1f9 100644
--- a/doc/python/bar-charts.md
+++ b/doc/python/bar-charts.md
@@ -37,7 +37,7 @@ jupyter:
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).
-With `px.bar`, **each row of the DataFrame is represented as a rectangular mark**. To aggregate multiple data points into the same rectangular mark, please refer to the [histogram documentation](/python/histograms).
+With `px.bar`, **each row of the DataFrame is represented as a rectangular mark**. To aggregate multiple data points into the same rectangular mark, please refer to the [histogram documentation](/python/histograms).
In the example below, there is only a single row of data per year, so a single bar is displayed per year.
@@ -152,7 +152,7 @@ fig.show()
### Aggregating into Single Colored Bars
-As noted above `px.bar()` will result in **one rectangle drawn per row of input**. This can sometimes result in a striped look as in the examples above. To combine these rectangles into one per color per position, you can use `px.histogram()`, which has [its own detailed documentation page](/python/histogram).
+As noted above `px.bar()` will result in **one rectangle drawn per row of input**. This can sometimes result in a striped look as in the examples above. To combine these rectangles into one per color per position, you can use `px.histogram()`, which has [its own detailed documentation page](/python/histogram).
> `px.bar` and `px.histogram` are designed to be nearly interchangeable in their call signatures, so as to be able to switch between aggregated and disaggregated bar representations.
@@ -304,7 +304,7 @@ fig.update_layout(barmode='stack')
fig.show()
```
-### Stacked Bar Chart From Aggregating a DataFrame
+### Stacked Bar Chart From Aggregating a DataFrame
Stacked bar charts are a powerful way to present results summarizing categories generated using the Pandas aggregate commands. `pandas.DataFrame.agg` produces a wide data set format incompatible with `px.bar`. Transposing and updating the indexes to achieve `px.bar` compatibility is a somewhat involved option. Here is one straightforward alternative, which presents the aggregated data as a stacked bar using plotly.graph_objects.
@@ -326,19 +326,19 @@ df_summarized["percent of world population"]=100*df_summarized["pop"]/df_summari
df_summarized["percent of world GDP"]=100*df_summarized["gdp"]/df_summarized["gdp"].sum()
-df = df_summarized[["continent",
+df = df_summarized[["continent",
"percent of world population",
"percent of world GDP",
]]
# We now have a wide data frame, but it's in the opposite orientation from the one that px is designed to deal with.
-# Transposing it and rebuilding the indexes is an option, but iterating through the DF using graph objects is more succinct.
+# Transposing it and rebuilding the indexes is an option, but iterating through the DF using graph objects is more succinct.
fig=go.Figure()
for category in df_summarized["continent"].values:
fig.add_trace(go.Bar(
x=df.columns[1:],
- # We need to get a pandas series that contains just the values to graph;
+ # We need to get a pandas series that contains just the values to graph;
# We do so by selecting the right row, selecting the right columns
# and then transposing and using iloc to convert to a series
# Here, we assume that the bar element category variable is in column 0
@@ -619,8 +619,12 @@ fig.update_layout(
title='US Export of Plastic Scrap',
xaxis_tickfont_size=14,
yaxis=dict(
- title='USD (millions)',
- titlefont_size=16,
+ title=dict(
+ text="USD (millions)",
+ font=dict(
+ size=16
+ )
+ ),
tickfont_size=14,
),
legend=dict(
diff --git a/doc/python/carpet-contour.md b/doc/python/carpet-contour.md
index 0d11800ea18..87642243977 100644
--- a/doc/python/carpet-contour.md
+++ b/doc/python/carpet-contour.md
@@ -159,9 +159,10 @@ fig.add_trace(go.Contourcarpet(
colorbar = dict(
y = 0,
yanchor = "bottom",
- titleside = "right",
len = 0.75,
- title = "Pressure coefficient, cp"
+ title = dict(
+ text="Pressure coefficient, cp",
+ side="right")
),
contours = dict(
start = -1,
diff --git a/doc/python/colorscales.md b/doc/python/colorscales.md
index 7e2aeb9ad73..757ff54911e 100644
--- a/doc/python/colorscales.md
+++ b/doc/python/colorscales.md
@@ -321,8 +321,10 @@ fig = go.Figure()
fig.add_trace(go.Heatmap(
z=dataset["z"],
colorbar=dict(
- title="Surface Heat",
- titleside="top",
+ title=dict(
+ text="Surface Heat",
+ side="top",
+ ),
tickmode="array",
tickvals=[2, 25, 50, 75, 100],
labelalias={100: "Hot", 50: "Mild", 2: "Cold"},
@@ -545,8 +547,10 @@ fig = go.Figure()
fig.add_trace(go.Heatmap(
z=dataset["z"],
colorbar=dict(
- title="Surface Heat",
- titleside="top",
+ title=dict(
+ text="Surface Heat",
+ side="top",
+ ),
tickmode="array",
tickvals=[2, 50, 100],
ticktext=["Cool", "Mild", "Hot"],
diff --git a/doc/python/contour-plots.md b/doc/python/contour-plots.md
index feb4f3b68a2..4ba74b175d4 100644
--- a/doc/python/contour-plots.md
+++ b/doc/python/contour-plots.md
@@ -281,12 +281,15 @@ fig = go.Figure(data=
[0.625, 1.25, 3.125, 6.25, 10.625],
[0, 0.625, 2.5, 5.625, 10]],
colorbar=dict(
- title='Color bar title', # title here
- titleside='right',
- titlefont=dict(
- size=14,
- family='Arial, sans-serif')
- )))
+ title=dict(
+ text='Color bar title', # title here
+ side='right',
+ font=dict(
+ size=14,
+ family='Arial, sans-serif')
+ )
+ ),
+ ))
fig.show()
```
diff --git a/doc/python/multiple-axes.md b/doc/python/multiple-axes.md
index 5bbdeda3c93..5a8deae7e53 100644
--- a/doc/python/multiple-axes.md
+++ b/doc/python/multiple-axes.md
@@ -192,18 +192,22 @@ fig.update_layout(
domain=[0.3, 0.7]
),
yaxis=dict(
- title="yaxis title",
- titlefont=dict(
- color="#1f77b4"
+ title=dict(
+ text="yaxis title",
+ font=dict(
+ color="#1f77b4"
+ )
),
tickfont=dict(
color="#1f77b4"
)
),
yaxis2=dict(
- title="yaxis2 title",
- titlefont=dict(
- color="#ff7f0e"
+ title=dict(
+ text="yaxis2 title",
+ font=dict(
+ color="#ff7f0e"
+ )
),
tickfont=dict(
color="#ff7f0e"
@@ -214,9 +218,11 @@ fig.update_layout(
position=0.15
),
yaxis3=dict(
- title="yaxis3 title",
- titlefont=dict(
- color="#d62728"
+ title=dict(
+ text="yaxis3 title",
+ font=dict(
+ color="#d62728"
+ )
),
tickfont=dict(
color="#d62728"
@@ -226,9 +232,11 @@ fig.update_layout(
side="right"
),
yaxis4=dict(
- title="yaxis4 title",
- titlefont=dict(
- color="#9467bd"
+ title=dict(
+ text="yaxis4 title",
+ font=dict(
+ color="#9467bd"
+ )
),
tickfont=dict(
color="#9467bd"
diff --git a/doc/python/network-graphs.md b/doc/python/network-graphs.md
index 9d2f3fec2e2..ae47e9923c0 100644
--- a/doc/python/network-graphs.md
+++ b/doc/python/network-graphs.md
@@ -98,9 +98,11 @@ node_trace = go.Scatter(
size=10,
colorbar=dict(
thickness=15,
- title='Node Connections',
+ title=dict(
+ text='Node Connections',
+ side='right'
+ ),
xanchor='left',
- titleside='right'
),
line_width=2))
@@ -128,8 +130,12 @@ node_trace.text = node_text
```python
fig = go.Figure(data=[edge_trace, node_trace],
layout=go.Layout(
- title='
Network graph made with Python',
- titlefont_size=16,
+ title=dict(
+ text="
Network graph made with Python",
+ font=dict(
+ size=16
+ )
+ ),
showlegend=False,
hovermode='closest',
margin=dict(b=20,l=5,r=5,t=40),
diff --git a/doc/python/range-slider.md b/doc/python/range-slider.md
index 9d1bce3bde6..bd6744fe7ac 100644
--- a/doc/python/range-slider.md
+++ b/doc/python/range-slider.md
@@ -252,7 +252,11 @@ fig.update_layout(
tickfont={"color": "#673ab7"},
tickmode="auto",
ticks="",
- titlefont={"color": "#673ab7"},
+ title=dict(
+ font=dict(
+ color="#673ab7"
+ )
+ ),
type="linear",
zeroline=False
),
@@ -268,7 +272,11 @@ fig.update_layout(
tickfont={"color": "#E91E63"},
tickmode="auto",
ticks="",
- titlefont={"color": "#E91E63"},
+ title=dict(
+ font=dict(
+ color="#E91E63"
+ )
+ ),
type="linear",
zeroline=False
),
@@ -284,8 +292,12 @@ fig.update_layout(
tickfont={"color": "#795548"},
tickmode="auto",
ticks="",
- title="mg/L",
- titlefont={"color": "#795548"},
+ title=dict(
+ text="mg/L",
+ font=dict(
+ color="#795548"
+ )
+ ),
type="linear",
zeroline=False
),
@@ -301,8 +313,12 @@ fig.update_layout(
tickfont={"color": "#607d8b"},
tickmode="auto",
ticks="",
- title="mmol/L",
- titlefont={"color": "#607d8b"},
+ title=dict(
+ text="mmol/L",
+ font=dict(
+ color="#607d8b"
+ )
+ ),
type="linear",
zeroline=False
),
@@ -318,8 +334,12 @@ fig.update_layout(
tickfont={"color": "#2196F3"},
tickmode="auto",
ticks="",
- title="mg/Kg",
- titlefont={"color": "#2196F3"},
+ title=dict(
+ text="mg/Kg",
+ font=dict(
+ color="#2196F3"
+ )
+ ),
type="linear",
zeroline=False
)
diff --git a/doc/python/scatter-plots-on-maps.md b/doc/python/scatter-plots-on-maps.md
index 9c4ad70bea8..e22a019eb6e 100644
--- a/doc/python/scatter-plots-on-maps.md
+++ b/doc/python/scatter-plots-on-maps.md
@@ -187,7 +187,9 @@ fig = go.Figure(data=go.Scattergeo(
opacity = 0.7,
size = 2,
colorbar = dict(
- titleside = "right",
+ title = dict(
+ side="right"
+ ),
outlinecolor = "rgba(68, 68, 68, 0)",
ticks = "outside",
showticksuffix = "last",
diff --git a/doc/python/setting-graph-size.md b/doc/python/setting-graph-size.md
index 611e0e29825..717c25341df 100644
--- a/doc/python/setting-graph-size.md
+++ b/doc/python/setting-graph-size.md
@@ -118,11 +118,15 @@ fig.update_layout(
width=500,
height=500,
yaxis=dict(
- title_text="Y-axis Title",
+ title=dict(
+ text="Y-axis Title",
+ font=dict(
+ size=30
+ )
+ ),
ticktext=["Very long label", "long label", "3", "label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
- titlefont=dict(size=30),
)
)
@@ -153,11 +157,15 @@ fig.update_layout(
width=500,
height=500,
yaxis=dict(
- title_text="Y-axis Title",
+ title=dict(
+ text="Y-axis Title",
+ font=dict(
+ size=30
+ )
+ ),
ticktext=["Very long label", "long label", "3", "label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
- titlefont=dict(size=30),
)
)
@@ -190,11 +198,15 @@ fig.update_layout(
width=450,
height=450,
yaxis=dict(
- title_text="Y-axis Title",
+ title=dict(
+ text="Y-axis Title",
+ font=dict(
+ size=30
+ )
+ ),
ticktext=["Label", "Very long label", "Other label", "Very very long label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
- titlefont=dict(size=30),
)
)
diff --git a/doc/python/ternary-plots.md b/doc/python/ternary-plots.md
index a389faba417..f53a0862b08 100644
--- a/doc/python/ternary-plots.md
+++ b/doc/python/ternary-plots.md
@@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
- format_version: '1.1'
- jupytext_version: 1.1.1
+ format_version: '1.3'
+ jupytext_version: 1.16.4
kernelspec:
- display_name: Python 3
+ display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
@@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
- version: 3.6.7
+ version: 3.11.10
plotly:
description: How to make Ternary plots in Python with Plotly.
display_as: scientific
@@ -82,8 +82,7 @@ rawData = [
def makeAxis(title, tickangle):
return {
- 'title': title,
- 'titlefont': { 'size': 20 },
+ 'title': {'text': title, 'font': { 'size': 20}},
'tickangle': tickangle,
'tickfont': { 'size': 15 },
'tickcolor': 'rgba(0,0,0,0)',
diff --git a/doc/unconverted/python/cars-exploration.md b/doc/unconverted/python/cars-exploration.md
index 34bb4aad123..70344867e54 100644
--- a/doc/unconverted/python/cars-exploration.md
+++ b/doc/unconverted/python/cars-exploration.md
@@ -109,19 +109,19 @@ fig.layout.title = 'Torque and Fuel Efficience'
Check default font size
```python
-fig.layout.titlefont.size
+fig.layout.title.font.size
```
Increase the title font size
```python
-fig.layout.titlefont.size = 22
+fig.layout.title.font.size = 22
```
-Set `fig.layout.titlefont.family` to `'Rockwell'`
+Set `fig.layout.title.font.family` to `'Rockwell'`
```python
-fig.layout.titlefont.family = 'Rockwell'
+fig.layout.title.font.family = 'Rockwell'
```
### Create New View for Figure