$X,Y$ is irreducible affine or projective variety, $\phi:X\to Y$ be a rational map, and let $U\subset X$ be the open set of regular point of $\phi$. The graph $\Gamma_\phi$ is defined as the closure of $\{(x,\phi(x)):x\in U\}$.
If $Y$ is affine variety, can we have $\Gamma_\phi=\{(x,\phi(x)):x\in U\}$, i.e. the set is closed?
In general, is there any sufficient and necessary condition to state that $\{(x,\phi(x)):x\in U\}\subset X\times Y$ is a closed set?
Let's take $Y$ separated, this means that the set $\Delta(Y)=\{(y,y)|\ y\in Y\}$ is closed in $Y\times Y$.
Now we consider the map $\phi|_{U}\times id_{Y}: U\times Y\rightarrow Y\times Y,\ (x,y)\mapsto (\phi|_{U}(x),y)$.
Since $\phi$ is a rational map $\phi|_{U}$ is continuous and hence so is $\phi|_{U}\times id_{Y}$.
$(\phi|_{U}\times id_{Y})^{-1}(\Delta(Y))=\{(x,y)\in U\times Y|\ (\phi|_{U}(x),y)=(y,y)\}=\{(x,\phi|_{U}(x)|\ x\in U\}=\Gamma_{\phi}$
By continuity the preimage of a closed set is closed, and since $Y$ is separated that means that $\Gamma_{\phi}$ is closed in $X\times Y$