python 纵坐标 log 网格

python 纵坐标 log 网格,第1张

import numpy as np
from matplotlib import pyplot as plt
x = np.arange(0, 100, 0.5)
y = 2 * x ** 3
plt.loglog(x, y)
plt.grid(True, which='both', ls='--')
plt.figure()
plt.plot(x, y)
plt.yscale('log')
plt.grid(True, which='both', ls='--')
plt.figure()
plt.plot(x,y)
plt.xscale('log')
plt.grid(True, which='both', ls='--')

plt.figure()
plt.plot(x,y)
plt.grid(True, which='both', ls='--')

plt.figure()
plt.plot(x, y)
plt.yscale('log')
plt.grid(True, which='major', ls='--')

plt.figure()
plt.plot(x, y)
plt.yscale('log')
plt.grid(True, which='minor', ls='--')

最终的结果为:

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/570256.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-09
下一篇 2022-04-09

发表评论

登录后才能评论

评论列表(0条)

保存