|
From: Daniel B. <dbo...@gm...> - 2018-01-28 17:46:49
|
(Just started using gnuplot 2 days ago, so I might've missed a trick here, but I like to think I read and absorb documentation at a rapid rate) I have a datafile with multiple blocks, each of which is headed by a title. Each block represents a series on my line graph. I can't hard-code these, because the count and names of series are totally arbitrary. I then do a "plot for" until STATS_blocks, and this gets me the desired lines. Using "set autotitle columnheader" or "title columnheader(optional index)", I can make the title of each block visible in the key. So far, so great! However, I now want to be able to use that title elsewhere - chiefly, in the mousing tooltip (with "hypertext point"). This is because, although I generate unique colours and cycling pointttypes per series, on datasets with many series they can still be difficult to tell apart. Also, I just love tooltips! The problem is it seems columnheader(optional index) can only be used alongside [auto]title, not anywhere else, e.g. the "using" for the hypertext point or as a function arg to stuff it in a variable. So, for now, I have to have the script that prepares my dataset write out the indexes into its titles above each block, then just use column(-2) in my tooltip - so at least users can have some way to marry a point on a dataseries with its tooltip, to the corresponding title shown in the key. That's better than nothing, but it's an extra hassle to have to do that lookup; I want to see the title directly. While it's probably possible to have gnuplot run through the file and stash the block titles in an array to be used later - or even just to have my script preparing the dataset write an extra column with the title duplicated, or the full text of the tooltip... I feel like it shouldn't be this difficult just to reuse a piece of data that gnuplot already has available in a tooltip. And that makes me hopeful that I've just overlooked an easy way. So, is there one you can think of? If not, is it possible that columnheader() could be made usable in more contexts? Not necessarily everywhere, but it makes sense here to me; the tooltip has all columns; data available, after all, so why not headers too? Thanks! |