pie chart outcomeI am trying to get 2 pie chart from 1 2 different columns showing beside each other.
They kept overlapping in in pie chart with overlapping text.
Now by extracting each column in their own CSV I was able to get them below each other, but not nice and unable to place side by side.
Found some old samples from many years back but not working well with the code I have.
See below code. each df is a CSV for only that column.
Somehow the code is only kind of working if I place the fig between the 2. See outcome in the screenshot.
Is there a way to place them side by side, and even by using the same CSV? or do I still need to keep 2 CSV 1 for each column to do this?
#Top 10 Most Worked with Databases + Pie Chart
ax1=palette_color = sns.color_palette("husl")
ax1=df_databeses_work_with['DatabaseHaveWorkedWith'].value_counts()[:10].plot.pie(
rot=0,title='Top 10 Currently Most used Databases',colors=palette_color,autopct='%.0f%%', labeldistance=1.0)
ax1 = df_databeses_work_with
fig,(ax1, ax2)= plt.subplots(1, 2,figsize=(8,6))
#Top 10 Wish to Work/learn Databases + Pie Chart
ax2=palette_color = sns.color_palette("husl")
ax2=df_databeses_wish_work['DatabaseWantToWorkWith'].value_counts()[:10].plot.pie(
rot=0,title='Top 10 wish to use/learn Databases',colors=palette_color,autopct='%.0f%%', labeldistance=1.0)
ax2 = df_databeses_wish_work
I have looked on google on stack overflow I found 1 code from 2022, I tried to implement part, but is not fully working.
Tried to make fig 1 and fig 2, Swap ax1, ax2 to ax2 and ax1 and swapped numbers 1,2 to 2,1 and 2,3 etc.
Did not work.
From the 2nd pie chart seems to be only affected by this to move from left to bottom.
As mentioned when used the same CSV with below codes, It keeps overlapping except when I put the fig inbetween. Same result as the screenshot.
#Top 10 Most Worked with Databases + Pie Chart
ax1=palette_color = sns.color_palette("husl")
ax1=df_databeses_work_with=df_survey_2024['DatabaseHaveWorkedWith'].value_counts()[:10].plot.pie(figsize=(8,4),
rot=0,title='Top 10 Currently Most used Databases',colors=palette_color,autopct='%.0f%%', labeldistance=1.0)
ax1 = df_databeses_work_with
fig,(ax1, ax2)= plt.subplots(1, 2,figsize=(8,6))
#Top 10 Wish to Work/learn Databases + Pie Chart
ax2=palette_color = sns.color_palette("husl")
ax2=df_databeses_wish_work=df_survey_2024['DatabaseWantToWorkWith'].value_counts()[:10].plot.pie(figsize=(8,4),
rot=0,title='Top 10 wish to use/learn Databases',colors=palette_color,autopct='%.0f%%', labeldistance=1.0)
ax2 = df_databeses_wish_work