How to modify color of number?

OK, you are using graph_objects. I this case this should work:

import plotly.graph_objects as go

fig = go.Figure(data=go.Heatmap(
                    z=[[1, 20, 30],
                      [20, 1, 60],
                      [30, 60, 1]]))

fig.update_layout(
    width=600,
    height=600,
    paper_bgcolor='rgba(0, 0, 0, 0.5)',
    title=dict(
      text='Daily Market Sentiment',
      font=dict(
          color='white'
      )
),
xaxis=dict(
  title='Dates',
  title_font=dict(
      color='white'
  ),
  tickfont=dict(
      color='white'
  )
),
yaxis=dict(
  title='Time',
  title_font=dict(
      color='white'
  ),
  tickfont=dict(
      color='white'
  )
),


)
fig.update_traces(
    colorbar=dict(
       title='Colorbar',
       tickfont={'color':'orange' },
       titlefont={"color":'green'}
    )
)

For the sake of completeness, here the plotly.expressversion:

import plotly.express as px#

fig = px.imshow([[1, 20, 30],
                 [20, 1, 60],
                 [30, 60, 1]])

fig.update_layout(
    width=600,
    height=600,
    paper_bgcolor='rgba(0, 0, 0, 0.5)',
    title=dict(
      text='Daily Market Sentiment',
      font=dict(
          color='white'
      )
),
xaxis=dict(
  title='Dates',
  title_font=dict(
      color='white'
  ),
  tickfont=dict(
      color='white'
  )
),
yaxis=dict(
  title='Time',
  title_font=dict(
      color='white'
  ),
  tickfont=dict(
      color='white'
  )
),


)
fig.update_coloraxes(
    colorbar=dict(
       title='Colorbar',
       tickfont={'color':'orange' },
       titlefont={"color":'green'}
    )
)

2 Likes