[英]remove titles plotly python
如何删除下图中的标题?
我想删除顶轴标题,因为它们是多余的并且对于图片来说太长了。
这是我正在使用的代码:
import plotly.express as px
fig = px.box(DF.melt(), y="value", facet_col="variable", boxmode="overlay", color="variable")
fig.update_yaxes(matches=None)
for i in range(len(fig["data"])):
yaxis_name = 'yaxis' if i == 0 else f'yaxis{i + 1}'
fig.layout[yaxis_name].showticklabels = True
#fig.update_layout(showlegend=False)
fig.update_layout(legend = dict(bgcolor = 'white'))
fig.update_layout(plot_bgcolor='white')
fig.update_xaxes(showline=True, linewidth=2, linecolor='black')#, mirror=True)
fig.update_yaxes(showline=True, linewidth=2, linecolor='black')#, mirror=True)
fig.update_xaxes(showgrid=True, gridwidth=1, gridcolor='gray')
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='gray')
fig.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.