Given the following chart created in plotly.
I want to add the percentage values of each count for M and F categories inside each block.
The code used to generate this plot.
arr = np.array([
['Dog', 'M'], ['Dog', 'M'], ['Dog', 'F'], ['Dog', 'F'],
['Cat', 'F'], ['Cat', 'F'], ['Cat', 'F'], ['Cat', 'M'],
['Fox', 'M'], ['Fox', 'M'], ['Fox', 'M'], ['Fox', 'F'],
['Dog', 'F'], ['Dog', 'F'], ['Cat', 'F'], ['Dog', 'M']
])
df = pd.DataFrame(arr, columns=['A', 'G'])
fig = px.histogram(df, x="A", color='G', barmode="stack")
fig.update_layout(height=400, width=800)
fig.show()