Skip to content

Axes.margins() raises ValueError when only **kwargs is used #2510

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

Closed
syoung-m4 opened this issue Oct 10, 2013 · 1 comment
Closed

Axes.margins() raises ValueError when only **kwargs is used #2510

syoung-m4 opened this issue Oct 10, 2013 · 1 comment
Milestone

Comments

@syoung-m4
Copy link

The docs state that 'margins(x=xmargin, y=ymargin)' is valid, however a ValueError is raised stating "more than two arguments were supplied". The problem seems a simple fix.

starting at axes.py line 1835 (version 1.3.0)

        if len(args) == 1:
            mx = my = args[0]
        elif len(args) == 2:
            mx, my = args
        else:
            raise ValueError("more than two arguments were supplied")

The else should be modified to

        elif len(args)>2:
@tacaswell
Copy link
Member

👍 Can you make a PR and add a test that exercises this?

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 24, 2014
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

No branches or pull requests

2 participants