简体   繁体   English

如何删除 plotly express 图形对象中的网格线(python)

[英]How do I remove gridlines in plotly express graph objects (python)

I tried many methods to remove the grid but I am unable to remove these gridlines, any help is appreciated.我尝试了很多方法来删除网格,但我无法删除这些网格线,感谢任何帮助。

Picture of Plot情节图片

fig = go.Figure()
for i in dfs:
    k = 2
    for j in selection:
        fig = fig.add_trace(go.Scatter(x = dfs[i]["Date Time"], y = dfs[i][j], name = "{a} : {b}".format(a=i, b=j), yaxis="y{k}".format(k=k)))
        k+=1
st.plotly_chart(fig, True)

try adding these two settings:尝试添加这两个设置:

fig.update_xaxes(showgrid=False)
fig.update_yaxes(showgrid=False)

That should get rid of the grid lines那应该摆脱网格线

This is an overkill,这是矫枉过正,

but try fig.update_layout(template='simple_white')但尝试fig.update_layout(template='simple_white')

Plotly templates reference Plotly 模板参考

Plotly axes: gridlines reference绘图轴:网格线参考

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

相关问题 python plotly express vs graph_objects:什么是plotly.express的line_group for plotly.graph_objects - python plotly express vs graph_objects: what is the equivalent of plotly.express's line_group for plotly.graph_objects 如何使用 Python 在 Plotly 中制作水平直方图? - How do I make a horizontal histogram in Plotly express using Python? 如何使用 python 中的破折号 plotly 更改图表的 colors - How do I change the colors of the graph using dash plotly in python 如何在python脚本中导入绘图? - How do I import a plotly graph within a python script? Plotly:如何使用883276440288 Graph Objects和Plotly Express在图中定义colors? - Plotly: How to define colors in a figure using Plotly Graph Objects and Plotly Express? Plotly:如何使用 Python 对 plotly 图形对象条形图进行颜色编码? - Plotly: How to colorcode plotly graph objects bar chart using Python? 如何使用 Python 中的 Plotly Express 向每个条形图添加可点击链接? - How do you add a clickable link to each bar graph using Plotly Express in Python? python plotly 图形对象 - 类似于 plotly 中的离散颜色映射 - python plotly graph objects - discrete_color_map like in plotly express 如何修改此 plotly 折线图? - How do I modify this plotly line graph? 如何将 plotly 图形保存为 jpg - How do I save plotly graph as jpg
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM