Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #4027
| From | Ethan Merritt <eamerritt@gmail.com> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Set plot title from datafile? |
| Date | 2018-08-02 16:44 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <pjvcdk$r4h$1@dont-email.me> (permalink) |
| References | <7f451633-8c55-48bc-92ad-ac5351eaff07@googlegroups.com> |
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
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar
Set plot title from datafile? rowlesmr@gmail.com - 2018-08-02 08:02 -0700
Re: Set plot title from datafile? Ethan Merritt <eamerritt@gmail.com> - 2018-08-02 16:44 +0000
Re: Set plot title from datafile? rowlesmr@gmail.com - 2018-08-02 18:35 -0700
Re: Set plot title from datafile? Ethan Merritt <eamerritt@gmail.com> - 2018-08-03 16:24 +0000
csiph-web