笔记本中的中心输出(图)

编程入门 行业动态 更新时间:2024-10-15 04:24:24
本文介绍了笔记本中的中心输出(图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚升级到IPython 1.0,新的笔记本界面表现非常出色。在我的屏幕上,它现在的默认宽度约为页面的50%,从而提高了可读性。但是,我经常使用长时间系列,我更喜欢显示它们。

I just upgraded to IPython 1.0 and the new notebook interface performs really well. On my screen it now has a default width of about 50% of the page which improves readability. However, i often work with long timeseries which i prefer to display as wide as possible.

非常宽的图片只会向右延伸。有没有办法显示输出更宽,然后默认扩展为居中事项?

Very wide pictures will only extend further to the right. Is there a way to display output wider then the default to expand in a centered matter?

附图显示第一个单元格中的正常内联图,宽度较小那么默认的笔记本宽度。第二个图更宽,向右扩展。这使我的屏幕左侧四分之一未使用。

The attached picture shows a normal inline plot in the first cell, which is less wide then the default notebook width. The second plot is wider and expands to the right. This leaves about the left quarter of my screen unused.

推荐答案

@tooblippe给出的答案虽然改变了笔记本的风格,却没有解决题。但是,使用该解决方案的第一部分,您将能够实现图的居中。此解决方案适用于 ipython == 3.1.0 。对于包含Jupyter的更高版本,您可能希望编辑 Jupyter 的样式。

The answer given by @tooblippe, although changes the style of the notebook, does not address the question. However, using the first part of that solution, you would be able to achieve the centering of the plots. This solution works for ipython==3.1.0. For higher versions that include Jupyter, you would want to edit the styling of Jupyter instead.

因此,解决方案将是:您可以修改上述css文件或将此行添加到ipython文件夹中ipython环境的样式中:

So, the solution would be: You can either modify the above css file or add this line to the styling of your ipython environment in the ipython folder:

.output_png { display: table-cell; text-align: center; vertical-align: middle; }

更多推荐

笔记本中的中心输出(图)

本文发布于:2023-11-30 03:03:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648504.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:笔记本   中心

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!