Skip to content
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

BUG: Ability to set both color and style in pandas plotting #59461

Closed
3 tasks done
maddytae opened this issue Aug 9, 2024 · 3 comments · Fixed by #59574
Closed
3 tasks done

BUG: Ability to set both color and style in pandas plotting #59461

maddytae opened this issue Aug 9, 2024 · 3 comments · Fixed by #59574
Assignees
Labels

Comments

@maddytae
Copy link

maddytae commented Aug 9, 2024

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

df = pd.DataFrame({
'pig': [20, 18, 489, 675, 1776],
 'horse': [4, 25, 281, 600, 1900]
}, index=[1990, 1997, 2003, 2009, 2014])

color={'pig':'black','horse':'brown'}
style={'pig':'solid','horse':'dashed'}
df.plot.line(color=color,style=style)

plt.show()

Issue Description

In above code we can pass color or style but not both.

Expected Behavior

We should be able to change both color and style.

Installed Versions

INSTALLED VERSIONS

commit : d9cdd2e
python : 3.9.6.final.0
python-bits : 64
OS : Darwin
OS-release : 23.5.0
Version : Darwin Kernel Version 23.5.0: Wed May 1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_CA.UTF-8
LOCALE : en_CA.UTF-8

pandas : 2.2.2
numpy : 1.26.3
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 58.0.4
pip : 21.2.4
Cython : None
pytest : 8.2.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.1.1
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.18.1
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.2
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.8.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 15.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.12.0
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : 2.4.1
pyqt5 : None

@maddytae maddytae added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 9, 2024
@maddytae
Copy link
Author

maddytae commented Aug 9, 2024

df = pd.DataFrame({
'pig': [20, 18, 489, 675, 1776],
 'horse': [4, 25, 281, 600, 1900]
}, index=[1990, 1997, 2003, 2009, 2014])

c={'pig':'black','horse':'brown'}
s={'pig':'-','horse':'--'}
df.plot.line(color=c,style=['-', '--']) #this works
# df.plot.line(color=c,style=s) #this does not


plt.show()

@rpattekar
Copy link

i will take up this issue

@rhshadrach rhshadrach added Visualization plotting Enhancement Bug and removed Needs Triage Issue that has not been reviewed by a pandas team member Bug Enhancement labels Aug 11, 2024
@AntiKnot
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants