Logo Search packages:      
Sourcecode: matplotlib version File versions  Download package

def matplotlib::pylab::subplot (   args,
  kwargs 
)

Create a subplot command, creating axes with

  subplot(numRows, numCols, plotNum)

where plotNum=1 is the first plot number and increasing plotNums
fill rows first.  max(plotNum)==numRows*numCols

You can leave out the commas if numRows<=numCols<=plotNum<10, as
in

  subplot(211)    # 2 rows, 1 column, first (upper) plot

subplot(111) is the default axis

The background color of the subplot can be specified via keyword
argument 'axisbg', which takes a color string or gdk.Color as value, as in

subplot(211, axisbg='y')

See help(axes) for additional information on axes and subplot
keyword arguments.

New subplots that overlap old will delete the old axes.  If you do
not want this behavior, use fig.add_subplot or the axes command.  Eg

  from pylab import *
  plot([1,2,3])  # implicitly creates subplot(111)
  subplot(211)   # overlaps, subplot(111) is killed
  plot(rand(12), rand(12))

Definition at line 1008 of file pylab.py.

01008                             :
    """
    Create a subplot command, creating axes with

      subplot(numRows, numCols, plotNum)

    where plotNum=1 is the first plot number and increasing plotNums
    fill rows first.  max(plotNum)==numRows*numCols

    You can leave out the commas if numRows<=numCols<=plotNum<10, as
    in

      subplot(211)    # 2 rows, 1 column, first (upper) plot

    subplot(111) is the default axis

    The background color of the subplot can be specified via keyword
    argument 'axisbg', which takes a color string or gdk.Color as value, as in

    subplot(211, axisbg='y')

    See help(axes) for additional information on axes and subplot
    keyword arguments.

    New subplots that overlap old will delete the old axes.  If you do
    not want this behavior, use fig.add_subplot or the axes command.  Eg

      from pylab import *
      plot([1,2,3])  # implicitly creates subplot(111)
      subplot(211)   # overlaps, subplot(111) is killed
      plot(rand(12), rand(12))

    """


    fig = gcf()
    a = fig.add_subplot(*args, **kwargs)
    bbox = a.bbox
    byebye = []
    for other in fig.axes:
        if other==a: continue
        if bbox.overlaps(other.bbox):
            byebye.append(other)
    for ax in byebye: delaxes(ax)

    draw_if_interactive()
    return a


def twinx(ax=None):


Generated by  Doxygen 1.6.0   Back to index