I need to generate a fairly complex chart, for which I need the ability to specify not only subplots, but also sub-subplots. (Our group has found such charts useful in the past, but they were generated using horrific MATLAB code, which we’re trying to get away from as quickly as we can, not only because the code is impenetrable, but because the MATLAB GUI is unstable, and produces very poor results when we try to print the charts.)
I’ll try to describe what I want to do in a bit more detail (it’s messy).
First imagine a simple plot (just a simple X-Y line graph connecting 3-4 datapoints). I’ll call this a level-0 plot. Now, join ~10 of these level-0 plots side-by-side (with no space between the plots). This new aggregate is a level-1 plot. Next stack ~10 level-1 plots vertically, again, with no space between them. The resulting aggregate is a level-2 plot. Finally arrange ~10 of these level-2 plots side-by-side, with some spacing between them. The desired final product is this level-3 plot.
(In practice, the numbers of elements within each aggregate is not exactly 10. For example, for my immediate application the numbers would be 8 level-0 plots per level-1 plot; 17 level-1 plots per level-2 plot; and 8 level-2 plots per level-3 plot. The level-0 plots should have an aspect ratio (H:W) of 4. Therefore, the level-2 plots will have an aspect ratio of almost 8.)
How can I achieve this?
P.S. Without knowing much about the internals of matplotlib, it seems to me that the best way to do this would be to define a container class that can have itself as one of the contained elements. In this way, a containment hierarchy of arbitrary depth could be defined. I understand that in matplot lib Figure objects can contain Axes objects. Can they also contain other Figure objects? If not, what would be required to enable this capability? Any comments or suggestions on what it would take to do this would be appreciated.