offs_count = my_crs.groupby('Year')['Use&Possession', 'Trafficking', 'Others'].sum()
offs_count.columns = ['Use&Possession', 'Trafficking', 'Others']
fig, ax = plt.subplots(figsize=(8, 6))
bar_width = 0.35
offence_indices = np.arange(len(offs_count))
ax.bar(offence_indices, offs_count['Use&Possession'], width=bar_width, align='center', color='green', label='μ¬μ©/μμ§')
ax.bar(offence_indices + bar_width, offs_count['Trafficking'], width=bar_width, align='center', color='pink', label='λ°λ§€')
ax.bar(offence_indices + bar_width, offs_count['Others'], width=bar_width, align='center', color='yellow', label='κ·Έ μΈ')
ax.set_xlabel('μ°λ')
ax.set_ylabel('건 μ')
ax.set_title('λ²μ£λ³ μ°λλ³ κ±΄ μ')
ax.set_xticks(offence_indices + bar_width / 2)
ax.set_xticklabels(offs_count.index, rotation=90)
ax.yaxis.set_major_formatter(ticker.StrMethodFormatter('{x:,.0f}'))
ax.legend()
plt.tight_layout()
I used an above code to draw a graph but it doesnβt show up on the page.
Is there any error?