Search code examples
matlabplotaxessubplot

Matlab - different axes size in subplot


I have two graphs with different scale and I would like to use subplot. How do I set axes size for subplot(211) and set different axes scale for subplot(212)???


Solution

  • subplot returns an axes object:

    ha = subplot(211);
    plot(1:10);
    set(ha, 'xscale', 'log');
    hb = subplot(212);
    plot(1:10);
    set(hb, 'xscale', 'linear');
    

    Store it in a variable and set the scale as you need.