8000 ENH better error message for wrong fontsize by NelleV · Pull Request #4159 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

ENH better error message for wrong fontsize #4159

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

Merged
merged 1 commit into from
Feb 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
NelleV committed Feb 25, 2015
commit 44141d603a4cdcf80820efcc70108c8814f6e0cc
4 changes: 3 additions & 1 deletion lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
str(i) for i in font_scalings.keys()))
self._size = size

def set_file(self, file):
Expand Down
0