justin franklin
justin franklin

Reputation: 35

How do I remove matplotlib text output in Jupyter Notebook

I am currently writing an undergraduate senior thesis using jupyter notebook. When I convert my notebook to pdf using latex, it keeps these function calls in the form of text(I am not sure what to call them).

For example, if I attempt to create a pie chart with this code:

fig1, ax1 = plt.subplots()
df['fraud'].value_counts().plot.pie(autopct='%1.3f%%',explode=[0,0.1])
plt.show 

The pie chart outputs correctly, but it also adds this line of text:

<function matplotlib.pyplot.show(close=None, block=None)>

Is there a way to only output the chart?

Upvotes: 2

Views: 2280

Answers (1)

Lalo Venegas
Lalo Venegas

Reputation: 58

You have to change plt.show to plt.show().

Upvotes: 2

Related Questions