I have a gnuplot data file:
Requested_width,Requested_depth,Requested_word,Name,N,M,Cycle_time,Clk2Q,Area,Total_Area
24,512,24,R1F512X24M8P24,1,1,1.9820,,7446.102,7446
24,512,24,R1F512X24M4P24,1,1,1.9937,,6757.0596,6757
....
I want to scatter plot columns 7 and 9 (this I can do!), then I want the name in column 4 to appear when I mouse over a data point. I think it will be too cluttered to have all labels present at all times.
This is completely possible in gnuplot4.7 (the current development branch), but not in previous versions -- The following works just fine when input from an interactive prompt:
set term wxt
set termoption enhanced
set datafile sep ','
plot 'test.dat' u 7:9:4 w labels hypertext point pt 7
If you put it in a script, you need to invoke gnuplot as gnuplot -persist script.gp
.
Just use hypertext and specify the correct terminal, you can make hypertext works.
1) You need to use hypertext as describe in GNUPlot manual link, page 122:
set label at 0,0 "Plot origin" hypertext point pt 1
plot 'data' using 1:2:0 with labels hypertext point pt 7 \
title 'mouse over point to see its order in data set'
2) There are currently 3 terms that support hypertext: canvas(HTML5), svg, and wxt. Let's take canvas as an example, on page 182 of the manual, there is an example show you how to use canvas:
set term canvas name 'fishplot'
set output 'fishplot.js'
And a minimal HTML file:
<html>
<head>
<script src="canvastext.js"></script>
<script src="gnuplot_common.js"></script>
</head>
<body onload="fishplot();">
<script src="fishplot.js"></script>
<canvas id="fishplot" width=600 height=400>
<div id="err_msg">No support for HTML 5 canvas element</div>
</canvas>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With