Ask Your Question
2

Is it possible to embed a plot (or png) within another plot?

asked 2016-09-30 14:58:10 +0100

fidbc gravatar image

updated 2017-01-08 12:20:14 +0100

FrédéricC gravatar image

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.

Is it possible to achieve this using sagemath's plotting interface?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-09-30 22:44:12 +0100

niles gravatar image

I'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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-09-30 14:58:10 +0100

Seen: 329 times

Last updated: Sep 30 '16