![]() Imagesc(flipud(z)), axis equal tight, colorbar To illustrate these 2 points, I produced the figure below with the following code: = meshgrid(1:10,1:5) The surf and the imagesc examples in gevang's answer only (almost - apart from the last row and column) correspond to each other because the 2D sinc function is symmetric. ![]() On the other hand, using imagesc, you have to be careful with the axes. Note that both pcolor and "surf + view(2)" do not show the last row and the last column of your 2D data. Surf(X, Y, Z,'EdgeColor', 'None', 'facecolor', 'interp') As points out, here is a smoothed, equal-axis, no-axis labels maps, adapted to this example: figure Update/Refining the map: Several design options on the map (resolution, smoothing, axis etc.) can be controlled by the regular MATLAB options. The color pallet of the map is controlled by colormap(map), where map can be custom or any of the built-in colormaps provided by MATLAB: or treating the values in Z as a matrix, viewing it as a scaled image using imagesc and selecting an appropriate colormap. = meshgrid(-8.5:8) ĢD map: You can get a 2D map by switching the view property of the figure % 2D map using view ![]() You can additionally use surf for filled surface patches and set the 'EdgeColor' property to 'None' (so the patch edges are non-visible). By default mesh will color surface values based on the (default) jet colormap (i.e.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |