[英]How to remove vertical line at x-axis and add labels to plotly subplots?
[英]Plotly subplots, hide x axis labels
如何从我的子图中删除 x 轴标签,我只想要它们在图例中
fig = make_subplots(rows=2, cols=4,)
for i,j in enumerate(to_show_up):
fig.add_trace(go.Box(y =df[j] ,name = j ),row=1, col=i+1)
fig.update_yaxes(showticklabels=False)
for i,j in enumerate(to_show_down):
fig.add_trace(go.Box(y =df[j] ,name = j ),row=2, col=i+1)
fig.update_yaxes(showticklabels=False)
fig.update_layout(height=600, width=1200, title_text="Метрики сотовой связи")
fig.show()
切换轴标签:可以通过将
showticklabels
轴属性设置为False
来禁用轴刻度标记标签。以下是使用 Plotly Express 创建的多面图形的所有子图中禁用刻度标签的示例:
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
fig.update_xaxes(showticklabels=False) # Hide x axis ticks
fig.update_yaxes(showticklabels=False) # Hide y axis ticks
fig.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.