pcolor() default EdgeColor or EdgeAlpha
39 views (last 30 days)
Show older comments
Michael Shagam
on 10 Mar 2022
Commented: Image Analyst
on 10 Mar 2022
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 Comments
Accepted Answer
Steven Lord
on 10 Mar 2022
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')
More Answers (1)
Image Analyst
on 10 Mar 2022
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 Comments
Image Analyst
on 10 Mar 2022
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.
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!