Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smooth color plots in Matlab

Tags:

matlab

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?

enter image description hereenter image description here

Thank you

like image 376
user2225930 Avatar asked Apr 03 '13 21:04

user2225930


People also ask

How do you fill a plot with color in Matlab?

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 .

How do you do shading in Matlab?

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.


1 Answers

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.

like image 72
nhowe Avatar answered Sep 21 '22 15:09

nhowe