如果我在matplotlib图中添加一个副标题,它会被子图的标题覆盖.有人知道如何轻松处理吗?我try 了tight_layout()
函数,但它只会让事情变得更糟.
例子:
import numpy as np
import matplotlib.pyplot as plt
f = np.random.random(100)
g = np.random.random(100)
fig = plt.figure()
fig.suptitle('Long Suptitle', fontsize=24)
plt.subplot(121)
plt.plot(f)
plt.title('Very Long Title 1', fontsize=20)
plt.subplot(122)
plt.plot(g)
plt.title('Very Long Title 2', fontsize=20)
plt.tight_layout()
plt.show()