|
From: Ethan A M. <eam...@gm...> - 2018-01-28 19:17:27
|
On Sunday, 28 January 2018 17:46:41 Daniel Boles wrote: > (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) Welcome. It seems that you are accelerating rapidly up the learning curve. > 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. When reporting a problem or asking a specific question please 1) tell us exactly what version of gnuplot you are using 2) show the commands you already tried that either didn't work or produced an unexpected result. If it requires data in a specific format, show that also. I think, but I'm not 100% sure, that what you want is possible in the current release version of gnuplot (5.2.2). See the discussion attached to tracker issue #1968 https://sourceforge.net/p/gnuplot/bugs/1968/ That discussion ends with a note that a "using" specifier can now (Sept 2017) call columnhead(index) as a function. However the test case shown does not involve hypertext, and it uses real column headers rather than index labels. So it might not cover your specific data format. If not, please provide an example data file and the hypertext command you are trying to use. You can attach these to the above issue tracker and I will re-open the bug if appropriate. Ethan > 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! -- |