We can use PIL.Image or sage.repl.image in Sagemath. Can we mix bitmap (non-vector) images with Sagemath Graphics objects (such as circle, text, plot, list_plot, etc)? For example, if I have 2 bitmap images and 4 plots, how can we use graphics_array to display them as tiles in 2 rows and 3 columns?
In other words, for example, how can we add bitmap images and graphics such as list_plot to the same Graphics object? Another example is when I want to superimpose some plots and text on a bitmap image.
This is a fleshed out version of my comment. The idea is to actually boil everything down to
matplotlib. Further configuration would then follow as with typical matplotlib configuration (which is to say that you can do anything you could possibly want, but it's not necessarily easy or straightforward).To make this example, I took two separate
pngfiles with SO logos, converted them to bitmaps using imagemagick, and then used these as my sample bitmaps.To make this a complete example, I also made two very simple sage plots, each of a single circle (one blue, one red). Then I made a 2x2 set of images.
The output is the following.
Customizing the axes and spacing and all that can be done as with typical
matplotlib.subplotssubplots. I wouldn't say that it's easy, but it's a very common task and there are lots of similar questions about that on SO. But it is possible to, for example, not display axes for the twoimshowbitmaps or to have the axis labels for the blue circle be terrible.