I am using a Jupyter notebook. I have a pretty wide screen, but the displayed output (say, when I print a numpy
array) is formatted as if the screen was narrow.
I found a way of increasing the width of the cells, with
from IPython.core.display import HTML
HTML("<style>.container { width:95% !important; }</style>")
but this seems to influence the input only, not the output (see screenshots):
I've tried setting the linewidth
option in numpy.set_printoptions
, I've tried setting numpy.core.arrayprint._line_width
, nothing...
EDIT: Using matplotlib I can set the width of plots (that I plot in the notebook with the magic %matplotlib inline
) with the command plt.rcParams['figure.figsize']=[X,Y]
. It turns out that I can increase X
to have plots fill the output cell horizontally all the way. This means (I think) that the original problem it's a numpy
thing.
question from:
https://stackoverflow.com/questions/37149933/how-to-set-max-output-width-in-numpy 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…