Skip to content

BUG: Min/max markers on box plot are not visible with 'dark_background' theme #40769

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
sandyscott opened this issue Apr 3, 2021 · 2 comments · Fixed by #41349
Closed

BUG: Min/max markers on box plot are not visible with 'dark_background' theme #40769

sandyscott opened this issue Apr 3, 2021 · 2 comments · Fixed by #41349
Assignees
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Visualization plotting
Milestone

Comments

@sandyscott
Copy link

The min & max markers (the short lines at the ends of the whiskers) aren't visible with the 'dark_background' theme

Code Sample, a copy-pastable example

import pandas as pd
import matplotlib.pyplot as plt

# Data is from the pandas plotting demo
# https://pandas.pydata.org/docs/getting_started/intro_tutorials/04_plotting.html
air_quality = pd.read_csv("air_quality_no2.csv", index_col=0, parse_dates=True)

plt.style.use('default')
air_quality.plot.box()

plt.style.use('dark_background')
air_quality.plot.box()

Problem description

The min & max markers (the short lines at the ends of the whiskers) aren't visible with the 'dark_background' theme

112621690-f4f9ab00-8e21-11eb-9fcf-0c734f4d9831

I initially reported this as matplotlib bug here: matplotlib/matplotlib#19778

They concluded it was an issue with pandas.
diegopetrola said: "I also briefly investigated pandas and it seems they have a function called _get_standard_colors() in line 83 of the script called boxplot.py. I am fairly confident that it is this function that overrides the theme and causes the issue."

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit : f2c8480 python : 3.8.6.final.0 python-bits : 64 OS : Linux OS-release : 5.4.72-microsoft-standard-WSL2 Version : #1 SMP Wed Oct 28 23:40:43 UTC 2020 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : C.UTF-8 LOCALE : en_US.UTF-8

pandas : 1.2.3
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 21.0.1
setuptools : 49.6.0
Cython : 0.29.21
pytest : None
hypothesis : None
sphinx : 3.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.13.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None

@sandyscott sandyscott added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 3, 2021
@mzeitlin11
Copy link
Member

Thanks for the report @sandyscott! Confirmed the issue in master, investigations welcome to fix.

@mzeitlin11 mzeitlin11 added Compat pandas objects compatability with Numpy or Python functions Visualization plotting and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 3, 2021
@mzeitlin11 mzeitlin11 added this to the Contributions Welcome milestone Apr 3, 2021
@jnchngc
Copy link

jnchngc commented Apr 4, 2021

take

yeshsurya added a commit to yeshsurya/pandas that referenced this issue Apr 6, 2021
yeshsurya added a commit to yeshsurya/pandas that referenced this issue Apr 8, 2021
@jreback jreback modified the milestones: Contributions Welcome, 1.3 Apr 13, 2021
yeshsurya added a commit to yeshsurya/pandas that referenced this issue May 6, 2021
yeshsurya added a commit to yeshsurya/pandas that referenced this issue May 6, 2021
yeshsurya added a commit to yeshsurya/pandas that referenced this issue May 10, 2021
charlesdong1991 pushed a commit that referenced this issue May 10, 2021
…nd' (#40769) (#41349)

* BUG : Fixing - Min/max markers on box plot are not visible with 'dark_background' (#40769)

* DOC : Replace method path with uesr friendly version (#40769)

* DOC : Formatting change in whatsnew note (#40769)
JulianWgs pushed a commit to JulianWgs/pandas that referenced this issue Jul 3, 2021
…nd' (pandas-dev#40769) (pandas-dev#41349)

* BUG : Fixing - Min/max markers on box plot are not visible with 'dark_background' (pandas-dev#40769)

* DOC : Replace method path with uesr friendly version (pandas-dev#40769)

* DOC : Formatting change in whatsnew note (pandas-dev#40769)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Visualization plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants