histogram with errorbars, pb with the titles of the columns - gnuplot

these are my data : TABLE11-mol+func.dat
#mol PBE optPBE optB86b BEEF Exp IncertitudeBEEF 0
0 PBE-PBE optPBE-vdW1 optB86b-vdW1 BEEF-vdW2 Exp Incert.BEEF 0
1 0.014 0.226 0.210 0.125 0.155 0.10444 0
2 0.033 0.362 0.392 0.223 0 0.16794 0
3 1.742 1.755 2.152 1.432 1.36 0.29116 0
4 1.206 1.441 1.724 1.115 0 0.17857 0
5 0.934 1.533 1.857 1.063 0 0.30034 0
6 0.777 1.514 1.843 0.959 1.295 0.31264 0
7 2.018 2.298 2.858 1.751 0 0.37737 0
8 1.084 1.648 2.336 1.033 1.762 0.60643 0
9 1.504 2.355 3.451 1.449 2.694 1.0138 0
this is my code :
set key left
set auto x
set ylabel "- E_{ads} (eV)" font "Times-Roman, 18"
set yrange [0:3.5]
set ytics (0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5) font "Times-Roman, 18"
set style data histograms
set style histogram errorbars lw 1
set style fill solid border -1
set boxwidth 0.9
set xtics ("Methane" 0, "Ethane" 1, "Ethylidyne" 2, "Ethylene" 3, "Butene" 4, "Cyclohexene" 5, "Butadiene" 6, "Benzene" 7, "Naphtalene" 8) font "Times-Roman, 15"
set xtic nomirror rotate by -45 scale 0
set grid y
plot 'TABLE11-mol+func.dat' using 2:8 ti col, '' u 3:8 ti col, '' u 4:8 ti col, '' u 5:7 ti col, '' u 6:8 ti col
this gives an histogram with wrong title for each color
so I tried to add them "with my hands" with this line instead of the last one :
plot 'TABLE11-mol+func.dat' using 2:8 ti 'PBE', '' u 3:8 ti 'optPBE', '' u 4:8 ti 'optB86b', '' u 5:7 ti 'BEEF', '' u 6:8 ti 'Exp'
and this messes up my histogram, with weird stuffs who appear all over the diagram, and it adds an xtic and bars...
somebody could help me ?
it's even more weird because it use to work some month ago... maybe it's because I have a new version of gnuplot ?

Gnuplot fails to select the correct column to get the title from. It tries to always use the 8th column, as given by the second column in the using option, although this gives the error estimate and not the y-value. You must explicitely give the column number as e.g. ti col(3):
set key left
set yrange [0:3.5]
set ytics 0.5
set style data histograms
set style histogram errorbars lw 1
set style fill solid border -1
set boxwidth 0.9
set xtics ("Methane" 0, "Ethane" 1, "Ethylidyne" 2, "Ethylene" 3, "Butene" 4, "Cyclohexene" 5, "Butadiene" 6, "Benzene" 7, "Naphtalene" 8)
set xtic nomirror rotate by -45 scale 0
set grid y
plot 'TABLE11-mol+func.dat' u 2:8 t col(2), '' u 3:8 t col(3), '' u 4:8 t col(4), '' u 5:7 t col(5), '' u 6:8 t col(6)

Related

Polar plot in gnuplot

