I recently had to re-install my OS and decided to switch to Python3. With it came updates of my IDE PyCharm and presumably also an update of Matplotlib.
Running a script that worked perfectly fine before, now gives me ugly results with overlapping titles of my subplots.
This is an example code:
import numpy as np
import matplotlib.pyplot as plt
z = np.random.uniform(low=0, high=100, size=(20,4))
fig, axes = plt.subplots(2, 2, constrained_layout=True, sharey=True, sharex=True)
axes[-1, 0].set_xlabel('.\n', color=(0, 0, 0, 0))
axes[-1, 0].set_ylabel('.\n', color=(0, 0, 0, 0))
for s_plot, ax in enumerate(axes.flat):
ax.scatter(x=range(20), y=z[:,s_plot])
fig.suptitle("The Title\nSecond Line\n", fontsize=12)
plt.show()
I tried setting constrained_layout to False and also experimented with subplots_adjust, but it does not change the layout of my plots.
I am currently using matplotlib 3.0.2. Was there a major change I have missed? I am puzzled about how to solve this.



