Batch plot in GNUplot

theironhide

Can anyone please help me with batch plotting in GNUplot? I have to plot around 20 of them. The file which contains the GNUplot commands, need to be changed only at two places to account for different filenames.

    set output "~/NEW1_line_hist_F1.eps"
    .
    .
    .
    .
    plot '~/performancePlotLineAndHist_F1.txt'   using 2: xtic(1) title column with histogram  , ''  using 3: xtic(1) title column with histogram

The files names vary from "...F1.txt" to "...F21.txt" and "...F1.eps" to "...F21.eps".

Is there a way I can automate the entire thing without having to manually update the 2 values manually and then run the code over and over again? Thanks in advance.

andyras

There sure is! You will want to use a do loop:

do for [ii=1:21] {
  set output 'F'.ii.'.eps'
  plot '~/performancePlotLineAndHist_F'.ii.'.txt' using ...
}

Side note: you may also want to store all those files in a place other than your home directory.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related