I have a problem. Im trying to do a polar plot, the fact it's that i want to plot some theorical line as some experimental data in the plot. But the theorical line has a range different of the experimental data because i had to do it like that to had gnuplot paint it.
I have the following script:
####
reset
set encoding utf8
set size 1,1
set terminal epslatex
set output "direccionalidad.tex"
unset border
set polar
set angles degrees #set gnuplot on degrees instead of radians
set style line 10 lt 1 lc 0 lw 0.3
set grid polar 30 #set the grid to be displayed every 60 degrees
set grid ls 10
set trange[-90:90]
f(t)=27.934*sin(1.81651*t+96.1991) # Theorical line
set xrange[-31:32]
set yrange[-30:30]
set xtics axis #disply the xtics on the axis instead of on the border
set ytics axis
set xtics scale 0 #"remove" the tics so that only the y tics are displayedj
set ytics (0, 6, 12) #make the ytics go from the center (0) to 6000 with incrment of 1000
unset ytics
set xtics ("5" 6, "15" 16.5, "30" 32)
# set the xtics only go from 0 to 6000 with increment of1000 but do not display anything. This has to be done otherwise the grid will not be displayed correctly.
set rtics (5,15,30)
set rtics format ' ' scale 0
set_label(x, text) = sprintf("set label '%s' at (32*cos(%f)), (32*sin(%f)) center", text, x, x) #this places a label on the outside
eval set_label(0, "0")
eval set_label(30, "30")
eval set_label(60, "60")
eval set_label(90, "90")
eval set_label(120, "120")
eval set_label(150, "150")
eval set_label(180, "180")
eval set_label(-150, "-150")
eval set_label(-120, "-120")
eval set_label(-90, "-90")
eval set_label(-60, "-60")
eval set_label(-30, "-30")
set size square
#PLOTS
plot "direccionalidaddatos.txt" u 1:3 pointtype 7 ps 2 lt 1 lw 3 lc rgb 'blue' notitle ,\
f(t) dt '-' lc rgb 'blue' notitle
#ACABAMOS
###
And here there are some examples of columns in the direccionalidaddatos.txt archive, the column in the middle it's just the angle in radians but it's usless cause i just want the angle in degrees so just ignore it ;):
-90 -1.570796327 0.1
-85 -1.483529864 0.2
-80 -1.396263402 0.4
-75 -1.308996939 0.7
-70 -1.221730476 1.1
-65 -1.134464014 1.7
-60 -1.047197551 2.5
#
And the result it is the image Polar plot
As you see in the image there are two branches that have no points, i want those branches to simply don't disappear cause they don't mean notihng in the graphic.So if anyone knows a form to made dissapear the branches, or to improve the script let me know hehe.
Thanks so much.
Can you just reduce the sampled range for the second plot component?
plot "direccionalidaddatos.txt" u 1:3 pointtype 7 ps 2 lt 1 lw 3 lc rgb 'blue' notitle ,\
[-52:45] '+' using 1:(f($1)) with lines dt '-' lc rgb 'blue' notitle

Filledcurves between different scaled y-axis

