smoothing the shading of pcolor plots

45 ビュー (過去 30 日間)
HC98
HC98 2023 年 6 月 16 日
コメント済み: Andres 2023 年 6 月 16 日
I'm preparing some plots for a presentation and no matter which options I combine, my pcolor plot is always really jagged and not smooth. I'm using interp shading but to no avail. IS there a way to make it as smooth as pcolormesh in python for example??
  2 件のコメント
DGM
DGM 2023 年 6 月 16 日
編集済み: DGM 2023 年 6 月 16 日
What is the size of the z data? What does the z data look like? What is the length of the current axes colormap?
Andres
Andres 2023 年 6 月 16 日
An example would be helpful here. I was curious how it would compare to https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html
[x,y] = ndgrid(1:0.05:5);
z = sin(x).^10 + cos(10 + y.*x) .* cos(x);
figure
s = pcolor(x,y,z);
s.EdgeColor = 'none';
s.FaceColor = 'interp';
colorbar
I think the plot looks very smooth.

サインインしてコメントする。

回答 (1 件)

Manas
Manas 2023 年 6 月 16 日
Hi,
You can provide the interpolation method in the interp function, for example, cubic
vq = interp1(x,v,xq,'cubic');
You can also use the imagesc function to interpolate the values as follows:
% Create a sample grid and corresponding values
[X, Y] = meshgrid(linspace(-1, 1, 100));
Z = sin(2*pi*X).*cos(2*pi*Y); % Example values, modify as needed
% Plot the smoothed color plot using imagesc
figure;
imagesc(X(1,:), Y(:,1), Z);
colorbar;
axis equal tight;
title('Smoothed Color Plot');
For more info, you can refer to these documentation:

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by