I want to fix a contour plot at the top of a 3D box. The following code sets the contour plot to the base:
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
width=0.9\textwidth,
3d box,
view={20}{8},
plot box ratio=3 15 3,
colormap/jet,
colorbar,
ylabel={y},
xlabel={x},
]
\addplot3[raw gnuplot,
surf,
samples=29,
samples y=80,
]
gnuplot[surf,
]{
n=1e-5;
b=100;
h=10;
p=-0.0001;
set samples 29,80;
set isosamples 29,80;
K=((16*b**2)/(n*pi**3))*(-p);
Sum(i,x,y)=K*(((-1)**(0.5*((2*i-1)-1)))*(1-((cosh(((2*i-1)*pi*x)/(2*b)))/(cosh(((2*i-1)*pi*h)/(2*b)))))*((cos(((2*i-1)*pi*y)/(2*b)))/((2*i-1)**3)));
u(i,x,y)=(i==0)?0:(u(i-1,x,y)+Sum(i,x,y));
splot [-h:h] [-b:b] u(25,x,y)/u(25,0,0);
};
\addplot[raw gnuplot,
%thick,
color=black,
]
gnuplot[]{
set contour base;
set cntrparam levels discrete 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9;
unset surface;
set isosamples 100;
n=1e-5;
b=100;
h=10;
p=-0.0001;
K=((16*b**2)/(n*pi**3))*(-p);
Sum(i,x,y)=K*(((-1)**(0.5*((2*i-1)-1)))*(1-((cosh(((2*i-1)*pi*x)/(2*b)))/(cosh(((2*i-1)*pi*h)/(2*b)))))*((cos(((2*i-1)*pi*y)/(2*b)))/((2*i-1)**3)));
u(i,x,y)=(i==0)?0:(u(i-1,x,y)+Sum(i,x,y));
splot [-h:h] [-b:b] u(25,x,y)/u(25,0,0);
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
I think the z
filter doesn't work in this case. The gnuplot command "set xyplane
" doesn't work in this context, too. Can I set the z
level for this plot in any option? Is there a way to achieve the same result with less computing effort?
contour prepared
plot handler is a good choice here. – Christian Feuersänger Aug 23 '11 at 17:10z filter
stuff should work here. I am willing to look into it in the next days, but perhaps you find it before I have time... – Christian Feuersänger Aug 23 '11 at 17:12z filter
, but i used theraw gnuplot
code and this doesn´t work directly with thecontour gnuplot
code. i´m still working on it and if i find a solution i´ll post it. – Mac-Cherony Aug 23 '11 at 17:56