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

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

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

    1. <tfoot id='qkbb5'></tfoot>

      Plotly:如何检索主要刻度线和网格线的值?

      Plotly: How to retrieve values for major ticks and gridlines?(Plotly:如何检索主要刻度线和网格线的值?)
        • <i id='lhVLi'><tr id='lhVLi'><dt id='lhVLi'><q id='lhVLi'><span id='lhVLi'><b id='lhVLi'><form id='lhVLi'><ins id='lhVLi'></ins><ul id='lhVLi'></ul><sub id='lhVLi'></sub></form><legend id='lhVLi'></legend><bdo id='lhVLi'><pre id='lhVLi'><center id='lhVLi'></center></pre></bdo></b><th id='lhVLi'></th></span></q></dt></tr></i><div id='lhVLi'><tfoot id='lhVLi'></tfoot><dl id='lhVLi'><fieldset id='lhVLi'></fieldset></dl></div>
            <bdo id='lhVLi'></bdo><ul id='lhVLi'></ul>
              1. <legend id='lhVLi'><style id='lhVLi'><dir id='lhVLi'><q id='lhVLi'></q></dir></style></legend>

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

                  <tbody id='lhVLi'></tbody>
                <tfoot id='lhVLi'></tfoot>
                本文介绍了Plotly:如何检索主要刻度线和网格线的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想检索该图中突出显示的 x 值:

                I'd like to retrieve the x-values highlighted in this plot:

                绘图是使用此代码段在 Jupyter Notebook 中生成的:

                The plot is generated in a Jupyter Notebook using this snippet:

                import plotly
                import cufflinks as cf
                from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
                import pandas as pd
                import numpy as np
                
                # setup
                init_notebook_mode(connected=True)
                np.random.seed(123)
                cf.set_config_file(theme='pearl')
                
                # Random data using cufflinks
                df = cf.datagen.lines()
                
                # plot
                fig = df.iplot(asFigure=True, kind='scatter',xTitle='Dates',yTitle='Returns',title='Returns')
                iplot(fig)
                

                <小时>

                这是我尝试过的:

                使用此设置,您只需在笔记本中运行 fig 即可检索每个系列的每个 x 和 y 值.但刻度值无处可寻.

                With this setup, you can retrieve every x and y value for every series by simply running fig in the notebook. But the tick values are nowhere to be found.

                我也尝试过深入研究 dir(fig),并认为 fig.axis 的输出可能会解决问题,但没有:

                I'v also tried digging deeper in dir(fig), and thought maybe the output from fig.axis would do the trick, but no:

                {'x1': {'gridcolor': '#E1E5ED',
                  'showgrid': True,
                  'tickfont': {'color': '#4D5663'},
                  'title': {'text': 'Dates', 'font': {'color': '#4D5663'}},
                  'zerolinecolor': '#E1E5ED'},
                 'y1': {'gridcolor': '#E1E5ED',
                  'showgrid': True,
                  'tickfont': {'color': '#4D5663'},
                  'title': {'text': 'Returns', 'font': {'color': '#4D5663'}},
                  'zerolinecolor': '#E1E5ED'}}
                

                然而,网格和刻度还有其他选项,例如 'showgrid': True'tickfont',但这些值似乎在某处隐藏"否则.

                There are however other options for the grid and ticks there like 'showgrid': True, and 'tickfont', but the values seem to be "hidden" somewhere else.

                有什么建议吗?

                推荐答案

                此数据仅在 Javascript 上下文中可用,因此很遗憾无法从 Python 访问.

                This data is only available in the Javascript context, and so unfortunately is inaccessible from Python.

                这篇关于Plotly:如何检索主要刻度线和网格线的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                1. <i id='g3IQq'><tr id='g3IQq'><dt id='g3IQq'><q id='g3IQq'><span id='g3IQq'><b id='g3IQq'><form id='g3IQq'><ins id='g3IQq'></ins><ul id='g3IQq'></ul><sub id='g3IQq'></sub></form><legend id='g3IQq'></legend><bdo id='g3IQq'><pre id='g3IQq'><center id='g3IQq'></center></pre></bdo></b><th id='g3IQq'></th></span></q></dt></tr></i><div id='g3IQq'><tfoot id='g3IQq'></tfoot><dl id='g3IQq'><fieldset id='g3IQq'></fieldset></dl></div>
                2. <tfoot id='g3IQq'></tfoot>
                    <tbody id='g3IQq'></tbody>

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

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

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