MATLAB Answers

Filtering a 2D plot from pcolor

1 view (last 30 days)
Marcus Rosales
Marcus Rosales on 24 Aug 2020
Commented: Marcus Rosales on 29 Aug 2020
Hello, just wondering what a good way to filter a plot obtained from a matrix of values, M, when using pcolor(m) with shading interp.
I attached a png of what I have. There seems to be good filters but for grey scale and I want to keep the color scheme shown. Any help would be appreciated! Been on this project for sometime and it turns out my math, physics and code is ok, and it all has to do with filtering the signal.

  2 Comments

Image Analyst
Image Analyst on 24 Aug 2020
Uh, you do know that there are a bazillion ways to filter an image or array, don't you? What filter are you thinking of? Enhance edges? Blur it? Remove noise? Clip values? Erase values? There is no generic mind-reading filter.
Marcus Rosales
Marcus Rosales on 24 Aug 2020
To remove noise. Honestly the snarky answer is not needed! I am not an expert in matlab and in my field of study (physics) filter means exactly this.... I accidentally used jargon I am used to.
The purpose of the forum is to help; I was not born knowing all the filters in matlab. I've been on java, c, and python forums and for whatever reason mathworks takes the cake for condescending answers. Thanks for making this a toxic environment!

Sign in to comment.

Answers (1)

Kiran Felix Robert
Kiran Felix Robert on 28 Aug 2020
Hi Marcus,
Refer to the documentation of imfilter and fspecial functions for filtering Color images.
Also refer to this document for a use case.
Kiran Felix Robert

  1 Comment

Marcus Rosales
Marcus Rosales on 29 Aug 2020
Hi Kiran,
I took a look at these, but they seemed to blur rather than make the image sharper.
I can give a quick eample of something I already did. I attached a screen shot of a spectral function; all you need to see is how noisy the original one was (small plot). I used a Guassian filter to smooth out the plot so that I get a resonably well behaved curve (big plot).
I believe my 2D plot is suffering a similar problem. Is there a filter more inline with this?
Thanks!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!