【问题标题】:Gnuplot Hypertext in canvas terminal画布终端中的 Gnuplot 超文本
【发布时间】: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 浏览器就可以实现鼠标“悬停”功能(超文本)?

【问题讨论】:

    标签: cygwin gnuplot


    【解决方案1】:

    Gnuplot 具有基于文件的交互式终端。 canvas 终端是基于文件的,即 gnuplot 生成一个输出文件,您必须使用适当的查看器查看该文件。

    如果您想直接查看结果,请使用交互式终端,它也支持hypertext 选项(至少wxtqtwindows 终端,无法测试aquax11)。顺便说一句:这也是您的示例文件中的注释告诉您的内容!

    【讨论】:

    • 感谢克里斯托夫的回答。该评论还告诉我支持画布 btw wxt,qt 并且 windows 终端未显示在我从 gnuplot 中的“设置终端”获得的终端列表中。有什么帮助吗?
    • 如果 cygwin 不提供这些终端之一,您需要自己在 cygwin 上编译 gnuplot。或者您可以直接使用 Windows 二进制文件,无需 cygwin。
    • 您能告诉我如何在 cygwin 中添加这些终端之一吗?我在哪里可以找到源文件或二进制文件?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-08
    • 1970-01-01
    • 2012-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多