Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #4026

Set plot title from datafile?

Newsgroups comp.graphics.apps.gnuplot
Date 2018-08-02 08:02 -0700
Message-ID <7f451633-8c55-48bc-92ad-ac5351eaff07@googlegroups.com> (permalink)
Subject Set plot title from datafile?
From rowlesmr@gmail.com

Show all headers | View raw


How can I set the title of my plot from a string in my data file?

My data is like so:

>filename        seqno   phasename       a       b       c       scale   Rwp
>blah_001.xye    1       corundum        3       3       12      0.001   3
>blah_002.xye    2       corundum        3.1     3.1     12.1    0.002   3.5
>blah_003.xye    3       corundum        3.2     3.2     12.2    0.001   3.1
>blah_004.xye    4       corundum        3.4     3.4     12.2    0.001   3.2
>blah_005.xye    5       corundum        3.5     3.5     12.3    0.001   3.9
>blah_006.xye    6       corundum        3.6     3.6     12.3    0.001   3.1
>
>
>filename        seqno   phasename       a       b       c       scale   Rwp
>blah_001.xye    1       silcon_NIST     5.4     5.4     5.4     0.002   3
>blah_002.xye    2       silcon_NIST     5.41    5.41    5.41    0.004   3.5
>blah_003.xye    3       silcon_NIST     5.42    5.42    5.42    0.002   3.1
>blah_004.xye    4       silcon_NIST     5.43    5.43    5.43    0.002   3.2
>blah_005.xye    5       silcon_NIST     5.44    5.44    5.44    0.002   3.9
>blah_006.xye    6       silcon_NIST     5.45    5.45    5.45    0.002   3.1


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



Thanks

Matthew

Back to comp.graphics.apps.gnuplot | Previous | NextNext in thread | Find similar


Thread

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