Skip to content

Instantly share code, notes, and snippets.

@HViktorTsoi
Created March 10, 2024 15:19
Show Gist options
  • Save HViktorTsoi/37bd93dc991a7025902f51e88f37c345 to your computer and use it in GitHub Desktop.
Save HViktorTsoi/37bd93dc991a7025902f51e88f37c345 to your computer and use it in GitHub Desktop.
Matplotlib, set decimal format of axis
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2f'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment