From: John H. <jdh...@ac...> - 2006-03-13 20:57:17
|
>>>>> "Michael" == Michael P Mossey <mo...@jp...> writes: Michael> Is there any different between Subplots and Axes, other Michael> than adding a subplot lets one use the matlab 3-digit Michael> specification (e.g., 221 )? Subplot inherits from Axes. It is the special case where your axes like on a grid, eg 3 rows by 2 columns. An Axes is created by defining the rectangle [left, bottom, width, height] that the Axes occupies. Subplot simply computes these for you given the layout you specify and the subplot parameters from the rc file. These parameters govern things like the leftmost point of the subplots, or the horizontal space between the rows. Subplot also provides some helper functions like is_last_row which are useful when creating lots-o-subplots in a loop, where you may want to set the xlabel only for the last row for i in range(9): ax = subplot(3,3,i+1) plot_something(i) if ax.is_last_row(): ax.set_xlabel('time') Other useful functions are is_first_col, is_first_row, is_last_col and change_geometry. See examples/axes_demo.py http://matplotlib.sf.net/screenshots.html#axes_demo for an example which uses both subplots and axes... JDH |