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

Skip to content

Commit 5d56ca8

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.x'
Conflicts: .travis.yml resolved in favor of master lib/matplotlib/cbook.py resolved in favor of v2.x lib/matplotlib/font_manager.py resolved in favor of master tests.py resolved in favor of master
2 parents 1f08d1c + e64a0a1 commit 5d56ca8

File tree

7 files changed

+32
-21
lines changed

7 files changed

+32
-21
lines changed

examples/pylab_examples/barchart_demo2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def format_score(scr, test):
5050
"""
5151
md = testMeta[test]
5252
if md:
53-
return '{}\n{}'.format(scr, md)
53+
return '{0}\n{1}'.format(scr, md)
5454
else:
5555
return scr
5656

@@ -86,7 +86,7 @@ def plot_student_results(student, scores, cohort_size):
8686
# Plot a solid vertical gridline to highlight the median position
8787
ax1.axvline(50, color='grey', alpha=0.25)
8888
# set X-axis tick marks at the deciles
89-
cohort_label = ax1.text(.5, -.07, 'Cohort Size: {}'.format(cohort_size),
89+
cohort_label = ax1.text(.5, -.07, 'Cohort Size: {0}'.format(cohort_size),
9090
horizontalalignment='center', size='small',
9191
transform=ax1.transAxes)
9292

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,5 +1583,5 @@ def kwdoc(a):
15831583

15841584
docstring.interpd.update(Artist=kwdoc(Artist))
15851585

1586-
_get_axes_msg = """{} has been deprecated in mpl 1.5, please use the
1586+
_get_axes_msg = """{0} has been deprecated in mpl 1.5, please use the
15871587
axes property. A removal date has not been set."""

lib/matplotlib/axis.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,25 +249,27 @@ def get_loc(self):
249249
@allow_rasterization
250250
def draw(self, renderer):
251251
if not self.get_visible():
252+
self.stale = False
252253
return
253-
renderer.open_group(self.__name__)
254+
254255
midPoint = mtransforms.interval_contains(self.get_view_interval(),
255256
self.get_loc())
256257

257258
if midPoint:
259+
renderer.open_group(self.__name__)
258260
if self.gridOn:
259261
self.gridline.draw(renderer)
260262
if self.tick1On:
261263
self.tick1line.draw(renderer)
262264
if self.tick2On:
263265
self.tick2line.draw(renderer)
264266

265-
if self.label1On:
266-
self.label1.draw(renderer)
267-
if self.label2On:
268-
self.label2.draw(renderer)
267+
if self.label1On:
268+
self.label1.draw(renderer)
269+
if self.label2On:
270+
self.label2.draw(renderer)
271+
renderer.close_group(self.__name__)
269272

270-
renderer.close_group(self.__name__)
271273
self.stale = False
272274

273275
def set_label1(self, s):

lib/matplotlib/cbook.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,13 @@ def get_label(y, default_name):
24512451
def _putmask(a, mask, values):
24522452
return np.copyto(a, values, where=mask)
24532453

2454+
_lockstr = """\
2455+
LOCKERROR: matplotlib is trying to acquire the lock {!r}
2456+
and has failed. This maybe due to any other process holding this
2457+
lock. If you are sure no other matplotlib process in running try
2458+
removing this folder(s) and trying again.
2459+
"""
2460+
24542461

24552462
class Locked(object):
24562463
"""
@@ -2462,29 +2469,31 @@ class Locked(object):
24622469
All Rights Reserved
24632470
24642471
conda is distributed under the terms of the BSD 3-clause license.
2465-
Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
2472+
Consult LICENSE_CONDA or http://opensource.org/licenses/BSD-3-Clause.
24662473
"""
2474+
LOCKFN = '.matplotlib_lock'
2475+
24672476
def __init__(self, path):
2468-
LOCKFN = '.matplotlib_lock'
24692477
self.path = path
24702478
self.end = "-" + str(os.getpid())
2471-
self.lock_path = os.path.join(self.path, LOCKFN + self.end)
2472-
self.pattern = os.path.join(self.path, LOCKFN + '-*')
2479+
self.lock_path = os.path.join(self.path, self.LOCKFN + self.end)
2480+
self.pattern = os.path.join(self.path, self.LOCKFN + '-*')
24732481
self.remove = True
24742482

24752483
def __enter__(self):
2476-
retries = 10
2484+
retries = 50
24772485
sleeptime = 1
24782486
while retries:
24792487
files = glob.glob(self.pattern)
24802488
if files and not files[0].endswith(self.end):
24812489
time.sleep(sleeptime)
2482-
sleeptime *= 2
2490+
sleeptime *= 1.1
24832491
retries -= 1
24842492
else:
24852493
break
24862494
else:
2487-
raise RuntimeError(lockstr)
2495+
err_str = _lockstr.format(self.pattern)
2496+
raise RuntimeError(err_str)
24882497

24892498
if not files:
24902499
try:

lib/matplotlib/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def set_linestyle(self, ls):
10701070
ls = ls_mapper_r[ls]
10711071
except KeyError:
10721072
raise ValueError(("You passed in an invalid linestyle, "
1073-
"`{}`. See "
1073+
"`{0}`. See "
10741074
"docs of Line2D.set_linestyle for "
10751075
"valid values.").format(ls))
10761076

lib/matplotlib/quiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ def _h_arrows(self, length):
710710
# by a float first, as with 'mid'.
711711
elif self.pivot != 'tail':
712712
raise ValueError(("Quiver.pivot must have value in {{'middle', "
713-
"'tip', 'tail'}} not {}").format(self.pivot))
713+
"'tip', 'tail'}} not {0}").format(self.pivot))
714714

715715
tooshort = length < self.minlength
716716
if tooshort.any():

lib/mpl_toolkits/axes_grid1/axes_rgb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ def imshow_rgb(self, r, g, b, **kwargs):
205205
ny, nx = r.shape
206206
if not ((nx, ny) == g.shape == b.shape):
207207
raise ValueError('Input shapes do not match.'
208-
'\nr.shape = {}'
209-
'\ng.shape = {}'
210-
'\nb.shape = {}'
208+
'\nr.shape = {0}'
209+
'\ng.shape = {1}'
210+
'\nb.shape = {2}'
211211
''.format(r.shape, g.shape, b.shape))
212212

213213
R = np.zeros([ny, nx, 3], dtype="d")

0 commit comments

Comments
 (0)