Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d877a27

Browse files
committed
Fix reST formatting in Axes.plot (as an opportunity to play with Darren's cool new toy)
svn path=/trunk/matplotlib/; revision=5232
1 parent 3d8eb61 commit d877a27

1 file changed

Lines changed: 60 additions & 61 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,85 +2723,85 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
27232723
def plot(self, *args, **kwargs):
27242724
"""
27252725
Plot lines and/or markers to the Axes. ``*args`` is a variable length
2726-
argument, allowing for multiple x,y pairs with an optional format
2727-
string. For example, each of the following is legal
2726+
argument, allowing for multiple *x*, *y* pairs with an optional format
2727+
string. For example, each of the following is legal::
27282728
2729-
plot(x,y) # plot x and y using the default line style and color
2730-
plot(x,y, 'bo') # plot x and y using blue circle markers
2729+
plot(x, y) # plot x and y using the default line style and color
2730+
plot(x, y, 'bo') # plot x and y using blue circle markers
27312731
plot(y) # plot y using x as index array 0..N-1
27322732
plot(y, 'r+') # ditto, but with red plusses
27332733
2734-
If x and/or y is 2-Dimensional, then the corresponding columns
2734+
If ``x`` and/or ``y`` is 2-dimensional, then the corresponding columns
27352735
will be plotted.
27362736
2737-
An arbitrary number of x, y, fmt groups can be specified, as in
2737+
An arbitrary number of ``x``, ``y``, ``fmt`` groups can be specified, as in::
27382738
2739-
a.plot(x1, y1, 'g^', x2, y2, 'g-')
2739+
a.plot(x1, y1, 'g^', x2, y2, 'g-')
27402740
27412741
Return value is a list of lines that were added.
27422742
2743-
The following line styles are supported:
2744-
2745-
* - : solid line
2746-
* -- : dashed line
2747-
* -. : dash-dot line
2748-
* : : dotted line
2749-
* . : points
2750-
* , : pixels
2751-
* o : circle symbols
2752-
* ^ : triangle up symbols
2753-
* v : triangle down symbols
2754-
* < : triangle left symbols
2755-
* > : triangle right symbols
2756-
* s : square symbols
2757-
* + : plus symbols
2758-
* x : cross symbols
2759-
* D : diamond symbols
2760-
* d : thin diamond symbols
2761-
* 1 : tripod down symbols
2762-
* 2 : tripod up symbols
2763-
* 3 : tripod left symbols
2764-
* 4 : tripod right symbols
2765-
* h : hexagon symbols
2766-
* H : rotated hexagon symbols
2767-
* p : pentagon symbols
2768-
* | : vertical line symbols
2769-
* _ : horizontal line symbols
2770-
* steps : use gnuplot style 'steps' # kwarg only
2771-
2772-
The following color abbreviations are supported
2773-
2774-
b : blue
2775-
g : green
2776-
r : red
2777-
c : cyan
2778-
m : magenta
2779-
y : yellow
2780-
k : black
2781-
w : white
2743+
The following line styles are supported::
2744+
2745+
- # solid line
2746+
-- # dashed line
2747+
-. # dash-dot line
2748+
: # dotted line
2749+
. # points
2750+
, # pixels
2751+
o # circle symbols
2752+
^ # triangle up symbols
2753+
v # triangle down symbols
2754+
< # triangle left symbols
2755+
> # triangle right symbols
2756+
s # square symbols
2757+
+ # plus symbols
2758+
x # cross symbols
2759+
D # diamond symbols
2760+
d # thin diamond symbols
2761+
1 # tripod down symbols
2762+
2 # tripod up symbols
2763+
3 # tripod left symbols
2764+
4 # tripod right symbols
2765+
h # hexagon symbols
2766+
H # rotated hexagon symbols
2767+
p # pentagon symbols
2768+
| # vertical line symbols
2769+
_ # horizontal line symbols
2770+
steps # use gnuplot style 'steps' # kwarg only
2771+
2772+
The following color abbreviations are supported::
2773+
2774+
b # blue
2775+
g # green
2776+
r # red
2777+
c # cyan
2778+
m # magenta
2779+
y # yellow
2780+
k # black
2781+
w # white
27822782
27832783
In addition, you can specify colors in many weird and
2784-
wonderful ways, including full names 'green', hex strings
2785-
'#008000', RGB or RGBA tuples (0,1,0,1) or grayscale
2786-
intensities as a string '0.8'. Of these, the string
2787-
specifications can be used in place of a fmt group, but the
2788-
tuple forms can be used only as kwargs.
2784+
wonderful ways, including full names (``'green'``), hex strings
2785+
(``'#008000'``), RGB or RGBA tuples (``(0,1,0,1)``) or grayscale
2786+
intensities as a string (``'0.8'``). Of these, the string
2787+
specifications can be used in place of a ``fmt`` group, but the
2788+
tuple forms can be used only as ``kwargs``.
27892789
27902790
Line styles and colors are combined in a single format string, as in
2791-
'bo' for blue circles.
2791+
``'bo'`` for blue circles.
27922792
27932793
The ``**kwargs`` can be used to set line properties (any property that has
27942794
a ``set_*`` method). You can use this to set a line label (for auto
27952795
legends), linewidth, anitialising, marker face color, etc. Here is an
2796-
example:
2796+
example::
27972797
27982798
plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2)
27992799
plot([1,2,3], [1,4,9], 'rs', label='line 2')
28002800
axis([0, 4, 0, 10])
28012801
legend()
28022802
2803-
If you make multiple lines with one plot command, the kwargs apply
2804-
to all those lines, eg
2803+
If you make multiple lines with one plot command, the ``kwargs`` apply
2804+
to all those lines, e.g.::
28052805
28062806
plot(x1, y1, x2, y2, antialised=False)
28072807
@@ -2810,10 +2810,9 @@ def plot(self, *args, **kwargs):
28102810
The kwargs are Line2D properties:
28112811
%(Line2D)s
28122812
2813-
kwargs scalex and scaley, if defined, are passed on
2814-
to autoscale_view to determine whether the x and y axes are
2815-
autoscaled; default True. See Axes.autoscale_view for more
2816-
information
2813+
kwargs ``scalex`` and ``scaley``, if defined, are passed on to
2814+
:meth:`autoscale_view` to determine whether the *x* and *y* axes
2815+
are autoscaled; the default is ``True``.
28172816
"""
28182817
scalex = kwargs.pop( 'scalex', True)
28192818
scaley = kwargs.pop( 'scaley', True)
@@ -5493,7 +5492,7 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
54935492
n, bins = np.histogram(x, bins, range=None,
54945493
normed=bool(normed), new=True)
54955494
n = [n,]
5496-
5495+
54975496
if cumulative:
54985497
if normed:
54995498
n = [(m * np.diff(bins)).cumsum() for m in n]
@@ -5577,7 +5576,7 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
55775576
patches.append( self.fill(x,y) )
55785577
else:
55795578
raise ValueError, 'invalid histtype: %s' % histtype
5580-
5579+
55815580
for patch in patches:
55825581
for p in patch:
55835582
p.update(kwargs)

0 commit comments

Comments
 (0)