MATLAB: Scatter Plot Extension to Entire Figure

colordatagraphMATLABplotscatterscatter plot

I have vectors of x and y data, as well as data that parameterizes the color of the scatter dots in another vector. I am graphing them with:
"scatter(x, y, dotSize, colorParameter, 'filled')"
This plots the colored dots in their correct positions. What I want to do is create a blanket graph that simply shows the color gradient. I do not want individual points, simply areas based on the points. How do I go about this?
Thanks in advance.

Best Answer

My guess is that you want a surface plot. Getting from points to a surface can be relatively straightforward if your data are gridded (regularly-spaced in the x and y coordinates), however you will need to interpolate them to a grid if they are not originally gridded. That requires that you first create regularly-spaced vectors for your x and y data, then use meshgrid to create the necessary matrices, and griddata (the most straightforward to use) to interpolate the z-data to a grid that surf or mesh can plot.