1

I have a for-loop like

 for[i=2:12] for[j in "3 6 8"] {code}

In my code I plot something and i'd like to put something in the title, such as "things and stuff value1" and value1 is calculated over i and j, for example

value1=i*j+1/2.

How can I calculate it then, for example in the title or a label?

Martin
  • 439
  • 1
  • 4
  • 8
  • 1
    I think you missed the language tag, can you hit [edit] and add that, please? – rene Dec 22 '14 at 12:05
  • Also, please read the description for `tag:title`. As a new user, you probably want to take the [Friendly Introductory Tour](http://stackoverflow.com/tour). – Jongware Dec 22 '14 at 12:08
  • Thanks for the answer...i don't know what you mean with language tag though – Martin Dec 22 '14 at 12:11
  • 1
    possible duplicate of [Loop structure inside gnuplot?](http://stackoverflow.com/questions/14946530/loop-structure-inside-gnuplot) – andyras Dec 22 '14 at 13:44

1 Answers1

1

You can have a for loop inside a plot command:

plot for [ii=2:12] for [jj in "3 6 8"] x*ii*jj title 'x*'.ii."*".jj
andyras
  • 15,542
  • 6
  • 55
  • 77