  We present a theoretical study of vortices within a harmonically trapped
Bose-Einstein condensate in a rotating optical lattice. Due to the competition
between vortex-vortex interactions and pinning to the optical lattice we find a
very complicated energy landscape, which leads to hysteretic evolution. The
qualitative structure of the vortex configurations depends on the
commensurability between the vortex density and the site density -- with
regular lattices when these are commensurate, and concentric rings when they
are not. We model the imaging of these structures by calculating time-of-flight
column densities. As in the absence of the optical lattice, the vortices are
much more easily observed in a time-of-flight image than \emph{in-situ}.
