I have a Graphics
object for a detailed plot that has too many points and regions in it to be quickly rendered, which I want to use as a background for a Manipulate
. How can I pre-render the plot into an image, without losing the coordinates of the parts of the Graphics
?
g = Graphics[Disk[]];
Show[g, Graphics[{Red, Thickness[.01], Circle[]}]]
Show[Image[g], Graphics[{Red, Thickness[.01], Circle[]}]]
Show[Rasterize[g], Graphics[{Red, Thickness[.01], Circle[]}]]
Here the first graphic displays correctly (the red border lines up with the disk) but the latter two, which prerender the disk, also put it at the rectangle {{0, 400}, {0, 400}} or something, rather than being centered at 0 with radius 1, like it was originally. (You can see a tiny red border in the bottom left of the latter two.)
Edit: Here is another example which some of the given solutions don't replicate. Here the bounding boxes of the two graphics don't match up. In this example the black disk should be under the right circle, not both of them or the middle.
g = Graphics[Disk[{1, 0}]];
Show[g, Graphics[{Red, Thickness[.01], Circle[], Circle[{1, 0}]}]]