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

Skip to content

Commit ca2cc2f

Browse files
committed
FIX nitpicks
1 parent 9bd261d commit ca2cc2f

File tree

4 files changed

+53
-38
lines changed

4 files changed

+53
-38
lines changed

examples/misc/multiprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# Demo of using multiprocessing for generating data in one process and plotting
33
# in another.
44
# Written by Robert Cimrman
5-
from six.moves import input
65

76
from __future__ import print_function
7+
from six.moves import input
8+
89
import time
910
from multiprocessing import Process, Pipe
1011
import numpy as np

examples/pylab_examples/griddata_demo.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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
5-
from six.moves import input
64

75
# make up data.
8-
#npts = int(input('enter # of random points to plot:'))
9-
seed(0)
6+
random_state = np.random.RandomState(19680801)
7+
108
npts = 200
11-
x = uniform(-2, 2, npts)
12-
y = uniform(-2, 2, npts)
9+
x = random_state.uniform(-2, 2, npts)
10+
y = random_state.uniform(-2, 2, npts)
1311
z = x*np.exp(-x**2 - y**2)
1412
# define grid.
1513
xi = np.linspace(-2.1, 2.1, 100)

examples/widgets/lasso_selector_demo.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
from matplotlib.path import Path
99

1010

11-
try:
12-
raw_input
13-
except NameError:
14-
# Python 3
15-
raw_input = input
16-
1711

1812
class SelectFromCollection(object):
1913
"""Select indices from a matplotlib collection using `LassoSelector`.

lib/matplotlib/axes/_base.py

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,17 +2927,29 @@ def get_xscale(self):
29272927
get_xscale.__doc__ = "Return the xaxis scale string: %s""" % (
29282928
", ".join(mscale.get_scale_names()))
29292929

2930-
@docstring.dedent_interpd
29312930
def set_xscale(self, value, **kwargs):
29322931
"""
29332932
Set the x-axis scale
29342933
29352934
Parameters
29362935
----------
2937-
value: float
2938-
Value to scale x-axis by
2936+
value : ["linear", "log", "symlog", "logit"]
2937+
scaling strategy to apply
2938+
2939+
Notes
2940+
-----
2941+
Different kwargs are accepted, depending on the scale. See
2942+
the `~matplotlib.scale` module for more information.
2943+
2944+
See also
2945+
--------
2946+
matplotlib.scale.LinearScale : linear transfrom
2947+
2948+
matplotlib.scale.LogTransform : log transform
29392949
2940-
Different kwargs are accepted, depending on the scale
2950+
matplotlib.scale.SymmetricalLogTransform : symlog transform
2951+
2952+
matplotlib.scale.LogisticTransform  : logit transform
29412953
"""
29422954
# If the scale is being set to log, clip nonposx to prevent headaches
29432955
# around zero
@@ -3007,24 +3019,22 @@ def get_xticklabels(self, minor=False, which=None):
30073019
self.xaxis.get_ticklabels(minor=minor,
30083020
which=which))
30093021

3010-
@docstring.dedent_interpd
30113022
def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
30123023
"""
3013-
Set the xtick labels with list of strings labels
3024+
Set the xtick labels with list of string labels
30143025
30153026
Parameters
30163027
----------
3017-
labels: list of str
3028+
labels : list of str
30183029
list of string labels
30193030
30203031
Returns
30213032
-------
3022-
list of str
3023-
A list of axis text instances
3033+
A list of `~matplotlib.text.Text` instances
30243034
30253035
Other Parameters
30263036
-----------------
3027-
kwargs : :class:`~matplotlib.text.Text` properties.
3037+
kwargs : `~matplotlib.text.Text` properties.
30283038
"""
30293039
if fontdict is not None:
30303040
kwargs.update(fontdict)
@@ -3214,19 +3224,29 @@ def get_yscale(self):
32143224
get_yscale.__doc__ = "Return the yaxis scale string: %s""" % (
32153225
", ".join(mscale.get_scale_names()))
32163226

3217-
@docstring.dedent_interpd
32183227
def set_yscale(self, value, **kwargs):
32193228
"""
32203229
Set the y-axis scale
32213230
32223231
Parameters
32233232
----------
3224-
value: float
3225-
Value to scale y-axis by
3233+
value : ["linear", "log", "symlog", "logit"]
3234+
scaling strategy to apply
3235+
3236+
Notes
3237+
-----
3238+
Different kwargs are accepted, depending on the scale. See
3239+
the `~matplotlib.scale` module for more information.
32263240
3227-
Other Parameters
3228-
-----------------
3229-
kwargs : :class:`~matplotlib.text.Text` properties.
3241+
See also
3242+
--------
3243+
matplotlib.scale.LinearScale : linear transfrom
3244+
3245+
matplotlib.scale.LogTransform : log transform
3246+
3247+
matplotlib.scale.SymmetricalLogTransform : symlog transform
3248+
3249+
matplotlib.scale.LogisticTransform  : logit transform
32303250
32313251
"""
32323252
# If the scale is being set to log, clip nonposy to prevent headaches
@@ -3300,24 +3320,22 @@ def get_yticklabels(self, minor=False, which=None):
33003320
self.yaxis.get_ticklabels(minor=minor,
33013321
which=which))
33023322

3303-
@docstring.dedent_interpd
33043323
def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs):
33053324
"""
33063325
Set the xtick labels with list of strings labels
33073326
33083327
Parameters
33093328
----------
3310-
labels: list of str
3329+
labels : list of str
33113330
list of string labels
33123331
33133332
Returns
33143333
-------
3315-
list of str
3316-
A list of :class:`~matplotlib.text.Text` instances.
3334+
A list of `~matplotlib.text.Text` instances.
33173335
33183336
Other Parameters
33193337
----------------
3320-
*kwargs* set the :class:`~matplotlib.text.Text` properties.
3338+
kwargs : `~matplotlib.text.Text` properties.
33213339
33223340
"""
33233341
if fontdict is not None:
@@ -3898,17 +3916,19 @@ def twinx(self):
38983916
"""
38993917
Create a twin Axes sharing the xaxis
39003918
3901-
Create a twin of Axes for generating a plot with a sharex
3902-
x-axis but independent y axis. The y-axis of self will have
3919+
Create a twin of Axes for generating a plot with a shared
3920+
x-axis but independent y-axis. The y-axis of self will have
39033921
ticks on left and the returned axes will have ticks on the
39043922
right. To ensure tick marks of both axis align, see
3905-
:class:`~matplotlib.ticker.LinearLocator`
3923+
`~matplotlib.ticker.LinearLocator`
39063924
39073925
Returns
39083926
-------
39093927
Axis
39103928
The newly created axis
39113929
3930+
Notes
3931+
-----
39123932
For those who are 'picking' artists while using twinx, pick
39133933
events are only called for the artists in the top-most axes.
39143934
"""
@@ -3926,7 +3946,7 @@ def twiny(self):
39263946
Create a twin Axes sharing the yaxis
39273947
39283948
Create a twin of Axes for generating a plot with a shared
3929-
y-axis but independent x axis. The x-axis of self will have
3949+
y-axis but independent x-axis. The x-axis of self will have
39303950
ticks on bottom and the returned axes will have ticks on the
39313951
top.
39323952
@@ -3935,6 +3955,8 @@ def twiny(self):
39353955
Axis
39363956
The newly created axis
39373957
3958+
Notes
3959+
------
39383960
For those who are 'picking' artists while using twiny, pick
39393961
events are only called for the artists in the top-most axes.
39403962
"""

0 commit comments

Comments
 (0)