multivariate-statistics/figures/schemes/regression_plan_3D.tex

27 lines
1.1 KiB
TeX

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{105}{-30}
\usetikzlibrary{patterns}
\begin{tikzpicture}[tdplot_main_coords,font=\sffamily]
\tdplotsetrotatedcoords{00}{30}{0}
\begin{scope}[tdplot_rotated_coords]
\begin{scope}[canvas is xy plane at z=0]
\draw[fill opacity=0,pattern=north west lines,pattern color=gray] (-2,-3) rectangle (2,3);
\draw[gray,fill=lightgray,fill opacity=0.75] (-2,-3) rectangle (2,3);
\draw[very thick] (-2,0) -- (2,0);
\path (-150:2) coordinate (H) (-1.5,0) coordinate(X);
\pgflowlevelsynccm
\draw[very thick,-stealth,gray] (0,0) -- (-30:1.5);
\end{scope}
\draw[stealth-] (H) -- ++ (-1,0,0.2) node[pos=1.3]{$H$};
\draw[stealth-] (X) -- ++ (0,1,0.2) node[pos=1.3]{$X$};
\draw[very thick,-stealth] (0,0,0) coordinate (O) -- (0,0,3) node[right]{$p$};
\end{scope}
\pgfmathsetmacro{\Radius}{1.5}
\draw[-stealth] (O)-- (2.5*\Radius,0,0) node[pos=1.15] {$x$};
\draw[-stealth] (O) -- (0,3.5*\Radius,0) node[pos=1.15] {$z$};
\draw[-stealth] (O) -- (0,0,2.5*\Radius) node[pos=1.05] {$y$};
\end{tikzpicture}
\end{document}