Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.9K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to align plots with different aspect ratio?

Posted 3 years ago

We know how to align two plots as explained here, but what can we do if one of the plots has a different aspect ratio?

padding = {{30, 30}, {30, 30}};
p1 = DateListPlot[FinancialData["IBM", "Jan. 1, 2000"], 
   PlotLabel -> "IBM", ImagePadding -> padding];
p2 = DateListPlot[FinancialData["NVDA", "Jan. 1, 2000"], 
   PlotLabel -> "NVIDIA", AspectRatio -> 1/2, ImagePadding -> padding];
GraphicsGrid[{{p1}, {p2}}]

The p2 plot now has an aspect ratio on 1/2 and as you can see the plots are no more aligned, i tried to play with different padding values for the two plot but i could not find a consistent solution. Any idea?

code snippet result

POSTED BY: Francesco Lasco
2 Replies

Hi Francesco

Column@{p1, p2}

seems to do the trick.

Robert

POSTED BY: Robert Nowak

Thank you Robert. Also GraphicsColumn if someone need to be able to zoom both plots at the same time.

POSTED BY: Francesco Lasco
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard