55 text_representation :
66 extension : .md
77 format_name : markdown
8- format_version : ' 1.1 '
9- jupytext_version : 1.1.1
8+ format_version : ' 1.2 '
9+ jupytext_version : 1.3.2
1010 kernelspec :
1111 display_name : Python 3
1212 language : python
@@ -20,7 +20,7 @@ jupyter:
2020 name : python
2121 nbconvert_exporter : python
2222 pygments_lexer : ipython3
23- version : 3.6.7
23+ version : 3.7.3
2424 plotly :
2525 description : How to add dropdowns to update Plotly chart attributes in Python.
2626 display_as : controls
@@ -80,7 +80,7 @@ fig.update_scenes(
8080# Add dropdown
8181fig.update_layout(
8282 updatemenus = [
83- go.layout.Updatemenu (
83+ dict (
8484 buttons = list ([
8585 dict (
8686 args = [" type" , " surface" ],
@@ -107,8 +107,8 @@ fig.update_layout(
107107# Add annotation
108108fig.update_layout(
109109 annotations = [
110- go.layout.Annotation (text = " Trace type:" , showarrow = False ,
111- x = 0 , y = 1.085 , yref = " paper" , align = " left" )
110+ dict (text = " Trace type:" , showarrow = False ,
111+ x = 0 , y = 1.085 , yref = " paper" , align = " left" )
112112 ]
113113)
114114
@@ -151,7 +151,7 @@ fig.update_scenes(
151151button_layer_1_height = 1.08
152152fig.update_layout(
153153 updatemenus = [
154- go.layout.Updatemenu (
154+ dict (
155155 buttons = list ([
156156 dict (
157157 args = [" colorscale" , " Viridis" ],
@@ -182,7 +182,7 @@ fig.update_layout(
182182 y = button_layer_1_height,
183183 yanchor = " top"
184184 ),
185- go.layout.Updatemenu (
185+ dict (
186186 buttons = list ([
187187 dict (
188188 args = [" reversescale" , False ],
@@ -203,7 +203,7 @@ fig.update_layout(
203203 y = button_layer_1_height,
204204 yanchor = " top"
205205 ),
206- go.layout.Updatemenu (
206+ dict (
207207 buttons = list ([
208208 dict (
209209 args = [{" contours.showlines" : False , " type" : " contour" }],
@@ -229,11 +229,11 @@ fig.update_layout(
229229
230230fig.update_layout(
231231 annotations = [
232- go.layout.Annotation (text = " colorscale" , x = 0 , xref = " paper" , y = 1.06 , yref = " paper" ,
232+ dict (text = " colorscale" , x = 0 , xref = " paper" , y = 1.06 , yref = " paper" ,
233233 align = " left" , showarrow = False ),
234- go.layout.Annotation (text = " Reverse<br>Colorscale" , x = 0.25 , xref = " paper" , y = 1.07 ,
234+ dict (text = " Reverse<br>Colorscale" , x = 0.25 , xref = " paper" , y = 1.07 ,
235235 yref = " paper" , showarrow = False ),
236- go.layout.Annotation (text = " Lines" , x = 0.54 , xref = " paper" , y = 1.06 , yref = " paper" ,
236+ dict (text = " Lines" , x = 0.54 , xref = " paper" , y = 1.06 , yref = " paper" ,
237237 showarrow = False )
238238 ])
239239
@@ -293,25 +293,25 @@ fig.add_trace(
293293)
294294
295295# Add buttons that add shapes
296- cluster0 = [go.layout.Shape (type = " circle" ,
296+ cluster0 = [dict (type = " circle" ,
297297 xref = " x" , yref = " y" ,
298298 x0 = min (x0), y0 = min (y0),
299299 x1 = max (x0), y1 = max (y0),
300300 line = dict (color = " DarkOrange" ))]
301- cluster1 = [go.layout.Shape (type = " circle" ,
301+ cluster1 = [dict (type = " circle" ,
302302 xref = " x" , yref = " y" ,
303303 x0 = min (x1), y0 = min (y1),
304304 x1 = max (x1), y1 = max (y1),
305305 line = dict (color = " Crimson" ))]
306- cluster2 = [go.layout.Shape (type = " circle" ,
306+ cluster2 = [dict (type = " circle" ,
307307 xref = " x" , yref = " y" ,
308308 x0 = min (x2), y0 = min (y2),
309309 x1 = max (x2), y1 = max (y2),
310310 line = dict (color = " RebeccaPurple" ))]
311311
312312fig.update_layout(
313313 updatemenus = [
314- go.layout.Updatemenu (buttons = list ([
314+ dict (buttons = list ([
315315 dict (label = " None" ,
316316 method = " relayout" ,
317317 args = [" shapes" , []]),
@@ -411,7 +411,7 @@ low_annotations = [dict(x="2015-05-01",
411411
412412fig.update_layout(
413413 updatemenus = [
414- go.layout.Updatemenu (
414+ dict (
415415 active = 0 ,
416416 buttons = list ([
417417 dict (label = " None" ,
0 commit comments