-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
bug: Figure.savefig(fname="...") not working #5323
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
Conversation
map `fname` to `filename` in kwargs passed down to `Canvas.print_figure`.
|
I don't quite understand how that commit (or the PR it is in #907) caused this bug. Looking back it is not clear to me this ever worked. Can you add a check that both |
Hmm, yeah, not sure either, actually. We had one instance of this in obspy/obspy (see above linked issue) and it was reported to us today. I'm pretty sure I would have come across it had it been in matplotlib some years ago, but I'm not sure and I guess it doesn't make a difference, just needs fixing now.
I'm not sure about this.. |
|
I milestoned too quickly on this one based on the reported introduction in 8cdc0da. I think we could safely do this later given where we are in the 1.5.0 cycle. I fear this is one of those dark things where the docs has just been wrong forever. It's been referred to as fname in the savefig docs since at least 2006, and filename in print_figure since around the same time. |
Yeah, I know what you mean. One more reason to get rid of legacy |
|
Part of the problem here is that we are doing our own arg/kwarg parsing The kwargs are passed through so passing filename currently works. If we On Mon, Oct 26, 2015, 17:55 Michael Droettboom notifications@github.com
|
|
punted to next bug-fix release. |
phobson
left a comment
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.
This seems good, but it'd be good to include a test to show that this works.
|
I don't think this PR is needed anymore with 3.0; fname is a positional argument, and our signature strictly enforces it, so unless I'm misunderstanding |
Due to a mismatch in
kwargnamesFigure.savefig(fname="...")is raising an exception (i.e. specifying output filename askwargas opposed to first (and only)arg. I think this bug was introduced with 8cdc0da.Code to reproduce:
The attached commit fixes the problem.