Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ethan Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Set plot title from datafile? Date: Thu, 2 Aug 2018 16:44:37 -0000 (UTC) Organization: A noiseless patient Spider Lines: 41 Message-ID: References: <7f451633-8c55-48bc-92ad-ac5351eaff07@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 2 Aug 2018 16:44:37 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="dd79a89a86acc2c9e1d3298622c826c9"; logging-data="27793"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DPx78XozZxHIDTF67hc/K" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:aNWxFFt1KhRZTaLe8zqusOcNQ6Q= Xref: csiph.com comp.graphics.apps.gnuplot:4027 On Thu, 02 Aug 2018 08:02:12 -0700, rowlesmr wrote: > How can I set the title of my plot from a string in my data file? > > My data is like so: [snip] > > and I'm plotting it with a nested for loop like so: > >>set key autotitle columnhead do for [j=0:1] { >> do for [i=4:8] { >> plot 'data.txt' index j u 2:i w lp t columnhead >> } >>} > > I am successfully setting the key from the header information. I would > like the title for each graph to be taken from the text string in the > 3rd column (ie corundum or silcon_NIST). I know that this would give > many graphs with the same title. > > > Is this possible? If so, how can I do it? > > I am using gnuplot 5.2 patchlevel 2 in Cygwin It is not possible in 5.2 In the development version (5.3) you could do it in two steps, which might or might not be OK in your application case: do for [i=4:8] { unset title plot 'data.txt' index j u 2:i w lp title (FOO=columhead(i)) set title FOO replot } Ethan