I have to "reinvent" a diagram like the following:
My problem is, the "filledcurves" option does not work correctly, if I use the different scaled y-axis.
set y2tics textcolor rgb "black"
set ytics nomirror
set yrange [0:80]
set y2range [0:180]
set key off
set grid dashtype 5 # auch dt ".-." möglich
plot "klima_flach.txt" using 1:3:4 with filledcurves x1,\
"" using 1:4 with lines axis x1y2,\
"" using 1:3:xtic(2) with lines axis x1y1
The used data is the following:
0 0 11 50
1 J 10 70
2 F 11 42
3 M 12 50
4 A 15 50
5 M 18 20
6 J 22 10
7 J 25 1
8 A 25 20
9 S 23 40
10 O 20 80
11 N 25 70
12 D 11 60
Any ideas, how I can get this problem solved?
By the way: A pattern as in the original diagram... possible or not?
#Wolfgang Höfer, the scaling between the axes in such type of Walter/Lieth-climate diagrams is 2. Hence, your y-range should be [0:90] and hence scaling factor 90./180.
Nevertheless, I assume #Christoph's answer solved your problem.
To your last question: a pattern as in your picture, i.e. a vertical hatch pattern? That's what I asked here (Hatch patterns in gnuplot) recently. Apparently, it's seems not possible in gnuplot.
Some time ago, I also "struggled" with climate diagrams, i.e. with filledcurves and even nonlinear axes. I would like to provide the code which I ended up. Maybe it will be useful to you or to others to draw such climate diagrams with gnuplot. If you are reading from a file, replace $DataIn with your filename. Suggestions and improvements are welcome.
# Walter/Lieth climate diagram with nonlinear axis
reset session
set encoding "utf8"
$DataIn <<EOD
# Mumbai/India, 18°54'N/72°49'E, 11 m
# No. Month Temperature Precipitation
1 January 23.9 3
2 February 23.9 3
3 March 26.1 3
4 April 28.1 2
5 May 29.7 18
6 June 28.9 485
7 July 27.2 617
8 August 27.0 340
9 September 27.0 264
10 October 28.1 64
11 November 27.2 13
12 December 25.6 3
EOD
# in order to be flexible for different input files
ColTemp = 3 # col# temperature
ColPrec = 4 # col# precipitation
# get location label from first commented row starting after '# '
set datafile commentschar "" # set the comment char to none
set datafile separator "\n" # data will be a full line
set table $Dummy # plot following data to a dummy table
# plots only first line 'every ::0::0' as string to the dummy table
# and assigns this line starting after the 3rd character to variable 'Location'
plot $DataIn u (Location = stringcolumn(1)[3:]) every ::0::0 with table
unset table # stop plotting to table
set datafile commentschar "#" # restore default commentschar
set datafile separator whitespace # restore default separator
set label 1 at graph 0.02,0.96 Location font ",10" # put label on graph
# set periodic boundaries, i.e. add lines of Dec and Jan again
# independent of the input format $DataIn, column1 of $Data will be the number of month
set datafile separator "\n"
set table $Data
plot $DataIn u (0):(stringcolumn(1)) every ::11::11 with table
plot $DataIn u ($0+1):(stringcolumn(1)) with table
plot $DataIn u (13):(stringcolumn(1)) every ::0::0 with table
unset table
set datafile separator whitespace
# print $Data
# settings for nonlinear scale
ScaleChangeAt = 100.
ScaleChangeFactor = 5.
f1(y) = (y<=ScaleChangeAt) ? y : ((y - ScaleChangeAt)/ScaleChangeFactor + ScaleChangeAt)
f2(y) = (y<=ScaleChangeAt) ? y : ((y - ScaleChangeAt)*ScaleChangeFactor + ScaleChangeAt)
f3(y) = f1(y)/2. # relation between axes y and y2; standard for Walter/Lieth climate diagrams
set nonlinear y2 via f1(y) inverse f2(y)
# settings for x-axis
set xrange[0.5:12.5]
set xtics 1 scale 0,1
set mxtics 2
set grid mxtics
# create months labels from local settings
do for [i=1:12] {
set xtics add (strftime("%b",strptime("%m",sprintf("%g",i))) i)
}
# settings for y- and y2-axes
stats [*:*] $DataIn u ColTemp:ColPrec nooutput
Round(m,n) = int(m/n)*n + sgn(m)*n
Ymin = STATS_min_x > 0 ? 0 : Round(STATS_min_x,10)
Ymax = 50
Y2min = Ymin < 0 ? f1(Ymin)*2 : 0
Y2max = Round(STATS_max_y,10**int(log(STATS_max_y)/log(10))) # round to next 10 or 100
# print Ymin, Ymax, Y2min, Y2max
# y-axis
set ylabel "Temperature / °C" tc rgb "red"
set yrange [Ymin:f3(Y2max)] # h(Y2max)]
set ytics 10 nomirror tc rgb "red"
# "manual" setting of ytics, up to 50°C
set ytics ("0" 0)
do for [i=Ymin:50:10] {
set ytics add (sprintf("%g",i) i)
}
# settings for y2-axis
set y2label "Precipitation / mm" tc rgb "blue"
set y2range [Y2min:Y2max]
# "manual" setting of y2tics
set y2tics nomirror tc rgb "blue"
set y2tics ("0" 0)
set grid y2tics
do for [i=20:ScaleChangeAt:20] {
set y2tics add (sprintf("%g",i) i)
}
do for [i=ScaleChangeAt:Y2max:20*ScaleChangeFactor] {
set y2tics add (sprintf("%g",i) i)
}
plot \
$Data u 1:ColTemp+1:(f3(column(ColPrec+1))) axis x1y1 w filledcurves above lc rgb "yellow" not,\
'' u 1:ColTemp+1:(f3(column(ColPrec+1))) axis x1y1 w filledcurves below fs pattern 4 fc rgb "blue" not,\
'' u 1:(f3(ScaleChangeAt)):(f3(column(ColPrec+1))) axis x1y1 w filledcurves below fs solid 1.0 fc rgb "blue" not,\
'' u 1:ColTemp+1 w l lw 2 lc rgb "red" not,\
'' u 1:ColPrec+1 axes x1y2 w l lw 2 lc rgb "blue" not
### end of code
which results in:
The filledcurves doesn't have an option for choosing different axes for the y-values in column two and three. But you are in the lucky situation, that you have fixed y-ranges. So you can define a scaling function for one of the columns:
set y2tics textcolor rgb "black"
set ytics nomirror
set yrange [0:80]
set y2range [0:180]
scale = 80.0/180.0
set key off
set grid dashtype 5 # auch dt ".-." möglich
plot "klima_flach.txt" using 1:3:(scale*$4) with filledcurves,\
"" using 1:4 with lines axis x1y2,\
"" using 1:3:xtic(2) with lines axis x1y1

