繁体   English   中英

从三进制中删除零 plot

[英]Remove zero from ternary plot

我有以下 plot,我想删除起源中的 0。

import plotly.graph_objects as go
import plotly.express as px  
  
fig = go.Figure(go.Scatterternary({
    'mode': 'markers', 'a': [0.3],'b': [0.5], 'c': [0.6],
    'marker': {'color': 'AliceBlue','size': 14,'line': {'width': 2} },
                                  }))
fig.update_layout({
    'ternary': {
        'sum': 100,
        'aaxis': {'nticks':1, 'ticks':""},
        'baxis': {'nticks':1},
        'caxis': {'nticks':1}  }})

fig.update_traces( hovertemplate = "<b>CatA: %{a:.0f}<br>CatB: %{b:.0f}<br>CatC: %{c:.0f}<extra></extra>")
  
fig.show()

删除零

我很惊讶,因为这里的文档说nticks的最小值是 1,而不是 0(这是行不通的)。 如何从角落删除 0?

文档

正如你提到的文档所说,ntick 指定特定轴的最大刻度数。 所以它是真的,不能为零。

fig.update_ternaries(aaxis_showticklabels=False)
fig.update_ternaries(baxis_showticklabels=False)
fig.update_ternaries(caxis_showticklabels=False)

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM