Rather than using the global document, let’s have a top-level document option that you can pass to Plot, and it will use that.