Solved: How can I plot Matplotlib suptitle above my axplot

463 Views Asked by At

first of all a lot of love to this forum. It has taught me so much already. But now I stumbled over a problem, I wasn't able to find a answer that worked for me. So here my first question on this forum.

My problem is, that my figure title that's supposed to be above my plots appears inside my first plot. Example Code:

fig = plt.figure(figsize=(10,10))
fig.suptitle('Titel', fontsize=50)
ax1 = fig.add_subplot(2,2,(1,2))
ax2 = fig.add_subplot(223)
ax3 = fig.add_subplot(224)

plt.show()

That's how it looks

I have experimented with

plt.subplots_adjust

and other things like tight_layout and so on, but to be honest, Im often confused by the matplotlib syntax and its different formulations.

I feel like there should be a easy solution, but maybe I googled the wrong things. Thank u for ur help :)

Edit: The problem appeard through my enviroment Pycharm in scentific mode

1

There are 1 best solutions below

6
pakpe On

Try this:

fig = plt.figure(figsize=(10,10))
ax1 = fig.add_subplot(2,2,(1,2))
ax2 = fig.add_subplot(223)
ax3 = fig.add_subplot(224)
plt.title('Title', fontsize=50)
plt.show()

enter image description here