Let
be a field and consider the ring
-
![{\displaystyle {}R=K[x,y,u,v]/(xu-yv)\,.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a752c09467f274b8e0eceda85df5d1778aa8dc81)
The ideal
is a prime ideal in
of height one. Hence the open subset
is the complement of an irreducible hypersurface. However,
is not affine. For this we consider the closed subscheme
-
![{\displaystyle {}{\mathbb {A} }_{K}^{2}\cong Z=V(u,v)\subseteq \operatorname {Spec} {\left(R\right)}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d7b0ffc15203c78111ccac08d4ea0a86320165c0)
and
.
If
were affine, then also the closed subscheme
would be affine, but this is not true, since the complement of the punctured plane has codimension
.