outlinebounds.m 748 B

12345678910111213141516171819202122232425262728293031
  1. function hnew = outlinebounds(hl, hp)
  2. %OUTLINEBOUNDS Outline the patch of a boundedline
  3. %
  4. % hnew = outlinebounds(hl, hp)
  5. %
  6. % This function adds an outline to the patch objects created by
  7. % boundedline, matching the color of the central line associated with each
  8. % patch.
  9. %
  10. % Input variables:
  11. %
  12. % hl: handles to line objects from boundedline
  13. %
  14. % hp: handles to patch objects from boundedline
  15. %
  16. % Output variables:
  17. %
  18. % hnew: handle to new line objects
  19. % Copyright 2012 Kelly Kearney
  20. hnew = zeros(size(hl));
  21. for il = 1:numel(hp)
  22. col = get(hl(il), 'color');
  23. xy = get(hp(il), {'xdata','ydata'});
  24. ax = ancestor(hl(il), 'axes');
  25. hnew(il) = line(xy{1}, xy{2}, 'parent', ax, 'linestyle', '-', 'color', col);
  26. end