MATLAB Language Controlling Subplot coloring in Matlab

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


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.


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).

Got any MATLAB Language Question?