Questions tagged [suptitle]

For questions about placing a title above all subplots of a plot

suptitle was originally a MATLAB Bioinformatics Toolbox function for placing a title above all subplots of a plot. The function has since been adopted by other languages, e.g., matplotlib.pyplot.suptitle in Python.

Use the suptitle tag for all questions related to placing a title above all subplots of a plot, regardless of programming language.

18 questions
305
votes
11 answers

tight_layout() doesn't take into account figure suptitle

If I add a subtitle to my matplotlib figure it gets overlaid by the subplot's titles. Does anybody know how to easily take care of that? I tried the tight_layout() function, but it only makes things worse. Example: import numpy as np import…
katrasnikj
  • 3,151
  • 3
  • 16
  • 27
69
votes
3 answers

How to position suptitle

I'm trying to adjust a suptitle above a multi-panel figure and am having trouble figuring out how to adjust the figsize and subsequently position the suptitle. The problem is that calling plt.suptitle("my title", y=...) to adjust the position of the…
Noah
  • 21,451
  • 8
  • 63
  • 71
28
votes
2 answers

Placement of text e.g. suptitle inside the frame

So far i have placed my suptitles above the frame, like this: How can i get the suptitles from above the frame into the frame? So far i have a solution that just prints a text and sets it on the right position with computing xlim and ylim. However…
tarrasch
  • 2,630
  • 8
  • 37
  • 61
12
votes
1 answer

Suptitle alignment issues

I would like to align my suptitle in the top left-hand corner on each page of the multiple PDF document I am trying to create, however, it doesn't seem to be doing as I try to ask. The below script produces the suptitle in the top and centre. I…
Curious Student
  • 669
  • 4
  • 13
  • 25
5
votes
1 answer

Plot three images horizontally in python

I'm trying to plot three images with their subtitles above them but nothing is showing right now. import cv2 from matplotlib import pyplot as plt img = cv2.imread('kids.tif') # Averaged environment avg_blur = cv2.blur(img,(5,5)) # Gaussian…
user4328677
3
votes
1 answer

Python, Matplotlib: Suptitle with arbitrary number of vertical figures

I have a website that produces (depending on available data stations running) an arbitrary number of plots (as an image), that are vertically stacked over one another. An example is the following: The problem is that depending on the number of…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
2
votes
1 answer

What does suptitle really mean in matplotlib?

In using any package, the name of a function should be obvious so that our brain does not keep remembering weird features. So in matplotlib, every time I use suptitle, I have no idea what "sup" is for. Does anyone have this problem or do we just use…
Ed Gan
  • 43
  • 6
2
votes
2 answers

How to add a title and suptitle to each gridspec group

I know I can use update to adjust the parameters of a GridSpec instance in a matplotlib figure, allowing to arrange multiple gridspec's in a single figure. Much as in this example taken from the matplotlib doc gs1 = gridspec.GridSpec(3,…
1
vote
1 answer

Unwanted whitespace between plot title and subplots in matplotlib

I've 2 subplots in a single row. Below is the code:- plt.suptitle('Water Vapor Count for Fani before landfall') #Overall plot title. fig,(ax1,ax2)=plt.subplots(nrows=1,ncols=2,figsize=(15,15)) #Defining the figure and…
Pixel_Bear
  • 97
  • 1
  • 1
  • 11
1
vote
2 answers

Bold Format Suptitle with Mathematical Expression

This line of code: plt.suptitle("Observed and Predicted $U_{dec,c}$",x=mid,fontweight='bold') Produces a suptitle like this: However, I require the entire string to be in bold, including the mathematical expression, and for various reasons I need…
chrisprt
  • 67
  • 6
1
vote
1 answer

Why does the title overlap with the plot when specifying x using constrained_layout?

Solved: This problem occurred with matplotlib 3.4, updating to 3.5 fixed the issue. I am plotting multiple subplots in a graph, which all have titles, labels and subplot titles. To keep everything visible and the right size, I am using…
Dianne
  • 73
  • 1
  • 8
1
vote
0 answers

matplotlib ginput does not allow the figure suptitle to change

I am trying to write a piece of code where the title of the figure changes before using ginput. However, it looks like the title changes only after pressing once on the figure, not before. Here a few lines of code that reproduce the issue. import…
Flavio.R.
  • 81
  • 1
  • 1
  • 4
0
votes
1 answer

Solved: How can I plot Matplotlib suptitle above my axplot

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…
Mr D Omas
  • 1
  • 1
0
votes
0 answers

Why does my figure title move when we increase the number of subplots?

I've plotted a graph containing many subplots, by using matplotlib in Python 3. I inserted the figure title by using fig.text() rather than fig.suptitle() because I need to place the title in the middle, on the right, and on the left. You can see…
0
votes
1 answer

Matplotlib Animation FuncAnimation - Header and subhead will be moved

I want to animate a picture in Python with a longer header and subheader. Unfortunately, the graph is moving upwards such that the extra spacing is lost. #%% Import packages import numpy as np import pandas as pd import seaborn as sns import…
1
2