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

Skip to content

Commit b6709ea

Browse files
authored
Merge pull request #7424 from sirlittle/master
DOC: Numpy Doc Format
2 parents e0a3da8 + 58f1169 commit b6709ea

File tree

4 files changed

+89
-47
lines changed

4 files changed

+89
-47
lines changed

doc/users/mathtext.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ When using the `STIX <http://www.stixfonts.org/>`_ fonts, you also have the choi
216216
``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}`
217217
====================================== =========================================
218218

219-
.. htmlonly::
219+
.. htmlonly::
220220

221221
====================================== =========================================
222222
``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}`

examples/misc/multiprocess.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Written by Robert Cimrman
55

66
from __future__ import print_function
7+
from six.moves import input
8+
79
import time
810
from multiprocessing import Process, Pipe
911
import numpy as np
@@ -76,10 +78,6 @@ def main():
7678
for ii in range(10):
7779
pl.plot()
7880
time.sleep(0.5)
79-
try:
80-
input = raw_input
81-
except NameError:
82-
pass
8381
input('press Enter...')
8482
pl.plot(finished=True)
8583

examples/pylab_examples/griddata_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from numpy.random import uniform, seed
21
from matplotlib.mlab import griddata
32
import matplotlib.pyplot as plt
43
import numpy as np
4+
55
# make up data.
6-
#npts = int(raw_input('enter # of random points to plot:'))
7-
seed(0)
6+
random_state = np.random.RandomState(19680801)
7+
88
npts = 200
9-
x = uniform(-2, 2, npts)
10-
y = uniform(-2, 2, npts)
9+
x = random_state.uniform(-2, 2, npts)
10+
y = random_state.uniform(-2, 2, npts)
1111
z = x*np.exp(-x**2 - y**2)
1212
# define grid.
1313
xi = np.linspace(-2.1, 2.1, 100)

lib/matplotlib/axes/_base.py

Lines changed: 81 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,17 +2918,29 @@ def get_xscale(self):
29182918
get_xscale.__doc__ = "Return the xaxis scale string: %s""" % (
29192919
", ".join(mscale.get_scale_names()))
29202920

2921-
@docstring.dedent_interpd
29222921
def set_xscale(self, value, **kwargs):
29232922
"""
29242923
Set the x-axis scale
29252924
2926-
Set the scaling of the x-axis: %(scale)s
2925+
Parameters
2926+
----------
2927+
value : {"linear", "log", "symlog", "logit"}
2928+
scaling strategy to apply
29272929
2928-
ACCEPTS: [%(scale)s]
2930+
Notes
2931+
-----
2932+
Different kwargs are accepted, depending on the scale. See
2933+
the `~matplotlib.scale` module for more information.
29292934
2930-
Different kwargs are accepted, depending on the scale:
2931-
%(scale_docs)s
2935+
See also
2936+
--------
2937+
matplotlib.scale.LinearScale : linear transfrom
2938+
2939+
matplotlib.scale.LogTransform : log transform
2940+
2941+
matplotlib.scale.SymmetricalLogTransform : symlog transform
2942+
2943+
matplotlib.scale.LogisticTransform : logit transform
29322944
"""
29332945
# If the scale is being set to log, clip nonposx to prevent headaches
29342946
# around zero
@@ -2998,18 +3010,22 @@ def get_xticklabels(self, minor=False, which=None):
29983010
self.xaxis.get_ticklabels(minor=minor,
29993011
which=which))
30003012

3001-
@docstring.dedent_interpd
30023013
def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
30033014
"""
3004-
Set the xtick labels with list of strings *labels*
3015+
Set the xtick labels with list of string labels
30053016
3006-
Return a list of axis text instances.
3017+
Parameters
3018+
----------
3019+
labels : list of str
3020+
list of string labels
30073021
3008-
*kwargs* set the :class:`~matplotlib.text.Text` properties.
3009-
Valid properties are
3010-
%(Text)s
3022+
Returns
3023+
-------
3024+
A list of `~matplotlib.text.Text` instances
30113025
3012-
ACCEPTS: sequence of strings
3026+
Other Parameters
3027+
-----------------
3028+
**kwargs : `~matplotlib.text.Text` properties.
30133029
"""
30143030
if fontdict is not None:
30153031
kwargs.update(fontdict)
@@ -3139,7 +3155,6 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
31393155
0 m, is at the top.
31403156
31413157
>>> set_ylim(5000, 0)
3142-
31433158
"""
31443159
if 'ymin' in kw:
31453160
bottom = kw.pop('ymin')
@@ -3199,16 +3214,29 @@ def get_yscale(self):
31993214
get_yscale.__doc__ = "Return the yaxis scale string: %s""" % (
32003215
", ".join(mscale.get_scale_names()))
32013216

