gnuplot xticks不等距 [英] gnuplot xticks not equally spaced

查看:91
本文介绍了gnuplot xticks不等距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据文件(d.asc),如下所示:

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

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

在0.1和1、1和10、10和100之间,我有35个值.因此,在d.asc文件中,我总共有109行.但是我只希望x轴显示这四个点值(即0.1、1、10和100).要绘制它,我使用以下命令:

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

但这有点奇怪,它将1和10放置在非常接近0.1的位置(在0.1之上覆盖了1和10).这样我就无法确定它是0.1、1还是10.然后将100放在最后.但是我希望看到的是x轴上彼此等距分布的0.1、1、10和100.我怎样才能做到这一点?谢谢.

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.

推荐答案

如果希望它们彼此等间隔,则需要使用logscale.

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

set logscale x

或者也许,

set logscale x 10

这篇关于gnuplot xticks不等距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