benjamin_ee
benjamin_ee

Reputation: 153

3D Boxes (histograms) Gnuplot with cairolatex (or epslatex)

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)

Upvotes: 2

Views: 665

Answers (1)

Ethan
Ethan

Reputation: 15118

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

Upvotes: 2

Related Questions