Octave – Grafici – strutture di dati – II – 79

nm2

Continuo da qui, oggi qui.

Proprietà degli oggetti grafici
In this Section the graphics object properties are discussed in detail, starting with the root figure properties and continuing through the objects hierarchy. The documentation about a specific graphics object can be displayed using doc function, e.g., doc ("axes properties") will show Axes Properties.
Uh! bello, p.es.: doc ("plot")

o410

Le pagine seguenti non sono quindi da riportare, anche perché molto specifiche (da programmatore).

Avanti, qui.

Cercare proprietà

Function File: h = findobj ()
Function File: h = findobj (prop_name, prop_value, ...)
Function File: h = findobj (prop_name, prop_value, "-logical_op", prop_name, prop_value)
Function File: h = findobj ("-property", prop_name)
Function File: h = findobj ("-regexp", prop_name, pattern)
Function File: h = findobj (hlist, ...)
Function File: h = findobj (hlist, "flat", ...)
Function File: h = findobj (hlist, "-depth", d, ...)

Find graphics object with specified property values.
The simplest form is findobj (prop_name, prop_value) which returns the handles of all objects which have a property named prop_name that has the value prop_value. If multiple property/value pairs are specified then only objects meeting all of the conditions are returned.
The search can be limited to a particular set of objects and their descendants, by passing a handle or set of handles hlist as the first argument.
The depth of the object hierarchy to search can be limited with the "-depth" argument. An example of searching only three generations of children is: findobj (hlist, "-depth", 3, prop_name, prop_value).
Specifying a depth d of 0, limits the search to the set of objects passed in hlist. A depth d of 0 is equivalent to the "flat" argument.
A specified logical operator may be applied to the pairs of prop_name and prop_value. The supported logical operators are: "-and", "-or", "-xor", "-not".
Objects may also be matched by comparing a regular expression to the property values, where property values that match regexp (prop_value, pattern) are returned.
Finally, objects may be matched by property name only by using the "-property" option.
Implementation Note: The search only includes objects with visible handles (HandleVisibility = "on"). See findall, to search for all objects including hidden ones.

o411

Function File: h = findall ()
Function File: h = findall (prop_name, prop_value, ...)
Function File: h = findall (prop_name, prop_value, "-logical_op", prop_name, prop_value)
Function File: h = findall ("-property", prop_name)
Function File: h = findall ("-regexp", prop_name, pattern)
Function File: h = findall (hlist, ...)
Function File: h = findall (hlist, "flat", ...)
Function File: h = findall (hlist, "-depth", d, ...)

Find graphics object, including hidden ones, with specified property values.
The return value h is a list of handles to the found graphic objects.
findall performs the same search as findobj, but it includes hidden objects (HandleVisibility = "off"). For full documentation, see findobj.

o412

Ancora avanti, qui

Gestire proprietà di default
Object properties have two classes of default values, factory defaults (the initial values) and user-defined defaults, which may override the factory defaults.
Although default values may be set for any object, they are set in parent objects and apply to child objects, of the specified object type. For example, setting the default color property of line objects to “green”, for the root object, will result in all line objects inheriting the color “green” as the default value: set (0, "defaultlinecolor", "green"); sets the default line color for all objects. The rule for constructing the property name to set a default value is default + object-type + property-name. This rule can lead to some strange looking names, for example "defaultlinelinewidth" specifies the default linewidth property for line objects.

The example above used the root figure object, 0, so the default property value will apply to all line objects. However, default values are hierarchical, so defaults set in a figure objects override those set in the root figure object. Likewise, defaults set in axes objects override those set in figure or root figure objects. For example,

subplot (2, 1, 1);
set (0, "defaultlinecolor", "red");
set (1, "defaultlinecolor", "green");
set (gca (), "defaultlinecolor", "blue");
line (1:10, rand (1, 10));
subplot (2, 1, 2);
line (1:10, rand (1, 10));
figure (2)
line (1:10, rand (1, 10));

produces two figures. The line in first subplot window of the first figure is blue because it inherits its color from its parent axes object. The line in the second subplot window of the first figure is green because it inherits its color from its parent figure object. The line in the second figure window is red because it inherits its color from the global root figure parent object.

o413

To remove a user-defined default setting, set the default property to the value "remove". For example, set (gca (), "defaultlinecolor", "remove"); removes the user-defined default line color setting from the current axes object. To quickly remove all user-defined defaults use the reset function.

Built-in Function: reset (h)
Reset the properties of the graphic object h to their default values.
For figures, the properties "position", "units", "windowstyle", and "paperunits" are not affected. For axes, the properties "position" and "units" are not affected.
The input h may also be a vector of graphic handles in which case each individual object will be reset.
Getting the "default" property of an object returns a list of user-defined defaults set for the object. For example, get (gca (), "default"); returns a list of user-defined default values for the current axes object.
Factory default values are stored in the root figure object. The command get (0, "factory"); returns a list of factory defaults.

:mrgreen:

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

%d blogger hanno fatto clic su Mi Piace per questo: