笔记本中的中心输出(图) [英] Center output (plots) in the notebook

查看:118
本文介绍了笔记本中的中心输出(图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚升级到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;
    }

这篇关于笔记本中的中心输出(图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