首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gnuplot -设置鼠标鼠标格式自定义格式

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

Stack Overflow用户
提问于 2015-05-21 15:45:21
回答 1查看 1.7K关注 0票数 1

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

代码语言:javascript
复制
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

代码语言:javascript
复制
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'

我也尝试过在交互式解释器中运行它:

代码语言:javascript
复制
└──> 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而不是坐标。

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

代码语言:javascript
复制
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

代码语言:javascript
复制
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

代码语言:javascript
复制
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'    
EN

回答 1

Stack Overflow用户

发布于 2016-07-26 03:02:45

根据v5.0文档,预定义的格式用于mouseformat

代码语言:javascript
复制
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"

我给出了一个例子,使用:

代码语言:javascript
复制
set timefmt '%Y-%m-%dT%H:%M:%S'
set mouse mouseformat 3

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30367589

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档