Skip to content

Commit e9fbfd8

Browse files
committed
Update marker-style.md
1 parent 9dc893d commit e9fbfd8

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

doc/python/marker-style.md

Lines changed: 26 additions & 2 deletions
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.6
9+
jupytext_version: 1.19.1
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.14.3
2424
plotly:
2525
description: How to style markers in Python with Plotly.
2626
display_as: file_settings
@@ -107,6 +107,30 @@ fig.show()
107107

108108
Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density.
109109

110+
### Dashed Marker Borders
111+
112+
*New in 6.6*
113+
114+
Set `dash` on `marker.line` to control the dash pattern of marker borders. Supported values are: `'solid'` (default), `'dot'`, `'dash'`, `'longdash'`, `'dashdot'`, `'longdashdot'`, or a custom dash length list in px (for example, `'12px,6px'`).
115+
116+
```python
117+
import plotly.graph_objects as go
118+
119+
styles = ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot", "12px,6px"]
120+
121+
fig = go.Figure(go.Scatter(
122+
x=list(range(len(styles))),
123+
y=[0] * len(styles),
124+
mode="markers+text",
125+
text=styles,
126+
textposition="bottom center",
127+
marker=dict(size=30, color="white", line=dict(color="blue", width=2, dash=styles))
128+
))
129+
130+
fig.show()
131+
```
132+
133+
The `marker.line.dash` attribute is available on `go.Scatter`, `go.Scatterpolar`, `go.Scattergeo`, `go.Scatterternary`, `go.Scattercarpet`, and `go.Scattersmith` traces.
110134

111135
### Control Marker Border with Dash
112136

0 commit comments

Comments
 (0)