I am having trouble using a for loop in gnuplot inside the plot command. Here is a pared down gnuplot script, which focuses on the parts that aren't working:
set multiplot layout 1, 3 title "Convergence Plots"
planeIter=4
do for [ringIter=0:20:10] {
    if (ringIter == 0) {ringName="outer"} else {if (ringIter == 10) {ringName="middle"} else {ringName="inner"}}
    set title "Pressure in ".ringName." ring"
    plot for [quadIter=0:90:30] path1 every ::5 using 1:(1 + planeIter + ringIter + quadIter) notitle   # title quadName.' quadrant' with lines
#   if (quadIter == 0) {quadName="first"} else {if (quadIter == 30) {quadName="second"} else {if (quadIter == 60) {quadName="third"} else {quadName="fourth"}}}
}
My questions are:
- Where/how can I include the (commented out) if/else statement, so that I can replace 'notitle' in the line above with the 'title' after the # symbol?
- The lines plotted should be of the following columns in p: (1:5, 1:35, 1:65, 1:95), (1:15, 1:45, 1:75, 1:105) and (1:25, 1:55, 1:85, 1:115) but instead of taking the value in the second column (5, 35, 65, ...) it plots the column number (i.e. a constant). How can I get the plot command to select the values inside the columns?
I have included an image of what it looks like and what it should look like (below), which I have generated by not using for loops and variables for quadName.

The file, p, is a list of numbers, each row containing 121 columns.
Thank you for any help you can provide.