Removing grid/edge lines in pcolor() figure
376 次查看(过去 30 天)
显示 更早的评论
I have a figure drawn using pcolor(). A lot of small grid lines are drawn that effectively darken the figure so that you can't see the colors well. I can remove the lines by selecting the graphic and then open the property editor and change "Edges" (shown with a drop down menu) to "no line". Is there a command I can code into my script that will do this?
2 个评论
NUR AMIRA ZULKIFLLI
2020-5-2
编辑:NUR AMIRA ZULKIFLLI
2020-5-26
set(h, 'edgecolor','none') or surf(SMImage{SMImageNumber},'edgecolor','none'); fix my problem
Image Analyst
2020-5-2
Well you could edit the function to change varargin to tack on the 'EdgeColor', 'none' to it.
>> edit pcolor.m
But it's not recommended to alter built-in functions.
Again, pcolor does not show the last row and column. From the comments in the function "PCOLOR(C) is a pseudocolor or "checkerboard" plot of matrix C. ... the last row and column of C are not used." Here it is displaying a 4-by-4 matrix:
>> pcolor(randi(9, 4, 4))
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/289695/image.png)
Note: it's not 4-by-4.
采纳的回答
更多回答(3 个)
Image Analyst
2012-4-30
Tell me why you're using pcolor() instead of image(), imagesc(), or imshow(), none of which have dark lines between the pixels and all of which have a color or intensity related to one pixel's value (unlike pcolor). pcolor can show a color related to the pixel value if you use flat shading but otherwise "each cell is colored by bilinear interpolation of the colors at its four vertices, using all elements of C" - is that what you want? Plus you don't get a little colored square for each pixel even if you did use flat shading - the last row and column are missing - is that what you want? I'm sure that there is someone out there who wants the "pixel" color to depend on how tilted the tile is when tying its corners to the four corners where the pixels are, rather than depend on the color of the individual pixels, but I haven't seen anyone say so yet - they've all dumped pcolor for a regular image display function.
4 个评论
Gabor Bekes
2017-2-22
arrayfun(@(s) set(s,'EdgeColor','none'), findobj(gcf,'type','surface'))
If you have multiple pcolor plots in subplots. I also haven't found a way to set it directly when drawing.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!