<small id='52pjz'></small><noframes id='52pjz'>

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

    <legend id='52pjz'><style id='52pjz'><dir id='52pjz'><q id='52pjz'></q></dir></style></legend>
    • <bdo id='52pjz'></bdo><ul id='52pjz'></ul>
    1. <tfoot id='52pjz'></tfoot>

      如何禁用 plotly.express.line 中的趋势线?

      How to disable trendline in plotly.express.line?(如何禁用 plotly.express.line 中的趋势线?)
        • <i id='BUKiV'><tr id='BUKiV'><dt id='BUKiV'><q id='BUKiV'><span id='BUKiV'><b id='BUKiV'><form id='BUKiV'><ins id='BUKiV'></ins><ul id='BUKiV'></ul><sub id='BUKiV'></sub></form><legend id='BUKiV'></legend><bdo id='BUKiV'><pre id='BUKiV'><center id='BUKiV'></center></pre></bdo></b><th id='BUKiV'></th></span></q></dt></tr></i><div id='BUKiV'><tfoot id='BUKiV'></tfoot><dl id='BUKiV'><fieldset id='BUKiV'></fieldset></dl></div>
            <bdo id='BUKiV'></bdo><ul id='BUKiV'></ul>

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

                  <tbody id='BUKiV'></tbody>
              1. <legend id='BUKiV'><style id='BUKiV'><dir id='BUKiV'><q id='BUKiV'></q></dir></style></legend>

                <tfoot id='BUKiV'></tfoot>
                本文介绍了如何禁用 plotly.express.line 中的趋势线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我愿意在同一张图表上绘制 3 个时间序列.Datasource是一个pandas.DataFrame()对象,Timestamp的类型是datetime.date,3个不同的时间序列取自同一Value 列使用 plotly.express.line() 的颜色参数.

                I am willing to plot 3 timeseries on the same chart. Datasource is a pandas.DataFrame() object, the type of Timestamp being datetime.date, and the 3 different time series drawn from the same column Value using the color argument of plotly.express.line().

                图表上显示了 3 条线,但每条线都伴随着某种趋势线.我在函数签名中看不到如何禁用这些趋势线.你能帮忙吗?

                The 3 lines show on the chart, but each one is accompanied by some sort of trendline. I can't see in the function signature how to disable those trendlines. Can you please help?

                我已经做了几次尝试,例如使用另一个 color,但趋势线只是停留在那里.

                I have made several attempts, e.g. using another color, but the trendlines just stay there.

                请在下面找到代码片段和生成的图表.

                Please find below the code snippet and the resulting chart.

                import plotly.io as pio
                import plotly.express as px
                pio.renderers = 'jupyterlab'
                fig = px.line(data_frame=df, x='Timestamp', y='Value', color='Position_Type')
                fig.show()
                

                (如果相关,我正在使用 jupyterlab)

                (If relevant, I am using jupyterlab)

                屏幕上的时间戳如下所示(这是 [常规] 每周时间序列):

                Timestamp on the screen appears like this (this are [regular] weekly timeseries) :

                并且,根据类型:

                type(df.Timestamp[0])
                > datetime.date
                

                我要补充的是,我最初认为是趋势线的线看起来更像是从每个时间序列的第一个数据点到最后一个数据点的直线.

                I am adding that it looks like the lines that I first thought were trendlines would rather be straight lines from the first datapoint to the last datapoint of each time series.

                推荐答案

                df_melt = df_melt.sort_values('datetime_id')
                

                排序摆脱了那些环绕".感谢以上建议.使用 Plotly 4.8.2.

                Sorting got rid of those "wrap-arounds". Thanks for the suggestions above. Using Plotly 4.8.2.

                这篇关于如何禁用 plotly.express.line 中的趋势线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 数据框制作线图?)
                • <bdo id='lqz1N'></bdo><ul id='lqz1N'></ul>

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

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