|
From: Ethan A M. <EAM...@gm...> - 2015-02-09 01:00:15
|
On Tuesday, 03 February 2015 05:37:50 PM Kevin Klein wrote: > I am trying to use Gnuplot 5's hypertext labels in conjunction with > multiple datasets on the same plot and am finding that when I add the > hypertext labels it removes the identifying color markings in my key. > > The following works fine and produces a plot with a legend/key in the upper > right with a blue box next to v5 and a green box next to v6: > > set term svg size 600,400 dynamic mousing name "test" > set output "test.svg" > plot "data_file.txt" using 1:2 title 'v5' w point pt 5 lc rgb 'blue', > "data_file.txt" using 4:5 title 'v6' w point pt 5 lc rgb 'green' > > Now I want to recreate the same plot with some hypertext labels: > > set term svg size 600,400 dynamic mousing name "test" > set output "test.svg" > plot "data_file.txt" using 1:2:3 title 'v5' w labels hypertext point pt 5 > lc rgb 'blue', "data_file.txt" using 4:5:6 title 'v6' w labels hypertext > point pt 5 lc rgb 'green' > > The plot is created and the hypertext labels appear when I mouse over the > data points, but my legend/key in the upper right no longer contains a blue > and green box next to the dataset titles. It is just blank white where the > two separate color points should be. Why is this happening? Each plot style places a corresponding symbol in the key together with its title. "with lines" places a line, "with boxes" places a box, "with points" places a point, and so on. "with labels" does not place a separate symbol because its primary feauture text and the corresponding title already representes text. So your plot "with points" showed a point in the key. Your plot "with labels" did not. Hypertext is actually not relevant here. Having said that, I am sympathetic to the idea that a plot using "with labels point pointtype 7 lc 'green'" could place a filled green circle next to the plot title just as it does next to each label in the plot itself. I suggest you add that as a Feature Request on the issues tracker on the project's SourceForge page. Meanwhile you could use the approach in the hypertext demo http://gnuplot.sourceforge.net/demo_svg_5.0/hypertext.html The data is plotted twice, once "with points" and then again "with labels hypertext". The demo doesn't use a key, but if you enable the key then the "with points" plot will be represented by a corresponding point sample in the key. Ethan > > > Here are the contents of data_file.txt: > > 150 1 x1 185 1 x1 > 105 1 x2 140 1 x2 > 140 1 x3 180 1 x3 |