clc
x = [1:1:10];
y1 = x;
y2 = 2*x;
y3 = 3*x;
plot2d(x,y1);
plot2d(x,y2);
plot2d(x,y3)
gca().children(1).children(1).thickness = 2
gca().children(2).children(1).thickness = 7
gca().children(3).children(1).thickness = 4
I am new from Matlab to Scilab
Could someone tell me, how to unterstand children?
What means
gca().children ?
gca().children.children ?
gca().children.children(1) ?
gca().children(1).children ?
How can we know which attribute belong to children ?
e.g gca().children(1).children(1).color = ... // not exist
I am very confused now.. Thanks in Advance
Let's schematize the nested graphical object by their children properties.
We have
Since gca is a function lets do
a = gca()becausegca().childrenwill raise an error because scilab doesn't understand that you're trying to access to the fields of its return value.gca()returns the handles to the axes of the current figure :a.a.childrenreturns the array of handles of all the children of theses axes. :c1, c2, c3a.children.childrenreturns the array of handles of all the children of the above objects:p1, p2, p3a.children.children(1)returns the first children ofc1, c2, c3:p1a.children(1).childrenreturns all the children of the first children of the current axes (c1). Since there only one :p1To access the value of your entities
Either go for a temp variable :
or use
getFYI
gce()command returns the handle of the last object created. With plot2d its a compound so we need to get its children.you could rewrite your program as