Point color in gnuplot 4.0 - gnuplot

When I try to plot three separate data files using gnuplot, I get an error "';' expected" in the output when I try to change the point color of the data sets.
For example, this works fine:
set terminal jpeg size 900,500
set xlabel 'x axis label'
set ylabel 'y axis label'
set title 'sample title'
set output "output.jpeg"
set xrange [-0.1:1.1]
set yrange [] reverse
set xtics 0.10
#set ytics 100
set key top left
set grid ytics lt 0 lw 1
set grid xtics lt 0 lw 1
plot 'file1.dat' u 1:2 w p pt 7 ps 0.8 ti 'dataset 1', \
'file2.dat' u 1:2 w p pt 6 ps 0.8 ti 'dataset 2', \
'file3.dat' u 1:2 w p pt 5 ps 0.8 ti 'dataset 3'
This does not:
set terminal jpeg size 900,500
set xlabel 'x axis label'
set ylabel 'y axis label'
set title 'sample title'
set output "output.jpeg"
set xrange [-0.1:1.1]
set yrange [] reverse
set xtics 0.10
#set ytics 100
set key top left
set grid ytics lt 0 lw 1
set grid xtics lt 0 lw 1
plot 'file1.dat' u 1:2 w p pt 7 ps 0.8 lc 9 ti 'dataset 1', \
'file2.dat' u 1:2 w p pt 6 ps 0.8 ti 'dataset 2', \
'file3.dat' u 1:2 w p pt 5 ps 0.8 ti 'dataset 3'
Why is this? Is there a workaround to simply change point color independent of point style and size?
Thanks!

The keyword linecolor (lc) was introduced in version 4.2. In your case you can change the color using linetype (lt):
set terminal jpeg size 900,500
set output "output.jpeg"
plot 'file1.dat' u 1:2 w p pt 7 ps 0.8 lt 9 ti 'dataset 1'
But I also strongly recommend you to upgrade!

Related

Linked top x-axis in Gnuplot

