• <i id='qwtmu'><tr id='qwtmu'><dt id='qwtmu'><q id='qwtmu'><span id='qwtmu'><b id='qwtmu'><form id='qwtmu'><ins id='qwtmu'></ins><ul id='qwtmu'></ul><sub id='qwtmu'></sub></form><legend id='qwtmu'></legend><bdo id='qwtmu'><pre id='qwtmu'><center id='qwtmu'></center></pre></bdo></b><th id='qwtmu'></th></span></q></dt></tr></i><div id='qwtmu'><tfoot id='qwtmu'></tfoot><dl id='qwtmu'><fieldset id='qwtmu'></fieldset></dl></div>

    <small id='qwtmu'></small><noframes id='qwtmu'>

  • <tfoot id='qwtmu'></tfoot>

      <legend id='qwtmu'><style id='qwtmu'><dir id='qwtmu'><q id='qwtmu'></q></dir></style></legend>

          <bdo id='qwtmu'></bdo><ul id='qwtmu'></ul>

        使用 plotly 离线生成图形作为图像

        Use plotly offline to generate graphs as images(使用 plotly 离线生成图形作为图像)
      1. <tfoot id='ROGsF'></tfoot>
        <legend id='ROGsF'><style id='ROGsF'><dir id='ROGsF'><q id='ROGsF'></q></dir></style></legend>
        • <bdo id='ROGsF'></bdo><ul id='ROGsF'></ul>

                <tbody id='ROGsF'></tbody>

              <small id='ROGsF'></small><noframes id='ROGsF'>

              • <i id='ROGsF'><tr id='ROGsF'><dt id='ROGsF'><q id='ROGsF'><span id='ROGsF'><b id='ROGsF'><form id='ROGsF'><ins id='ROGsF'></ins><ul id='ROGsF'></ul><sub id='ROGsF'></sub></form><legend id='ROGsF'></legend><bdo id='ROGsF'><pre id='ROGsF'><center id='ROGsF'></center></pre></bdo></b><th id='ROGsF'></th></span></q></dt></tr></i><div id='ROGsF'><tfoot id='ROGsF'></tfoot><dl id='ROGsF'><fieldset id='ROGsF'></fieldset></dl></div>
                  本文介绍了使用 plotly 离线生成图形作为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在离线使用 plotly 并且能够使用生成 html 文件

                  I am working with plotly offline and am able to generate an html file using

                  plotly.offline.plot({"data": data, "layout": layout})
                  

                  效果很好.该图已正确生成,并且 html 文件被保存到我的当前目录中.

                  It works great. The graph is generated correctly and the html file gets saved to my current directory.

                  不过,我想要的是,使用 plotly 离线保存一个图像(.png、.jpg 等)文件.我在正确的轨道上吗?我需要从这里做什么?

                  What I want, though is, using plotly offline, is to have an image (.png, .jpg, etc.) file saved instead. Am I on the right track? What do I need to do from here?

                  推荐答案

                  试试这个

                  import plotly.offline
                  import plotly.graph_objs as go
                  
                  plotly.offline.plot({"data": [go.Scatter(x=[1, 2, 3, 4], y=[4, 3, 2, 1])],
                                       "layout": go.Layout(title="hello world")},
                                       image='jpeg', image_filename='test')
                  

                  在 Chrome 中打开

                  and open it in Chrome

                  这篇关于使用 plotly 离线生成图形作为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
                  Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
                  Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
                  Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)
                  How to get file size of newly created Image() if src is base64 string?(如果 src 是 base64 字符串,如何获取新创建的 Image() 的文件大小?)

                    • <bdo id='Ql7Dl'></bdo><ul id='Ql7Dl'></ul>

                      <small id='Ql7Dl'></small><noframes id='Ql7Dl'>

                      • <legend id='Ql7Dl'><style id='Ql7Dl'><dir id='Ql7Dl'><q id='Ql7Dl'></q></dir></style></legend>
                          <i id='Ql7Dl'><tr id='Ql7Dl'><dt id='Ql7Dl'><q id='Ql7Dl'><span id='Ql7Dl'><b id='Ql7Dl'><form id='Ql7Dl'><ins id='Ql7Dl'></ins><ul id='Ql7Dl'></ul><sub id='Ql7Dl'></sub></form><legend id='Ql7Dl'></legend><bdo id='Ql7Dl'><pre id='Ql7Dl'><center id='Ql7Dl'></center></pre></bdo></b><th id='Ql7Dl'></th></span></q></dt></tr></i><div id='Ql7Dl'><tfoot id='Ql7Dl'></tfoot><dl id='Ql7Dl'><fieldset id='Ql7Dl'></fieldset></dl></div>
                            <tbody id='Ql7Dl'></tbody>
                            <tfoot id='Ql7Dl'></tfoot>