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).
The below MATLAB code is designed to generate pseudo color plot from the x-y co oridinates generated from parametric equations.Įxplanation: The resultant plot represents the input matrix data, generated from repmat() function within the x-y coordinate values that are defined by two parametric equations.By default mesh will color surface values based on the (default) jet colormap (i.e. Parametric functions are also supported by pcolor() method. The pseudo color semi logarithmic plot generated from the pcolor() method can be stored as surface object and its properties can be altered as shown in the below example: Example #2Įxplanation: The plot from the above code is generated with modified y-tick values by altering the properties of the surface object ‘s’. The below MATLAB code is designed to create semi logarithmic pseudo color plot and to alter the appearance using surface object properties from its return value.Įxplanation: The resultant output is surface plot where y-coordinate input is the logarithmic function of x-coordinate inputs. The MATLAB plotting function pcolor() can also be used to create semi logarithmic pseudo color plot. The color representation of the faces are modified due to modification applied to the surface object property ‘facecolor’ for the surface object ‘s’. The below code snippet is designed to create the pseudo color plot and modify the face color of the cells using interpolated coloring using surface object properties.Ĭmat = Įxplanation: The resultant pseudo color plot is assigned to surface object ‘s’. The edge color and the line width of the plot is modified using ‘s’ value as shown in the output plot. The below code is developed create a pseudo color plot for input matrix and modify the edge color and line width after the plot is generated.Įxplanation: The resultant pseudo color plot is assigned to variable ‘s’. This return value can be used to customize the properties of the plot after its creation. When pcolor() method is assigned to a variable, it returns a surface object.
The below code is wriiten to create 1X2 chart layout and creating two different pseudo color plot for two different set of inputs and functions in each cell of the layout.Įxplantion: The resultant plots are arranged in single layout consisting of two tiles generated using the function nexttile(). MATLAB supports tilling of plots using the functions like nexttile() and tiledlayout(). The data from the input matrix are represented by different color code in the plot. Example #3Ĭreate pseudo color plot for the input matrix data Cmat within the defined x and y coordinates given by matrix inputs X and Y.Įxplanation: The resultant plot has the vertices as per the values given by X and Y matrices and data from Cmat is plotted within the limits.
Generate Hadamard square orthogonal matrix and create pseudo color plot for same,with the origin set in the upper left corner.Įxplanation: The resultant graph is a 40X40 two-color map, represented in the reverse direction. The pseudo color plot also can be created in the reverse direction using axis function. Here are the examples mentioned: Example #1Ĭreate pseudo color plot for input matric Cmat.Įxplanation: The input matrix is of size 2X3 and the vertices of the plot is decided 2X3 as default data. Here is the table of Attributes: Attribute S=pcolor(_) Attributes of Matlab pcolor() To store the pseudo color plot as surface object Hadoop, Data Science, Statistics & othersĪx defines the axes targeted for the plot