Issue
I want to publish an HTML (preferably) or PDF from a Jupyter notebook, however when I export from Visual Studio Code it also outputs some annoying text that I do not want for certain cells, alongside the expected output. See for example:
Input:
fig, axs = plt.subplots(2,5, figsize=(20,10))
axs[0,0].hist(pay_data_trim['amount'], bins=15, color = 'b')
axs[0,0].set_ylabel('Frequency', fontsize=14)
axs[0,0].set_title('amount', fontsize=14)
axs[1,0].boxplot(pay_data_trim['amount'])
axs[1,0].set_ylabel('IQR + Outliers', fontsize=14)
axs[0,1].hist(pay_data_trim['oldbalanceOrg'], bins=15, color = 'g')
axs[0,1].set_title('oldbalanceOrg', fontsize=14)
axs[1,1].boxplot(pay_data_trim['oldbalanceOrg'])
(by the way I haven't finished this chunk, so the figure is incomplete)
Output:
{'whiskers': [<matplotlib.lines.Line2D at 0x7ff133493760>,
<matplotlib.lines.Line2D at 0x7ff133493a30>],
'caps': [<matplotlib.lines.Line2D at 0x7ff133493d00>,
<matplotlib.lines.Line2D at 0x7ff133493fd0>],
'boxes': [<matplotlib.lines.Line2D at 0x7ff133493370>],
'medians': [<matplotlib.lines.Line2D at 0x7ff1334bc2e0>],
'fliers': [<matplotlib.lines.Line2D at 0x7ff1334bc5b0>],
'means': []}
As well as the figure (so no problems with that). However I don't want to publish the meaningless output text. Does anyone know how to mute it in Visual Studio Code? Alternatively, if you can recommend a software/interface/anything that I can use to publish this without the unwanted text, I'm happy to take recommendations.
Thanks for your help!
Solution
Adding plt.show()
at the end of the statement solved the problem, as suggested by @Michael S.
Additionally, comments from @Wayne and @JialeDu were very helpful.
Answered By - Sebastian Quezada
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.