Is it possible to suppress the array output when plotting a histogram in ipython?:
For example:
plt.hist(OIR['Range'], bins, named=True, histtype='bar')
outputs/prints the array information before displaying the graph.
Put a ';' at the end of a line to suppress the printing of output.
Capturing Output With %%capture IPython has a cell magic, %%capture , which captures the stdout/stderr of a cell. With this magic you can discard these streams or store them in a variable. By default, %%capture discards these streams. This is a simple way to suppress unwanted output.
We can simply save plots generated from Matplotlib using savefig() and imsave() methods. If we are in interactive mode, the plot might get displayed. To avoid the display of plot we use close() and ioff() methods.
just put ;
after the code.
It works only in ipython-notebook.
plt.hist(...);
Assign the return value to a variable (which I call _
to indicate it's unused):
_ = plt.hist(...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With