How to highlight regions of plot with gnuplot

I'd appreciate if somebody can help with this question.
I am working with a radar (or spiderweb) plot with gnuplot 5.0.0:
The scale and range in all axes is the same. The numbers at and beyond 1 have a special meaning and I would like to highlight that.
I am thinking of three things that would increase visibility:
Simply make the tick mark at 1 (labelled "Limit") boldfaced. How could I highlight just a specific tick and label?
I could also highlight the circular dashed line at level 1
On the plot itself I'd like to have the background colored differently for radius > 1.
How can I achieve either of the three options above? All three would be ideal of course, but just a a minimum differentiation from the rest of that value would help.
This is what generated the plot in the link:
set term x11
set title "My title "
set polar
set angles degrees
npoints = 6
a1 = 360/npoints*1
a2 = 360/npoints*2
a3 = 360/npoints*3
a4 = 360/npoints*4
a5 = 360/npoints*5
a6 = 360/npoints*6
set grid polar 360
set size square
set style data lines
unset border
set grid ls 0
set linetype 1 lc rgb 'red' lw 2 pt 7 ps 2
M=2.2
set arrow from 0,0 to first M*cos(a1), M*sin(a1)
set arrow from 0,0 to first M*cos(a2), M*sin(a2)
set arrow from 0,0 to first M*cos(a3), M*sin(a3)
set arrow from 0,0 to first M*cos(a4), M*sin(a4)
set arrow from 0,0 to first M*cos(a5), M*sin(a5)
set arrow from 0,0 to first M*cos(a6), M*sin(a6)
a1_min = 0
a1_max = 1
a2_min = 0
a2_max = 1
a3_min = 0
a3_max = 1
a4_min = 0
a4_max = 1
a5_min = 0
a5_max = 1
a6_min = 0
a6_max = 1
set label "M1" at M*cos(a1),M*sin(a1) center offset char 1,1
set label "M2" at M*cos(a2),M*sin(a2) center offset char 1,1
set label "M3" at M*cos(a3),M*sin(a3) center offset char 1,1
set label "M4" at M*cos(a4),M*sin(a4) center offset char 1,1
set label "M5" at M*cos(a5),M*sin(a5) center offset char 1,1
set label "M6" at M*cos(a6),M*sin(a6) center offset char 1,1
set xrange [0:1]
set yrange [0:1]
set xtics axis 0,0.5,M
unset ytics
set rrange [0:M]
set rtics (""0,""0.25,""0.5,""0.75,"Limit"1,""1.25,""1.50,""1.75,""2)
set rtics scale 0 format ''
set style fill transparent solid 0.5
set style function filledcurves y1=0.5
set grid noxtics nomxtics noytics nomytics front
plot '-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 1 title "AAA",\
'-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 2 title "BBB"
1 2.1
2 1
3 0.1
4 0.5
5 0.5
6 0.1
1 2.1
EOF
1 2.2
2 0.9
3 0.9
4 0.2
5 0.3
6 0.1
1 2.2
EOF
set output
I've taken the liberty to streamline your script a bit, you can now easily adjust the number of arms in the web. Also added a coloured background for 1 >r > M.
Btw., there is no need to enter the first datapoint again at the end to close the contour.
Update: That is, there shouldn't be. However the line between the last and first point is missing then, even with giving the "closed" option to "with filledcurve". I wonder if this is a bug.
set term wxt
set title "My title "
set polar
set angles degrees
set grid polar 360
set size square
set style data lines
set key top left
unset border
set grid ls 0
set linetype 1 lc rgb 'red' lw 2 pt 7 ps 2
M=2.2
npoints = 7
minima = "0 0 0 0 0 0 0" # adjust and add more as necessary
maxima = "1 1 1 1 1 1 1"
a(n) = 360./npoints*n
amin(n) = 0.0 + word(minima,int(n))
amax(n) = 0.0 + word(maxima,int(n))
do for [i=1:npoints] {
set arrow i from 0,0 to first M*cos(a(i)), M*sin(a(i))
set label i sprintf("M%.f",i) at M*cos(a(i)),M*sin(a(i)) \
center offset char 1,1
}
set object 1 circle at 0,0 size M fillc rgb "yellow" behind
set object 2 circle at 0,0 size 1 fillc rgb "white" behind
set xrange [0:1]
set yrange [0:1]
set xtics axis 0,0.5,M
unset ytics
set rrange [0:M]
set rtics (""0,""0.25,""0.5,""0.75,"{/:Bold Limit}"1,""1.25,""1.50,""1.75,""2)
set rtics scale 0 format ''
set style fill transparent solid 0.5
set style function filledcurves y1=0.5
set grid noxtics nomxtics noytics nomytics front
plot '-' us (a($1)):(($2-amin($1))/(amax($1)-amin($1))) \
w filledcurve closed lt 1 title "AAA",\
'-' us (a($1)):(($2-amin($1))/(amax($1)-amin($1))) \
w filledcurve closed lt 2 title "BBB"
1 2.1
2 1
3 0.1
4 0.5
5 0.5
6 0.1
7 0.5
EOF
1 2.2
2 0.9
3 0.9
4 0.2
5 0.3
6 0.1
7 1.8
EOF

