-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert docstring of Axes.pie() into numpydoc #8357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ea9250d
d4d912b
ce79bfe
492b0ac
50aa3ff
17570af
9b6c50b
8df19bd
f570978
027cbae
34f688b
03bacb8
465a453
6e451f1
710b509
9f53b14
b9ff429
c3d012a
d12a3cd
0b4909a
8e54067
a0c7bd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Converts the docstring of pie() function in _ axes.py into numpydoc
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2475,99 +2475,102 @@ def pie(self, x, explode=None, labels=None, colors=None, | |
startangle=None, radius=None, counterclock=True, | ||
wedgeprops=None, textprops=None, center=(0, 0), | ||
frame=False, rotatelabels=False): | ||
r""" | ||
Plot a pie chart. | ||
r"""Plot a pie chart. | ||
|
||
Make a pie chart of array *x*. The fractional area of each | ||
wedge is given by x/sum(x). If sum(x) <= 1, then the values | ||
of x give the fractional area directly and the array will not | ||
be normalized. The wedges are plotted counterclockwise, | ||
by default starting from the x-axis. | ||
|
||
Keyword arguments: | ||
Parameters | ||
---------- | ||
x : array | ||
The input array used to make the pie chart. | ||
|
||
*explode*: [ *None* | len(x) sequence ] | ||
explode: None or array | ||
If not *None*, is a ``len(x)`` array which specifies the | ||
fraction of the radius with which to offset each wedge. | ||
|
||
*colors*: [ *None* | color sequence ] | ||
colors: None or array | ||
A sequence of matplotlib color args through which the pie chart | ||
will cycle. If `None`, will use the colors in the currently | ||
active cycle. | ||
|
||
*labels*: [ *None* | len(x) sequence of strings ] | ||
labels: None or list | ||
A sequence of strings providing the labels for each wedge | ||
|
||
*autopct*: [ *None* | format string | format function ] | ||
autopct: None or string or function | ||
If not *None*, is a string or function used to label the wedges | ||
with their numeric value. The label will be placed inside the | ||
wedge. If it is a format string, the label will be ``fmt%pct``. | ||
If it is a function, it will be called. | ||
|
||
*pctdistance*: scalar | ||
pctdistance: float | ||
The ratio between the center of each pie slice and the | ||
start of the text generated by *autopct*. Ignored if | ||
*autopct* is *None*; default is 0.6. | ||
|
||
*labeldistance*: scalar | ||
labeldistance: float | ||
The radial distance at which the pie labels are drawn | ||
|
||
*shadow*: [ *False* | *True* ] | ||
shadow: bool | ||
Draw a shadow beneath the pie. | ||
|
||
*startangle*: [ *None* | Offset angle ] | ||
startangle: None or Offset angle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
If not *None*, rotates the start of the pie chart by *angle* | ||
degrees counterclockwise from the x-axis. | ||
|
||
*radius*: [ *None* | scalar ] | ||
radius: None or float | ||
The radius of the pie, if *radius* is *None* it will be set to 1. | ||
|
||
*counterclock*: [ *False* | *True* ] | ||
counterclock: bool | ||
Specify fractions direction, clockwise or counterclockwise. | ||
|
||
*wedgeprops*: [ *None* | dict of key value pairs ] | ||
wedgeprops: None or dict | ||
Dict of arguments passed to the wedge objects making the pie. | ||
For example, you can pass in wedgeprops = { 'linewidth' : 3 } | ||
to set the width of the wedge border lines equal to 3. | ||
For more details, look at the doc/arguments of the wedge object. | ||
By default `clip_on=False`. | ||
|
||
*textprops*: [ *None* | dict of key value pairs ] | ||
textprops: None or dict | ||
Dict of arguments to pass to the text objects. | ||
|
||
*center*: [ (0,0) | sequence of 2 scalars ] | ||
Center position of the chart. | ||
|
||
*frame*: [ *False* | *True* ] | ||
Plot axes frame with the chart. | ||
center: list of int | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra space. Also, why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad. Changing to float. |
||
Center position of the chart. Takes value (0,0) or is a sequence | ||
of 2 scalars. | ||
|
||
*rotatelabels*: [ *False* | *True* ] | ||
Rotate each label to the angle of the corresponding slice. | ||
frame: bool | ||
Plot axes frame with the chart if true. | ||
|
||
The pie chart will probably look best if the figure and axes are | ||
square, or the Axes aspect is equal. e.g.:: | ||
rotatelabels: bool | ||
Rotate each label to the angle of the corresponding slice if true. | ||
|
||
figure(figsize=(8,8)) | ||
ax = axes([0.1, 0.1, 0.8, 0.8]) | ||
Returns | ||
------- | ||
patches: list | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also add space before colon of every return value. |
||
A sequence of :class:`matplotlib.patches.Wedge` instances | ||
|
||
or:: | ||
texts: list | ||
A is a list of the label :class:`matplotlib.text.Text` instances. | ||
|
||
axes(aspect=1) | ||
autotexts: list | ||
A is a list of :class:`~matplotlib.text.Text` instances for the | ||
numeric labels. Is returned only is if parameter *autopct* is | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is if -> if |
||
not *None*. If *autopct* is *None*, the tuple returned | ||
is (patches, texts). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave out this last sentence. |
||
|
||
Return value: | ||
If *autopct* is *None*, return the tuple (*patches*, *texts*): | ||
Notes | ||
-------- | ||
The pie chart will probably look best if the figure and axes are | ||
square, or the Axes aspect is equal. | ||
|
||
- *patches* is a sequence of | ||
:class:`matplotlib.patches.Wedge` instances | ||
>>> figure(figsize=(8,8)) | ||
>>> ax = axes([0.1, 0.1, 0.8, 0.8]) | ||
|
||
- *texts* is a list of the label | ||
:class:`matplotlib.text.Text` instances. | ||
>>> axes(aspect=1) | ||
|
||
If *autopct* is not *None*, return the tuple (*patches*, | ||
*texts*, *autotexts*), where *patches* and *texts* are as | ||
above, and *autotexts* is a list of | ||
:class:`~matplotlib.text.Text` instances for the numeric | ||
labels. | ||
""" | ||
|
||
x = np.array(x, np.float32) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space before the colon for all parameters.