Looks like you need to explicitly define the size of your figure, making it wide enough so the legend doesn't cover it. It might also help to create a shorter label in your legend or move the legend to the top or bottom so it doesn't cover your figure. To change the size of your figure, you can do so in fig.update_layout()
or when exporting the image in fig.write_image()
.
updating image:
fig.update_layout(
autosize=False,
width=1920,
height=1080)
exporting image:
fig.write_image('figure.pdf', width=1920, height=1080)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.