2010/10/19 Kynn Jones <kyn...@gmail.com>: > 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?
My idea would be to add another layer. Meaning to provide a class which *creates* Axes, and which has other instances of *this class* in an attribute. The attrib would be scalar. Repetition is done via recursive call so some privat e method, initiated by a call to a public commit method. So you would do in pseudo-code: level0 = LevelAxesGenerator() # NOT actually creating the Axes, see below. level1 = LevelAxesGenerator(leaf=level0, repeat=10, direction='x') # NOT creating too. level1.create(width=foo, height=bar) # Subdividing automatically, generating Axes in the recursive calls on level0-level This shouldn't be super-hard. Sorry, I cannot help you with implementation currently. When you code it, think about general usability, also for other users, if you're inclined. I would maybe have been such a user in the past. ``.create()`` could maybe called ``.commit()``, this is more specific. Create can mean anything. You could even add a .populate() method, so that you can derive from ``LevelAxesGenerator`` and the instances automatically populate their axes based on the "coordinate" tuple (level0, level1, level2, ...). This would be really neat, and it's not too specific, because it'll be the main use of this level-functionality. Success, Friedrich ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users