- pcolor: https://www.mathworks.com/help/matlab/ref/pcolor.html
- imagescn: https://viewer.mathworks.com/?viewer=plain_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2Fdff4ffb7-190a-4494-839f-ff39787bd48e%2F1741389382%2Ffiles%2Fcdt%2Fimagescn.m&embed=web
between pcolor & imascn which of them better for correlation plot
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a big problem
i used to differennt function pcolor & imascn for showing corrrelation map but i see different plots what's problem because the data are same
i put my code
subplot(1,2,1)
imagescn(lons1,lats1,rs1)
cb1 = colorbar;
ylabel(cb1,'zero-phase correlation')
caxis([-1 1])
cmocean('balance','pivot',0)
subplot(1,2,2)
pcolor(lons1,lats1,rs1');
shading interp;
hold on;
lakes = readgeotable("worldlakes.shp");
geoshow(lakes,"FaceColor","blue")
rivers = readgeotable("worldrivers.shp");
geoshow(rivers,"Color","blue")
cb1 = colorbar;
ylabel(cb1,'zero-phase correlation')
caxis([-1 1])
댓글 수: 0
답변 (1개)
Soumya
2025년 5월 30일
The different plots from using ‘pcolor’ and ‘imagescn’ is because these functions handle matrix data and axis alignment differently. According to the MATLAB documentation, ‘pcolor’ omits the last row and column of the matrix because it uses vertex-based color interpolation. This causes part of your data to be left out or misaligned. In contrast, ‘imagescn’ plots the full matrix with values centered in each cell, maintaining correct orientation and full data coverage matrix value as a full cell.
Therefore, 'imagescn' is the preferred choice for plotting correlation maps, especially when working with geospatial data like latitude and longitude grids. It preserves the full structure and scale of the matrix without omitting rows/columns, aligns correctly with the coordinates, and visually represents the data as intended.
The following documentations will give more information on the given functions and their applications:
I hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!