3202-
@docstring.dedent_interpd
32033217
def set_yscale(self, value, **kwargs):
3204-
"""Set the y-axis scale
3218+
"""
3219+
Set the y-axis scale
3220+
3221+
Parameters
3222+
----------
3223+
value : {"linear", "log", "symlog", "logit"}
3224+
scaling strategy to apply
3225+
3226+
Notes
3227+
-----
3228+
Different kwargs are accepted, depending on the scale. See
3229+
the `~matplotlib.scale` module for more information.
3230+
3231+
See also
3232+
--------
3233+
matplotlib.scale.LinearScale : linear transfrom
32053234
3206-
Set the scaling of the y-axis: %(scale)s
3235+
matplotlib.scale.LogTransform : log transform
32073236
3208-
ACCEPTS: [%(scale)s]
3237+
matplotlib.scale.SymmetricalLogTransform : symlog transform
32093238
3210-
Different kwargs are accepted, depending on the scale:
3211-
%(scale_docs)s
3239+
matplotlib.scale.LogisticTransform : logit transform
32123240
"""
32133241
# If the scale is being set to log, clip nonposy to prevent headaches
32143242
# around zero
@@ -3281,18 +3309,22 @@ def get_yticklabels(self, minor=False, which=None):
32813309
self.yaxis.get_ticklabels(minor=minor,
32823310
which=which))
32833311

3284-
@docstring.dedent_interpd
32853312
def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs):
32863313
"""
3287-
Set the y tick labels with list of strings *labels*
3314+
Set the y-tick labels with list of strings labels
32883315
3289-
Return a list of :class:`~matplotlib.text.Text` instances.
3316+
Parameters
3317+
----------
3318+
labels : list of str
3319+
list of string labels
32903320
3291-
*kwargs* set :class:`~matplotlib.text.Text` properties for the labels.
3292-
Valid properties are
3293-
%(Text)s
3321+
Returns
3322+
-------
3323+
A list of `~matplotlib.text.Text` instances.
32943324
3295-
ACCEPTS: sequence of strings
3325+
Other Parameters
3326+
----------------
3327+
**kwargs : `~matplotlib.text.Text` properties.
32963328
"""
32973329
if fontdict is not None:
32983330
kwargs.update(fontdict)
@@ -3872,15 +3904,21 @@ def twinx(self):
38723904
"""
38733905
Create a twin Axes sharing the xaxis
38743906
3875-
create a twin of Axes for generating a plot with a sharex
3876-
x-axis but independent y axis. The y-axis of self will have
3907+
Create a twin of Axes for generating a plot with a shared
3908+
x-axis but independent y-axis. The y-axis of self will have
38773909
ticks on left and the returned axes will have ticks on the
38783910
right. To ensure tick marks of both axis align, see
3879-
:class:`~matplotlib.ticker.LinearLocator`
3911+
`~matplotlib.ticker.LinearLocator`
38803912
3881-
.. note::
3882-
For those who are 'picking' artists while using twinx, pick
3883-
events are only called for the artists in the top-most axes.
3913+
Returns
3914+
-------
3915+
Axis
3916+
The newly created axis
3917+
3918+
Notes
3919+
-----
3920+
For those who are 'picking' artists while using twinx, pick
3921+
events are only called for the artists in the top-most axes.
38843922
"""
38853923
ax2 = self._make_twin_axes(sharex=self)
38863924
ax2.yaxis.tick_right()
@@ -3895,14 +3933,20 @@ def twiny(self):
38953933
"""
38963934
Create a twin Axes sharing the yaxis
38973935
3898-
create a twin of Axes for generating a plot with a shared
3899-
y-axis but independent x axis. The x-axis of self will have
3936+
Create a twin of Axes for generating a plot with a shared
3937+
y-axis but independent x-axis. The x-axis of self will have
39003938
ticks on bottom and the returned axes will have ticks on the
39013939
top.
39023940
3903-
.. note::
3904-
For those who are 'picking' artists while using twiny, pick
3905-
events are only called for the artists in the top-most axes.
3941+
Returns
3942+
-------
3943+
Axis
3944+
The newly created axis
3945+
3946+
Notes
3947+
------
3948+
For those who are 'picking' artists while using twiny, pick
3949+
events are only called for the artists in the top-most axes.
39063950
"""
39073951

39083952
ax2 = self._make_twin_axes(sharey=self)

0 commit comments

Comments
 (0)