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
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.