11

for example, when I plot something and add titles and so forth, I get a list of lines showing output like the ones below before the actual plot shows, sometimes very long lists.

<matplotlib.figure.Figure at 0x244deb8dd68>

<matplotlib.axes._subplots.AxesSubplot at 0x244deb99358>

<matplotlib.text.Text at 0x244defc9240>

Is there a way to hide these when plotting?

1
  • Can you show us how you're adding the titles, etc? Commented Mar 6, 2017 at 21:28

1 Answer 1

19

Add ";" after your matplotlib commands. This seems to suppress output.

plt.plot(np.arange(0,5))
plt.title('Some Title')

Yields:

<matplotlib.text.Text at 0x119188490>

and an image.

Yet:

plt.plot(np.arange(0,5))
plt.title('Some Title');

just yields the image.

This was done using python 2 in a v4 Jupyter notebook.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.