subplot

Alan G Isaac <alan.isaac@...83...> writes:

> super-mongo WINDOW command (e.g.
> SM)

The functionality is good,
but the syntax is awful.

It might not be crystal clear indeed at 1st glance, but once you get used
to it (as I got used to sm-WINDOW command), it is fairly trivial to
pre-visualize. And IMHO it would have the advantage of conciseness while
an easy extension to subplot.

subplot2grid(loc=(0,0), rowspan=2, colspan=3)

would confuse nobody (or so I claim).

Most probably... but me: I did not catch what subplot2grid(loc=(0,0),
rowspan=2, colspan=3) should actually do. What would be the syntax for
the following layouts?

···

On 5/18/2009 4:27 PM Yannick Copin apparently wrote:

+-----+-----+

    > ax2 |
ax1 +-----+
    > ax3 |

+-----+-----+

+-------+---+

      > >
ax1 |ax3|
      > >

+-------+---+

   ax2 |

+-----------+

Cheers.

rowspan=2, colspan=3) should actually do. What would be the syntax for the following layouts?

+-----+-----+
> > ax2 |
> ax1 +-----+
> > ax3 |
+-----+-----+

subplot2grid(shape=(2,2), loc=(0,0), rowspan=2)
subplot2grid(shape=(2,2), loc=(0,1))
subplot2grid(shape=(2,2), loc=(1,1))

+-------+---+
> > >
> ax1 |ax3|
> > >
+-------+---+
> ax2 |
+-----------+

subplot2grid(shape=(3,3), loc=(0,0), rowspan=2, colspan=2)
subplot2grid(shape=(3,3), loc=(0,2), rowspan=2)
subplot2grid(shape=(3,3), loc=(2,0), colspan=3)

Again, consider the tkinter grid manager.

hth,
Alan Isaac

···

On 5/18/2009 6:25 PM Yannick Copin apparently wrote:

I think there is no functionality difference between subplot2grid and
SM Window. And the syntax of the subplot2grid seems much more cleaner,
especially when you have large number of cells. So, I'm +1 for
subplot2grid in this regard.

One thing I like about my option 3 is that it can have some benefit
from the array indexing. For example,

+-------+---+
> > >
> ax1 |ax3|
> > >
+-------+---+
> ax2 |
+-----------+

ax2 = subplot(grid_spec(3,3)[2,:])

Any suggestions?

-JJ

I’ll admit that I wasn’t too sure about this when you first introduced it, but it’s growing on me. I could foresee this usage:

#Make grid
ax_grid = grid_spec(3,3)

ax1 = subplot(ax_grid[:2, :2])
#do plot 1

ax2 = subplot(ax_grid[2, :])
#do plot 2

ax3 = subplot(ax_grid[:2, 2])
#do plot3

What I like about this is that it uses fewer keyword arguments and doesn’t add another function with overlapping functionality to the API, but adds functionality to the function that already handles subplots. I also like that it makes use of a syntax (slicing) that pretty much everyone has to be familiar with. I could also see that the grid_spec could cache some calculations (slight performance benefit) as well as (maybe?) handle what happens when overlapping axes are requested from the grid.

My 0.02.

Ryan

···

On Tue, May 19, 2009 at 12:00 PM, Jae-Joon Lee <lee.j.joon@…83…287…> wrote:

I think there is no functionality difference between subplot2grid and

SM Window. And the syntax of the subplot2grid seems much more cleaner,

especially when you have large number of cells. So, I’m +1 for

subplot2grid in this regard.

One thing I like about my option 3 is that it can have some benefit

from the array indexing. For example,

±------±–+

  >   >

ax1 |ax3|

  >   >

±------±–+

ax2 |

±----------+

ax2 = subplot(grid_spec(3,3)[2,:])

Any suggestions?


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States

rowspan=2, colspan=3) should actually do. What would be the syntax for the following layouts?

+-----+-----+
> > ax2 |
> ax1 +-----+
> > ax3 |
+-----+-----+

subplot2grid(shape=(2,2), loc=(0,0), rowspan=2)
subplot2grid(shape=(2,2), loc=(0,1))
subplot2grid(shape=(2,2), loc=(1,1))

+-------+---+
> > >
> ax1 |ax3|
> > >
+-------+---+
> ax2 |
+-----------+

subplot2grid(shape=(3,3), loc=(0,0), rowspan=2, colspan=2)
subplot2grid(shape=(3,3), loc=(0,2), rowspan=2)
subplot2grid(shape=(3,3), loc=(2,0), colspan=3)

Again, consider the tkinter grid manager.

hth,
Alan Isaac

···

On 5/18/2009 6:25 PM Yannick Copin apparently wrote: