  We study the spin textures of a confined two-dimensional electron in
inhomogeneous magnetic fields. These fields can either be external or effective
fields due to a background magnetic texture in the plane in which the electron
resides. By analytical considerations, WKB-type approximations, and by
performing numerical diagonalizations we show that the in-plane spin field
components of a single electron can form vortices while the total spin field
can become a skyrmion. Most interestingly, we find that topological trivial
magnetic fields can induce topological spin field configurations in the
eigenstates of the electron due to quantum effects.
