From 9f2af6834bcbd465a9f69777a45736cc1210301b Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 8 Jan 2017 13:35:28 -0800 Subject: [PATCH] Invalid escape sequences are deprecated in Py3.6. ... so mark the strings with r"". For `psd`, the backslashes appear a bit lower, in `\mathrm` and `\log`. --- lib/matplotlib/__init__.py | 4 ++-- lib/matplotlib/axes/_axes.py | 2 +- lib/matplotlib/mlab.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index d6fca151b4be..7267aa4e9028 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -141,7 +141,7 @@ __version__numpy__ = str('1.7.1') # minimum required numpy version -__bibtex__ = """@Article{Hunter:2007, +__bibtex__ = r"""@Article{Hunter:2007, Author = {Hunter, J. D.}, Title = {Matplotlib: A 2D graphics environment}, Journal = {Computing In Science \& Engineering}, @@ -398,7 +398,7 @@ def checkdep_tex(): stderr=subprocess.PIPE) stdout, stderr = s.communicate() line = stdout.decode('ascii').split('\n')[0] - pattern = '3\.1\d+' + pattern = r'3\.1\d+' match = re.search(pattern, line) v = match.group(0) return v diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 9f3bc1b9fe83..bf3fe7dc1848 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6501,7 +6501,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None, def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, return_line=None, **kwargs): - """ + r""" Plot the power spectral density. Call signature:: diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index fcc31e62bcad..b44e02dda961 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -887,7 +887,7 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None, @docstring.dedent_interpd def psd(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None): - """ + r""" Compute the power spectral density. Call signature::