diff --git a/doc/users/mathtext.rst b/doc/users/mathtext.rst index cf906d2caaff..a0e1b8ddd6a4 100644 --- a/doc/users/mathtext.rst +++ b/doc/users/mathtext.rst @@ -216,7 +216,7 @@ When using the `STIX `_ fonts, you also have the choi ``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}` ====================================== ========================================= -.. htmlonly:: + .. htmlonly:: ====================================== ========================================= ``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}` diff --git a/examples/misc/multiprocess.py b/examples/misc/multiprocess.py index b1230d464eef..7d2ca7ad4930 100644 --- a/examples/misc/multiprocess.py +++ b/examples/misc/multiprocess.py @@ -4,6 +4,8 @@ # Written by Robert Cimrman from __future__ import print_function +from six.moves import input + import time from multiprocessing import Process, Pipe import numpy as np @@ -76,10 +78,6 @@ def main(): for ii in range(10): pl.plot() time.sleep(0.5) - try: - input = raw_input - except NameError: - pass input('press Enter...') pl.plot(finished=True) diff --git a/examples/pylab_examples/griddata_demo.py b/examples/pylab_examples/griddata_demo.py index 74af8424fb83..cb929f6fdb6f 100644 --- a/examples/pylab_examples/griddata_demo.py +++ b/examples/pylab_examples/griddata_demo.py @@ -1,13 +1,13 @@ -from numpy.random import uniform, seed from matplotlib.mlab import griddata import matplotlib.pyplot as plt import numpy as np + # make up data. -#npts = int(raw_input('enter # of random points to plot:')) -seed(0) +random_state = np.random.RandomState(19680801) + npts = 200 -x = uniform(-2, 2, npts) -y = uniform(-2, 2, npts) +x = random_state.uniform(-2, 2, npts) +y = random_state.uniform(-2, 2, npts) z = x*np.exp(-x**2 - y**2) # define grid. xi = np.linspace(-2.1, 2.1, 100) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 61efde46ca93..94b3f3b255b8 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2918,17 +2918,29 @@ def get_xscale(self): get_xscale.__doc__ = "Return the xaxis scale string: %s""" % ( ", ".join(mscale.get_scale_names())) - @docstring.dedent_interpd def set_xscale(self, value, **kwargs): """ Set the x-axis scale - Set the scaling of the x-axis: %(scale)s + Parameters + ---------- + value : {"linear", "log", "symlog", "logit"} + scaling strategy to apply - ACCEPTS: [%(scale)s] + Notes + ----- + Different kwargs are accepted, depending on the scale. See + the `~matplotlib.scale` module for more information. - Different kwargs are accepted, depending on the scale: - %(scale_docs)s + See also + -------- + matplotlib.scale.LinearScale : linear transfrom + + matplotlib.scale.LogTransform : log transform + + matplotlib.scale.SymmetricalLogTransform : symlog transform + + matplotlib.scale.LogisticTransform : logit transform """ # If the scale is being set to log, clip nonposx to prevent headaches # around zero @@ -2998,18 +3010,22 @@ def get_xticklabels(self, minor=False, which=None): self.xaxis.get_ticklabels(minor=minor, which=which)) - @docstring.dedent_interpd def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ - Set the xtick labels with list of strings *labels* + Set the xtick labels with list of string labels - Return a list of axis text instances. + Parameters + ---------- + labels : list of str + list of string labels - *kwargs* set the :class:`~matplotlib.text.Text` properties. - Valid properties are - %(Text)s + Returns + ------- + A list of `~matplotlib.text.Text` instances - ACCEPTS: sequence of strings + Other Parameters + ----------------- + **kwargs : `~matplotlib.text.Text` properties. """ if fontdict is not None: kwargs.update(fontdict) @@ -3139,7 +3155,6 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw): 0 m, is at the top. >>> set_ylim(5000, 0) - """ if 'ymin' in kw: bottom = kw.pop('ymin') @@ -3199,16 +3214,29 @@ def get_yscale(self): get_yscale.__doc__ = "Return the yaxis scale string: %s""" % ( ", ".join(mscale.get_scale_names())) - @docstring.dedent_interpd def set_yscale(self, value, **kwargs): - """Set the y-axis scale + """ + Set the y-axis scale + + Parameters + ---------- + value : {"linear", "log", "symlog", "logit"} + scaling strategy to apply + + Notes + ----- + Different kwargs are accepted, depending on the scale. See + the `~matplotlib.scale` module for more information. + + See also + -------- + matplotlib.scale.LinearScale : linear transfrom - Set the scaling of the y-axis: %(scale)s + matplotlib.scale.LogTransform : log transform - ACCEPTS: [%(scale)s] + matplotlib.scale.SymmetricalLogTransform : symlog transform - Different kwargs are accepted, depending on the scale: - %(scale_docs)s + matplotlib.scale.LogisticTransform : logit transform """ # If the scale is being set to log, clip nonposy to prevent headaches # around zero @@ -3281,18 +3309,22 @@ def get_yticklabels(self, minor=False, which=None): self.yaxis.get_ticklabels(minor=minor, which=which)) - @docstring.dedent_interpd def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ - Set the y tick labels with list of strings *labels* + Set the y-tick labels with list of strings labels - Return a list of :class:`~matplotlib.text.Text` instances. + Parameters + ---------- + labels : list of str + list of string labels - *kwargs* set :class:`~matplotlib.text.Text` properties for the labels. - Valid properties are - %(Text)s + Returns + ------- + A list of `~matplotlib.text.Text` instances. - ACCEPTS: sequence of strings + Other Parameters + ---------------- + **kwargs : `~matplotlib.text.Text` properties. """ if fontdict is not None: kwargs.update(fontdict) @@ -3872,15 +3904,21 @@ def twinx(self): """ Create a twin Axes sharing the xaxis - create a twin of Axes for generating a plot with a sharex - x-axis but independent y axis. The y-axis of self will have + Create a twin of Axes for generating a plot with a shared + x-axis but independent y-axis. The y-axis of self will have ticks on left and the returned axes will have ticks on the right. To ensure tick marks of both axis align, see - :class:`~matplotlib.ticker.LinearLocator` + `~matplotlib.ticker.LinearLocator` - .. note:: - For those who are 'picking' artists while using twinx, pick - events are only called for the artists in the top-most axes. + Returns + ------- + Axis + The newly created axis + + Notes + ----- + For those who are 'picking' artists while using twinx, pick + events are only called for the artists in the top-most axes. """ ax2 = self._make_twin_axes(sharex=self) ax2.yaxis.tick_right() @@ -3895,14 +3933,20 @@ def twiny(self): """ Create a twin Axes sharing the yaxis - create a twin of Axes for generating a plot with a shared - y-axis but independent x axis. The x-axis of self will have + Create a twin of Axes for generating a plot with a shared + y-axis but independent x-axis. The x-axis of self will have ticks on bottom and the returned axes will have ticks on the top. - .. note:: - For those who are 'picking' artists while using twiny, pick - events are only called for the artists in the top-most axes. + Returns + ------- + Axis + The newly created axis + + Notes + ------ + For those who are 'picking' artists while using twiny, pick + events are only called for the artists in the top-most axes. """ ax2 = self._make_twin_axes(sharey=self)