Skip to content

Commit c3d012a

Browse files
committed
Revert "numpydocstring added"
This reverts commit ea9250d.
1 parent b9ff429 commit c3d012a

File tree

1 file changed

+80
-82
lines changed

1 file changed

+80
-82
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 80 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
'markeredgecolor': ['mec'],
5757
'markeredgewidth': ['mew'],
5858
'markersize': ['ms'],
59-
}
59+
}
6060

6161

6262
def _plot_args_replacer(args, data):
@@ -1063,7 +1063,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
10631063

10641064
verts = [((thisx, thisymin), (thisx, thisymax))
10651065
for thisx, thisymin, thisymax in zip(x, ymin, ymax)]
1066-
# print 'creating line collection'
1066+
#print 'creating line collection'
10671067
lines = mcoll.LineCollection(verts, colors=colors,
10681068
linestyles=linestyles, label=label)
10691069
self.add_collection(lines, autolim=False)
@@ -1082,9 +1082,9 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
10821082
return lines
10831083

10841084
@_preprocess_data(replace_names=["positions", "lineoffsets",
1085-
"linelengths", "linewidths",
1086-
"colors", "linestyles"],
1087-
label_namer=None)
1085+
"linelengths", "linewidths",
1086+
"colors", "linestyles"],
1087+
label_namer=None)
10881088
@docstring.dedent_interpd
10891089
def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
10901090
linelengths=1, linewidths=None, colors=None,
@@ -1226,7 +1226,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12261226
colls = []
12271227
for position, lineoffset, linelength, linewidth, color, linestyle in \
12281228
zip(positions, lineoffsets, linelengths, linewidths,
1229-
colors, linestyles):
1229+
colors, linestyles):
12301230
coll = mcoll.EventCollection(position,
12311231
orientation=orientation,
12321232
lineoffset=lineoffset,
@@ -1263,8 +1263,8 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12631263
# ### Basic plotting
12641264
# The label_naming happens in `matplotlib.axes._base._plot_args`
12651265
@_preprocess_data(replace_names=["x", "y"],
1266-
positional_parameter_names=_plot_args_replacer,
1267-
label_namer=None)
1266+
positional_parameter_names=_plot_args_replacer,
1267+
label_namer=None)
12681268
@docstring.dedent_interpd
12691269
def plot(self, *args, **kwargs):
12701270
"""
@@ -1857,10 +1857,10 @@ def step(self, x, y, *args, **kwargs):
18571857
return self.plot(x, y, *args, **kwargs)
18581858

18591859
@_preprocess_data(replace_names=["left", "height", "width", "bottom",
1860-
"color", "edgecolor", "linewidth",
1861-
"tick_label", "xerr", "yerr",
1862-
"ecolor"],
1863-
label_namer=None)
1860+
"color", "edgecolor", "linewidth",
1861+
"tick_label", "xerr", "yerr",
1862+
"ecolor"],
1863+
label_namer=None)
18641864
@docstring.dedent_interpd
18651865
def bar(self, left, height, width=0.8, bottom=None, **kwargs):
18661866
"""
@@ -2469,108 +2469,105 @@ def stem(self, *args, **kwargs):
24692469
return stem_container
24702470

