For the final 3D surface output, I need to show a legend of two colors with X>breakpoint being blue and Y<breakpoint being green. I have been able to graph the two colored plot, but am having a hard time figuring out how to split up the legend according to my breakpoint.
I have been using the colormap tool but have not been successful as it is still not using my defined breakpoint. The colors need to be two defined regions with no shading.
surf(xa,ya,Profile,'EdgeColor','none')
breakpoint = 1;
colors = [0 0 1; 0 1 1];
colormap(colors);
colorbar

You need to give a colour map with more points, specifically with the "middle colour" of the map centred around your breakpoint, but with that colour being in the correct point of the colour map relative to the minimum and maximum values of your surface.
So if your desired breakpoint is 1/4 of the way between the min and max values of the surface, you could have a colour map with 100 rows where the 25th row contains the middle/breakpoint colour.
You can achieve this by interpolating from a an array including your breakpoint to something with consistent intervals. Please see the commented code below
If you want a "sharp" delineation instead of a gradient then you can change the settings for
interp1to use previous instead of linear interpolationPlot for
breakpoint = 2Plot for
breakpoint = -1plot for
breakpoint = 1but with nearest instead of linear interpYou could condense the colour map generation part of the code slightly, but I think this makes it a bit less clear what's going on