Интересный вопрос. Я просмотрел исходный код модуля matplotlib.text
и обнаружил функцию _get_wrap_line_width()
, которая, кажется, отвечает за вычисление ширины поля. Но вы не можете передать ему никаких параметров, кроме положения текста и его ориентации. Без маржи. Я пришел к выводу, что то, что вы хотите сделать, невозможно.
Единственное обходное решение, которое я могу предложить, - это перенос текста вручную в исходный код, например:
ax1.text(.5, .5, ('{}\n\n{}, {}').format(
"""Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to make
a type specimen book. It has survived not only five centuries, but also the leap
into electronic typesetting, remaining essentially unchanged. It was popularised
in the 1960s with the release of Letraset sheets containing Lorem Ipsum
passages, and more recently with desktop publishing software like Aldus
PageMaker including versions of Lorem Ipsum.""",
"Hello", "2020-07-12"),
color="white", style='oblique', ha='center', va='center', wrap=True,
bbox={'facecolor': "#34C8EC", 'boxstyle': 'round,pad=1'})
Чтобы знать, куда обратиться вставьте разрывы, я счел полезным временно сдвинуть поле влево, например ax1.text(.4, .5, ...
.