It's not a big deal, but it's easy to forget.
import numpy as np
arr = np.random.randn(10)
print(arr)
# => array([ 0.24671671, -0.8013258 , -0.29147271, -0.10755521, -1.39065478,
# -1.03983494, -0.75304377, 0.62645801, 0.76417769, -0.31104797])
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.bar(x=range(len(arr)), height=arr)
ax.set_title('Some percentage')
It is difficult to understand that this is a ratio.
import matplotlib
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.bar(x=range(len(arr)), height=arr)
ax.yaxis.set_major_formatter(matplotlib.ticker.PercentFormatter(1.0))
ax.set_title('Some percentage')
matplotlib.ticker — Matplotlib documentation
Recommended Posts