简体   繁体   English

绘制线图x轴增量5

[英]Plotly line plot x-axis increment by 5

I have a list of times I want to use with plotly to make a line graph. 我有一个要与plotly一起使用来制作线图的时间列表。 The Y values work perfectly, but the x's are just spaced out by 1. I would like to make them be spaced out by 5 instead, but I don't know how to do that. Y值可以完美地工作,但是x只是以1隔开。我想让它们以5隔开,但是我不知道该怎么做。 I saw here that you can use a range, but that range seems to be whole numbers and an interval of 1, so how do I get the x to increase by 5 for every Y value? 我在这里看到可以使用一个范围,但是该范围似乎是整数,并且间隔为1,那么如何使x随每个Y值增加5? I can't put a for loop here to do that, so I'm not sure how this would work. 我不能在这里放一个for循环来做到这一点,所以我不确定这将如何工作。 Any help? 有什么帮助吗? Thanks! 谢谢!

I'm not clear on what you want to achieve, but if you only want a specific spacing between x axis labels you can use tick0 and dtick for that purpose: 我不清楚要实现的目标,但是如果您只希望x轴标签之间有特定的间距,则可以为此使用tick0dtick

xaxis=dict(
    tick0=0,
    dtick=5,
    ...
),

it would help if you show what you have and what you want for example. 例如,如果您展示自己拥有的东西和想要的东西,这将有所帮助。

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

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