Code covered by the BSD License  

Highlights from
Compare Two Figures side by side

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 1.58 KB File ID: #21998
image thumbnail

Compare Two Figures side by side

by Michael Katz

 

05 Nov 2008

Takes the content of a two figures and puts them next to each other in one figure window.

| Watch this File

File Information
Description

This should copy a figure window and all the objects in it to the first one and resized to fit both.

Example:
figure(1)
plot(rand(5))
figure(2)
surf(peaks)
compareFigures(1,2)

This is a little cleaner than managing two figure windows, but it may not be best thing to do if you want to do further processing on either figure.

I'd expect issues if you're using two different colormaps.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
06 Apr 2009 Soo Toh

Can I know how can I define fig1 and fig2?
I already plot two graph by using imagesc() function, but I don't know how to put it in the code?
I'm really new to Matlab. Please help me. Thanks.

02 Jan 2011 Jennifer

This does not work for me. The images overlap each other are are not properly displayed. Perhaps a version issue...? I'm using

MATLAB Version 7.4.0.287 (R2007a)

17 Jan 2011 Jennifer

Updated comment: I realize now this script assumes that each of the original figures is in the desired position, as the scrip then looks up this position in order to copy over. So now it works fine. However, it strips off the legend from the second plot.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
plot Cristina McIntire 05 Nov 2008 11:26:47
colormap Cristina McIntire 05 Nov 2008 11:27:05

Contact us at files@mathworks.com