Skip to content

Commit 9ecd876

Browse files
committed
Merge pull request #5934 from jenshnielsen/merge15xto2xconflict
Merge 15x to 2x
2 parents 1e72a2b + b32900d commit 9ecd876

25 files changed

+750
-85
lines changed

doc/_templates/index.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ <h4>Need help?</h4>
147147

148148
<p>To keep up to date with what's going on in matplotlib, see
149149
the <a href="{{ pathto('users/whats_new.html', 1) }}">what's new
150-
page</a>, the more detailed <a href="{{ pathto('_static/CHANGELOG', 1)
151-
}}">changelog</a> or browse
152-
the <a href="https://github.com/matplotlib/matplotlib">source
150+
page</a> or browse the <a href="https://github.com/matplotlib/matplotlib">source
153151
code</a>. Anything that could require changes to your existing code
154152
is logged in the <a href="{{ pathto('api/api_changes.html', 1) }}">api
155153
changes</a> file.</p>

lib/matplotlib/artist.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def set_axes(self, axes):
214214
215215
ACCEPTS: an :class:`~matplotlib.axes.Axes` instance
216216
"""
217-
warnings.warn(_get_axes_msg, mplDeprecation, stacklevel=1)
217+
warnings.warn(_get_axes_msg.format('set_axes'), mplDeprecation,
218+
stacklevel=1)
218219
self.axes = axes
219220

220221
def get_axes(self):
@@ -225,7 +226,8 @@ def get_axes(self):
225226
This has been deprecated in mpl 1.5, please use the
226227
axes property. Will be removed in 1.7 or 2.0.
227228
"""
228-
warnings.warn(_get_axes_msg, mplDeprecation, stacklevel=1)
229+
warnings.warn(_get_axes_msg.format('get_axes'), mplDeprecation,
230+
stacklevel=1)
229231
return self.axes
230232

231233
@property
@@ -1580,5 +1582,5 @@ def kwdoc(a):
15801582

15811583
docstring.interpd.update(Artist=kwdoc(Artist))
15821584

1583-
_get_axes_msg = """This has been deprecated in mpl 1.5, please use the
1585+
_get_axes_msg = """{} has been deprecated in mpl 1.5, please use the
15841586
axes property. A removal date has not been set."""

lib/matplotlib/dviread.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ def find_tex_file(filename, format=None):
841841
"""
842842
Call :program:`kpsewhich` to find a file in the texmf tree. If
843843
*format* is not None, it is used as the value for the
844-
:option:`--format` option.
844+
`--format` option.
845845
846846
Apparently most existing TeX distributions on Unix-like systems
847847
use kpathsea. I hear MikTeX (a popular distribution on Windows)

lib/matplotlib/mathtext.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2843,12 +2843,15 @@ def subsuper(self, s, loc, toks):
28432843
sub = None
28442844
super = None
28452845

2846-
# Pick all of the apostrophe's out
2846+
# Pick all of the apostrophes out, including first apostrophes that have
2847+
# been parsed as characters
28472848
napostrophes = 0
28482849
new_toks = []
28492850
for tok in toks[0]:
28502851
if isinstance(tok, six.string_types) and tok not in ('^', '_'):
28512852
napostrophes += len(tok)
2853+
elif isinstance(tok, Char) and tok.c == "'":
2854+
napostrophes += 1
28522855
else:
28532856
new_toks.append(tok)
28542857
toks = new_toks
@@ -2903,6 +2906,9 @@ def subsuper(self, s, loc, toks):
29032906
super = Hlist([])
29042907
for i in range(napostrophes):
29052908
super.children.extend(self.symbol(s, loc, ['\prime']))
2909+
# kern() and hpack() needed to get the metrics right after extending
2910+
super.kern()
2911+
super.hpack()
29062912

29072913
# Handle over/under symbols, such as sum or integral
29082914
if self.is_overunder(nucleus):

lib/matplotlib/patches.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -3011,15 +3011,21 @@ class Bar(_Base):
30113011

30123012
def __init__(self, armA=0., armB=0., fraction=0.3, angle=None):
30133013
"""
3014-
*armA* : minimum length of armA
3014+
Parameters
3015+
----------
3016+
armA : float
3017+
minimum length of armA
30153018
3016-
*armB* : minimum length of armB
3019+
armB : float
3020+
minimum length of armB
30173021
3018-
*fraction* : a fraction of the distance between two points that
3019-
will be added to armA and armB.
3022+
fraction : float
3023+
a fraction of the distance between two points that
3024+
will be added to armA and armB.
30203025
3021-
*angle* : angle of the connecting line (if None, parallel to A
3022-
and B)
3026+
angle : float or None
3027+
angle of the connecting line (if None, parallel
3028+
to A and B)
30233029
"""
30243030
self.armA = armA
30253031
self.armB = armB

lib/matplotlib/quiver.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class QuiverKey(martist.Artist):
228228
""" Labelled arrow for use as a quiver plot scale key."""
229229
halign = {'N': 'center', 'S': 'center', 'E': 'left', 'W': 'right'}
230230
valign = {'N': 'bottom', 'S': 'top', 'E': 'center', 'W': 'center'}
231-
pivot = {'N': 'mid', 'S': 'mid', 'E': 'tip', 'W': 'tail'}
231+
pivot = {'N': 'middle', 'S': 'middle', 'E': 'tip', 'W': 'tail'}
232232

233233
def __init__(self, Q, X, Y, U, label, **kw):
234234
martist.Artist.__init__(self)
@@ -708,6 +708,10 @@ def _h_arrows(self, length):
708708
X = X - X[:, 3, np.newaxis] # numpy bug? using -= does not
709709
# work here unless we multiply
710710
# by a float first, as with 'mid'.
711+
elif self.pivot != 'tail':
712+
raise ValueError(("Quiver.pivot must have value in {{'middle', "
713+
"'tip', 'tail'}} not {}").format(self.pivot))
714+
711715
tooshort = length < self.minlength
712716
if tooshort.any():
713717
# Use a heptagonal dot:
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_31.svg

+214-17
Loading
Binary file not shown.

0 commit comments

Comments
 (0)