# What is the most elegant way to display multiple graphs with a common title?

I often seek to display two graphs, side by side, with a common label over them. There is no option for adding a label to GraphicsRow, which means, I think, that I need to use Grid or GraphicsGrid and include a row on top that has SpanFromLeft set to allow a graphically defined line of text occupy the entire row.

It seems like a lot of work to do something simple. Is there a better solution?

• You can use Labeled – rm -rf Sep 24 '13 at 0:07

Possibly more versatile, but you have to mess with text overlapping your plots, but GraphicsRow also accepts Epilog

GraphicsRow[{Plot[Sin[x], {x, 0, 4 Pi}], Plot[Cos[x], {x, 0, 4 Pi}]},
Spacings -> Scaled[0.4],
Epilog -> Inset["Plot Title", Scaled[{0.5, 0.95}]]]


• PlotRangePadding -> {0, {0, 25}} could help avoid possible text/plot collisions. – ssch Sep 24 '13 at 0:24
• @ssch Thanks - I figured there was a padding option, but couldn't put my finger on it. – bobthechemist Sep 24 '13 at 0:26
• Since PlotLabel broke in v12, I’ve switched over to this approach. – Michael Stern Sep 4 '19 at 17:43

GraphicsRow takes a PlotLabel option:

p1 = Plot[Sin[x], {x, 0, Pi}, PlotLabel -> Sin];
p2 = Plot[Cos[x], {x, 0, Pi}, PlotLabel -> Cos];
GraphicsRow[{p1, p2}, PlotLabel -> "Two plots"]


• I can't imagine how I missed this. Thanks. – Michael Stern Sep 24 '13 at 0:36
• @MichaelStern Easy to miss since it's not in the GraphicsRow documentation :) – ssch Sep 24 '13 at 0:38
• @Michael Indeed, this is the first time I can recall seeing this, so thank you for asking the question! (+1 of course, ssch) – Mr.Wizard Sep 24 '13 at 0:50
• As of version 12, this no longer works. Sigh. – Michael Stern May 17 '19 at 14:47

When I need more interface control, I usually do something like this:

p1=Plot[Sin[x],{x,0,Pi},PlotLabel->Sin,ImageSize->150];
p2=Plot[Cos[x],{x,0,Pi},PlotLabel->Cos,ImageSize->150];
title=Panel[Style["Test Label",White,20],ImageSize->300,Background->Orange,Alignment->Center];
Deploy@Grid[{{title,SpanFromLeft},{p1,p2}},Dividers->Gray,Spacings->{0,0}]


p1 = Plot[Sin[x], {x, 0, 2 Pi}, ImageSize -> 200];
p2 = Plot[Cos[x], {x, 0, 2 Pi}, ImageSize -> 200];


Labeled

Labeled[Panel@GraphicsRow[{p1, p2}], Style["Label", "Subsubsection"], Top] // Panel


Panel

Panel[GraphicsRow[{p1, p2}], Style["Label", "Subsubsection"], Top] // Panel
(* same picture *)


Legended

Legended[Panel@GraphicsRow[{p1, p2}], Placed[Style["Label", "Subsubsection"], Top]] // Panel
(* same picture *)


Show with PlotLabel

Show[GraphicsRow[{p1, p2}],  PlotLabel -> Style["Label", "Subsubsection"]] // Panel


• This answer actually seems to be the most versatile. – Just Some Old Man Dec 6 '18 at 23:52