Factor out cycles.plot writing.