How do I create smooth color plots in Matlab?
Here is where I am at now. I use the imagesc function and I send you two images. One of them is smoother and better looking and that is because I used denser meshgrid to compute the function. But still, it is discrete looking. How do I make it smooth?
Thank you
Specify an m-by-n matrix of colormap indices, where [m,n] = size(X) . Specify one color per vertex. Create matrices x , y , and c . Then plot the filled region with fill color interpolated from vertex colors c .
The shading function controls the color shading of surface and patch graphics objects. shading flat each mesh line segment and face has a constant color determined by the color value at the endpoint of the segment or the corner of the face that has the smallest index or indices.
Sounds like you need a colormap with more gradation. All the colormap generators accept an argument describing the number of discrete colors to include. Try increasing that number; I think the default is something like 64. For example:
colormap(jet(4096))
You can increase the number even further if you like, but eventually you'll hit the limits of 24-bit color space.
Incidentally, the human eye is most sensitive to color gradations in blue hues, so another thing you could do is choose an alternate colormap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With