[scilab-Users] Copying windows in subplot

Samuel Gougeon Samuel.Gougeon at univ-lemans.fr
Sat Feb 20 20:51:18 CET 2010


Hello,

As a funny thing, i had the same need for cloning a graphic window,
in the same hour you posted your request! :-)
I was also quite surprised by this restriction about copy(), able
to copy every kind of graphic entity, except a whole figure.
unfortunately, a figure is not just the set of its children.
It includes other properties that then should be copied by hand.
Strange thing.
Some hints about the reason of this restriction would be nice from
the opteam. Or one could wish to extend copy() to whole figures.

BTW, exclusion of figures is not indicated in the help page.
It should be legal to state: f1=scf(); f2=copy(f1);


Before finding copy() in the graphic bag, i tested some simple
things such that:
cf=gcf()
figure()
cf2=gcf(); cf2=cf;
But it doesn't work. No error is yielded, but it does draw anything.
Then i tried to apply replot(), and draw(), etc, without success.
Such an intuitive syntax is apparently not supported, despite that
cloning is done and no error is displayed.
To the opteam: Could we expect that such syntax would be supported
with Scilab 6?
For cloning and adding an axes from a figure to another one:
f1=scf(1); f2=scf(2); f2 += f1.children(1); // isn't it intelligible ?

This kind of feature is quite standard in other high level languages.


Mathieu Dubois <mathieu.dubois at limsi.fr> a écrit :

> .../...
> It makes sense. The copy help page says that the 2nd handle "should"  
> be an axis handle but it doesn't say anything about the first one...

What do you mean? Would you like to be able to copy an axes as a rectangle?
More transtyping would be a great thing in Scilab. IMHO, it is quite
comprehensible that copy is not a function for casting or extraction.
So when an axes is copied, it yields an axes.


> Also the example is not very verbose...
>> Furthermore, you can do without using subplot:
> I was using subplot in the hope that it creates the sub-axis with  
> the right bounding boxes. If not then what does subplot do?

Your can edit subplot(). It computes normalized coordinates of the area
you are targetting in the figure, and finally calls newaxes() for
creating a new axes in this area.

Best regards
Samuel




More information about the users mailing list