From: Adnan Abdulally on
Can someone please help?

I have modified the code a bit:

f = figure('Position', [0 0 1200 400]);
t1 = uitable('Parent', f, 'Position', [0 200 632 166]);
t2 = uitable('Parent', f, 'Position', [0 0 632 166]);
set(t1, 'Data', rand(8));
for i=1:20;
set(t2, 'Data', rand(8));
h = subplot(1,2,2);
plot(rand(64,1));
ylabel('error (sum squared)')
xlabel('matrix element')
title('error of elements in matrix completion')
subplot(h)
subplot('Position',[700,10,400,400]);
pause(1)
end

why is the subplot Position function not working??? When i call it it doesnt move the plot at all.
From: Steven Lord on

"Adnan Abdulally" <adnan.abdulally(a)tsc.com> wrote in message
news:i1kmd8$n6d$1(a)fred.mathworks.com...
> Can someone please help?
>
> I have modified the code a bit:
>
> f = figure('Position', [0 0 1200 400]);
> t1 = uitable('Parent', f, 'Position', [0 200 632 166]);
> t2 = uitable('Parent', f, 'Position', [0 0 632 166]);
> set(t1, 'Data', rand(8));
> for i=1:20;
> set(t2, 'Data', rand(8));
> h = subplot(1,2,2);
> plot(rand(64,1));
> ylabel('error (sum squared)')
> xlabel('matrix element')
> title('error of elements in matrix completion')
> subplot(h)
> subplot('Position',[700,10,400,400]);
> pause(1)
> end
>
> why is the subplot Position function not working??? When i call it it
> doesnt move the plot at all.

Of course not -- it's _creating a new subplot_ and as per the Description
section of the documentation for SUBPLOT, it's creating the new subplot at
position [700, 10, 400, 400] _in normalized coordinates_, which is WELL off
the upper-right corner of your figure.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/subplot.html?BB=1&BB=1

If you want to control the Position property of an existing axes, use SET on
it. Get rid of the lines "subplot(h)" and "subplot('Position', ..." and
replace them with:

set(h, 'Position', [700 10 400 400]);

You'll probably want to make sure that the Units property of the axes is set
to the units you expect (pixels or maybe points, not normalized or one of
the larger units like inches or centimeters) before executing that code.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Ben on
Hay,

I don't see the problem in your script directly, but
I use screensize most of the time to get the plot where ever I like. Hopefully it can help you.

scrsz = get(0,'ScreenSize');
figure ('Position',[1 scrsz(4) scrsz(3) scrsz(4)]);
hold on
plot([1:length(dd)].*0.01,dd(:,1), 'b'); %SI
plot([1:length(dd)].*0.01,dd(:,2), 'g'); %ML
plot([1:length(dd)].*0.01,dd(:,3),'r'); %AP
legend('Superioinferior', 'Mediolateral', 'Anterioposterior');
xlabel('time (s)')
hold off

succes