简体   繁体   中英

Plotly graph title and labels are off white color

I have generated the below plotly graph using the code as below:

x=['a','b','c','d']

y=['1','2','3','4']

df = pd.DataFrame({'x':x, 'y':y})

fig=df.iplot(kind= 'scatter', size =9,mode='markers+text',opacity=0.8, colors=['blue'], yTitle= 'Count',xTitle = 'x', asFigure=True)

fig.update_layout(height=300, width=500, title_text="Plot X on Y",barmode='stack',template='plotly_dark',  plot_bgcolor='rgb(17,17,17)',
    legend = dict(bgcolor = 'rgb(17,17,17)', orientation="h",yanchor="bottom", x=1,y=1.02, xanchor='right'), paper_bgcolor ='rgb(12,12,12)', xaxis = {'showgrid': False, 'zeroline':True}, yaxis = {'showgrid': False})

The graph is coming as below with the title, xaxis, yaxis label titles are all appearing in suppressed color. I want them to be in a sharp white color.

在此处输入图像描述

There are several themes you can try out. If you use 'solar', you will get the color you want. The source of the theme can be found here for your reference.

fig=df.iplot(kind= 'scatter', size =9,
             mode='markers+text',
             opacity=0.8,
             colors=['blue'],
             yTitle= 'Count',
             xTitle = 'x',
             asFigure=True,
             theme='solar')

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM