Discrepancy in imagesc from given matrix

2 Ansichten (letzte 30 Tage)
Suchetana Mitra
Suchetana Mitra am 13 Aug. 2022
Kommentiert: Suchetana Mitra am 13 Aug. 2022
I want to plot a heatmap of a matrix with corresponding values of d1 and d2 using imagesc
%Relevant code
d1=linspace(0.1,2.2,200);
d2=linspace(0.1,2.2,200);
x=d1;
y=d2;
z=readmatrix('Plant.csv');
imagesc(x,y,z)
colorbar
colormap(flipud(hot))
set(gca,'YDir','normal')
d1(150)=1.67
d2(50)=0.6
z(150,50)=0.43
However according to the plot z(150,50)=0; this is very confusing to me am I using imagesc wrong

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Aug. 2022
Remember that z(150,50) is z at the 150th Y value and the 50th X value. Rows correspond to Y not to X.
  4 Kommentare
Suchetana Mitra
Suchetana Mitra am 13 Aug. 2022
Ohh in that case what I really want to plot is probably the transpose of this matrix
Suchetana Mitra
Suchetana Mitra am 13 Aug. 2022
Thank you so much!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by