user11607936
user11607936

Reputation:

Open .fig file and delete some of the plot entries-Matlab

I have the following image stored as f7.fig. I want to open it again and delete all the other entries except the first (red), second (blue) and last(cyan). I want also to delete them from the legend. Is this possible?

enter image description here

Upvotes: 3

Views: 205

Answers (1)

If_You_Say_So
If_You_Say_So

Reputation: 1283

An easy interactive approach would be like this:

savefig(h, 'somefig.fig`); % Save figure
% Close the figure ...
openfig('somefig.fig'); % Open figure
% Click on the curves you wanted to delete ....
delete(gco); % delete object -> this takes care of the legend too
% Click on the curves you wanted to delete ....
delete(gco); 
% so on...

This approach here is also an alternative.

Upvotes: 1

Related Questions