How to make my text of the scatters show on the scatter

I have already set up text, textposition, texttemplate and textfont in the go.Scatter, but i still cannot make my text show on the the figure, while the hoverinfo seems work well. what should I do to make the text shows on the graph but not only in the hover? :sob:

Here is my code:
edge_x =
edge_y =
for edge in G.edges():
x0, y0 = G.nodes[edge[0]][‘pos’]
x1, y1 = G.nodes[edge[1]][‘pos’]
edge_x.append(x0)
edge_x.append(x1)
edge_x.append(None)
edge_y.append(y0)
edge_y.append(y1)
edge_y.append(None)

edge_trace = go.Scatter(
x=edge_x, y=edge_y,
line=dict(width=0.5, color=’#888’),
hoverinfo=‘none’,
mode=‘lines’)

node_x =
node_y =
for node in G.nodes():
x, y = G.nodes[node][‘pos’]
node_x.append(x)
node_y.append(y)

node_trace = go.Scatter(
x=node_x, y=node_y,
mode=‘markers’,
hoverinfo=‘text’,
textposition=‘bottom center’,
** texttemplate="%{text}",**
** textfont={“size”:20},**
marker=dict(
showscale=True,
colorscale=‘Blues’,
reversescale=True,
color=,
size=10,
colorbar=dict(
thickness=15,
title=‘connections’,
xanchor=‘left’,
titleside=‘right’
),
line_width=2))

node_adjacencies =
node_text =
for node, adjacencies in enumerate(G.adjacency()):
node_adjacencies.append(len(adjacencies[1]))
node_text.append(’# of connections: '+str(len(adjacencies[1])))

node_trace.marker.color = node_adjacencies
node_trace.text = node_text

fig = go.Figure(data=[edge_trace, node_trace],
layout=go.Layout(
titlefont_size=16,
showlegend=False,
hovermode=‘closest’,
margin=dict(b=20,l=5,r=5,t=40),
xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
yaxis=dict(showgrid=False, zeroline=False, showticklabels=False))
)
fig.update_layout(coloraxis_showscale=False)
fig.update_layout(autosize=False, height=600,width=700)
fig.show()

and here is my result.

@ericzhao
To get help please post a formatted code, by inserting it between a pair of three backticks ```

In your node_trace set:

text=[ a list of node names]
mode="markers+text"

to get the text displayed on plot, not only on hover.

Hi @empet

Is it possible to assign different color to the text that is displayed on the plot? I mean the color of the scatter be something and the color of the its corresponding text be something else.

Hi again @empet

I’m sure if you are not the god, you are from god

Dear God, I found the solution. I put the solution here maybe be useful for the someone one day:

textfont=dict(family='Balto', size=-14, color=f'rgba(141, 20, 20, 1)')

Hi @empet

Another question. Is it possible to define the text position distance? I mean that move text closer to the scatter point by defining a distance value!