I know this question has been asked before but their solution didn't help me. I have a dataframe of size (391,28) and I want to create a bubble chart like shown here:
My dataframe looks like:
# A B C
# X 0 10 0
# Y 1 2 1
Here I show only a smaller dataframe to give an idea but like I said my dataframe is 391*28 big.
In order to create a bubble chart I do the following:
dfu = df.unstack().reset_index()
dfu.columns = list("XYS")
dfu["S"] *= 20
figure(figsize=(17, 15))
colors = np.random.rand(40)
plt.xticks(rotation=-15)
plt.scatter(x="X", y="Y", s="S", data=dfu)
plt.margins(.4)
plt.show()
But this produces categories on y-axis that are overlapping.
I tried increasing the size but it didn't help. Overlap stays the same. So How can I solve for this? Insights will be appreciated.