I have the following code to make an scatter plot using plotly as px
fig1 = px.scatter(utilities, x="Rating", y="Spread", facet_col="Duration",text="Security_Name")
fig1.update_layout(width=1200,title_text='Spread por rating y duración en el sector Utilities')
fig1.update_traces(textfont_size=8,textposition='top right')
fig1.show()
The problem is that when I export fig1 to PDF using this code:
fig1.write_image("Utilities.pdf")
Then most of the texts in "text" are cut because names are too long (they cannot be shortened). I have already tried using "top center" and "top left" but in either case the text is cut. I would really appreciate your help.



