Updated margin handling of floating diagrams