Skip to content

Commit c674802

Browse files
committed
Update selections.md
1 parent fa2f3f4 commit c674802

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/python/selections.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,38 +100,38 @@ fig.show()
100100

101101
```
102102

103-
## Fill Color for Active Selections
103+
## Styling New Selections
104104

105-
You can style the active selection with `activeselection`. In this example, we set active selections (when created or clicked) to appear with a `fillcolor` of `yellow`.
105+
You can style new selections made on the figure by setting properties on `newselection`.
106+
Try making a new selection on the figure to try it out.
106107

107108
```python
108109
import plotly.express as px
109110

110111
df = px.data.iris()
111112

112113
fig = px.scatter(df, x="sepal_width", y="sepal_length")
113-
fig.add_selection(x0=3.0, y0=6.5, x1=3.5, y1=5.5)
114114

115115
fig.update_layout(dragmode='select',
116-
activeselection=dict(fillcolor='yellow'))
116+
newselection=dict(line=dict(color='blue')))
117117

118118
fig.show()
119119
```
120120

121-
## Styling New Selections
121+
## Fill Color for Active Selections
122122

123-
You can style new selections made on the figure by setting properties on `newselection`.
124-
Try making a new selection on the figure to try it out.
123+
You can style the active selection with `activeselection`. In this example, we set active selections (when created or clicked) to appear with a `fillcolor` of `yellow`.
125124

126125
```python
127126
import plotly.express as px
128127

129128
df = px.data.iris()
130129

131130
fig = px.scatter(df, x="sepal_width", y="sepal_length")
131+
fig.add_selection(x0=3.0, y0=6.5, x1=3.5, y1=5.5)
132132

133133
fig.update_layout(dragmode='select',
134-
newselection=dict(line=dict(color='blue')))
134+
activeselection=dict(fillcolor='yellow'))
135135

136136
fig.show()
137137
```

0 commit comments

Comments
 (0)