在JupyterLab中如何绘制可滚动x轴的条形图?

2024-04-20 03:21:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用%matplotlib inline绘制条形图。x轴上的数据类别是大量的,所以我想使x轴可滚动。在

使用jupyter/datascience笔记本映像托管JupyterLab。我不能使用matplotlib小部件或笔记本后端使图形交互

%matplotlib inline

import matplotlib.pyplot as plt
.
.                                 //some logic
.
.
wordsForPlottingBarGraph = wordsDF.head(15)
plt.bar(wordsForPlottingBarGraph.get('words'),wordsForPlottingBarGraph.get('frequency'))

输出: enter image description here

当我试图增加x轴上的数据类别时,这在x轴上变得更加笨拙


Tags: 数据getmatplotlib部件绘制inline笔记本jupyter