【发布时间】:2015-03-31 10:26:08
【问题描述】:
我正在尝试在 Cygwin/x 中运行的 Gnuplot(版本 5.0 补丁级别 0 上次修改时间为 2015-01-01)中使用超文本功能。
脚本 (test_script.gp) 取自 gnuplot 官方文档(超文本部分或http://gnuplot.sourceforge.net/demo_canvas/):
#
# Demonstrates how to attach hypertext to points so that
# the text is displayed on mouse-over.
# Not much to see here unless you are using the wxt, svg, qt,
# or HTML5 canvas terminal.
#
set terminal canvas solid butt size 600,400 enhanced fsize 10 lw 1 fontscale 1 name "hypertext_1" jsdir "." mousing
#set output 'hypertext.1.js'
unset border
unset key
set encoding utf8
set datafile separator " "
set size ratio 1 1,1
set noxtics
set noytics
set title "Hypertext is shown when the mouse is over a point"
Scale(size) = 0.08*sqrt(sqrt(column(size)))
City(String,Size) = sprintf("%s\npop: %d", stringcolumn(String), column(Size))
GPFUN_Scale = "Scale(size) = 0.08*sqrt(sqrt(column(size)))"
GPFUN_City = "City(String,Size) = sprintf(\"%s\\npop: %d\", stringcolumn(String), column(Size))"
plot 'cities.dat' using 5:4:(City(1,3)):(Scale(3)) with labels hypertext point pt 7 ps var lc rgb "#ffee99", 'cities.dat' using 5:4:(City(1,3)):(Scale(3)) with labels hypertext point pt 6 ps var lc rgb "black" lw 0.1
pause -1 "hit return to continue"
set encoding save_encoding
reset
从 cygwin/x 终端调用这个脚本
gnuplot -persist test_script.gp
不会产生任何新窗口打开,但在终端中仅返回一种 html 语言的翻译。 是否有可能有一个新的 gnuplot 窗口,其中显示了所需的绘图,并且无需 html5 浏览器就可以实现鼠标“悬停”功能(超文本)?
【问题讨论】: