I've an issue with visualizing the data in a correct way.
I have an array with 3 colums and N rows.
DATA =
|x1 y1 v1|
|x2 y2 v2|
|x3 y3 v3|
| . |
| . |
| . |
|xn yn vn|
The first 2 columns represent the x-coordinate and y-coordinate of the Nth-point, while each element of the third column is a scalar value v (ranging from -1 to +1) which must represent a color. How can I create a nice 2D-plot with a colorbar, based on this data-array only?
My attempts:
Direct use of surf and mesh-plotcommands resulted in an error, since the COLOR-info needs to be in a matrix-form, but in my case it is only a vector (i.e. the third column).
Using a scatter plot with n-rows (I used the following commands)
pointsize = 20; scatter(DATA(:,1), DATA(:,2), pointsize, DATA(:,3),'filled');
But the result is not good enough, since I want the complete image filled up with the respective colors (and thus get rid off the white discontinuities). Increasing the number of rows, makes it look denser, but at the end the white spaces are still visible.
Any kind of help is much appreciated.
It seems that to generate a continuous surface you will have to use either
meshorsurf, but both of them only work for grid data points. So what you can do is to firstly interpolate and/or extrapolate your (x,y,v) data points such that they form a grid.griddatamight be a good function to try first. Here is just an example I made up: