- 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 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Soumya
el 30 de Mayo de 2025
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 comentarios
Ver también
Categorías
Más información sobre Discrete Data Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!