- 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!