我有以下代码作为示例:
x=[1,2,3,4]
y=[2,2,4,3]
colors = ["blue","blue","orange","blue"]
textures = ["","","x",""]
myfig = go.Figure()
myfig.add_trace(go.Bar(x=x
,y=y
,showlegend=True
,marker_color=colors
,marker_pattern_shape=textures
,name="my_trace"))
myfig.show()
这将产生以下数字:
我想让图例显示两个名字:
- 一个代表蓝条(比方说,命名为"Any")
- 一个是带有纹理的橙色条(假设命名为"max",也显示纹理)
我不能给情节增加更多的痕迹,关键是要用同样独特的痕迹来做.