pcolor() default EdgeColor or EdgeAlpha
39 次查看(过去 30 天)
显示 更早的评论
rarely do I ever plot data using pcolor() that is sparse enough for the pcolor grid lines to be sueful. Usually, I end up with a sea of blackness.
Is there a way to change the default behavior of pcolor() such that EdgeAlpha = 0 or EdgeColor = 'none'?
I do not see an option in get(0,'Factory')
x=1:200;
y=1:100;
[X, Y] = meshgrid(x, y);
dummyData = (sqrt(X.^2 + Y.^2));
area = 2;
distance = 100;
nexttile
p1=pcolor(x,y, dummyData);
title('default pcolor()')
nexttile
p2=pcolor(x,y, dummyData);
p2.EdgeAlpha = 0;
title('EdgeAlpha = 0')
nexttile
p3=pcolor(x,y, dummyData);
p3.EdgeColor = 'none';
title("EdgeColor = 'none'")
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/921859/image.png)
0 个评论
采纳的回答
Steven Lord
2022-3-10
x=1:200;
y=1:100;
[X, Y] = meshgrid(x, y);
dummyData = (sqrt(X.^2 + Y.^2));
area = 2;
distance = 100;
nexttile
p1=pcolor(x,y, dummyData);
title('default pcolor()')
nexttile
set(groot, 'DefaultSurfaceEdgeColor', 'none')
p2=pcolor(x,y, dummyData);
title('Default EdgeColor = none')
nexttile
set(groot, 'DefaultSurfaceEdgeColor', 'r', 'DefaultSurfaceEdgeAlpha', 0.25)
pcolor(x, y, dummyData);
title('Default EdgeColor = r and EdgeAlpha = 0.25')
更多回答(1 个)
Image Analyst
2022-3-10
Not sure why you're even using pcolor. I never liked how it not only put up the black lines, but that it doesn't show the last row or column. Why not use image() or imshow() instead. There are no black lines with those.
2 个评论
Image Analyst
2022-3-10
What is there to be careful about? Having pixels show up linearly (not warped or stretched) is good. You can also have the tick marks show up in either pixels, or in calibrated units if you want.
In your other post, the two plots on the left with imagesc() look great. With the plots on the right made with pcolor(), the annoying lines from the pcolor displays are probably due to aliasing due to subsampling for display and might change as you resize the figure.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!