Plotly Python - Heatmap - Change Hovertext (x,y,z)

Viewed 6325

I have a heatmap done with plotly in python. The hovertext works perfectly, however it has each variable prefixed with x, y or z like this:

enter image description here

It there any way to change this i.e. x = "FY", y = "Month" and z = "Count"

This is the code that produced the heatmap above

dfreverse = df_hml.values.tolist()
dfreverse.reverse()

colorscale = [[0, '#454D59'],[0.5, '#FFFFFF'], [1, '#F1C40F']]

trace = go.Heatmap(z=dfreverse,
                   colorscale = colorscale,
                   x = [threeYr,twoYr,oneYr,Yr],
                   y=['March', 'February', 'January', 'December', 'November', 'October', 'September', 'August', 'July', 'June', 'May', 'April'])
data=[trace]



layout = go.Layout(
    autosize=False,
    font=Font(
        family="Courier New",
    ),
    width=700,
    height=450,
    margin=go.Margin(
        l=150,
        r=160,
        b=50,
        t=100,
        pad=3
    ),
)

fig = go.Figure(data=data, layout=layout)
plotly.offline.iplot(fig,filename='pandas-heatmap')

Thank you!

1 Answers
Related