Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
772 views
in Technique[技术] by (71.8m points)

gnuplot - 设置xtics <start> , <incr> 在gnuplot中不起作用(set xtics by <start>, <incr> in gnuplot does not work)

I plot with gnuplot the following:

(我用gnuplot绘制以下内容:)

$Data <<EOD

time_,value

1-23:59:58,1

1-23:59:59,2

2-00:00:00,3

2-00:00:01,4

2-00:00:02,5

EOD

set term png  size 800,600 

set output "ask.png"

set datafile separator comma

set grid

set xdata time

set timefmt "%d-%H:%M:%S" 

set format x "%H:%M:%S" 

set xtics nomirror

set autoscale xfix

set autoscale x2fix

startnumber=1

xticdata=2

mxticdata=2

set xtics xticdata rotate

set mxtics mxticdata

set x2data

set x2tics startnumber, xticdata rotate

set mx2tics mxticdata

set link x2 via x+1 inverse x-1


plot $Data using 1:2 title columnheader(2)

set output

The output is alright, but you can see from the attached figure that the labels on x2-axis are big numbers, which is not what I want.

(输出没问题,但是从附图中可以看到x2轴上的标签是大数字,这不是我想要的。)

I want to get labels like "1,3,5...".

(我想获取类似“ 1、3、5 ...”的标签。)

So what's wrong with my code?

(那么我的代码有什么问题呢?)

And how to correct it?

(以及如何纠正呢?)

Thanks.

(谢谢。) 在此处输入图片说明

  ask by lyl translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

the quickest fix would be

(最快的解决办法是)

set link x2 via x-86397 inverse x+86397

But it depends what timesteps you have and what numbers you have in column 2. If your time step it is strictly regular and 1 second, and column 2 just counts up, then column 2 is redundant.

(但这取决于您在第2列中使用的时间步长和编号。如果您的时间步长严格固定且为1秒,而第2列只是递增计数,则第2列是多余的。)

Timedata is handled internally as seconds from 01.01.1970 00:00:00.

(从1970年1月1日00:00:00起,时间数据在内部以秒为单位进行处理。)

One day has 86400 seconds.

(一天有86400秒。)

Check help time/date .

(检查help time/date 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...