Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: stretch is invalid #2006

Merged
merged 1 commit into from May 15, 2013
Merged

Conversation

mdboom
Copy link
Member

@mdboom 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

@pelson
Copy link
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
Copy link
Author

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.

@pelson
Copy link
Member

pelson commented May 15, 2013

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

@mdboom
Copy link
Member

mdboom commented May 15, 2013

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

@bmu
Copy link
Author

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
@mdboom mdboom deleted the fix-stretch-invalid branch August 7, 2014 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants