Hello
I am triying to modify the size of my figure. I want to do that beacuse I can not see some labels in a graph.
.
import plotly.graph_objects as go
fig = go.Figure(go.Bar(
x=dfEstrato.Estrato,
y=dfEstrato.Part,
text=dfEstrato.Part,
texttemplate = "%{y}%",
textposition = "outside",
orientation='v'))
fig.update_traces(marker_color='#000080')
fig.update_layout(title_text='3. Estrato Socioeconomico',yaxis = go.YAxis(showticklabels=False))
fig.show()
This is the datafreme dfEstrato.
Thanks
user123
February 9, 2020, 11:18pm
2
Try increasing the top (βtβ) margin in the figure layout. That might fix it.
e.g.
layout = {βmarginβ:{βtβ:100}}
this isnβt documented well, but try setting the cliponaxis property to false: fig.update_yaxis(cliponaxis=False)
ideally this would be the default, but since we added it after adding text, setting it as the default would be backwards incompatible. so, iβd recommend always setting this.
Hello, I try your recomendation but I continue with the same problem
I did the follow:
fig.update_layout(title_text='3. Estrato Socioeconomico',yaxis = go.YAxis(showticklabels=False,cliponaxis=False))
I did the follow But I continue with the same problem.
fig.update_layout(title_text='3. Estrato Socioeconomico',yaxis = go.YAxis(showticklabels=False,cliponaxis=False),layout = {"margin":{"t":100}})
user123
February 11, 2020, 2:05am
6
I have got old code where I have cliponaxis in the trace itself (as opposed to yaxis). Can you try:
trace={
...
'cliponaxis':False,
...
}
2 Likes