  The gas metallicity distributions across individual galaxies and across
galaxy samples can teach us much about how galaxies evolve. Massive galaxies
typically possess negative metallicity gradients, and mass and metallicity are
tightly correlated on local scales over wide range of galaxy masses; however,
the precise origins of such trends remain elusive. Here, we employ data from
SDSS-IV MaNGA to explore how gas metallicity depends on local stellar mass
density and on galactocentric radius within individual galaxies. We also
consider how the strengths of these dependencies vary across the galaxy
mass-size plane. We find that radius is more predictive of local metallicity
than stellar mass density in extended lower mass galaxies, while we find
density and radius to be almost equally predictive in higher-mass and more
compact galaxies. Consistent with previous work, we find a mild connection
between metallicity gradients and large-scale environment; however, this is
insufficient to explain variations in gas metallicity behaviour across the
mass-size plane. We argue our results to be consistent with a scenario in which
extended galaxies have experienced smooth gas accretion histories, producing
negative metallicity gradients over time. We further argue that more compact
and more massive systems have experienced increased merging activity that
disrupts this process, leading to flatter metallicity gradients and more
dominant density-metallicity correlations within individual galaxies.
