BUG: Plotting charts in different orders creates different plot outputs #36083
Labels
Bug
Duplicate Report
Duplicate issue or pull request
Needs Triage
Issue that has not been reviewed by a pandas team member
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample
Problem description
Plotting the "separate" plot before the "total" plot results in the following graphs:
separate_plot.png:

total_plot.png:

As you can see, the lines from the "separate" plot also appear on the "total" plot, despite not grouping by "group" in the "total" plot. In my testing, this only occurs when the "separate" plot is made before the "total" plot.
Expected Output
The graphs should look something like the following regardless of which is plotted first:
separate_plot.png:

total_plot.png:

Output of
pd.show_versions()
/usr/lib/python3.8/site-packages/_distutils_hack/init.py:30: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
INSTALLED VERSIONS
commit : f2ca0a2
python : 3.8.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.8.5_1
Version : #1 SMP Thu Aug 27 08:23:40 UTC 2020
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.1
numpy : 1.19.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 50.0.0
Cython : None
pytest : 5.4.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.18.1
pandas_datareader: None
bs4 : 4.8.2
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.1
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: