Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

getfigurepos.m 555 B

12345678910111213141516171819202122232425
  1. function f = getfigurepos(fig,units)
  2. % function f = getfigurepos(fig,units)
  3. %
  4. % <fig> (optional) is the figure handle. default: gcf.
  5. % <units> (optional) is 'normalized' (default) | 'points'
  6. %
  7. % return the position of <fig> in units specified by <units>.
  8. %
  9. % example:
  10. % figure; getfigurepos(gcf,'points')
  11. % input
  12. if ~exist('fig','var') || isempty(fig)
  13. fig = gcf;
  14. end
  15. if ~exist('units','var') || isempty(units)
  16. units = 'normalized';
  17. end
  18. % do it
  19. prev = get(fig,'Units');
  20. set(fig,'Units',units);
  21. f = get(fig,'Position');
  22. set(fig,'Units',prev);