Hauptinhalt

Erstellen, Löschen und Abfragen von Grafikobjekten

Auffinden, Kopieren und Löschen von Grafikobjekten

Verwenden Sie Funktionen, um Grafikobjekte zu erstellen, zu löschen und zu kopieren, Abbildungen und Achsen für das Plotten vorzubereiten und auf gültige Grafikobjekte zu testen. Navigieren Sie durch das Grafiksystem und machen Sie Ihren Code fehlerresistenter. Sie können zum Beispiel testen, ob ein Objekt ein gültiges Grafikobjekt ist, bevor Sie es einer Funktion übergeben.

Funktionen

alle erweitern

gcaAktuelle Achsen oder aktuelles Diagramm
gcfHandle der aktuellen Abbildung
gcbfHandle of figure containing object whose callback is executing
gcboHandle of object whose callback is executing
gcoHandle of current object
grootGraphics root object
ancestorAncestor of graphics object
allchildFind all children of specified objects
findallFind all graphics objects
findobjFind graphics objects with specific properties
findfigsFind visible offscreen figures
isgraphicsTrue for valid graphics object handles
ishandleTest for valid graphics or Java object handle
isaDetermine if input is instance of specified class
isholdCurrent hold state
gobjectsInitialize array for graphics objects
copyobjCopy graphics objects and their children
newplotSpecify where to draw graphics objects
deleteDelete files or objects
clfClear figure
claClear axes
closeClose one or more figures

Themen

Festlegen von Zielfiguren und -achsen

  • Responding to Hold State
    This example shows how to test for the hold state and respond appropriately in user-defined plotting functions.
  • Use newplot to Control Plotting
    This example shows how to prepare figures and axes for user-written plotting functions.
  • Control Graph Display
    You can control which figures and which axes MATLAB® uses to display the result of plotting functions.
  • Prepare Figures and Axes for Graphs
    MATLAB plotting functions rely on the values of the figure and axes NextPlot properties to determine whether to add, clear, or clear and reset the figure and axes before drawing the new graph.
  • Prevent Access to Figures and Axes
    In some situations it is important to prevent particular figures or axes from becoming the target for graphics output.

Erstellen eines Objekts

Identifizieren, Kopieren und Löschen von Objekten

  • Find Objects
    The findobj function can scan the object hierarchy to obtain the handles of objects that have specific property values.
  • Delete Graphics Objects
    Remove graphics objects with the delete function.
  • Special Object Identifiers
    MATLAB provides functions that return important object handles so that you can obtain these handles whenever you require them.
  • Test for Valid Handle
    Use isgraphics to determine if a variable is a valid graphics object handle.
  • Handles in Logical Expressions
    Handle objects do not evaluate to logical true or false. You must use the function that tests for the state of interest and returns a logical value.