My test.dat file is given below
6.78E-01 -1.907881356 -1.938152542 -1.994762712 -4.409491525 -3.707118644 -2.623559322 -1.903389831 -1.891452492 -1.880469492 -2.009079661 -1.835169492 -2.193627119
6.73E-01 -1.828333333 -1.861727273 -1.916205387 -4.308956229 -3.614276094 -2.547508418 -1.823097643 -1.811922731 -1.800939731 -1.930919529 -1.757255892 -2.114855219
6.69E-01 -1.749849498 -1.786324415 -1.838698997 -4.209765886 -3.522675585 -2.472474916 -1.743879599 -1.733456913 -1.722473913 -1.853805017 -1.680384615 -2.037137124
6.64E-01 -1.672408638 -1.711923588 -1.762222591 -4.111893688 -3.432292359 -2.398438538 -1.665714286 -1.656033831 -1.645050831 -1.777715282 -1.604534884 -1.960451827
6.60E-01 -1.595990099 -1.63850495 -1.686755776 -4.015313531 -3.34310231 -2.325379538 -1.588580858 -1.579632835 -1.568649835 -1.702630033 -1.529686469 -1.884778878
6.56E-01 -1.52057377 -1.56604918 -1.612278689 -3.92 -3.255081967 -2.253278689 -1.512459016 -1.50423382 -1.49325082 -1.628529508 -1.455819672 -1.810098361
6.51E-01 -1.446140065 -1.494537459 -1.538771987 -3.825928339 -3.168208469 -2.182117264 -1.43732899 -1.429817202 -1.418834202 -1.555394463 -1.382915309 -1.736390879
6.47E-01 -1.372669903 -1.423951456 -1.466216828 -3.733074434 -3.082459547 -2.111877023 -1.363171521 -1.356363906 -1.345380906 -1.483206149 -1.310954693 -1.66363754
6.43E-01 -1.300144695 -1.354273312 -1.394594855 -3.641414791 -2.997813505 -2.042540193 -1.289967846 -1.283855347 -1.272872347 -1.411946302 -1.239919614 -1.591819936
6.39E-01 -1.228546326 -1.285485623 -1.323888179 -3.550926518 -2.914249201 -1.974089457 -1.217699681 -1.212273415 -1.201290415 -1.341597125 -1.169792332 -1.520920128
6.35E-01 -1.157857143 -1.217571429 -1.254079365 -3.461587302 -2.831746032 -1.906507937 -1.146349206 -1.14160046 -1.13061746 -1.27214127 -1.100555556 -1.450920635
6.31E-01 -1.088059937 -1.150514196 -1.18515142 -3.373375394 -2.750283912 -1.83977918 -1.075899054 -1.071819278 -1.060836278 -1.20356183 -1.032192429 -1.381804416
6.27E-01 -1.019137931 -1.084297806 -1.117087774 -3.286269592 -2.66984326 -1.773887147 -1.006332288 -1.002913094 -0.991930094 -1.13584232 -0.96468652 -1.313554859
6.23E-01 -0.951074766 -1.018906542 -1.049872274 -3.200249221 -2.590404984 -1.708816199 -0.937632399 -0.934865555 -0.923882555 -1.068966667 -0.898021807 -1.246155763
6.19E-01 -0.883854489 -0.954325077 -0.983489164 -3.115294118 -2.511950464 -1.644551084 -0.869783282 -0.867660709 -0.856677709 -1.002919195 -0.832182663 -1.179591331
6.15E-01 -0.817461538 -0.890538462 -0.917923077 -3.031384615 -2.434461538 -1.581076923 -0.802769231 -0.801283 -0.7903 -0.937684615 -0.767153846 -1.113846154
6.12E-01 -0.751880734 -0.82753211 -0.853159021 -2.948501529 -2.357920489 -1.518379205 -0.736574924 -0.735717251 -0.724734251 -0.873248012 -0.702920489 -1.048905199
6.08E-01 -0.687097264 -0.765291793 -0.789182371 -2.86662614 -2.28231003 -1.456443769 -0.67118541 -0.670948653 -0.659965653 -0.809594833 -0.639468085 -0.984753799
6.04E-01 -0.623096677 -0.703803625 -0.725978852 -2.785740181 -2.207613293 -1.395256798 -0.606586103 -0.606962758 -0.595979758 -0.746710876 -0.576782477 -0.921377644
I use the following code in gnuplot to check the plot
set terminal postscript eps enhanced colour font 'Times-Roman,12' size 6in,5in
set output "Plot1.eps"
set xtics out scale 1.5
set ytics out scale 1.5
set tics font ", 16"
set xlabel "10^{3}{/Symbol \264} 1/T (K^{-1})" font ",16"
set ylabel "log&{t}{/Times-Italic p}_{Pu({/Times-Italic g}),Pa} " font ",16"
set key outside right top
set key maxrows 12 spacing 2.1 font ",16" width -2
plot [0.60:0.70] 'test.dat.dat' u 1:2 with points pt 1 ps 1.75 lt rgb "red" title "Maeda {/Times-Italic et al.} [7]", \
'' u 1:3 with points pt 1 ps 1.75 lt rgb "blue" title "Pu-20Zr [7]", \
'' u 1:4 with points pt 1 ps 1.75 lt rgb "dark-green" title "Pu-50Zr [7]", \
'' u 1:5 with points pt 2 ps 1.75 lt -1 title "Present work", \
'' u 1:6 with points pt 3 ps 1.75 lt -1 title "Present work", \
'' u 1:7 with points pt 4 ps 1.75 lt rgb "red" title "Alcock [16]", \
'' u 1:8 with points pt 4 ps 1.75 lt rgb "blue" title "Phipps {/Times-Italic et al.} [19]", \
'' u 1:9 with points pt 4 ps 1.75 lt rgb "dark-green" title "Mulford [20]", \
'' u 1:10 with points pt 5 ps 1.75 lt rgb "blue" title "Kent [21]", \
'' u 1:11 with points pt 5 ps 1.75 lt rgb "red" title "Ackermann and Rauh [22]", \
'' u 1:12 with points pt 5 ps 1.75 lt rgb "dark-green" title "Bradbury and Ohse [23]", \
'' u 1:13 with points pt 5 ps 1.75 lt -1 title "Kim and Hofman [24]"
The code runs well. One can see that x axis is related to temperature as 1000/temperature. Now I wanted a linked top x2-axis with temperature in K. So, for example, xrange is from 0.6 to 0.7. Then x2 axis should be from 1000/0.6 to 1000/0.7 i.e. from 1666.67 K to 1428.57 K. So I modified the code based on linkedaxes.dem.
set terminal postscript eps enhanced colour font 'Times-Roman,12' size 6in,5in
set output "Plot2.eps"
set xtics out scale 1.5
set ytics out scale 1.5
set tics font ", 16"
set xtics nomirror
set xlabel "10^{3}{/Symbol \264} 1/T (K^{-1})" font ",16"
set ylabel "log&{t}{/Times-Italic p}_{Pu({/Times-Italic g}),Pa} " font ",16"
set key outside right top
set key maxrows 12 spacing 2.1 font ",16" width -2
set link x2 via 1000./x inverse 1000./x
set x2tics out scale 1.5
set x2label "Temperature (K)" font ",16"
plot [0.60:0.70] 'test.dat' u 1:2 with points pt 1 ps 1.75 lt rgb "red" title "Maeda {/Times-Italic et al.} [7]", \
'' u 1:3 with points pt 1 ps 1.75 lt rgb "blue" title "Pu-20Zr [7]", \
'' u 1:4 with points pt 1 ps 1.75 lt rgb "dark-green" title "Pu-50Zr [7]", \
'' u 1:5 with points pt 2 ps 1.75 lt -1 title "Present work ", \
'' u 1:6 with points pt 3 ps 1.75 lt -1 title "Present work", \
'' u 1:7 with points pt 4 ps 1.75 lt rgb "red" title "Alcock [16]", \
'' u 1:8 with points pt 4 ps 1.75 lt rgb "blue" title "Phipps {/Times-Italic et al.} [19]", \
'' u 1:9 with points pt 4 ps 1.75 lt rgb "dark-green" title "Mulford [20]", \
'' u 1:10 with points pt 5 ps 1.75 lt rgb "blue" title "Kent [21]", \
'' u 1:11 with points pt 5 ps 1.75 lt rgb "red" title "Ackermann and Rauh [22]", \
'' u 1:12 with points pt 5 ps 1.75 lt rgb "dark-green" title "Bradbury and Ohse [23]", \
'' u 1:13 with points pt 5 ps 1.75 lt -1 title "Kim and Hofman [24]"
But the set link does not give the computed values on the top x2 axis. What modifications in code need to be made?
It looks like for some reason (which I don't know) you have to give an increment for the x2tics.
Try the following minimal example:
Code:
### link x2 axis
reset session
set xrange[0.6:0.7]
set xtics nomirror
set link x2 via 1000./x inverse 1000./x
set x2tics 50
plot x
### end of code
Result:

How to manage tick lable and axis-lable in gnu multiplot

I have two files each is having five columns where 1st will be the x-axis in both the data.
I want to make a multiplot 2 2 in GNU with zero spacing.
I could manage many things but I am could not fix below problems:
1. How to place the figure at the center of the page i.e. equal left right margin? I set the left, right, top and bottom margin but it is not working.
2. How to number the figure. For example, Figure 1 1 should be numbered as (a), figure 1 2 should be numbered as (b) and so on.
3. How to put tick lable and tick mark on the plot 1 2 and 2 2 on right side of the plot?
4. how to create a common title at the bottom of the figure representing the X-axis.
I have tried to make gnu multiplot layout but still it is not giving desired results. The script I used is mentioned below:
My code is
[![set terminal postscript eps enhanced size 20cm,15cm color solid lw 3 "Times-Roman" 24
reset
set lmargin screen 0.10
set rmargin screen 0.95
set bmargin screen 0.15
set tmargin screen 0.9
set mxtics 2
set mytics 2
set tics font "Times-bold, 50"
set output "absorption.pdf"
set multiplot layout 2,2 margin 0.2, 0.9, 0.1, 0.9 spacing 0.00, 0.00
set tics scale 1.2
set tics font "Times-bold, 26"
set key spacing 1.2
unset key
set xrange \[0:8.5\]
set yrange \[0:1\]
set xlabel ' '
set format x ""
set ylabel 'A11' font 'Times-bold, 26' offset 1,1,3
unset label
plot "data1.dat" u 1:($2/10**4) w l lw 3 lt 2 lc rgb "red" title "x-D", 'data1.dat' u 1:($3/10**4) w l lw 3 lc rgb "blue" title "z-D"
unset label
unset format x
unset key
set key inside center top # to adjust the legends position
set xrange \[0:8.5\]
set yrange \[0:1\]
set title ' '
set xlabel ' '
set xlabel ' '
set format x ""
set ylabel ' '
set format y " "
set key spacing 1.2
set ylabel 'A12' font 'Times-bold, 26' offset 1,0,3
plot "data1.dat" u 1:($4/10**2) w l lw 3 lt 2 lc rgb "red" title "x-D", 'data1.dat' u 1:($5/10**2) w l lw 3 lt 2 lc rgb "blue" title "Z-D"
unset label
unset format y
unset format x
unset key
set xrange \[0:8.5\]
set yrange \[0:1.08\]
set xlabel ' '
unset label
set ylabel 'A21' font 'Times-bold, 28'
unset label
plot "data2.dat" u 1:($2/10) w l lw 3 lt 2 lc rgb "red" title "x-dir", 'data2.dat' u 1:($4/10) w l lw 3 lt 2 lc rgb "blue" title "z-dir" ,\
unset label
unset format x
unset key
set xrange \[0:8.5\]
set yrange \[0:1.08\]
set title ' '
set format y ""
set xlabel 'X-12-scale' font 'Times-bold, 28'
set ylabel 'A22' font 'Times-bold, 28'
plot "data2.dat" u 1:($3/10) w l lw 3 lt 2 lc rgb "red" title "x-dir", 'data2.dat' u 1:($5/10) w l lw 3 lt 2 lc rgb "blue" title "z-dir"
unset label
unset format y
unset key
unset multiplot
set output][1]][1]
My data should be like what I want according to attached figure queries and hand marks.
Try this
reset
set encoding utf8
set terminal pngcairo size 750,500 font ",10"
set output "Multiplot_2x2.png"
set multiplot \
layout 2,2 rowsfirst \
title "{/:Bold=11 Multiplot 2×2}" \
margins screen 0.10,0.92,0.12,0.90 \
spacing screen 0.00,0.00
set link y2
# Gaussian fuction
f(x,a,b,c) = a*exp(-((x-b)/c)**2)
# Parameters to first one
a1 = 0.95
b1 = 4.00
c1 = 1.00
# Parameters to second one
a2 = 0.95
b2 = 5.00
c2 = 1.00
# Line style
set style line 1 lc "#e41a1c" # red
set style line 2 lc "#377eb8" # blue
# -----------------------------------------------
set xrange [0:10]
set yrange [0:1.0]
set xtics format ""
set ytics
set ylabel "y-label"
set label 1 "{/:Bold (a)}" at graph 0.05, 0.9
plot f(x,a1,b1,c1) w l ls 1 notitle, f(x,a2,b2,c2) w l ls 2 notitle
# -----------------------------------------------
unset ylabel
set ytics format ""
set y2tics format ""
set y2label "y2-label"
set label 1 "{/:Bold (b)}"
plot f(x,a1,b1,c1) w l ls 1 title "Your title 1", f(x,a2,b2,c2) w l ls 2 title "Your title 2"
# -----------------------------------------------
unset y2tics
unset y2label
set xtics 0,2,9 format "%g"
set ytics 0,0.2,0.9 format "%g"
set ylabel "y-label"
set label 1 "{/:Bold (c)}"
plot f(x,a1,b1,c1) w l ls 1 notitle, f(x,a2,b2,c2) w l ls 2 notitle
# -----------------------------------------------
unset ylabel
set xtics 0,2,10
set xlabel "common x-label" offset screen -0.20,0.0
set ytics format ""
set y2tics
set y2label "y2-label"
set label 1 "{/:Bold (d)}"
plot f(x,a1,b1,c1) w l ls 1 notitle, f(x,a2,b2,c2) w l ls 2 notitle
# -----------------------------------------------
Result

Separate key (legend) for colors and markers

I have a plot with several types of objects (each read from a separate file). I'm plotting the same several functions for all of them, all on the same graph (same X-axis).
I set the markers (pt) explicitly for each, and the color (lc), so the same object has the same marker, but the same function has the same color. As an example we have 2 files, one for each object (| is just to separate the files here):
0 0 0 | 0 1 1
1 1 2 | 1 1 2
Let's call the left file A, the right B. Column 1 in each file is the x axis, column 2 is using 1:2, and column 3 is using 1:3. So using the above files in an interactive session:
gnuplot> plot "A" using 1:2 with lp pt 1 lc 'black'
gnuplot> replot "A" using 1:3 with lp pt 1 lc 'red'
gnuplot> replot "B" using 1:2 with lp pt 2 lc 'black'
gnuplot> replot "B" using 1:3 with lp pt 2 lc 'red'
we get:
Is it possible to have the key separated, so A/B appear next to their respective marker, and the function name ("using...") appears next to a line (or anything) with the appropriate color?
Right now by omitting titles (notitle in the plot command) I can get one or the other, though I would have to settle on some uniform arbitrary marker/color (depending on what I chose to set as key). Can I:
Get two keys somehow? - Preferably setting the missing attribute (color or marker) to something not in the plot.
If not, can I customize a manual legend somehow?
I am not fully sure what you want to achieve, nevertheless as for the splitting of the key, I don't think that Gnuplot has some "out-of-the-box" feature for this. However, you could (ab)use multiplot to achieve this effect. The idea is basically to generate two overlapping plots - one with points and one with lines - and to position the keys independently:
set terminal pngcairo rounded font ",16"
set output 'fig.png'
$A << EOD
0 0 0
1 1 2
EOD
$B << EOD
0 1 1
1 1 2
EOD
set multiplot
set xtics out nomirror
set ytics out nomirror
eps = 0.1
set lmargin at screen eps
set rmargin at screen 1 - eps/2
set bmargin at screen eps
set tmargin at screen 1 - eps/2
#common key settings
set key left top Left reverse spacing 1.5
set key at screen 0.1,screen 1-eps
plot \
$A u 1:2 with p ps 1.5 pt 1 lc 'black' t 'A', \
$A u 1:3 with p ps 1.5 pt 1 lc 'red' t 'A' , \
$B u 1:2 with p ps 1.5 pt 2 lc 'black' t 'B', \
$B u 1:3 with p ps 1.5 pt 2 lc 'red' t 'B'
unset border; unset xtics; unset ytics
set key at screen 0.3,screen 1-eps
plot \
$A u 1:2 with l lc 'black' t 'using 1:2', \
$A u 1:3 with l lc 'red' t 'using 1:3', \
$B u 1:2 with l lc 'black' t '', \
$B u 1:3 with l lc 'red' t ''
This would give you:

reduce empty spaces in the plot and make the graph fit optimally

I am plotting multiplot with 11 graphs. I given the code used below:
#!/usr/bin/gnuplot
########################################################################################
#OUTPUT
set size 1.0, 1.0
#POSTCRIPT
set term postscript landscape enhanced color
set output "radial_distribution_function.ps" #
#set terminal postscript portrait enhanced color dashed "Helvetica" 8
#set output "time-density-profile-maltose.ps"
#PNG
#set terminal pngcairo size 650,450 enhanced dash
#set output "multi-plot_gauche_bcMalto-chain2-thermo.png"
# WXT
#set terminal wxt size 900,450 enhanced font 'Arial,10' dashed persist
#set style line 4 lt 4 lw 10 # Please DISABLE pause -1
#########################################################################
set style line 1 lt 1 lc rgb "#FFB6C1" lw 2.0
set style line 2 lt 1 lc rgb "black" lw 2.0
set style line 3 lt 1 lc rgb "green" lw 2.0
set style line 4 lt 1 lc rgb "blue" lw 2.0
set style line 5 lt 1 lc rgb "#8B008B" lw 2.0
set style line 6 lt 1 lc rgb "yellow" lw 2.0
#########################################################################
### START MARCRO
set macro
#ylabelFONT="font 'Arial,16'"
labelFONT="font 'Arial,12'"
scaleFONT="font 'Arial,12'"
keyFONT="font 'Arial,14'"
#graph="using 1:2 with lines lw 1 "
scaleFONT2="font 'Arial,11'"
### END MACRO
set key font ",8"
set key spacing 0.7
unset key
set autoscale # scale axes automatically
set xtic auto #scaleFONT # set xtics automatically
set ytic auto #scaleFONT # set ytics automatically
set xlabel "Distance (Angstrom)" #labelFONT
set ylabel "g(r)" #labelFONT
set xrange [0:10]
set yrange [0:5]
#set title "Density profile for isomaltose"
set multiplot layout 4,3 title ""
# PLOT_1
set label "(a) O11" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O11-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O11-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O11-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O11-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O11-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O11-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_2
unset label
set label "(b) O12" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O12-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O12-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O12-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O12-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O12-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O12-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_3
unset label
set label "(c) O13" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O13-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O13-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O13-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O13-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O13-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O13-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_4
unset label
set label "(d) O14" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O14-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O14-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O14-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O14-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O14-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O14-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_5
unset label
set label "(e) O15" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O15-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O15-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O15-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O15-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O15-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O15-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_6
unset label
set label "(f) O16" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O16-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O16-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O16-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O16-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O16-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O16-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_7
unset label
set label "(g) O22" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O22-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O22-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O22-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O22-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O22-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O22-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_8
unset label
set label "(h) O23" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O23-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O23-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O23-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O23-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O23-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O23-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_9
unset label
set label "(i) O24" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O24-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O24-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O24-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O24-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O24-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O24-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_10
unset label
set label "(j) O25" at 1.5, 4 #labelFONT
plot "maltoLyo12per-ddm_O25-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O25-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O25-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O25-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O25-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O25-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
# PLOT_11
unset label
set label "(k) O26" at 1.5, 4 #labelFONT
unset key
plot "maltoLyo12per-ddm_O26-wat_O.dat" using 1:2 w l ls 1 title "{/Symbol b}Mal-C_{12}12%H_{2}O",\
"maltoLyo23per-ddm_O26-wat_O.dat" using 1:2 w l ls 2 title "{/Symbol b}Mal-C_{12}23%H_{2}O",\
"bcmLyo25perR-BMR_O26-wat_O.dat" using 1:2 w l ls 3 title "{/Symbol b}Mal-C_{12}C_{8}(R)25%H_{2}O",\
"bcmLyo25perS-BCS_O26-wat_O.dat" using 1:2 w l ls 4 title "{/Symbol b}Mal-C_{12}C_{8}(S)25%H_{2}O",\
"bchainRS25per-BMR_O26-wat_O.dat" using 1:2 w l ls 5 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(R)25%H_{2}O",\
"bchainRS25per-BMS_O26-wat_O.dat" using 1:2 w l ls 6 title "{/Symbol b}Mal-C_{12}C_{8}(RS)(S)25%H_{2}O"
unset multiplot
The graph that I get is show here
What I notice from the graph is there is lot of empty space between the graphs. For example between graph (a) and (b) and also between graph (a) and (d). I want to reduce the space between them and make the graph little bigger.
What I should do to reduce the space and optimize the graph size.
Thanks in advance.
Ok, lets start :)
First, your script and your naming of the data files is perfect for iterations. So, you can define a list of file name templates with a placeholder %s, which is later substituted by the actual parameter.
So you first have an iteration over the different O11, O12 etc. values and for each of those a new plot is generated. Then you have a plot for iteration over the file names which are all placed in a single plot.
Using set linetype to define the colors allows you to make use of the automatic line type increment.
Now to your actual question:
I think the best options are to correct the offset of the labels a bit, e.g. with
set ylabel "g(r)" offset 1,0 #labelFONT
which shifts the ylabel by one character unit to the right with respect to the automatically selected position. That should give you a little bigger graph.
If that isn't enough you must start to manually set the margins. I would start by changing only the top and right margins. With e.g.
set tmargin 0
set rmargin 0
the top and right margins will be placed at the boundaries of the respective panels. With e.g. set rmargin 0.5 the right margin is set to a half character width. You must play around with these values.
Here is a shortened script. Note, that I couldn't test it, because I don't have the data files. I hope I didn't make any errors :)
#!/usr/bin/gnuplot
set term postscript landscape enhanced color
set output "radial_distribution_function.ps" #
#########################################################################
set linetype 1 lt 1 lc rgb "#FFB6C1" lw 2.0
set linetype 2 lt 1 lc rgb "black" lw 2.0
set linetype 3 lt 1 lc rgb "green" lw 2.0
set linetype 4 lt 1 lc rgb "blue" lw 2.0
set linetype 5 lt 1 lc rgb "#8B008B" lw 2.0
set linetype 6 lt 1 lc rgb "yellow" lw 2.0
#########################################################################
set macro
labelFONT="font 'Arial,12'"
scaleFONT="font 'Arial,12'"
keyFONT="font 'Arial,14'"
scaleFONT2="font 'Arial,11'"
unset key
set autoscale # scale axes automatically
set xtic auto #scaleFONT # set xtics automatically
set ytic auto #scaleFONT # set ytics automatically
set xlabel "Distance (Angstrom)" #labelFONT
set ylabel "g(r)" offset 1,0 #labelFONT
set xrange [0:10]
set yrange [0:5]
file_tmpls = "maltoLyo12per-ddm_%s-wat_O.dat ".\
"maltoLyo23per-ddm_%s-wat_O.dat ".\
"bcmLyo25perR-BMR_%s-wat_O.dat ".\
"bcmLyo25perS-BCS_%s-wat_O.dat ".\
"bchainRS25per-BMR_%s-wat_O.dat ".\
"bchainRS25per-BMS_%s-wat_O.dat "
par = "O11 O12 O13 O14 O15 O16 O22 O23 O24 O25 O26"
labels = "a b c d e f g h i j k"
label_tmpl = "(%s) %s"
# You must optimize the values, which are given in units of character widths (or heights)
set tmargin 0.5
set rmargin 0.5
#set lmargin 2
#set bmargin 2
set multiplot layout 4,3 title ""
do for [i=1:words(par)] {
set label 1 sprintf("(%s) %s", word(labels, i), word(par, i)) at 1.5, 4 #labelFONT
plot for [f in file_tmpls] sprintf(f, word(par, i)) using 1:2 w l
}
unset multiplot

Gnuplot not filling the lines in 3D graphics

I'm ploting with gnuplot but in the 3D graphics some areas are not completed, empty.
The question is simple: how to force it to fill the empty areas ?
Commands that I'm using:
fit (a**-(x**(y**b))) './Tabela_perda_01_MOS_70ms_com_sameq_GOP_30_2_Foot.txt' using 1:2:3:(1) via a,b
set clabel '%8.2f'
set key right
set xlabel "X"
set ylabel "Y"
set zlabel "Z"
set xrange [0:1]
set yrange [2:20]
set zrange [0:1]
set isosample 11,20
set pointsize 0.5
set style line 1 lt 1 lw 2 pt 3 lc rgb "black"
set style line 2 lt 1 lw 1 pt 3 lc rgb "black"
splot "./Tabela_perda_01_MOS_70ms_com_sameq_GOP_30_2_Foot.txt" using 1:2:3 notitle w points ls 1, (a**-(x**(y**b))) w l ls 2

Resources