Open pollo-coder opened 2 months ago
Thanks for the report. Looks like this was introduced in #27009.
@datapythonista / @jorisvandenbossche - do you know why there is different behavior here for Series vs DataFrame? Ref: https://github.com/pandas-dev/pandas/pull/27009#discussion_r299048026
hi @datapythonista @jorisvandenbossche what s your view? i d be v interested!
Research
[X] I have searched the [pandas] tag on StackOverflow for similar questions.
[X] I have asked my usage related question on StackOverflow.
Link to question on StackOverflow
https://stackoverflow.com/questions/72375976/odd-behavior-of-plotting-in-pandas
Question about pandas
I had asked this question on SO some time ago but got no satisfactory answer.
Essentially the question (slightly improved wrt what i asked on SO) was, after having imported necessary packages:
why this code reuses the figure (so i end up with just one figure)
while this one does not (and i end up with two figures)
?
Then i debugged a little bit and noticed that this is caused by the following two lines
in the PlotAccessor.call in pandas/pandas/plotting/_core.py around line 990
Why do we need those two lines? What is the logic behind? Could we just remove them or set
kwargs["reuse_plot"]
always toTrue
? I do not see the reason for the inconsistency.