2

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?

2
  • 3
    generally, to suppress any output in jupyter notebook (except for those from print), just add ; after your last command in the cell :-). Commented Mar 23, 2021 at 2:52
  • @QuangHoang that is extremely useful as well thank you! Commented Mar 23, 2021 at 4:00

1 Answer 1

2

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.