[英]Creating a plot with x-axis not to scale in python
Plot with semilogx
function to set log scale of x axis: 使用
semilogx
函数进行绘图以设置x轴的对数刻度:
import matplotlib.pyplot as plt
import numpy as np
x =np.array([0.0001,0.001,0.01,0.1,1.])
plt.semilogx(x, np.sin(x*x))
plt.grid(True)
plt.show()
In common case to put the points equidistance from one another you have to reorganize your data because you may change labels of axis ticks but not points value. 通常情况下,要使点彼此等距,必须重新组织数据,因为您可以更改轴刻度的标签,但不能更改点值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.