2

I want to plot the function x=-3 in a 3D System. I've been searching in the internet for hours and found this example :

\begin{tikzpicture}[
declare function = {
X1(\y,\z) = -3;
}]
\begin{axis}[grid,
x={(-0.7071cm,-0.7071cm)},    
y={(1cm,0.0cm)}, 
z={(0cm,1cm)},
axis lines=center,
font=\footnotesize,
xmax=5.4,ymax=5.4,zmax=5.4,
xmin=-5.4,ymin=-5.4,zmin=-5.4,
xlabel=\normalsize$x$,ylabel=\normalsize$y$,zlabel=\normalsize$z$,
major tick style = {black},
minor tick num=1, minor tick style = {very thin},
axis line style = {-latex}, %Pfeilspitzen
%enlargelimits=0.1

% Ebene x=-3
\addplot3 [color=red, surf, semitransparent] {X1(y,z)};
\end{axis}
\end{tikzpicture}

The example I got this example was z=5, now I wanted to plot this new Code, but when it is not working. when I put z anywhere there's the following Package PGF Math Error could not parse '' as a floating point number. Is it possible, that the System doesn't see z as a variable ? I don't have any other ideas ... Thanks for help

1

For 3d-plots you need points with three coordinates; {X1(y,z)} is just one component. Moreover, the varying parameters are called x and y.

enter image description here

\documentclass[border=2mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}%
  [declare function = { X1(\y,\z) = -3;} ]
  \begin{axis}%
    [grid,
     % x={(-0.7071cm,-0.7071cm)},    
     % y={(1cm,0.0cm)}, 
     % z={(0cm,1cm)},
     axis lines=center,
     font=\footnotesize,
     xmax=5.4,ymax=5.4,zmax=5.4,
     xmin=-5.4,ymin=-5.4,zmin=-5.4,
     xlabel={\normalsize$x$},
     ylabel={\normalsize$y$},
     zlabel={\normalsize$z$},
     major tick style = {black},
     minor tick num=1, minor tick style = {very thin},
     axis line style = {-latex},
    ]
    \addplot3 [color=red, surf, semitransparent] ({X1(x,y)},x,y);
  \end{axis}
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.