ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 30 Sep 2016 15:44:12 -0500Is it possible to embed a plot (or png) within another plot?http://ask.sagemath.org/question/34998/is-it-possible-to-embed-a-plot-or-png-within-another-plot/I have looked at the documentation for 2d plots without any success. I would like to know if it is possible to embed a plot within a plot.
I currently have a set of polygons and I would like to have plots of graphs embedded into each region. Something resembling the attached [image](/upfiles/14752402076305906.png).
Is it possible to achieve this using sagemath's plotting interface?
Thanks!Fri, 30 Sep 2016 07:58:10 -0500http://ask.sagemath.org/question/34998/is-it-possible-to-embed-a-plot-or-png-within-another-plot/Answer by niles for <p>I have looked at the documentation for 2d plots without any success. I would like to know if it is possible to embed a plot within a plot.</p>
<p>I currently have a set of polygons and I would like to have plots of graphs embedded into each region. Something resembling the attached <a href="/upfiles/14752402076305906.png">image</a>.</p>
<p>Is it possible to achieve this using sagemath's plotting interface?</p>
<p>Thanks!</p>
http://ask.sagemath.org/question/34998/is-it-possible-to-embed-a-plot-or-png-within-another-plot/?answer=35001#post-id-35001I'm not aware of a Sage command for this, but I have three ideas for how to do it:
* Use matplotlib: Sage does a lot of its plotting under the hood with matplot lib. If all of the things you're drawing are produced using matplot lib internally, then you could try to get the underlying matplotlib objects and combine them using its (extensive) functionality. [You could check the source code to see whether there are some internal methods to get the matplot lib objects.]
* Use PIL: Sage includes the Python Image Library, so you could try to use it to overlay the different images.
* Use ImageMagick (convert): This isn't included with Sage, but is standard on many *nix systems. Save the individual images, and then make a montage.Fri, 30 Sep 2016 15:44:12 -0500http://ask.sagemath.org/question/34998/is-it-possible-to-embed-a-plot-or-png-within-another-plot/?answer=35001#post-id-35001