Skip to content

Commit a3d540d

Browse files
committed
Update shapes.md
1 parent 50a2948 commit a3d540d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

doc/python/shapes.md

+8-5
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.14.5
9+
jupytext_version: 1.14.6
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.8.8
23+
version: 3.10.8
2424
plotly:
2525
description: How to make SVG shapes in python. Examples of lines, circle, rectangle,
2626
and path.
@@ -919,7 +919,7 @@ fig.show()
919919

920920
Use `texttemplate` to add text with variables to shapes. `texttemplate` uses d3 number and date formatting and supports raw variables, which use the raw data from the shape definition, and some calculated variables. Add a variable with "%{variable}".
921921

922-
This example adds the raw variables `x0` and `y0` to a rectangle and shows the calculated variables `height`, `slope`, and `width` on three other shapes.
922+
This example adds the raw variables `x0` and `y0` to a rectangle and shows the calculated variables `height`, `slope`, `length`, and `width` on three other shapes.
923923

924924
For a complete list of available variables, see the [Shape Reference Docs](https://plotly.com/python/reference/layout/shapes/).
925925

@@ -955,9 +955,12 @@ fig.add_shape(
955955
x0=3,
956956
y0=0.5,
957957
x1=5,
958-
y1=0.8,
958+
y1=1.5,
959959
line_width=3,
960-
label=dict(texttemplate="Slope: %{slope:.3f}", font=dict(size=20)),
960+
label=dict(
961+
texttemplate="Slope of %{slope:.3f} and length of %{length:.3f}",
962+
font=dict(size=20),
963+
),
961964
)
962965
fig.add_shape(
963966
type="rect",

0 commit comments

Comments
 (0)