Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib wrap title

from textwrap import wrap
import matplotlib.pyplot as plt

x=[1,2,3]
y=[4,5,6]
plt.figure(figsize=(10,10))
plt.plot(x, y, color='red')
title='my extremely long title. I mean, really really long. Unbelievably long.'
plt.title('
'.join(wrap(title,60)))
 
PREVIOUS NEXT
Tagged: #matplotlib #wrap #title
ADD COMMENT
Topic
Name
6+2 =