Revision: 4665
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4665&view=rev
Author: efiring
Date: 2007-12-06 23:12:33 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
Clarify docstrings on Subplot classes; closes 1659419
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2007-12-07 06:29:31 UTC (rev
4664)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2007-12-07 07:12:33 UTC (rev
4665)
@@ -5403,25 +5403,23 @@
class SubplotBase:
"""
- Emulate matlab's(TM) 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
+ Base class for subplots, which are Axes instances with additional
+ methods to facilitate generating and manipulating a set of Axes
+ within a figure.
"""
def __init__(self, fig, *args):
"""
fig is a figure instance
- args is a varargs to specify the subplot
+ args is numRows, numCols, plotNum
+ where the array of subplots in the figure has dimensions
+ numRows, numCols, and where plotNum is the number of the
+ subplot being created. plotNum starts at 1 in the upper
+ right corner and increases to the right.
+ If numRows<=numCols<=plotNum<10, args can be the decimal
+ integer numRows*100 + numCols*10 + plotNum.
"""
self.figure = fig
@@ -5538,24 +5536,17 @@
class Subplot(SubplotBase, Axes):
"""
- Emulate matlab's(TM) subplot command, creating axes with
+ subplot class for Cartesian Axes
- 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
+ This is not normally instantiated by the user; instead,
+ use the Figure.add_subplot method.
"""
def __str__(self):
return "Subplot(%g,%g)"%(self.bottom.get(),self.left.get())
def __init__(self, fig, *args, **kwargs):
"""
- See Axes base class documentation for args and kwargs
+ See SubplotBase and Axes base class documentation for args and kwargs
"""
SubplotBase.__init__(self, fig, *args)
Axes.__init__(self, fig, [self.figLeft, self.figBottom,
@@ -5565,7 +5556,6 @@
class PolarAxes(Axes):
"""
-
Make a PolarAxes. The rectangular bounding box of the axes is given by
@@ -6018,17 +6008,10 @@
class PolarSubplot(SubplotBase, PolarAxes):
"""
- Create a polar subplot with
+ subplot class for Polar Axes
- PolarSubplot(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
+ This is not normally instantiated by the user; instead,
+ use the Figure.add_subplot(..., polar=True) method.
"""
def __str__(self):
return "PolarSubplot(%gx%g)"%(self.figW,self.figH)
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2007-12-07 06:29:31 UTC (rev
4664)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2007-12-07 07:12:33 UTC (rev
4665)
@@ -519,6 +519,7 @@
Add a subplot. Examples
add_subplot(111)
+ add_subplot(1,1,1) # equivalent but more general
add_subplot(212, axisbg='r') # add subplot with red background
add_subplot(111, polar=True) # add a polar subplot
add_subplot(sub) # add Subplot instance sub
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins