Filter löschen
Filter löschen

Editing existing figures to overlay with different colors

10 Ansichten (letzte 30 Tage)
Mitchell
Mitchell am 18 Jun. 2018
I have several figure files with the same number of subplots that I need to edit and overlay, subplots1.fig, subplots2.fig, and subplots3.fig.
The problem is that they are all plotted in red and when plotted on top of each other become indistinguishable. Is there a simple way to change the color of a line plotted on a figure before overlaying it on another figure? Loading and rewriting the data to plot later would be very expensive and untimely.
Regards,

Antworten (1)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy am 18 Jun. 2018
Use this.
if true
f1 = open('f1.fig');
f2 = open('f2.fig');
a1 = get(f1, 'Children');
a2 = get(f2, 'Children');
for i = 1 : numel(a2)
a2Children = get(a2(i),'Children');
copyobj(a2Children, a1(i));
end
close(f2)
save_figure('f3')
end
  2 Kommentare
Mitchell
Mitchell am 20 Jun. 2018
Hi Yuvaraj V, thanks for your reply. This script overlays the plots, but I do not see how it changes the colors. Could you elaborate on changing the colors?
Nathaniel H Werner
Nathaniel H Werner am 2 Nov. 2018
Bearbeitet: Nathaniel H Werner am 2 Nov. 2018
Depending on how you want to change the colors, you can try using shade.m to make it darker or tint.m to make it brighter.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by