我正在尝试使用破折号将绘制线图上的数值从数字更改为文本描述,我可以使其适用于第一个棒值,但不能适用于其余的棒值。我试图在Y轴上进行更改
我很想知道我做错了什么
stay_at_home = ['a','b','c','d']
fig_two = px.line(top5_confirmed_cases,
x=top5_confirmed_cases.Date.astype(str),
y=policies,
color='CountryName',
title=policies + ' in the top five countries',
labels={'x': 'Date'})
fig_two.update_layout(yaxis = dict(type='category',
tickmode = 'array',
ticktext=stay_at_home,
tickvals=(top5_confirmed_cases['Stay at home requirements'])))
我误解了“滴答声”的目的
这篇文章帮助我更好地理解这一点,并解决了这个问题
Display given value in XY axis - Plotly
一旦我改变了下面的内容,这就非常有效了
相关问题 更多 >
编程相关推荐