Different set key multiplot gnuplot


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Different set key multiplot gnuplot
# 1  
Old 07-08-2018
Different set key multiplot gnuplot

Hello everybody,

I am using Windows 10. I need to plot several graphs simultaneously with Gnuplot. The script is:

Code:
 
GNUTERM = "wxt"
set terminal wxt
set termoption enhanced
set encoding iso_8859_1
set multiplot layout 2,3
set xtics out
set ytics out
set xtics nomirror
set ytics nomirror
set xzeroaxis linetype 2 linewidth 1.5
show xzeroaxis
# Graph1
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 1"
set xlabel "x"
set ylabel "y"
plot \
"results_1.dat" u 1:2:4 title "exp." with e pointtype 9 pointsize 0.5 linecolor rgb "red" , \
"results_1.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph2
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 2"
set xlabel "x"
set ylabel "y"
plot \
"results_2.dat" u 1:2:4 title "exp." with e pointtype 9 pointsize 0.5 linecolor rgb "blue", \
"results_2.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph3
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 3"
set xlabel "x"
set ylabel "y
plot \
"results_3.dat" u 1:2:4 title "exp." with e pointtype 9 linecolor rgb "red", \
"results_3.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph4
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 4"
set xlabel "x"
set ylabel "y"
plot \
"results_4.dat" u 1:2:4 title "exp." with e pointtype 9 linecolor rgb "red", \
"results_4.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph5
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 5"
set xlabel "x"
set ylabel "y"
plot \
"results_5.dat" u 1:2:4 title "exp." with e pointtype 9 linecolor rgb "red", \
"results_5.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph6
set xrange [2.5:9.5]
set yrange [-0.1:1.10]
set key outside maxcols 1
set title "Title 6"
set xlabel "x"
set ylabel "y"
plot \
"results_6.dat" u 1:2:(0.1) title "XXXXXXXXXXXXXXXXXXXXXXXXX" with circles linecolor rgb "red" fill solid noborder, \
"results_6.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "red", \
"results_7.dat" u 1:2:(0.1) title "YYYYYYYYYYYYYYYYYYYYYYYYY" with circles linecolor rgb "blue" fill solid noborder, \
"results_7.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "blue", \
"results_8.dat" u 1:2:(0.1) title "ZZZZZZZZZZZZZZZZZZZZZZZZZ" with circles linecolor rgb "orange" fill solid noborder, \
"results_8.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "orange", \
"results_9.dat" u 1:2:(0.1) title "AAAAAAAAAAAAAAAAAAAAAAAAA" with circles linecolor rgb "black" fill solid noborder, \
"results_9.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "black", \
"results_aa.dat" u 1:2:(0.1) title "BBBBBBBBBBBBBBBBBBBBBBBBB" with circles linecolor rgb "violet" fill solid noborder, \
"results_aa.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "violet", \
"results_bb.dat" u 1:2:(0.1) title "CCCCCCCCCCCCCCCCCCCCCCCCC" with circles linecolor rgb "red" fill solid noborder, \
"results_bb.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "red", \
"results_cc.dat" u 1:2:(0.1) title "DDDDDDDDDDDDDDDDDDDDDDDDD" with circles linecolor rgb "blue" fill solid noborder, \
"results_cc.dat" u 1:3:(0.1) title "fit." with circles linecolor rgb "blue"
unset multiplot
pause 3
reread

I have two issues: (see attached image)

a) I would like to have the legends for graphs 1 to 5 on the top right position (inside the graphs) and that of graph 6 outside.

b) I would like graph 6 to have the same size than all the other graphs and the legend of graph 6 to be next to it on a 4th column.

Any help is appreciated, thanks.

Supernono06
Different set key multiplot gnuplot-plotpng
# 2  
Old 07-08-2018
If you want a table and its key to take the space of two tables in your output, you'll have to change table 6 to be tables 6 and 7 with the plot in table 6 and the key for table 6 in table 7. And, of course, you'll have to change:
Code:
set multiplot layout 2,3

to:
Code:
set multiplot layout 2,4

# 3  
Old 07-08-2018
Thanks Don Cragun. But I don't know how to do that, can you please give me an example or show me? Also how to differentiate the position of the legends in the different subplots?
# 4  
Old 07-08-2018
I'm afraid I can't help much with examples of how to do it. I don't have gnuplot installed on my system, so I don't have any way to play with suggestions so I could verify whether or not they might work.
# 5  
Old 07-10-2018
For the first issue, once the outside option is used, one has to add inside for all other keys
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies

2. Linux

Gnuplot terminal set to 'unknown'

I installed version 4.6.4 of gnuplot recently on my system running 10.04 ubuntu linux. I am getting error Terminal type set to 'unknown' Also when i try to set term X11 or wxt i get error Terminal type set to 'unknown' ^ unknown or ambiguous terminal... (5 Replies)
Discussion started by: Ujjwal1982
5 Replies

3. Shell Programming and Scripting

Grep final set of parameters from fit.log gnuplot file

I would like to grep the final set of fit parameters from a gnuplot log file to form columns that look like this. a_1001 b_1001 x_1001 a_1002 b_1002 x_1002 a_1003 b_1003 x_1003 . . . . . . . . . a_1250 b_1250 c_1250 At... (8 Replies)
Discussion started by: kayak
8 Replies

4. Shell Programming and Scripting

gnuplot set key issue

Hi I have a plotting function like this- plot '../processing_old/time0.txt' using 1:6 title "1.6" with boxes fs solid 0.05 ls 5,\ 'time0.txt' using 1:6 title "1.7" with boxes fs solid 0.05 ls 6,\ '../processing_new/time0.txt' using 1:6 title "2.0" with boxes fs solid... (8 Replies)
Discussion started by: jamie_123
8 Replies

5. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

6. Shell Programming and Scripting

How to set delete Key to erase automatically

We need to su to root in 1000 systems, so it is almost impossible to add "stty erase ^H" to every .profile on these systems. Is there any way to set delete key to erase automatically after running "su -"? Thanks :) (4 Replies)
Discussion started by: aixlover
4 Replies

7. Solaris

How to set history key in Solaris

Hi Solaris guys, I just have my solaris 10 setup on x86 old box... How can i get history key? eg. Linux using up/down arrow key to call history command... HPUX using Esc-k How can i do the samething in Solaris? Thanks in advanced! Regards, gary (3 Replies)
Discussion started by: timontt
3 Replies

8. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies
Login or Register to Ask a Question