I am plotting multiplot surfaces. I found this code 1 very helpful to plot my graph. However, I want to label the z-axis throughout all surfaces in one plot. I tried this set zrange[0.5:b+0.5], but nothing showed up. then I tried min_z and max_z, still, nothing showed up. though I calculated and checked the range by the following the command.
print min_z,max_z.
can anyone please tell me how can I choose zrange with my own choice? like 1 ,2 3 4 5.
I will expand my comment as a possible answer. Multiplot is not needed for this style of plot. Here is an approximate recreation of the figure you linked to.
If you want to customize the axis labels along z, you can add a command to change the format like this: set ztic format "%.2f"
, and/or add additional commands of the form: set ztic add ( pi/2 "z = π/2" )
f(x,y,z) = besj0(x*x/z + y*y/z) / z
set palette cubehelix
set xyplane 0
set view 64,58
set ztics 0.2
unset key
splot for [i=1:6] z=(1.+i/6.), '++' using 1:2:(z):(f(x,y,z)) with pm3d
Answer expanded to show plotting from a series of files
Plotting from a series of files is essentially the same. The splot
command again inserts a constant z value to create a plane, taking the data coordinates [x,y] from columns 1 and 3 and the f(x,y) value from column 4.
Here is an example:
set palette defined( 0 "dark-red", 1 "yellow" )
set xyplane 0
set view 74, 62, 0.85, 1.8
set border 16 # z axis only
unset xtics; unset ytics
unset key
file(i) = sprintf("map%d.dat",i)
set ztics ("File 1" 1, "File 2" 2, "File 3" 3, "File 4" 4)
splot for [i=1:4] file(i) using 1:2:(i):3 with image