plot - How to position axes from top of the figure in Matlab? -


when issue following command

>> figure; axes('units','pixels','position',[0,0,100,100]) 

i small 100x100 axes object @ left bottom corner of figure.

the size of axes remains constant , remains docked same corner if figure resize.

how same upper left corner?

if want set origin upper left corner can set attributes xaxislocation top , yaxislocation left. further can mention y coords should increase top bottom setting ydir reverse.

to make sure size of axes maintained set attribute activepositionproperty position.

so @ end command like:

figure;axes('units','pixels','position', [10,200,100,100],'xaxislocation','top','yaxislocation','left','ydir','reverse','activepositionproperty','position') 

note in figure obtained origin @ upper left corner of axes not of window.


Comments