Skip to content

Commit bf27e66

Browse files
author
mahdis-z
committed
closed shape
1 parent 51f7011 commit bf27e66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: doc/python/shapes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jupyter:
3535

3636
### Filled Area Chart
3737

38-
There are two ways to draw filled shapes: scatter traces and [layout.shapes](https://plot.ly/python/reference/#layout-shapes-items-shape-type) which is mostly useful for the 2d subplots, and defines the shape type to be drawn, and can be rectangle, circle, line, or path (a custom SVG path). You also can use [scatterpolar](https://plot.ly/python/polar-chart/#categorical-polar-chart), scattergeo, [scattermapbox](https://plot.ly/python/filled-area-on-mapbox/#filled-scattermapbox-trace) to draw filled shapes on any kind of subplots. To set an area to be filled with a solid color, you need to define [Scatter.fill="toself"](https://plot.ly/python/reference/#scatter-fill) that connects the endpoints of the trace into a closed shape.
38+
There are two ways to draw filled shapes: scatter traces and [layout.shapes](https://plot.ly/python/reference/#layout-shapes-items-shape-type) which is mostly useful for the 2d subplots, and defines the shape type to be drawn, and can be rectangle, circle, line, or path (a custom SVG path). You also can use [scatterpolar](https://plot.ly/python/polar-chart/#categorical-polar-chart), scattergeo, [scattermapbox](https://plot.ly/python/filled-area-on-mapbox/#filled-scattermapbox-trace) to draw filled shapes on any kind of subplots. To set an area to be filled with a solid color, you need to define [Scatter.fill="toself"](https://plot.ly/python/reference/#scatter-fill) that connects the endpoints of the trace into a closed shape. If `mode=line` (default value), then you need to repeat the initial point of a shape at the of the sequence to have a closed shape.
3939

4040
```python
4141
import plotly.graph_objects as go
4242

43-
fig = go.Figure(go.Scatter(x=[0,1,2], y=[0,2,0], fill="toself"))
43+
fig = go.Figure(go.Scatter(x=[0,1,2,0], y=[0,2,0,0], fill="toself"))
4444
fig.show()
4545
```
4646

@@ -49,7 +49,7 @@ You can have more shapes either by adding [more traces](https://plot.ly/python/f
4949
```python
5050
import plotly.graph_objects as go
5151

52-
fig = go.Figure(go.Scatter(x=[0,1,2,None,3,3,5,5], y=[0,2,0,None,0.5,1.5,1.5,0.5], fill="toself"))
52+
fig = go.Figure(go.Scatter(x=[0,1,2,0,None,3,3,5,5,3], y=[0,2,0,0,None,0.5,1.5,1.5,0.5,0.5], fill="toself"))
5353
fig.show()
5454
```
5555

0 commit comments

Comments
 (0)