BUG: DataFrame.plot(kind='scatter') does not raise KeyError when unknown colormap is applied

This issue has been created since 2022-09-23.

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

import pandas as pd
iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')
iris.plot(x='sepal_length', y='sepal_width', colormap='unknown')
# -> TypeError raised as expected
iris.plot(x='sepal_length', y='sepal_width', colormap='unknown', kind='scatter')
# -> TypeError is expected but not raised at version 1.5.0

Issue Description

.plot(..., colormap='unknown') raises TypeError because the colormap is unknown, but .plot(..., colormap='unknown', kind='scatter') does raise TypeError.

Expected Behavior

.plot(..., cmap='unknown', kind='scatter') will raise TypeError.

Installed Versions

INSTALLED VERSIONS

commit : 87cfe4e
python : 3.10.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.16.3-microsoft-standard-WSL2
Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.5.0
numpy : 1.23.3
pytz : 2022.2.1
dateutil : 2.8.2
setuptools : 65.3.0
pip : 22.2.2
Cython : None
pytest : 7.1.3
hypothesis : None
sphinx : 5.1.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.5.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.6.0
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 9.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.8.1
snappy : None
sqlalchemy : 1.4.41
tables : None
tabulate : 0.8.10
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None

phofl wrote this answer on 2022-09-23

This will raise a Waring with the newest matplotlib, since colormap has no effect in that scenario, even if a valid value is passed

lisphilar wrote this answer on 2022-09-23

Thank you for your information and pull request!

More Details About Repo
Owner Name pandas-dev
Repo Name pandas
Full Name pandas-dev/pandas
Language Python
Created Date 2010-08-24
Updated Date 2022-09-29
Star Count 35373
Watcher Count 1123
Fork Count 15031
Issue Count 3581

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
webauthn and passkeys support 0 2022-07-08 2022-09-08
raise the problem No module named 'exceptions' When train the model 6 2022-07-21 2022-09-24
Dark Reader breaks and Addons website doesn't see my browser after disabling ResistFingerprinting 0 2022-05-13 2022-05-14
Librewolf typo in Settings menu 3 2022-04-03 2022-05-14
Additional documentation request. 1 2022-05-04 2022-05-14
Transfers from 1wallet to KuCoin are not recognized and deposited into the exchange's accounts 5 2022-03-23 2022-08-12
Loss of Funds in 1Wallet After Update 6 2021-11-03 2022-09-10
Reliable relayer and documentations for developers 3 2022-03-04 2022-03-17
No way to edit Recovery Wallet 39 2021-11-03 2022-07-25
METHOD mismatch between config and axios request 1 2021-05-24 2022-07-23
Typegen generated responses contains errors which are thrown and not returned. 1 2021-05-25 2022-08-30
typegen - update dtsgenerator 3 2021-05-10 2022-08-29
set transformResponse in axiosConfigDefaults 0 2021-05-03 2022-09-28
[Bug]: "Filecorelibrary" NDK build failure 40 2021-12-24 2022-09-24
What's the meaning of conv1d with the same input and output size 1 2020-05-08 2022-05-12
沈大大好,关于IP CAMERA安卓版本设置里的自启动功能 0 2021-08-25 2022-08-10
Codecov configuration 0 2022-02-15 2022-08-29
Show more from this tag at the bottom of each post 1 2020-10-23 2022-09-19
is open62541 compatible with Y2038 under a 32-bit architecture? 1 2022-02-19 2022-09-09
good vs bad header fields 5 2021-05-25 2022-09-11
[BUG] - Content Security Policy Headers- Browser complaints about inline scripts, application fails. 1 2021-02-10 2022-09-09
selftests: `mptcp_join.sh`: "multi subflows, fair usage on close" is unstable 0 2022-01-31 2022-09-16
authenticateEmail with username fails 2 2021-01-28 2022-09-28
HearthMirror.GetRewardTrackData() no longer works 0 2022-09-05 2022-09-21
Do I understand correctly that this issue does not occur with gamemode disabled/removed? 0 2021-11-23 2022-09-14
刚切换主题会提示 themeConfig 函数重复定义 1 2021-09-13 2022-09-22
In the new version of elementor, the finder does not work properly. 7 2021-12-21 2022-07-18
Zoomin and Zoomout with Slider 12 2021-07-29 2022-09-06
adding a border to a cropped image 1 2021-08-06 2022-09-18
API error when using Facebook Marketing source v0.2.54 0 2022-07-20 2022-09-22
Code syntax hightlighting 13 2022-07-20 2022-09-07
Discover possibilities to work around ext-ldap 0 2021-06-24 2022-08-14
Add meta description and open graph tags to docs.sourcegraph.com 0 2021-09-27 2022-09-27
Set Timeout Policy per GRPC Service/Method level 1 2021-12-25 2022-09-14
React Native iOS: error: duplicate interface definition for class 'BugsnagApp' 1 2021-10-20 2022-08-03
Choose or design a management protocol 4 2021-10-20 2022-08-13
"resolution" filter just upscales smaller thumbnail 6 2015-12-21 2022-09-15
ValueError: gmp_init(): Argument #1 ($num) is not an integer string in file /home/forge/user/vendor/ccxt/ccxt/php/Precise.php on line 21 2 2022-04-01 2022-09-28
Dark-themed icon 1 2021-09-26 2022-01-07
[DateRangeInput2]: footerElement prop does not render 2 2022-09-12 2022-09-22
purpose of environment-pipeline-copy_codecommit_repositories_to_s3 lambda 1 2021-11-04 2022-09-03
JFR does not work for remote OracleJDK 8 1 2022-06-30 2022-09-27
JFR enabled for JDK 7 1 2022-06-30 2022-09-10
Unable to create ionic 3 project with ionic 6 cli 2 2022-08-19 2022-09-27
Issue cloning repository 6 2020-03-03 2022-09-09
Colemak modifier remapping 2 2021-03-30 2022-09-21
After updating to null safety seems I get this issue 1 2021-07-14 2022-09-14
LDAP Plugin dont support case Sensitive Fieldnames 2 2021-11-08 2022-09-07
インストール画面で未入力で登録を押してもエラーメッセージが表示されない 1 2022-08-26 2022-08-23
Various themes, Form block: outline of submit button is missing. 0 2022-01-09 2022-01-03