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
-

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
.