subplot of already saved figures

721 views (last 30 days)
Iyk on 21 Aug 2013
Commented: Walter Roberson on 5 May 2020
i have somany figures like dyke_tap, dyke_tbp,dyke_tcp and dyke_tdp...... they aare all bar plots and i want to have them side by side in other to compare them. i have seen ways of merging them, but that wont be good for what i want so i want to use a subplot. how can i use a subplot on already saved figures..... example ' having 'dyke_tap, dyke_tbp,dyke_tcp and dyke_tdp' side by side

Sign in to comment.

Answers (4)

laurie on 21 Aug 2013
Here is a small bit of code that does just that for two saved figures. The figures need to be saved in the .fig format with this code (hgload only takes .fig figures as inputs), but there might be some way to adapt this code to make it work for other formats.
% Load saved figures
% Prepare subplots
% Paste figures on the subplots
% Add legends

Sign in to comment.

Farhad Sedaghati
Farhad Sedaghati on 22 Jun 2015
Edited: Farhad Sedaghati on 22 Jun 2015
You can use the following function to insert all the saved fig files next to each other:

Jesica Gomez
Jesica Gomez on 20 Feb 2017
Hi, does it work for 3d graphs? I'm trying to use the code but it plots 2D graphs.

Tasos Ampelas
Tasos Ampelas on 7 Aug 2018
Hi everyone,
In the @laurie 's first answer code, is there a way to get only the final figure and not every single one that I have loaded to matlab?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!