How to make scatter size the same as pixel size
Show older comments
I plot a figure by 'imagesc'.
And I want to replace the pixels on the diagonal line with white color.
I use 'scatter(1:100,1:100,30,'w','s','fill')'. But it is difficult to make scatter size the same as pixel size.
Is there any solution or workaround?

Accepted Answer
More Answers (1)
Image Analyst
on 3 Dec 2020
0 votes
The pixel size depends on the size of your figure. If you resize your figure then the pixel size will change. So I think the best you can do, if you're overlaying a scatterplot over an image, is to just adjust the size (third argument to scatter) manually to be a reasonable size for the figure sizes you expect to have.
Otherwise you can simply burn the pixel directly into the image with some color instead of using scatter, which puts markers into the overlay.
Categories
Find more on Red 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!

