如何在python中绘制半对数图?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43434958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 23:03:36  来源:igfitidea点击:

How do I plot a semilog plot in python?

pythonmatplotlibplot

提问by Jingjie YANG

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?

如何在python中绘制半对数图?X 轴为对数,y 轴为线性。目前我正在规划阶段与欧米茄,我需要 y 轴是线性的,而 x 轴是对数的。我怎么能在python中做到这一点?

回答by Jingjie YANG

Use semilogx, as documented here

使用semilogx,如此处所述

A quick example:

一个简单的例子:

import matplotlib.pyplot as plt
plt.semilogx([1, 10, 100], [1, 10, 100])
plt.xlabel("Omega")
plt.ylabel("phase")
plt.show()

enter image description here

在此处输入图片说明