如何在python中绘制半对数图? [英] How do I plot a semilog plot in python?
本文介绍了如何在python中绘制半对数图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在python中绘制半对数图?X 轴为对数,y 轴为线性.目前我正在规划阶段与欧米茄,我需要 y 轴是线性的,而 x 轴是对数的.我如何在 python 中做到这一点?
解决方案
使用 semilogx
,如
How do I plot a semilog plot in python? with X axis in log and y axis as linear. Currently I m plooting phase vs omega where I need the y axes to be linear while x axes to be in log. Hoow can I do that in python?
解决方案
Use semilogx
, as documented here
A quick example:
import matplotlib.pyplot as plt
plt.semilogx([1, 10, 100], [1, 10, 100])
plt.xlabel("Omega")
plt.ylabel("phase")
plt.show()
这篇关于如何在python中绘制半对数图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文