0

This might be similar to a question mentioned in the below post: matplotlib: format axis offset-values to whole numbers or specific number

but I am writing this coz I tested solutions but nothing worked. I was unable to add comment on give solutions. So, please bear with me on this.

Here is the dataset: https://github.com/JordanTheDodger/Temp-Repo

gender_cases = df.groupby('gender').sum().sort_values(by='std_cases',ascending=False)
gender_cases = gender_cases.reset_index()

#plot
plt.figure(figsize=(10,7))
sb.barplot(data=gender_cases, x='gender',y='rate');
plt.title('STD Rate of Male vs Female',fontsize=20)
plt.xlabel('Gender',fontsize=15)
plt.ylabel('Rate',fontsize=15);

enter image description here

From the plot picture the goal is to fix yticks to normal format (like 1M or 500K).
Here is the pic of one of the proposed solutions in the post noted above

enter image description here

Zephyr
  • 11,891
  • 53
  • 45
  • 80
  • Show your problematic attempt. Reduce to mcve. There is no need to ask me to download your dataset to illustrate the problem. Use numpy.random to create a minimal sample that illustrates the issue. – Mad Physicist Jul 04 '20 at 15:51
  • Sure I will do that – Jordan TheDodger Jul 04 '20 at 15:59
  • https://matplotlib.org/api/ticker_api.html – wwii Jul 04 '20 at 17:03
  • The solution from https://matplotlib.org/examples/pylab_examples/custom_ticker1.html worked from @wwii solution (https://stackoverflow.com/questions/40566413/matplotlib-pyplot-auto-adjust-unit-of-y-axis) Thanks – Jordan TheDodger Jul 04 '20 at 20:10

0 Answers0