Skip to content

BUG: Hexbin plots does not display x label and xtick labels in pandas 1.3.3 #44050

Closed
@stelios-c

Description

@stelios-c

  • 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 master branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(1000, 2), columns=['a', 'b'])
df.plot.hexbin(x='a', y='b');
#thanks @rabernat

Issue Description

Hexbin plots does not display x label and xtick labels. This has been a bug in the past, see closed issue #10678 , it must have been fixed with #20446 and must have been introduced again later.

Expected Behavior

Expect to see 'a' as the x label and numbers under the x axis ticks. This is only achievable with workaround:

import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(1000, 2), columns=['a', 'b'])
df.plot.hexbin(x='a', y='b',sharex=False);

Installed Versions

INSTALLED VERSIONS

commit : 73c6825
python : 3.7.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.0-18-cloud-amd64
Version : #1 SMP Debian 4.19.208-1 (2021-09-29)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.3.3
numpy : 1.19.5
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.28.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fsspec : 2021.10.0
fastparquet : None
gcsfs : 2021.10.0
matplotlib : 3.4.3
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 5.0.0
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.54.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions