plot没有xlabel或axis值

plot没有xlabel或axis值

本文介绍了pandas dataframe hexbin plot没有xlabel或axis值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据框架绘制为hexbin,但似乎无法绘制xlabel和x轴值。数据框如下:

I am trying to plot a dataframe as hexbin but can't seem to get the xlabel and x-axis values to plot. The dataframe is as follows:

szen_df.xs('left', level='pos')

,情节如下:

szen_df.xs('left', level='pos').plot(x='szen', y='lat', xlim=(0,90), ylim=(-90,90), kind='hexbin', colormap='Reds' )

结果:

推荐答案

我在python 2.7,pandas 0.16.2.dev和ipython 3.1.0版本中也遇到了这个问题。

I'm seeing this problem as well with python 2.7, pandas 0.16.2.dev, and ipython version 3.1.0.

期待,唯一参考对于x标签和不可见的刻度是在sharex选项中。所以,我手动设置sharex = False,poof,xlabel和xticks回来。

Looking to the documentation for pandas.DataFrame.plot, the only reference to the x labels and ticks being invisible is in the sharex option. So, I manually set sharex=False, and poof, the xlabel and xticks come back.

显然这是一个错误,但我希望这暂时有所帮助。我会将这些评论添加到您已经开始的错误报告中。

Clearly this is a bug, but I hope this helps for the time being. I'll add these comments to the bug report that you've already started.

这篇关于pandas dataframe hexbin plot没有xlabel或axis值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 14:45