ValueError: stretch is invalid #2006

Merged
merged 1 commit into from May 15, 2013

Conversation

Projects
None yet
4 participants
Owner

mdboom commented May 15, 2013

On current master

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

results in

Traceback (most recent call last):
  File "mpl_xkcd.py", line 19, in <module>
    fig, ax = plt.subplots()
  File "/scratch/matplotlib/lib/matplotlib/pyplot.py", line 1034, in subplots
    ax0 = fig.add_subplot(nrows, ncols, 1, **subplot_kw)
  File "/scratch/matplotlib/lib/matplotlib/figure.py", line 914, in add_subplot
    a = subplot_class_factory(projection_class)(self, *args, **kwargs)
  File "/scratch/matplotlib/lib/matplotlib/axes.py", line 9225, in __init__
    self._axes_class.__init__(self, fig, self.figbox, **kwargs)
  File "/scratch/matplotlib/lib/matplotlib/axes.py", line 450, in __init__
    self._init_axis()
  File "/scratch/matplotlib/lib/matplotlib/axes.py", line 507, in _init_axis
    self.xaxis = maxis.XAxis(self)
  File "/scratch/matplotlib/lib/matplotlib/axis.py", line 645, in __init__
    self.label = self._get_label()
  File "/scratch/matplotlib/lib/matplotlib/axis.py", line 1615, in _get_label
    weight=rcParams['axes.labelweight']),
  File "/scratch/matplotlib/lib/matplotlib/font_manager.py", line 689, in __init__
    self.set_stretch(stretch)
  File "/scratch/matplotlib/lib/matplotlib/font_manager.py", line 872, in set_stretch
    raise ValueError("stretch is invalid")
ValueError: stretch is invalid

Maybe this is related to commit cc61700

Member

pelson commented May 15, 2013

Thanks for reporting. I can't reproduce this - have you changed any values in rcParams? Did you re-build matplotlib when updating?

I've marked this as a 1.3.x release blocker as I think we need to get to the bottom of this before we can continue with the release.

bmu commented May 15, 2013

My mplrc is here. There are some changes. However everything worked fine up to today when I pulled the current master.

Member

pelson commented May 15, 2013

Thanks @bmu - I've commented on the commit where I think a bug was introduced.

Owner

mdboom commented May 15, 2013

@bmu: Can you confirm the attached patch resolves your issue?

bmu commented May 15, 2013

yup, thist solves the issue. Thanks

mdboom added a commit that referenced this pull request May 15, 2013

@mdboom mdboom merged commit ab5a141 into matplotlib:master May 15, 2013

1 check passed

default The Travis CI build passed
Details

@mdboom mdboom deleted the mdboom:fix-stretch-invalid branch Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment