Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how to control axes inside axes position?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
ha chang eup

Posts: 42
Registered: 2/27/09
how to control axes inside axes position?
Posted: Oct 30, 2013 5:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

how to control axes inside axes position?

my code is...............

clear all;clc;close all;

XX=100; YY=200; %data point

figure(1)
line([XX],...
[YY],'LineWidth',2,'color','k' , 'LineStyle','.');

axesPos=get(gca,'position');%getting data axes position
xmin=axesPos(1);
xmax=axesPos(1)+axesPos(3);
ymin=axesPos(2);
ymax=axesPos(2)+axesPos(4);

XXlim=get(gca,'XLim');
YYlim=get(gca,'YLim');

%linear mapping on data axes position
x_a=((xmax-xmin)/(XXlim(2)-XXlim(1)))*(XX-XXlim(1))+xmin;
y_a=((ymax-ymin)/(YYlim(2)-YYlim(1)))*(YY-YYlim(1))+ymin;

ax1 = axes('Position', [x_a, y_a, axesPos(3)-0.4, axesPos(4)-0.4], ...
'XTick', [], ...
'YTick', [], ...
'Box', 'on', ...
'LineWidth', 2, ...
'Color', [0.1, 0.5, 1]);
line([0 0.3],[0 0.4])
hold on;

pause()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%after resizing axis limit position cannot touch data point
axis equal
bbb=3;
axis([-bbb bbb -bbb bbb])




after resizing axis limit, axes position cannot touch data point.

how can i control axes position??



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.