24712471
@_preprocess_data(replace_names=['x', 'explode', 'labels', 'colors'],
2472-
label_namer=None)
2472+
label_namer=None)
24732473
def pie(self, x, explode=None, labels=None, colors=None,
24742474
autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1,
24752475
startangle=None, radius=None, counterclock=True,
24762476
wedgeprops=None, textprops=None, center=(0, 0),
24772477
frame=False, rotatelabels=False):
2478-
r"""Plot a pie chart.
2478+
r"""
2479+
Plot a pie chart.
24792480
24802481
Make a pie chart of array *x*. The fractional area of each
24812482
wedge is given by x/sum(x). If sum(x) <= 1, then the values
24822483
of x give the fractional area directly and the array will not
24832484
be normalized. The wedges are plotted counterclockwise,
24842485
by default starting from the x-axis.
24852486
2486-
Parameters
2487-
----------
2488-
x : array
2489-
The input array used to make the pie chart.
2487+
Keyword arguments:
24902488
2491-
explode: None or array
2489+
*explode*: [ *None* | len(x) sequence ]
24922490
If not *None*, is a ``len(x)`` array which specifies the
24932491
fraction of the radius with which to offset each wedge.
24942492
2495-
colors: None or array
2493+
*colors*: [ *None* | color sequence ]
24962494
A sequence of matplotlib color args through which the pie chart
24972495
will cycle. If `None`, will use the colors in the currently
24982496
active cycle.
24992497
2500-
labels: None or list
2498+
*labels*: [ *None* | len(x) sequence of strings ]
25012499
A sequence of strings providing the labels for each wedge
25022500
2503-
autopct: None or string or function
2501+
*autopct*: [ *None* | format string | format function ]
25042502
If not *None*, is a string or function used to label the wedges
25052503
with their numeric value. The label will be placed inside the
25062504
wedge. If it is a format string, the label will be ``fmt%pct``.
25072505
If it is a function, it will be called.
25082506
2509-
pctdistance: float
2507+
*pctdistance*: scalar
25102508
The ratio between the center of each pie slice and the
25112509
start of the text generated by *autopct*. Ignored if
25122510
*autopct* is *None*; default is 0.6.
25132511
2514-
labeldistance: float
2512+
*labeldistance*: scalar
25152513
The radial distance at which the pie labels are drawn
25162514
2517-
shadow: bool
2515+
*shadow*: [ *False* | *True* ]
25182516
Draw a shadow beneath the pie.
25192517
2520-
startangle: None or Offset angle
2518+
*startangle*: [ *None* | Offset angle ]
25212519
If not *None*, rotates the start of the pie chart by *angle*
25222520
degrees counterclockwise from the x-axis.
25232521
2524-
radius: None or float
2522+
*radius*: [ *None* | scalar ]
25252523
The radius of the pie, if *radius* is *None* it will be set to 1.
25262524
2527-
counterclock: bool
2525+
*counterclock*: [ *False* | *True* ]
25282526
Specify fractions direction, clockwise or counterclockwise.
25292527
2530-
wedgeprops: None or dict
2528+
*wedgeprops*: [ *None* | dict of key value pairs ]
25312529
Dict of arguments passed to the wedge objects making the pie.
25322530
For example, you can pass in wedgeprops = { 'linewidth' : 3 }
25332531
to set the width of the wedge border lines equal to 3.
25342532
For more details, look at the doc/arguments of the wedge object.
25352533
By default `clip_on=False`.
25362534
2537-
textprops: None or dict
2535+
*textprops*: [ *None* | dict of key value pairs ]
25382536
Dict of arguments to pass to the text objects.
25392537
2540-
center: list of int
2541-
Center position of the chart. Takes value (0,0) or is a sequence
2542-
of 2 scalars.
2538+
*center*: [ (0,0) | sequence of 2 scalars ]
2539+
Center position of the chart.
25432540
2544-
frame: bool
2545-
Plot axes frame with the chart if true.
2541+
*frame*: [ *False* | *True* ]
2542+
Plot axes frame with the chart.
25462543
2547-
rotatelabels: bool
2548-
Rotate each label to the angle of the corresponding slice if true.
2544+
*rotatelabels*: [ *False* | *True* ]
2545+
Rotate each label to the angle of the corresponding slice.
25492546
2550-
Returns
2551-
-------
2552-
patches: list
2553-
A sequence of :class:`matplotlib.patches.Wedge` instances
2547+
The pie chart will probably look best if the figure and axes are
2548+
square, or the Axes aspect is equal. e.g.::
25542549
2555-
texts: list
2556-
A is a list of the label :class:`matplotlib.text.Text` instances.
2550+
figure(figsize=(8,8))
2551+
ax = axes([0.1, 0.1, 0.8, 0.8])
25572552
2558-
autotexts: list
2559-
A is a list of :class:`~matplotlib.text.Text` instances for the
2560-
numeric labels. Is returned only is if parameter *autopct* is
2561-
not *None*. If *autopct* is *None*, the tuple returned
2562-
is (patches, texts).
2553+
or::
25632554
2564-
Examples
2565-
--------
2566-
The pie chart will probably look best if the figure and axes are
2567-
square, or the Axes aspect is equal.
2555+
axes(aspect=1)
2556+
2557+
Return value:
2558+
If *autopct* is *None*, return the tuple (*patches*, *texts*):
25682559
2569-
>>> figure(figsize=(8,8))
2570-
>>> ax = axes([0.1, 0.1, 0.8, 0.8])
2560+
- *patches* is a sequence of
2561+
:class:`matplotlib.patches.Wedge` instances
25712562
2572-
>>> axes(aspect=1)
2563+
- *texts* is a list of the label
2564+
:class:`matplotlib.text.Text` instances.
25732565
2566+
If *autopct* is not *None*, return the tuple (*patches*,
2567+
*texts*, *autotexts*), where *patches* and *texts* are as
2568+
above, and *autotexts* is a list of
2569+
:class:`~matplotlib.text.Text` instances for the numeric
2570+
labels.
25742571
"""
25752572

25762573
x = np.array(x, np.float32)
@@ -2626,9 +2623,9 @@ def get_next_color():
26262623
y += expl * math.sin(thetam)
26272624

26282625
w = mpatches.Wedge((x, y), radius, 360. * min(theta1, theta2),
2629-
360. * max(theta1, theta2),
2630-
facecolor=get_next_color(),
2631-
**wedgeprops)
2626+
360. * max(theta1, theta2),
2627+
facecolor=get_next_color(),
2628+
**wedgeprops)
26322629
slices.append(w)
26332630
self.add_patch(w)
26342631
w.set_label(label)
@@ -2685,9 +2682,9 @@ def get_next_color():
26852682
self.set_frame_on(False)
26862683

26872684
self.set_xlim((-1.25 + center[0],
2688-
1.25 + center[0]))
2685+
1.25 + center[0]))
26892686
self.set_ylim((-1.25 + center[1],
2690-
1.25 + center[1]))
2687+
1.25 + center[1]))
26912688
self.set_xticks([])
26922689
self.set_yticks([])
26932690

@@ -2697,7 +2694,7 @@ def get_next_color():
26972694
return slices, texts, autotexts
26982695

26992696
@_preprocess_data(replace_names=["x", "y", "xerr", "yerr"],
2700-
label_namer="y")
2697+
label_namer="y")
27012698
@docstring.dedent_interpd
27022699
def errorbar(self, x, y, yerr=None, xerr=None,
27032700
fmt='', ecolor=None, elinewidth=None, capsize=None,
@@ -3308,8 +3305,7 @@ def _update_dict(dictionary, rc_name, properties):
33083305
dictionary = dict()
33093306
for prop_dict in properties:
33103307
dictionary.setdefault(prop_dict,
3311-
rcParams[rc_str.format(rc_name,
3312-
prop_dict)])
3308+
rcParams[rc_str.format(rc_name, prop_dict)])
33133309
return dictionary
33143310

33153311
# Common property dictionnaries loading from rc
@@ -3319,7 +3315,7 @@ def _update_dict(dictionary, rc_name, properties):
33193315

33203316
boxprops = _update_dict(boxprops, 'boxprops', default_props)
33213317
whiskerprops = _update_dict(whiskerprops, 'whiskerprops',
3322-
default_props)
3318+
default_props)
33233319
capprops = _update_dict(capprops, 'capprops', default_props)
33243320
medianprops = _update_dict(medianprops, 'medianprops', default_props)
33253321
meanprops = _update_dict(meanprops, 'meanprops', default_props)
@@ -3811,9 +3807,9 @@ def dopatch(xs, ys, **kwargs):
38113807
medians=medians, fliers=fliers, means=means)
38123808

38133809
@_preprocess_data(replace_names=["x", "y", "s", "linewidths",
3814-
"edgecolors", "c", 'facecolor',
3815-
'facecolors', 'color'],
3816-
label_namer="y")
3810+
"edgecolors", "c", 'facecolor',
3811+
'facecolors', 'color'],
3812+
label_namer="y")
38173813
def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38183814
vmin=None, vmax=None, alpha=None, linewidths=None,
38193815
verts=None, edgecolors=None,
@@ -4617,7 +4613,7 @@ def stackplot(self, x, *args, **kwargs):
46174613
stackplot.__doc__ = mstack.stackplot.__doc__
46184614

46194615
@_preprocess_data(replace_names=["x", "y", "u", "v", "start_points"],
4620-
label_namer=None)
4616+
label_namer=None)
46214617
def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
46224618
cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
46234619
minlength=0.1, transform=None, zorder=None,
@@ -4717,7 +4713,7 @@ def fill(self, *args, **kwargs):
47174713
return patches
47184714

47194715
@_preprocess_data(replace_names=["x", "y1", "y2", "where"],
4720-
label_namer=None)
4716+
label_namer=None)
47214717
@docstring.dedent_interpd
47224718
def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
47234719
step=None,
@@ -4886,7 +4882,7 @@ def get_interp_point(ind):
48864882
return collection
48874883

48884884
@_preprocess_data(replace_names=["y", "x1", "x2", "where"],
4889-
label_namer=None)
4885+
label_namer=None)
48904886
@docstring.dedent_interpd
48914887
def fill_betweenx(self, y, x1, x2=0, where=None,
48924888
step=None, interpolate=False, **kwargs):
@@ -5185,7 +5181,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
51855181
if im.get_clip_path() is None:
51865182
# image does not already have clipping set, clip to axes patch
51875183
im.set_clip_path(self.patch)
5188-
# if norm is None and shape is None:
5184+
#if norm is None and shape is None:
51895185
# im.set_clim(vmin, vmax)
51905186
if vmin is not None or vmax is not None:
51915187
im.set_clim(vmin, vmax)
@@ -5245,7 +5241,7 @@ def _pcolorargs(funcname, *args, **kw):
52455241
if X.shape != Y.shape:
52465242
raise TypeError(
52475243
'Incompatible X, Y inputs to %s; see help(%s)' % (
5248-
funcname, funcname))
5244+
funcname, funcname))
52495245
if allmatch:
52505246
if not (Nx == numCols and Ny == numRows):
52515247
raise TypeError('Dimensions of C %s are incompatible with'
@@ -5497,7 +5493,7 @@ def pcolor(self, *args, **kwargs):
54975493
# Transform from native to data coordinates?
54985494
t = collection._transform
54995495
if (not isinstance(t, mtransforms.Transform) and
5500-
hasattr(t, '_as_mpl_transform')):
5496+
hasattr(t, '_as_mpl_transform')):
55015497
t = t._as_mpl_transform(self.axes)
55025498

55035499
if t and any(t.contains_branch_seperately(self.transData)):
@@ -5649,7 +5645,7 @@ def pcolormesh(self, *args, **kwargs):
56495645
# Transform from native to data coordinates?
56505646
t = collection._transform
56515647
if (not isinstance(t, mtransforms.Transform) and
5652-
hasattr(t, '_as_mpl_transform')):
5648+
hasattr(t, '_as_mpl_transform')):
56535649
t = t._as_mpl_transform(self.axes)
56545650

56555651
if t and any(t.contains_branch_seperately(self.transData)):
@@ -7348,7 +7344,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
73487344
nr, nc = Z.shape
73497345
extent = [-0.5, nc - 0.5, nr - 0.5, -0.5]
73507346
ret = self.imshow(mask, interpolation='nearest', aspect=aspect,
7351-
extent=extent, origin=origin, **kwargs)
7347+
extent=extent, origin=origin, **kwargs)
73527348
else:
73537349
if hasattr(Z, 'tocoo'):
73547350
c = Z.tocoo()
@@ -7368,8 +7364,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
73687364
if markersize is None:
73697365
markersize = 10
73707366
marks = mlines.Line2D(x, y, linestyle='None',
7371-
marker=marker, markersize=markersize,
7372-
**kwargs)
7367+
marker=marker, markersize=markersize, **kwargs)
73737368
self.add_line(marks)
73747369
nr, nc = Z.shape
73757370
self.set_xlim(xmin=-0.5, xmax=nc - 0.5)
@@ -7380,9 +7375,11 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
73807375
self.xaxis.tick_top()
73817376
self.xaxis.set_ticks_position('both')
73827377
self.xaxis.set_major_locator(mticker.MaxNLocator(nbins=9,
7383-
steps=[1, 2, 5, 10], integer=True))
7378+
steps=[1, 2, 5, 10],
7379+
integer=True))
73847380
self.yaxis.set_major_locator(mticker.MaxNLocator(nbins=9,
7385-
steps=[1, 2, 5, 10], integer=True))
7381+
steps=[1, 2, 5, 10],
7382+
integer=True))
73867383
return ret
73877384

73887385
def matshow(self, Z, **kwargs):
@@ -7427,10 +7424,11 @@ def matshow(self, Z, **kwargs):
74277424
self.xaxis.tick_top()
74287425
self.xaxis.set_ticks_position('both')
74297426
self.xaxis.set_major_locator(mticker.MaxNLocator(nbins=9,
7430-
steps=[1, 2, 5, 10], integer=True))
7427+
steps=[1, 2, 5, 10],
7428+
integer=True))
74317429
self.yaxis.set_major_locator(mticker.MaxNLocator(nbins=9,
7432-
steps=[1, 2, 5, 10],
7433-
integer=True))
7430+
steps=[1, 2, 5, 10],
7431+
integer=True))
74347432
return im
74357433

74367434
@_preprocess_data(replace_names=["dataset"], label_namer=None)

0 commit comments

Comments
 (0)