matplotlibで対数グラフをかく

対数グラフをmatplotlibでかく

 

import matplotlib.pyplot as plt

x = (10, 100, 1000, 2000, 5000, 100000, 1000000)
y = (10, 20, 40, 41, 44, 50, 60)

plt.plot(x, y, 'bo')
plt.xscale('log')
plt.grid(True, which = "both", ls="--",color = "r")
plt.show()

これだけ

f:id:TKYMa:20160413234738p:plain