The figure plotly adds years in between:
import pandas as pd
import plotly.figure_factory as ff
df = pd.DataFrame(index=[2017, 2019, 2020, 2021],
data={'Product A':[62.46, 118.77, 88.42, 37.35],
'Product B':[0, 0, 0, 0.32],
'Product C':[0, 0, 0, 0.43],
'Product D':[7.32, 15.15, 18.05, 7.47]})
import plotly.figure_factory as ff
fig = ff.create_annotated_heatmap(
z = df.values,
x = df.columns.tolist(),
y = df.index.tolist(),
colorscale='greens'
)
fig.show()
How to avoid automatic adding years in between? Remove in this example 2018 and 2016?