<tfoot id='iRG3P'></tfoot>

      <bdo id='iRG3P'></bdo><ul id='iRG3P'></ul>
    <legend id='iRG3P'><style id='iRG3P'><dir id='iRG3P'><q id='iRG3P'></q></dir></style></legend>

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

      1. <small id='iRG3P'></small><noframes id='iRG3P'>

      2. 获取 &lt;脚本&gt;和 &lt;div&gt;来自 Plotly 的标签使用 Py

        Getting lt;scriptgt; and lt;divgt; tags from Plotly using Python(获取 lt;脚本gt;和 lt;divgt;来自 Plotly 的标签使用 Python)

      3. <i id='Ig98Q'><tr id='Ig98Q'><dt id='Ig98Q'><q id='Ig98Q'><span id='Ig98Q'><b id='Ig98Q'><form id='Ig98Q'><ins id='Ig98Q'></ins><ul id='Ig98Q'></ul><sub id='Ig98Q'></sub></form><legend id='Ig98Q'></legend><bdo id='Ig98Q'><pre id='Ig98Q'><center id='Ig98Q'></center></pre></bdo></b><th id='Ig98Q'></th></span></q></dt></tr></i><div id='Ig98Q'><tfoot id='Ig98Q'></tfoot><dl id='Ig98Q'><fieldset id='Ig98Q'></fieldset></dl></div>
        <tfoot id='Ig98Q'></tfoot>
      4. <legend id='Ig98Q'><style id='Ig98Q'><dir id='Ig98Q'><q id='Ig98Q'></q></dir></style></legend>

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

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

                  <tbody id='Ig98Q'></tbody>
                1. 本文介绍了获取 &lt;脚本&gt;和 &lt;div&gt;来自 Plotly 的标签使用 Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想知道是否有人知道获取 <script>< 的好方法(最好是内置方法,但我当然愿意编写自己的方法);div> 来自 Plotly 离线客户端的 HTML 输出的标签.

                  我已经熟悉散景,并且非常喜欢将它用于 2D 可视化,但我真的很想集成 Plotly 以及它的 3D 可视化功能.

                  如果您需要有关该项目的任何其他详细信息,请告诉我.

                  解决方案

                  如果调用:

                  plotly.offline.plot(data, filename='file.html')

                  它会创建一个名为 file.html 的文件并在您的网络浏览器中打开它.但是,如果你这样做:

                  plotly.offline.plot(data, include_plotlyjs=False, output_type='div')

                  该调用将返回一个字符串,其中仅包含创建图表所需的 div,您可以将其存储在您想要的任何变量中(而不是磁盘).

                  我刚刚尝试过,它返回了,对于我正在做的给定图表:

                  请注意,它只是您应该嵌入更大页面的 html 的一小部分.为此,我使用了标准模板引擎,例如 Jinga2.

                  使用它,您可以创建一个 html 页面,其中包含按您想要的方式排列的多个图表,甚至可以将其作为 对 ajax 调用的服务器响应返回,非常棒.

                  更新:

                  请记住,您需要包含 plotly js 文件才能使所有这些图表正常工作.

                  您可以在放置 div 之前包含 <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>拿到.如果你把这个js放在页面底部,图表就不行了.

                  I was wondering if anyone knew a good way (preferably a built in method, but I'm open to writing my own of course) to get the <script> and <div> tags from the HTML output of the Plotly offline client.

                  I'm already familiar with bokeh and really enjoy using it for 2D visualization, but would really like to integrate Plotly as well for its 3D visualization capabilities.

                  Let me know if you need any extra details about the project.

                  解决方案

                  If you call:

                  plotly.offline.plot(data, filename='file.html')
                  

                  It creates a file named file.html and opens it up in your web browser. However, if you do:

                  plotly.offline.plot(data, include_plotlyjs=False, output_type='div')
                  

                  the call will return a string with only the div required to create the chart, which you can store in whatever variable you desire (and not to disk).

                  I just tried it and it returned, for a given chart that I was doing:

                  <div id="82072c0d-ba8d-4e86-b000-0892be065ca8" style="height: 100%; width: 100%;" class="plotly-graph-div"></div>
                  <script type="text/javascript">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL="https://plot.ly";Plotly.newPlot("82072c0d-ba8d-4e86-b000-0892be065ca8", 
                  [{"y": ..bunch of data..., "x": ..lots of data.., {"showlegend": true, "title": "the title", "xaxis": {"zeroline": true, "showline": true}, 
                  "yaxis": {"zeroline": true, "showline": true, "range": [0, 22.63852380952382]}}, {"linkText": "Export to plot.ly", "showLink": true})</script>
                  

                  Notice how its just a tiny portion of an html that you are supposed to embed in a bigger page. For that I use a standard template engine like Jinga2.

                  With this you can create one html page with several charts arranged the way you want, and even return it as a server response to an ajax call, pretty sweet.

                  Update:

                  Remember that you'll need to include the plotly js file for all these charts to work.

                  You could include <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> just before putting the div you got. If you put this js at the bottom of the page, the charts won't work.

                  这篇关于获取 &lt;脚本&gt;和 &lt;div&gt;来自 Plotly 的标签使用 Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Plot data in website from multiple csv file(从多个 csv 文件中绘制网站中的数据)
                  Content Service for Google Apps Script returning HTML instead of JSON(返回 HTML 而不是 JSON 的 Google Apps 脚本的内容服务)
                  Javascript Confirm popup Yes, No button instead of OK and Cancel(Javascript 确认弹出窗口是,否按钮而不是确定和取消)
                  Opensource/free HTML5/CSS3/JavaScript IDE?(开源/免费 HTML5/CSS3/JavaScript IDE?)
                  jump to CSS selector in a css file from the HTML file in Vim using a single keystroke(使用单次击键从 Vim 中的 HTML 文件跳转到 CSS 文件中的 CSS 选择器)
                  Is there a good in-browser code editor?(有没有好的浏览器内代码编辑器?)
                      1. <tfoot id='DwMC3'></tfoot>
                      2. <legend id='DwMC3'><style id='DwMC3'><dir id='DwMC3'><q id='DwMC3'></q></dir></style></legend>
                          <tbody id='DwMC3'></tbody>

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

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