The wave function of the $2\mathrm{p}_z$ orbital is
$$Ψ = \frac{1}{4\sqrt{2π}}\left(\frac Z a\right)^{5/2} r \mathrm e^{-Zr/a}\cos θ.$$
I'm confused if this function will be a three-dimensional function or a four-dimensional function?
My professor told me that
$$z/r = \cos θ,$$
where $θ$ is the angle made by $r$ with the $z$ axis. So, I guess it will be four-dimensional since we would have to then plug in
$$r = \sqrt{x^2 + y^2 + z^2}$$
in the equation.
But when he plotted the function, he plotted a three-dimensional one! What is the correct answer and why?
Hydrogen-like orbitals are always 3-dimensional. But, since we can't directly visualize functions $\mathbb R^3\mapsto \mathbb R$, to plot them you need some trick.
One of such tricks it to take a cross section of the 3D space, e.g. xOz plane, and plot the function inside this plane. Then, knowing that the function is symmetric with respect to rotation around the $z$ axis, you can imagine what it could look like in other cross sections (or just plot these too). Here's an example:
Another way is to draw the function in a density plot. This will look like a cloud of colored points, with their opacity depending on the function value. Example (here blue is negative, orange is positive):