Skip to content

Commit

Permalink
Merge pull request matplotlib#7424 from sirlittle/master
Browse files Browse the repository at this point in the history
DOC: Numpy Doc Format
  • Loading branch information
tacaswell authored Jan 16, 2017
2 parents e0a3da8 + 58f1169 commit b6709ea
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 47 deletions.
2 changes: 1 addition & 1 deletion doc/users/mathtext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ When using the `STIX <http://www.stixfonts.org/>`_ fonts, you also have the choi
``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}`
====================================== =========================================

.. htmlonly::
.. htmlonly::

====================================== =========================================
``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}`
Expand Down
6 changes: 2 additions & 4 deletions examples/misc/multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions examples/pylab_examples/griddata_demo.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
118 changes: 81 additions & 37 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit b6709ea

Please sign in to comment.