Black Lives Matter. Please consider donating to Black Girls Code today.

How to disable grid lines in heatmap plot?

How can I disable grid lines corresponding to x axis and y axis values in a heatmap plot?

@fkromer if fig is your go.Figure, then the following update removes the gridlines:

fig.update_layout(xaxis_showgrid=False, yaxis_showgrid=False)

Great. In principle it works. However the y axis grid line at y=0 is still present. Probably that relates to how the grid axis is defined. E.g. my minimal y axis value is -0.5

Sorry, I omitted to add the folowing updates:
xaxis_zeroline=False, yaxis_zeroline=False

1 Like