[Scilab-users] xpoly()

Antoine Monmayrant antoine.monmayrant at laas.fr
Thu Nov 20 12:59:52 CET 2014


On 11/19/2014 06:39 PM, Stefan Du Rietz wrote:
> Hello,
>
> I have made quite an effort to write commands in numerous sci-files 
> with the low level function xpoly() to avoid changes to the axes.
>
> But (surprise, surprise!), suddenly the low level function make those 
> changes, and there is no way of avoiding it!
>
> Because set(a,"auto_clear","off") only works for high level functions:
>
> auto_clear:
> "If this property value is equal to "on", a call to a high level 
> graphic will re-ininitialize the current axes and erase all its 
> children before preforming the drawing (log_flags will be reset). If 
> the value is "off" the drawings will be added to current axes 
> according to "auto_scale" property."
>
> So, the good low level function has become a new type of high level 
> function (that does not obey the usual rules) and is not replaced by 
> anything!
>
> Is that not a serious bug?
Hi,

It sounds like a regression.
You might be able to hack a workaround by making your own version of 
xpoly that correct the changes?
Something like:

//horrible pseudo code
your_xpoly(poly_arguments):
     //keep a copy of the axis properties before
     //calling xpoly
     a=gca();
     ac=copy(a);

     //actual call to xpoly
     x=sin(2*%pi*(0:4)/5);
     y=cos(2*%pi*(0:4)/5);
     xpoly(x,y,"lines");

     //undoing xpoly changes to the axis
     a.data_bounds=ac.data_bounds;
             ...
     a.whatever=ac.whatever;

     //clean up the mess
     delete(ac);
end


Antoine


>
> "re-ininitialize" should probably be "re-initialize" ...
>
> Stefan
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>




More information about the users mailing list