image thumbnail

makeSubplotScalesEq​ual(h,w,IDX, FIG )

version (1.2 KB) by Sanjay
Function to make the scales of subplots the same as each other


Updated 02 Nov 2014

View License

Often we use subplots to compare data.
This means we want the scales to be comparable.
This function goes through subplots and finds the one with the largest scaling. It then applies this scale to each of the other subplots.
The syntax is like subplot:

for i=1:6
plot( rand(3) );
makeSubplotScalesEqual(2,3, [1:6] )

or simply

makeSubplotScalesEqual(2,3) % for all 6 subplots

This makes each of the 6 plots have equal limits.
The function also sets colour limits, e.g. for image() plots.
The function can also operate across multiple figures.

Cite As

Sanjay (2022). makeSubplotScalesEqual(h,w,IDX, FIG ) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!