File Exchange Pick of the Week

Our best user submissions

Handle Graphics Filtering


The file submission referenced in this post is no longer available on File Exchange.

Duane Hanselman looks too young in his MATLAB Central picture to be an accomplished author, but he is. This week’s pick is great for understanding handle graphics better in MATLAB. For those who have not yet discovered handle graphics, the short of it is that every graphical entity in MATLAB from lines, axes, to figures, has a handle that identifies it in a unique manner. Once you have the handle of an object, you can manipulate it to customize your plots. There are lots of properties that an object can have, and not all of them can be modified. GETSET lets you filter out read only properties, making it easier to see those things you can change.

Here is the simplest possible use of handle graphics. Try this line by line to see what happens.

>> h = plot(rand(1,10)) % Your handle number will likely be different
h =
>> set(h, 'color', 'g')
>> get(h)
  • print


댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.