Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>By default <code>mesh</code> will color surface values based on the (default) <code>jet</code> colormap (i.e. hot is higher). You can additionally use <code>surf</code> for filled surface patches and set the <code>'EdgeColor'</code> property to <code>'None'</code> (so the patch edges are non-visible). </p> <pre><code>[X,Y] = meshgrid(-8:.5:8); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; % surface in 3D figure; surf(Z,'EdgeColor','None'); </code></pre> <p><img src="https://i.stack.imgur.com/lYPXt.png" alt="enter image description here"></p> <p><strong>2D map</strong>: You can get a 2D map by switching the <code>view</code> property of the figure </p> <pre><code>% 2D map using view figure; surf(Z,'EdgeColor','None'); view(2); </code></pre> <p><img src="https://i.stack.imgur.com/MloE4.png" alt="enter image description here"></p> <p>... or treating the values in <code>Z</code> as a matrix, viewing it as a scaled image using <code>imagesc</code> and selecting an appropriate <a href="http://www.mathworks.com/help/matlab/ref/colormap.html" rel="noreferrer">colormap</a>. </p> <pre><code>% using imagesc to view just Z figure; imagesc(Z); colormap jet; </code></pre> <p><img src="https://i.stack.imgur.com/AZDRc.png" alt="enter image description here"> </p> <p>The color pallet of the map is controlled by <code>colormap(map)</code>, where <code>map</code> can be custom or any of the built-in colormaps provided by MATLAB: </p> <p><img src="https://i.stack.imgur.com/dP9eY.gif" alt="enter image description here"></p> <p><strong>Update/Refining the map</strong>: Several design options on the map (resolution, smoothing, axis etc.) can be controlled by the regular MATLAB options. As @Floris points out, here is a smoothed, equal-axis, no-axis labels maps, adapted to this example: </p> <pre><code>figure; surf(X, Y, Z,'EdgeColor', 'None', 'facecolor', 'interp'); view(2); axis equal; axis off; </code></pre> <p><img src="https://i.stack.imgur.com/Sd45L.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload