4

I've just read Gnuplotting data without a textfile, and I want to do the same thing, but with a "multi-plot". I currently have:

plot 'data.csv' using 1:3:2:6:5:7:xticlabels(8) with candlesticks title 'Quartiles' whiskerbars, \
  ''         using 1:4:4:4:4:4 with candlesticks lt -1 notitle

and I want to inline the data in data.csv.

1 Answer 1

5

This is easy enough:

set multiplot layout 1,2
plot '-' u 1:2
1 2
2 3
3 4  
e

plot '-' u 1:2
2 3
3 4
4 5
e

Note that inline data is not really particularly happy with the '' pseudofile. You would actually need to include your entire data again at that point. So, If you want 2 traces on the same subplot of a multiplot:

set multiplot layout 1,2
plot '-' u 1:2, '-' u 1:3
1 2 3
4 5 6
7 8 9
e
1 2 3
4 5 6
7 8 9
e

plot '-' u 1:($2*$3)
1 2 3
4 5 6
7 8 9
e

This ends up being the same thing as if you had a datafile data.txt:

#data.txt
1 2 3
4 5 6
7 8 9

and plotted it with this (much simpler) script:

set multiplot layout 1,2
plot 'data.txt' u 1:2, '' u 1:3
plot '' u 1:($2*$3)
Sign up to request clarification or add additional context in comments.

3 Comments

So, there's absolutely no alternative to having the data inlined (at least) twice?
I don't really think so. You might be able to accomplish something with the volatile keyword and using refresh, but I sort of doubt it.
Congrats to the gnuplot gold badge :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.