Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to treat the first line of the data file as column labels in gnuplot?

Tags:

I have a table like this:

A B C D E F G H I  10 23998 16755 27656 17659 19708 20328 19377 18925 20 37298 33368 53936 41421 44548 40756 40985 37294 

I use this command to plot

plot "C:/file.txt" using 1:2 with lines smooth bezier, "C:/file.txt" using 1:3 with lines smooth bezier, ... 

However, all the labels come out as the file name. Is it possible for gnuplot to read the first row and label the lines accordingly?

like image 963
Verhogen Avatar asked Apr 21 '09 17:04

Verhogen


People also ask

How use Gnuplot to plot data from a file?

To plot functions simply type: plot [function] at the gnuplot> prompt. Discrete data contained in a file can be displayed by specifying the name of the data file (enclosed in quotes) on the plot or splot command line. Data files should have the data arranged in columns of numbers.

What files can gnuplot open?

Gnuplot can read binary data files. However, adequate information about details of the file format must be given on the command line or extracted from the file itself for a supported binary filetype. In particular, there are two structures for binary files, a matrix binary format and a general binary format.

Does R use gnuplot?

gnuplot can be used from various programming languages to graph data, including Perl (via PDL and other CPAN packages), Python (via gnuplotlib, Gnuplot-py and SageMath), R via (Rgnuplot), Julia (via Gaston.


1 Answers

 set key autotitle columnhead 
like image 159
Svante Avatar answered Sep 23 '22 00:09

Svante