I am generating a networkx word graph and displaying it with pyplot as follows:
import networkx as nx
import matplotlib.pyplot as plt
IN_TXT = """
Giorgia Meloni festeggia i 10 anni di FdI e oggi arriverà la ciliegina sulla torta: l’accordo con gli alleati su una manovra che colpisce i più poveri. Annunciata una nuova stretta al reddito di cittadinanza per finanziare le pensioni minime: solo 600 euro e solo agli over 75
"""
then populate my networkx graph and when ready:
nodelabels = nx.get_node_attributes(G, "lemma")
edgelabels = nx.get_edge_attributes(G, "label")
# and now display the graphs
nx.draw(G, pos, with_labels=True, labels=nodelabels, **NXDOPTS)
nx.draw_networkx_edge_labels(G, pos, edge_labels=edgelabels)
plt.margins(0.2)
plt.suptitle(sentence.text)
plt.show()
but this results in the superior title being vastly outside the picture:
Is there a way to word wrap the title so it fits the viewing window?
If I manually stretch the window I can get the title to fit into it, but would like to obtain this then the graph is first displayed.
I am not understanding the relationship between matplotlib abd pyplot :(
Thank you.