axis position and insets
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chad Greene
am 19 Aug. 2014
Beantwortet: Chad Greene
am 20 Aug. 2014
I am having trouble getting insets to match the dimensions of my figure window. For any given figure I'd like to get the current position of axes and pin an inset to the upper left corner. Here is what I have tried:
gp = get(gca,'position');
axes('position',[gp(1) gp(2)+(.75)*gp(4) .25*gp(3) .25*gp(4)])
Unfortunately, this doesn't snap to my current figure axes:

I can manually adjust the figure size after plotting the inset and then it looks good:

But the manual solution is clunky and unrepeatable. Is there a way to get this inset pinned a little better?
2 Kommentare
dpb
am 19 Aug. 2014
Seems to work here if just use the above.
Any chance you've got a container that causes the position to be relative to it instead?
Otherwise, think need more detail to reproduce the problem/symptoms.
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!