gnuplot xticks not equally spaced

本秂侑毒 提交于 2019-12-24 07:07:26

问题


I have a data file (d.asc) as follows:

0.1  0.5
...  
1    0.34
... 
10   9.4
...
100  45.3

In between 0.1 and 1, 1 and 10, 10 and 100 I have 35 values. So that in total in d.asc file I have 109 lines. But I just want x-axis to display these four point values (i.e. 0.1, 1, 10, and 100). To plot it I use the following:

set xtics ("0.1" 0.1, "1" 1, "10" 10, "100" 100)
set grid
plot "d.asc" using 1:2 notitle with lines

But this gives something weird, it places 1 and 10 very close to 0.1 (kind of overwrites 1 and 10 on top of 0.1). So that I cannot figure out whether it is 0.1, 1, or 10. And places 100 at the end. But what I would expect to see is 0.1, 1, 10, and 100 on x-axis equally spaced from each other. How can I achieve this? Thanks.


回答1:


If you want them to be equally spaced from each other, you need to use a logscale.

set logscale x

Or maybe,

set logscale x 10


来源:https://stackoverflow.com/questions/14008376/gnuplot-xticks-not-equally-spaced

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!