MATLAB LanguageControlling Subplot coloring in Matlab


Introduction

As I was struggling with this more than once, and the web isn't really clear on what to do, I decided to take what's out there, adding some of my own in order to explain how to create subplots which have one colorbar and they are scaled according to it.

I have tested this using latest Matlab but I'm pretty sure it'll work in older versions.

Remarks

The only thing that you need to work out by yourself is the positioning of the colorbar (if you want to display it at all). this will depend on the number of graphs you have, and the bar's orientation.

Position and size is defined using 4 parameters - x_start, y_start, x_width, y_width. The plot is usually scaled to normalized units so that the bottom-left corner corresponds with (0,0) and the top-right to (1,1).