简体   繁体   English

使用X轴创建图无法在python中缩放

[英]Creating a plot with x-axis not to scale in python

My x axis are x =[0.0001,0.001,0.01,0.1,1] When I create a graph it looks like this 我的x轴是x =[0.0001,0.001,0.01,0.1,1]创建图形时,它看起来像这样 在此处输入图片说明

I want to make a graph that ignores the scale in x-axis and puts the points equidistance from one another 我想制作一个图表,该图表忽略x轴上的比例并将点彼此等距放置

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM