# Plot three color maps in the same figure?

3 Ansichten (letzte 30 Tage)
C A am 17 Jan. 2023
Kommentiert: C A am 17 Jan. 2023
I have three different matrices, each 64x1322, named as NormRes1, NormRes2 and NormRes3. I want to plot all of them on the same figure. This is what I have now,
AllMatrix=cell(3);
AllMatrix{1}=NormRes1;AllMatrix{2}=NormRes2;AllMatrix{3}=NormRes3;
for idx=1:length(AllMatrix)
rot_a1=(AllMatrix{idx});
figure (1);
pcolor(rot_a1);
end
I usually plot them separately using the following command
Figure1=pcolor(TimeValues1,Xvalues1,NormRes1)
Figure2=pcolor(TimeValues2,Xvalues2,NormRes2)
Figure3=pcolor(TimeValues3,Xvalues3,NormRes3)
I can't quite figure out how to plot all of them on the same figure.
PS: I would like each matrix to be represented in separate colors.
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

KSSV am 17 Jan. 2023
Bearbeitet: KSSV am 17 Jan. 2023
figure
subplot(131)
pcolor(rand(10)) ;
colorbar
subplot(132)
pcolor(rand(10)) ;
colorbar
subplot(133)
pcolor(rand(10)) ;
colorbar
If you want to plot it on same figure, you have to use hold on. As you are plotting only a matrix, it will plot wrt indices and you wont be able to see the plot peroperly.
So in your case, you may use:
figure
for idx=1:length(AllMatrix)
rot_a1=(AllMatrix{idx});
subplot(1,3,idx)
pcolor(rot_a1);
end
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
C A am 17 Jan. 2023
Thanks! May be I was not clear enough, but is there a way to superpose these plots?

Melden Sie sich an, um zu kommentieren.

### Kategorien

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

R2017b

### Community Treasure Hunt

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

Start Hunting!

Translated by