Here is a MWE:
\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{angles}
\begin{document}
\begin{tikzpicture}
\coordinate (ey) at (1,0,0);
\coordinate (ez) at (0,1,0);
\coordinate (ex) at (0,0,1);
\begin{scope}[x={(ex)},y={(ey)},z={(ez)},scale=2]
\def\xM{1.2}
\def\yM{1.6}
\def\zM{1.8}
\def\ech{2}
\coordinate (O) at (0,0,0);
\coordinate (X) at (\ech,0,0);
\coordinate (Y) at (0,\ech,0);
\coordinate (Z) at (0,0,\ech);
\coordinate (Px) at (\xM,0,0);
\coordinate (Py) at (0,\yM,0);
\coordinate (Pz) at (0,0,\zM);
\coordinate (M) at (\xM,\yM,\zM);
\coordinate (H) at (\xM,\yM,0);
\coordinate (ey) at (1,0,0);
\coordinate (ez) at (0,1,0);
\coordinate (ex) at (0,0,1);
\draw[->,thick] (0,0,0) -- (1,0,0) node[above left] {$\vec{\imath}$};
\draw[->,thick] (0,0,0) -- (0,1,0) node[below] {$\vec{\jmath}$};
\draw[->,thick] (0,0,0) -- (0,0,1) node[left] {$\vec{k}$};
\draw (O) -- (X);
\draw (O) -- (Y);
\draw (O) -- (Z);
\draw[dashed] (H) -- (Px) node[left] {$x$};
\draw[dashed] (H) -- (Py) node[above] {$y$};
\draw[dashed] (H) -- (Py);
\draw[->,blue] (O) -- (H);
\draw[blue] (M) -- node[right,black] {$z$} (H);
\draw[blue] (M) -- node[above,black] {$r$} (Pz);
\path (H) node[below right] {$H$};
\path (M) node[above right] {$M$};
\draw pic [draw,->,angle radius=0.5cm] {angle = X--O--H};
\draw (23:1) node {$\theta$};
\end{scope}
\end{tikzpicture}
\end{document}
I am not satisfied with the angle theta. It doesn't seem in the plane (Oxy). Probably because it is a circle instead of an ellipse (I hope I am clear). So is there a way to improve this?