%SCALED_IMAGE % % Usage: % scaled_image(xPts, yPts, zPts, xSpacing, ySpacing, useNumBlocks) % % This function adds a scaled image of the provided data to the current % figure, and plots the data point locations on top of the image. % Note that the title, axis labels, etc. must be handled outside of the % function. % % Input arguments: % xPts, yPts, zPts: Arrays of the x-, y-, and z-locations of the data % points. % xSpacing, ySpacing: Desired grid spacing for the plot. Exact meaning depends on % the value of useNumBlocks. % useNumBlocks: Flag to determine how xSpacing and ySpacing are used. % Values: % 0: Treat xSpacing, ySpacing as the distance between % each grid point. % non-0: Select xSpacing evenly-spaced grid points in the % x-direction, and ySpacing evenly-spaced points % in the y-direction. % % Author: Robert Wagner % Date: 2nd March 2009 % Last Modified: 12th March 2009 function scaled_image(xPts, yPts, zPts, xSpacing, ySpacing, useNumBlocks) [X Y Z] = createGrid(xPts, yPts, zPts, xSpacing, ySpacing, 'linear', useNumBlocks); hold on; imagesc(X(1,:),Y(:,1),Z); set(gca,'Ydir','normal') colorbar % Draw the original points. plot(xPts, yPts, '.k'); axis equal hold off %{ * Scaled image plot WITH original data points Input is the same as contour plots. %}