gnuplot - calculate distance between lines

Can gnuplot calculate the distance between two lines or maybe two points?
I'm having a plot where two (main) lines are plotted. For the moment let's assume that the first line is always above the second one. Is there a way to calculate the distance from line 2 to line 1 at a given x-value?
here is a picture of what my plot looks like and which distance I want to calculate:
The vertical lines are just for style and have nothing to do with the actual plot, their data is stored in test.dat and test2.dat.
My data-files of the lines look like this:
line1
0 118.1
2.754 117.77
4.054 117.64
6.131 116.17
7.7 116.04
8.391 115.36
10.535 115.25
11.433 116.03
12.591 116.22
19.519 118.59
line2
19.4 118.51
15.2 116.56
10.9 115.94
10.35 114.93
9.05 114.92
8.3 115.9
5.9 116.19
4.2 116.62
2.2 117.66
-0.3 118.06
My plotting-code looks like this:
set term wxt enhanced
cd 'working directory'
unset key
set size 0.9,0.9
set origin 0.1,0.1
set title 'TITLE'
unset border
set label 21 " rotate by 45" at -3.0,0.0 rotate by 45 point ps 2
set xrange [0:19.519]
set yrange [110:119]
set xtics nomirror(0, 2.745, 4.054, 6.131, 7.7, 8.391, 10.535, 11.433, 12.591, 19.519) rotate by 90 offset 0,-0.1 right
set ytics " ", 30000
plot "line1.dat" using ($1):($2):2 with labels offset 1, 1.8 rotate by 90, "line1.dat" using 1:2 with lines lt 1 lw 1 lc rgb '#000000', +112 lt 1 lw 1 lc rgb '#000000' , 'test.dat' with lines lt 1 lw 1 lc rgb '#000000', +110 lt 1 lw 1 lc rgb '#000000', 'line2.dat' with lines lt 0.5 lw 1 lc rgb '#000000', 'test2.dat' with lines lt 0.5 lw 1 lc rgb '#000000'
You can measure the distance manually. Move the mouse to the first point and type 'r'. Then as you move the mouse around, the x and y offsets, distance and angle are displayed. Type '5' to draw a line segment and to toggle between degrees and tangent display. Zooming in beforehand increases accuracy.
By the way, typing 'h' in the plot window will display a list of keybindings to the console.
An answer to this "rather old" question still might be of interest to OP, if not, maybe to others.
Yes, you can calculate and plot the difference of two lines. It requires some linear interpolation. Simply assign the desired x-value to the variable myX.
Data:
SO17717287_1.dat
0 118.1
2.754 117.77
4.054 117.64
6.131 116.17
7.7 116.04
8.391 115.36
10.535 115.25
11.433 116.03
12.591 116.22
19.519 118.59
SO17717287_2.dat
19.4 118.51
15.2 116.56
10.9 115.94
10.35 114.93
9.05 114.92
8.3 115.9
5.9 116.19
4.2 116.62
2.2 117.66
-0.3 118.06
Script: (works for gnuplot>=4.6.0)
### calculating and plotting a difference between two curves
reset
FILE1 = "SO17717287_1.dat"
FILE2 = "SO17717287_2.dat"
set border 1
unset key
set origin 0.05,0.05
set size 0.9,0.8
set xrange [0:19.519]
set xtics nomirror rotate by 90 offset 0,-0.1 right
set yrange [110:119]
unset ytics
myX = 15.2
getYa(xi) = (x0=x1, x1=$1, y0=y1, y1=$2, x1==xi ? ya=y1 : (sgn(x0-xi)!=sgn(x1-xi)) ? ya=(y1-y0)/(x1-x0)*(xi-x0)+y0 : NaN)
getYb(xi) = (x0=x1, x1=$1, y0=y1, y1=$2, x1==xi ? yb=y1 : (sgn(x0-xi)!=sgn(x1-xi)) ? yb=(y1-y0)/(x1-x0)*(xi-x0)+y0 : NaN)
set samples 2 # set to minimal possible value for plotting '+'
plot x1=y1=NaN FILE1 u 1:2:2:xtic(1) w labels offset 0,0.5 left rotate by 90, \
'' u 1:(getYa(myX),$2) w l lc rgb 'black', \
'' u 1:2:(0):(110-$2) w vec lt 0 nohead, \
+112 w l lc rgb 'black', \
x1=y1=NaN FILE2 u 1:(getYb(myX),$2) w l lt 0 lc rgb 'black', \
'+' u (myX):(ya):(0):(yb-ya) w vec heads lc rgb "red", \
'+' u (myX):(ya):(sprintf("%.3f",yb-ya)):xtic(sprintf("%g",myX)) w labels tc rgb "red" offset 0,1, \
'+' u (myX):(ya):(0):(110-ya) w vec nohead lt 0 lc rgb "red"
### end of script
Result: (created with gnuplot 4.6.0)

