为什么我在Jupyter笔记本中得到两个图(而不是一个图?)>

问题描述 投票:0回答:1

使用%matplotlib笔记本时,我得到了两个图,而不是熊猫系列中的一个图。

单元格中的代码为:

%matplotlib notebook
import matplotlib.pyplot as plt
fig=plt.figure()
ax1=fig.add_subplot(1,1,1)
cTitle='H-alpha plot '+galaxy[10:17]
cXAxisTitle='Galactocentric radius/pixels'
cYAxisTitle='Data counts'
ax1.set_title(cTitle)
ax1.set_xlabel(cXAxisTitle)
ax1.set_ylabel(cYAxisTitle)
ax1.grid()
ds.plot()

我得到图1和图2:

enter image description here

enter image description here

图1中的标题,轴标签和网格线是我想要的(期望),图2中的图也是我期望的。但是为什么我还是要得到两个地块?

[使用%matplotlib笔记本时,我得到了两个图,而不是熊猫系列中的一个图。单元格中的代码为:%matplotlib笔记本将matplotlib.pyplot导入为plt fig = plt.figure()ax1 = fig.add_subplot(...

pandas matplotlib jupyter-notebook
1个回答
0
投票

开始于:

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.