Quantcast

Using title columnheader

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using title columnheader

Frazer Williams
Hi,

I generate data files consisting of x,y data for a number of different times.
I would like gnuplot to plot the data for each of the times, along with a title
that is something like "t=0.1".  So far I have been unsuccessful.  I would
appreciate suggestions.  I can write the data file in any format that works.

I am putting the data for each time sequentially in the file, with two blank
lines between data sets.  I am putting a line like

TIME "t=0.1"

at the start of each set.  In other words, the file looks like

TIME "t=0.1"
1  10
2  20
3  40


TIME "t=0.2"
1  20
2  30
3  53

and so forth.

I have tried to plot it with

plot "graph.dat" using 1:2:((column(-2)) lc variable title columnheader

This gives me the first (t=0.1) plot, with the correct title, but the remainder
of the sets are plotted but have no title.  I get a similar result with

set key autotitle columnhead
plot "graph.dat" using 1:2:((column(02)) lc variable

I am using gnuplot 4.4, patchlevel 0.

It seems this ought to be possible.  Any help would be appreciated.

Thanks.

Frazer


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gnuplot-info mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using title columnheader

thse
plot for [i=0:1] "graph.dat" using 1:2:-2 index i lc variable title columnheader

Frazer Williams wrote
Hi,

I generate data files consisting of x,y data for a number of different times.
I would like gnuplot to plot the data for each of the times, along with a title
that is something like "t=0.1".  So far I have been unsuccessful.  I would
appreciate suggestions.  I can write the data file in any format that works.

I am putting the data for each time sequentially in the file, with two blank
lines between data sets.  I am putting a line like

TIME "t=0.1"

at the start of each set.  In other words, the file looks like

TIME "t=0.1"
1  10
2  20
3  40


TIME "t=0.2"
1  20
2  30
3  53

and so forth.

I have tried to plot it with

plot "graph.dat" using 1:2:((column(-2)) lc variable title columnheader

This gives me the first (t=0.1) plot, with the correct title, but the remainder
of the sets are plotted but have no title.  I get a similar result with

set key autotitle columnhead
plot "graph.dat" using 1:2:((column(02)) lc variable

I am using gnuplot 4.4, patchlevel 0.

It seems this ought to be possible.  Any help would be appreciated.

Thanks.

Frazer


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gnuplot-info mailing list
gnuplot-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using title columnheader

Frazer Williams
Thomas Sefzick <t.sefzick <at> fz-juelich.de> writes:


> plot for [i=0:1] "graph.dat" using 1:2:-2 index i lc variable title
> columnheader


Thanks.  That almost works.  I get the plots I want, with the graph lines in
different colors, but the sample lines in the keys are all solid black, so the
keys don't help a lot.  Is there something else I should do?

On related topic, it would also be nice if there were some way to read in the
number of data sets from the input file, so I could write something like

plot for [i=0:n]

Is there any way to do that?  It appears I can just write

plot for [i=0:20]

where 20 is assumed larger than the number of data sets I'll ever have.  That
gets me some warnings, but otherwise seems to work.

Thanks for the response and for your time.

Frazer



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gnuplot-info mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using title columnheader

Frazer Williams
In reply to this post by thse

Thomas Sefzick <t.sefzick <at> fz-juelich.de> writes:


> plot for [i=0:1] "graph.dat" using 1:2:-2 index i lc variable title
> columnheader


Thanks for the reply.  Your suggestion almost works.  When I use it, I get a
plot with multiple lines, each with a different color.  I also get a key with
multiple titles, one for each line.  The problem is that all the sample lines in
the key are solid black, so it is difficult to know which line on the plot
belongs with each title.  Is there something else I should be doing?

Also, a minor problem is that it would be nice to be able to determine the value
of n from the file, something like

  plot for [i=0:n]

where n is determined from "graph.dat".  A work-around is
 
  plot for [i=0:20]

where I assume the number of lines to be plotted is < 20.  That gives some
warnings, but works otherwise.

Thank you for your time.

Frazer

P.S.  I submitted this followup several days ago, but it didn't appear, so I'm
reposting.  I apologize if it becomes a multiple post.




------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gnuplot-info mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using title columnheader

thse
the black sample lines are due to a bug which is in version 4.4.0
the development version (4.5) works properly.

Frazer Williams wrote
Thomas Sefzick <t.sefzick <at> fz-juelich.de> writes:


> plot for [i=0:1] "graph.dat" using 1:2:-2 index i lc variable title
> columnheader


Thanks for the reply.  Your suggestion almost works.  When I use it, I get a
plot with multiple lines, each with a different color.  I also get a key with
multiple titles, one for each line.  The problem is that all the sample lines in
the key are solid black, so it is difficult to know which line on the plot
belongs with each title.  Is there something else I should be doing?

Also, a minor problem is that it would be nice to be able to determine the value
of n from the file, something like

  plot for [i=0:n]

where n is determined from "graph.dat".  A work-around is
 
  plot for [i=0:20]

where I assume the number of lines to be plotted is < 20.  That gives some
warnings, but works otherwise.

Thank you for your time.

Frazer

P.S.  I submitted this followup several days ago, but it didn't appear, so I'm
reposting.  I apologize if it becomes a multiple post.




------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gnuplot-info mailing list
gnuplot-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...