Grid in xzplane

I'm having trouble with displaying a grid in the xzplane. I've changed the position of my z-axis like this:
Now I'd like to have a grid like in the xy-plane in my xz-plane, but since I'm rather new to gnuplot, I couldn't find the correct command.
My code looks like this:
set parametric
set xlabel "Abweichung"
set ylabel "Dosis [%]"
set zlabel "Volumen [%]"
set xrange [-1:1]
set yrange [0:100]
set zrange [0:100]
set xtics 0.2
set ytics 10
set ztics 10
set grid
set border 4095 ls 1 lc rgb "black"
set xtics axis
set ytics axis
set ztics axis
set xzeroaxis lt 1 lw 2 lc rgb "black"
set yzeroaxis lt 1 lw 2 lc rgb "black"
set zzeroaxis lt 1 lw 2 lc rgb "black"
set xyplane 0
splot [t=0:100] 0, t, t
This works in gnuplot 4.6:
set grid ztics
Have a look at this article: http://gnuplot.sourceforge.net/docs_4.2/node188.html
And for a complicated example: http://www.phyast.pitt.edu/~zov1/gnuplot/html/bargraphs.html
Sadly this is currently not supported by the grid command, a feature request should probably be posted.
Anyway, as suggested by mgilson you can manually add the grid-lines with for-loops and the set arrow command. For example adding the following two lines:
set for [x = -10:10:2] arrow from x/10.0, 0, 0 to x/10.0, 0, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 0, z to 1, 0, z nohead lt 0
Results in:
You may want to rotate the plot with set view. The divide-by-ten is there because floating-point increment doesn't seem to work.
Or if you wanted the grids to be on the back of the box, do something like this:
set for [x = -10:10:2] arrow from x/10.0, 100, 0 to x/10.0, 100, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 100, z to 1, 100, z nohead lt 0
set for [y = 0:100:10] arrow from -1, y, 0 to -1, y, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 0, z to -1, 100, z nohead lt 0
Which results in:
A style note
You can replace:
set xtics axis
set ytics axis
set ztics axis
set xzeroaxis lt 1 lw 2 lc rgb "black"
set yzeroaxis lt 1 lw 2 lc rgb "black"
set zzeroaxis lt 1 lw 2 lc rgb "black"
with the equivalent:
set tics axis
set zeroaxis lt 1 lw 2 lc rgb "black"

Resources