2
votes

I would like to plot 3D graphics using histograms (3D boxes) in gnuplot. However I use epslatex or cairolatex, and the demonstrations I used from the gnuplot demo site use a command:

set boxdepth

And this command always gives the error in my script.

The image I want to get looks similar to this: enter image description here Image link: http://www.gnuplot.info/demo_cvs/3dboxes.html

My basic script is this:

# Change filename to whatever you want.
filename = "fig4"

# LaTeX amsmath and utf8 input support.
set terminal cairolatex size 9cm,9cm color colortext standalone lw 4 header  \
    "\\usepackage{amsmath}\
     \\usepackage[utf8]{inputenc}"

# Don't change output name
set output "gptemp.tex"

unset key

splot 'data.dat' with boxes


set out
system sprintf("pdflatex\
    -interaction batchmode gptemp.tex &&\
    mv gptemp.pdf %s.pdf &&\
    rm -f gptemp*", filename)
1

1 Answers

2
votes

The capability to draw 3D boxes is new, and only present in the gnuplot development version (5.3).