yt-project annotate_scale
snippet in c

yt-project annotate_scale

user1063

import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
p = yt.SlicePlot(ds, 'z', 'density', center='c', width=(20, 'kpc'))
p.annotate_scale()
p.save()