Блокнот Jupyter: аннотация (и) лежит / лежит вне заданного размера рисунка - PullRequest
0 голосов
/ 05 февраля 2020

Я пытаюсь построить сводную таблицу в виде гистограммы, и Jupyter Notebook выдает мне ошибку, которую я не совсем понимаю.

Вот мой код:

import matplotlib.pyplot as plt

sex_pivot = train.pivot_table(index=["Sex", "Pclass"],values="Survived")
sex_pivot.plot.bar()
plt.show()

Вот вывод:

<matplotlib.figure.Figure at 0x7f4dc25c1278>
<matplotlib.figure.Figure at 0x7f4dc22aaac8>

Вот мое сообщение об ошибке:

/dataquest/system/env/python3/lib/python3.4/site-packages/plotly/matplotlylib/renderer.py:522: UserWarning:

Looks like the annotation(s) you are trying 
to draw lies/lay outside the given figure size.

Therefore, the resulting Plotly figure may not be 
large enough to view the full text. To adjust 
the size of the figure, use the 'width' and 
'height' keys in the Layout object. Alternatively,
use the Margin object to adjust the figure's margins.

/dataquest/system/env/python3/lib/python3.4/site-packages/plotly/matplotlylib/renderer.py:487: UserWarning:

I found a path object that I don't think is part of a bar chart. Ignoring.

Может кто-то, пожалуйста, скажите мне, что я должен напечатать, чтобы решить эту проблему и отобразить диаграмму?

1 Ответ

0 голосов
/ 05 февраля 2020

Я использовал% matplotlib notebook, и это решило мою проблему.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...