Overlap of x-axis label and figure title

I am trying to create an annotated heatmap:

import plotly.figure_factory as ff
from plotly.offline import plot, iplot

z = [[9, 36 ],[401, 4]]
x = [0,1]
y = [1, 0]

fig = ff.create_annotated_heatmap(z, showscale=True, x = x, y = y)
fig['layout']['title'] = 'Confusion Matrix'
fig['layout']['xaxis']['title'] = 'Predicted label'
fig['layout']['yaxis']['title'] = 'True label'

plotly.offline.plot(fig)

Hovever, my x-axis label and the title are overlapping. Moreover, I want the x-axis label to appear at the bottom and not at the top. Any idea how to do it?

1 Like

Setting Single-page reference in JavaScript to β€˜bottom’ should do that

Axis title don’t automatically push extra room in the margins for the graph title unfortunately at the moment. So you’ll have to bump the top margin manually Single-page reference in JavaScript

1 Like