How to obtain structured metal deposits from diamagnetic ions in magnetic gradient fields