Azzera filtri
Azzera filtri

How can i find the position of the origin of a Cartesian plot?

2 visualizzazioni (ultimi 30 giorni)
I am trying to maintain the position of an 'edit box' in a resizeable GUI by the origin of a Cartesian plot. The position of the axes object is of course known.
How do I determine the location of the origin of the plot relative the position of the object? is there another way to find the position of the origin of the plot?
Thanks for any assistance

Risposte (1)

neil jerome
neil jerome il 7 Ago 2019
i would try looking at the 'position' property of the axes against the limits; the following works for figures, and seems to for axes in GUIs from a quick check...
hh = gca;
xRange = hh.XLim(2) - hh.XLim(1);
xFract = (0 - hh.XLim(1))/xRange;
xO = hh.Position(1) + xFract*hh.Position(3);
yRange = hh.YLim(2) - hh.YLim(1);
yFract = (0 - hh.YLim(1))/yRange;
yO = hh.Position(2) + yFract*hh.Position(4);
disp(['origin at (' num2str(xO) ',' num2str(yO) ')']);

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by