@@ -319,16 +319,20 @@ In the following figures, hover over a symbol to see its name or number. Set the
319319
320320``` python
321321import plotly.graph_objects as go
322+
322323fig = go.Figure()
324+
323325fig.update_layout(title = " Basic Symbols" )
326+
324327fig.update_xaxes(showticklabels = False )
325328fig.update_yaxes(showticklabels = False )
326329
327330for index in range (27 ):
328331 fig.add_trace(go.Scatter(x = [(index % 6 )], y = [index // 6 ], name = " " ,
329332 marker_symbol = index, marker_color = ' black' ,
330- marker_size = 10 , showlegend = False ,
331- text = index, hovertemplate = f ' <b>Symbol Number: { index} </b> ' ))
333+ marker_size = 10 , showlegend = False , mode = " markers+text" ,
334+ textposition = " middle right" , text = f ' <b> { index} </b> ' ,
335+ hovertemplate = f ' <b>Symbol Number: { index} </b> ' ))
332336
333337fig.show()
334338```
@@ -337,6 +341,7 @@ fig.show()
337341
338342``` python
339343import plotly.graph_objects as go
344+
340345symbols = [0 , ' circle' , 100 , ' circle-open' , 200 , ' circle-dot' , 300 ,
341346 ' circle-open-dot' , 1 , ' square' , 101 , ' square-open' , 201 ,
342347 ' square-dot' , 301 , ' square-open-dot' , 2 , ' diamond' , 102 ,
@@ -400,19 +405,21 @@ symbols = [0, 'circle', 100, 'circle-open', 200, 'circle-dot', 300,
400405 ' line-nw-open' ]
401406
402407fig = go.Figure()
403- fig.update_layout(title = " Custom Marker Symbols" )
408+
409+ fig.update_layout(title = " Custom Marker Symbols" , height = 800 )
410+
404411fig.update_xaxes(showticklabels = False )
405412fig.update_yaxes(showticklabels = False )
406413
407414for index, symbol in enumerate (symbols[::2 ]):
408- fig.add_trace(go.Scatter(x = [(index % 30 )], y = [index // 30 ],
409- marker_symbol = symbol, marker_color = ' black' ,
410- marker_size = 10 , showlegend = False ,
411- hovertext = symbols[2 * index + 1 ], name = ' ' ,
412- hovertemplate = f ' <b> { symbols[2 * index + 1 ]} </b> '
415+ fig.add_trace(go.Scatter(x = [(index % 16 )], y = [(index // 16 )],
416+ marker_symbol = symbol, marker_color = index,
417+ marker_size = 20 , showlegend = False , mode = " markers+text" ,
418+ name = ' ' ,
419+ hovertemplate = f ' <b>Symbol Name: { symbols[2 * index + 1 ]} </b><br><b>Symbol Number: { symbols[2 * index]} </b> ' ,
420+ textfont_size = 8
413421 ))
414-
415-
422+
416423fig.show()
417424```
418425
0 commit comments