Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #4028
| Newsgroups | comp.graphics.apps.gnuplot |
|---|---|
| Date | 2018-08-02 18:35 -0700 |
| References | <7f451633-8c55-48bc-92ad-ac5351eaff07@googlegroups.com> <pjvcdk$r4h$1@dont-email.me> |
| Message-ID | <f60d1d36-0bfc-4432-829e-6b1c54878db2@googlegroups.com> (permalink) |
| Subject | Re: Set plot title from datafile? |
| From | rowlesmr@gmail.com |
On Friday, 3 August 2018 00:44:38 UTC+8, Ethan Merritt wrote:
> 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
Thanks Ethan
Is it possible to set the title as a particular columnhead? eg the third one? I could do some preprocessing to put the string I want into that position.
Matthew
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