0
votes

I'm trying to use the Hypertext functionality in Gnuplot (Version 5.0 patchlevel 0 last modified 2015-01-01) which is running in Cygwin/x.

The script (test_script.gp) is taken from the offical gnuplot official documentation (Hypertext section or at 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

Calling this script fromt he cygwin/x teminal as

gnuplot -persist test_script.gp

does not produce any new window openining but returns in terminal only a sort of translation in html language. Is there any possibility to have a new gnuplot window with the desired plot showed in it and that makes possible the mouse "hovering" functionality (hypertext) without the need of an html5 browser?

1

1 Answers

0
votes

Gnuplot has file-based and interactive terminals. The canvas terminal is file-based, i.e. gnuplot generates an output file which you must view with an appropriate viewer.

If you want to view the results directly, use an interactive terminal, which do also support the hypertext option (at least the wxt, qt and windows terminals, couldn't test aqua and x11). BTW: This is also what the comment in your example file tells you!