I have a ternary plot with labels in every corner of the triangle. I have cut the margins of the plot for space efficiency but that also cuts the labels. Is there any way to move the Label2
and Label3
so they are not truncated?
Please see left with labels truncated and right with labels repositioned.
MWE with attempt to use automargin
in the commented out line:
import plotly.graph_objects as go
fig = go.Figure()
fig.update_layout(ternary_sum=100, showlegend=False, ternary_aaxis_linecolor='black', ternary_aaxis_linewidth=2.5,
ternary_baxis_linecolor='black', ternary_baxis_linewidth=2.5, ternary_caxis_linecolor='black',
ternary_caxis_linewidth=2.5)
fig.add_trace(go.Scatterternary({
'mode': 'markers',
'a': [int(round(20,0))],
'b': [int(round(50,0))],
'c': [int(round(30,0))],
'opacity': 1,
'marker': {'color': '#FFFFFF', 'size': 24, 'line': {'width': 2.2, 'color': 'black'}},
'visible': True, }))
fig.update_layout(height=300,width=300, margin=dict(t=40,b=40,l=0,r=0))
# fig.update_layout({'ternary': {'aaxis': {'title':'Label 1','titlefont': {'size': 15}},'baxis': {'title':'Label 2','titlefont': {'size': 15},'automargin':False},'caxis': {'title':'Label 3','titlefont': {'size': 15},'automargin':False} }})
fig.update_layout({'ternary': {'aaxis': {'title':'Label 1','titlefont': {'size': 15}},'baxis': {'title':'Label 2','titlefont': {'size': 15}},'caxis': {'title':'Label 3','titlefont': {'size': 15}} }})
fig.show()