


For example, if h1, h2, and h3 are handles to graphics objects that you want to delete, concatenate the handles into a single array. Note: Like the rest of Matlab’s undocumented items, all hidden properties are undocumented, unsupported and may well change in future Matlab releases so use them with care.ĭid you find any useful hidden property? If so, then please leave your finding in the comments section below. delete (gca) If you want to delete multiple objects, pass an array of handles to delete. You can find the latest list by looking at this blog’s “Hidden property” category page. In future posts I will sometimes use such hidden properties. It provides the figure’s external position values, including the space used by the window frame, toolbars etc., whereas the regular documented Position property only reports the internal bounds: > get(gcf, 'pos') Let’s take the figure handle’s OuterPosition property for example. Other properties (like Dithermap or ShareColors) are deprecated and display a warning wherever they are accessed.īut every so often we find a hidden property that can be of some actual benefit. For example, I have found the PixelBounds property to be problematic – (it sometimes reports incorrect values!). hPlot (3) plot ( x1 x2, y1 y2, ) delete ( hPlot (2) ) You do need to be careful, depending what you do with those handles afterwards though because you will still have a 3-element vector, you will just have the 2nd element of this being the handle to a deleted object. > hiddenProps = props(strcmp(propsVisibility, 'off' )) ĭifferent HG handles have different hidden properties. > propsVisibility = get(props, 'Visible' )' Access the properties’ definition in the handle’s class definition: > ch = classhandle(handle(gcf)) With TrueColor displays, and will be removed in a future release.Ģ. Note that some of the properties might display a warning indication: > get(gcf)ĭithermap Warning: figure Dithermap is no longer useful use the desktop’s hidden HideUndocumented property: set(0, 'HideUndocumented','off' ) įrom now on, when displaying handle properties using get and set you’ll see the hidden properties. Like the hidden properties, these two methods are themselves undocumented…ġ. We can use hidden properties just like any other handle property, using the built-in get and set functions.īut how can we know about these properties? Here are two methods to do so. data processing and calculation for plot3. Since there's no other figure in sight, the current axes will remain so so there's no need for the set (), either. One pretty well-known example is the JavaFrame property of the figure handle, which enables access to the GUI’s underlying Java peer object. Above hold on does nothing as you immediately turn it back off so can just eliminate both. HG handles often have some undocumented hidden properties. I know I could recreate the plot by copy and pasting my code, but this seems cumbersome and a hassle to manage if I change something else about my plots.Matlab Handle Graphics (HG) is a great way to manipulate GUI objects. The first plot I want set for a specific part of the axis (0 to 10), the second plot I want to be from (90:100). One pretty well-known example is the JavaFrame property of the figure handle, which enables access to the GUI’s underlying Java peer object. I want to create a figure with two subplots. Matlab Handle Graphics (HG) is a great way to manipulate GUI objects.
#Cplot figure handle code#
My plotting code creates special symbols for each point in a scatter plot. Is there anyway to create the same plot twice by saving it to some type of axis handle?
