Code Sample, a copy-pastable example if possible

from pandas import DataFrame

df = DataFrame({"A": [1, 2], 'B': [3, 4]})
df.plot(x=0, y=1)

Problem description

IndexError: index 1 is out of bounds for axis 0 with size 1

I came across this when writing test cases for my PR #20000 - looks like it happens due to calling set_index on the data rather than on a copy. I can potentially fix it there or open a separate PR.

Comment From: gfyoung

Indeed, that does look very odd! Patch is by all means welcome.

(BTW, fine job are securing such a nice, round number for your other PR 😉 )

Comment From: masongallo

(BTW, fine job are securing such a nice, round number for your other PR 😉 )

I waited for just the right moment :)

I didn't see anywhere in the plotting test cases that tested for integer args so it's possible this slipped through for awhile.

Comment From: masongallo

I'm going to remove support for integer args in my PR - I think it's confusing to allow both integer & names

Comment From: mroeschke

Looks like this has been fixed and appears to have tests so closing