Reputation: 99
I draw a figure in plotly (python). To change the label color of y axis in the plot I used the code fig.update_yaxes(color='white')
and fig.update_layout(font_color="white")
but unfortunately both of them didn't work, what else can I do?
My code:
for index, i in enumerate(values):
fig_1.add_trace(go.Scatter(x=[today], y=[i], mode='markers', name=names[index], marker_symbol='star-triangle-up', marker_size=15))
fig_1.update_layout(
xaxis_title="",
)
fig_1.update_layout( height=450, width=700,xaxis_title="", plot_bgcolor='rgba(65, 104, 119, 0.8)', )
fig_1.update_layout(legend=dict(
yanchor="top",
y=0.99,
xanchor="left",
x=0.01,
)
)
fig_1.layout.yaxis.color = 'white'
fig_1.update_xaxes(color='white')
fig_1.update_yaxes(color='white')
Upvotes: 3
Views: 10518
Reputation: 9786
You can use:
fig.update_yaxes(title_font_color="red")
You can look here for more settings.
Upvotes: 3