File Exchange Pick of the Week

September 28th, 2005

Handle Graphics Filtering

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 =
  151.0028
>> set(h, 'color', 'g')
>> get(h)

Comments are closed.


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.