简体   繁体   English

python plotly 在 slider 中显示 x 轴抽动

[英]python plotly show x axis tics in slider

I am using plotly to show some graph.我正在使用 plotly 来显示一些图表。 I add a slider as shown in the picture.如图所示,我添加了一个 slider。 I would like to add the x values in the axis of the slider as shown in the pic:我想在 slider 的轴中添加 x 值,如图所示:

在此处输入图像描述

    fig.update_layout(xaxis=dict(autorange=True,
                                     range[df.index.to_list()[0], df.index.to_list()[-1]], rangeslider=dict(autorange=True,
                                                  range=[df.index.to_list()[0], df.index.to_list()[-1]],
                                                  bordercolor="red",
                                                  borderwidth=3,
                                                  visible=True,
#### HERE code to show the axis ####),
                                 type="date"),

https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeselector I dont see any possibility in the API to show the x axis of the slider, but it should be possible. https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-rangeselector我在 API 中看不到任何显示 slider 的 x 轴的可能性,但它应该是可能的。 Any idea?任何的想法?

I think this is impossible to do with plotly. As you see in the API docs you just sent the link of, there is no attribute like “showxaxis” or the like.我认为这对 plotly 是不可能的。正如您在刚刚发送链接的 API 文档中看到的,没有“showxaxis”等属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM