getting point position in pixels and then to start a plot from this point but using another axis

1 view (last 30 days)
Hi all,
I have GUI application with two x-axes (top and bottom) and one y-axes.
So I need to draw a point using top x-axes, and then get position in pixels of this point to draw a plot on bottom x-axes using this point as a start point.
I write for point.
x1 = 6;
y1 = 4.2;
xlimit=[2 8]
ylimit=[2 6]
axesPosition = [100 108 430 209];
h1 = axes('Units','pixels','Position',axesPosition,...
'Color','none','XColor','r','YColor','r',...
'yticklabel',[],'ytick',[],'xlim',xlimit,'ylim',ylimit,...
'NextPlot','add');
set(h1,'xaxislocation','top','yaxislocation','right')
h1=plot(x1,y1,'r')
What should I write for a line starting from this point, but with 'xaxislocation','bottom' and the same 'yaxislocation'?
Thank you!

Answers (0)

Community Treasure Hunt

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

Start Hunting!