-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: color list passed in as list/array/series of colors only picks up first color. #40605
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
Comments
Have you tried adding the colour list as an argument to the dataframe your using, then referencing that attribute of the df in the scatter? I had a similar problem with mpl.scatter, and that fixed it |
What's |
I posted this over a year ago so don't remember however i think i remember importing pandas as EDIT: let me look though i might have this somewhere and if i find it or reproduce it i'll check back |
For now, this looks fine, as the docs state:
and your dataframe only has one column |
closing for now as I'm pretty sure this is behaving as documented, but can reopen if you paste a reproducible example |
So I found this issue was fixed in 2017 and 2019 respectively, however I think it's back. I spent half the day trying to figure out what I was doing wrong until I stumbled upon this thread/report: #16822
And it seems like the bug may have crawled its way back in? Sorry if I should not have opened a new bug report however you mentioned opening a new bug report for the 2019 reports of this bug so I figured I would report that it might be back as well.
[x ] I have checked that this issue has not already been reported.
[x ] I have confirmed this bug exists on the latest version of pandas.
[x ] (optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
So I have a dataframe with 1 data column and an index column, the dataframe has 50 values/rows in it and when i pass in a list of 50 colors I would expect those colors get matched up with each bar (or in my case half the bars are one color and half another) however only the first color passed in gets used to color all of the bars.
Expected Output
A bar graph with multiple colored bars rather than just 1 color
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : f2c8480
python : 3.8.8.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 11, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.2.3
numpy : 1.18.5
pytz : 2021.1
dateutil : 2.8.1
pip : 21.0.1
setuptools : 52.0.0.post20210125
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 1.3.7
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.21.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.6.1
sqlalchemy : 1.3.18
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
None
The text was updated successfully, but these errors were encountered: