-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
ENH better error message for wrong fontsize #4159
Conversation
👍 |
@@ -899,7 +899,9 @@ def set_size(self, size): | |||
size = float(size) | |||
except ValueError: | |||
if size is not None and size not in font_scalings: | |||
raise ValueError("size is invalid") | |||
raise ValueError( | |||
"Size is invalid. Valid font size are" + ", ".join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super picky: I think you need a trailing space after 'are' and I don't think you need the []
in the generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need [] for python 2.6 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, maybe. Ignore my comment if that is the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested and it works without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. I can't remember. Better safe than sorry.
On Wed, Feb 25, 2015 at 12:13 PM, Thomas A Caswell <notifications@github.com
wrote:
In lib/matplotlib/font_manager.py
#4159 (comment):@@ -899,7 +899,9 @@ def set_size(self, size):
size = float(size)
except ValueError:
if size is not None and size not in font_scalings:
raise ValueError("size is invalid")
raise ValueError(
"Size is invalid. Valid font size are" + ", ".join(
Oh, maybe. Ignore my comment if that is the case.
—
Reply to this email directly or view it on GitHub
https://github.com/matplotlib/matplotlib/pull/4159/files#r25358324.
When the fontsize provided is unknown to matplotlib, the error raised now contains the list of known fontsize.
Everything is fixed. |
Thanks! I'll merge as soon as travis finishes. |
ENH better error message for wrong fontsize
When the fontsize provided is unknown to matplotlib, the error raised now
contains the list of known fontsize.