gnuplot - 设置鼠标鼠标格式自定义格式

时间:2015-05-21 07:45:21

标签: gnuplot

set mouse command的文档显示了可能影响鼠标行为的以下格式,在这种情况下,在左下角使用了正确的格式来显示鼠标指针坐标:

0   real coordinates in  brackets e.g. [1.23, 2.45]
1   real coordinates w/o brackets e.g.  1.23, 2.45
2   x == timefmt                       [(as set by `set timefmt`), 2.45]
3   x == date                          [31. 12. 1999, 2.45]
4   x == time                          [23:59, 2.45]
5   x == date / time                   [31. 12. 1999 23:59, 2.45]
6   alt. format, specified as string   ""

但是,两次尝试设置自定义格式后,最终会出现错误line 0: wrong option

gnuplot -p -e 'set datafile separator ",";
            set xdata time;
            set timefmt "%m/%d/%y %H:%M";
            set format x "%d/%H:%M";
            set mouse mouseformat "mouse = %y/%m/%d %H:%M";
            set autoscale xfix;
            plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines'

gnuplot -p -e 'set datafile separator ",";
            set xdata time;
            set timefmt "%m/%d/%y %H:%M";
            set format x "%d/%H:%M";
            set mouse mouseformat "%y/%m/%d %H:%M";
            set autoscale xfix;
            plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines'

我试过从交互式翻译中运行它:

└──> gnuplot -p
Terminal type set to 'wxt'
gnuplot> set datafile separator ",";
gnuplot> set xdata time;
gnuplot> set timefmt "%m/%d/%y %H:%M";
gnuplot> set format x "%d/%H:%M";
gnuplot> set mouse mouseformat "mouse = %y/%m/%d %H:%M";
gnuplot> set autoscale xfix;
gnuplot> plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines

└──> gnuplot -p
gnuplot> set datafile separator ",";
gnuplot> set xdata time;
gnuplot> set timefmt "%m/%d/%y %H:%M";
gnuplot> set format x "%d/%H:%M";
gnuplot> set mouse mouseformat "%y/%m/%d %H:%M";
gnuplot> set autoscale xfix;
gnuplot> plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines

然后显示图表,但在左下角是:mouse = %y/Argument list too long/7827416 %H:M而不是坐标。

我还注意到了另一种奇怪的行为,这里再次从提到的页面中摘录:

1   real coordinates w/o brackets e.g.  1.23, 2.45
2   x == timefmt                       [(as set by `set timefmt`), 2.45]
3   x == date                          [31. 12. 1999, 2.45]

似乎set mouse mouseformat X命令的数字由于某种原因而被移位:

在我的机器中跟随timefmt而不是date

gnuplot -p -e 'set datafile separator ",";
            set xdata time;
            set timefmt "%m/%d/%y %H:%M";
            set format x "%d/%H:%M";
            set mouse mouseformat 3;
            set autoscale xfix;
            plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines'

以及关注集real coordinates w/o brackets e.g. 1.23, 2.45而不是timefmt

gnuplot -p -e 'set datafile separator ",";
            set xdata time;
            set timefmt "%m/%d/%y %H:%M";
            set format x "%d/%H:%M";
            set mouse mouseformat 2;
            set autoscale xfix;
            plot "rec-center-hourly.csv" using 1:2 every ::3::616 with lines'    

1 个答案:

答案 0 :(得分:0)

根据v5.0 doc,预定义格式适用于mouseformat

Use set mouse mouseformat "" to turn this string off again.
The following formats are available:
0 default (same as 1)
1 axis coordinates 1.23, 2.45
2 graph coordinates (from 0 to 1) /0.00, 1.00/
3 x = timefmt y = axis [(as set by ‘set timefmt‘), 2.45]
4 x = date y = axis [31. 12. 1999, 2.45]
5 x = time y = axis [23:59, 2.45]
6 x = date time y = axis [31. 12. 1999 23:59, 2.45]
7 format from ‘set mouse mouseformat‘, e.g. "mouse x,y = 1.23, 2.450"

我使用了一个例子:

set timefmt '%Y-%m-%dT%H:%M:%S'
set mouse mouseformat 3

enter image description here

如果我使用set mouse format 3进行尝试,我也会收到wrong option错误。