[Scilab-users] Adjusting data bounds of semi-log plot with dual axes

Samuel Gougeon sgougeon at free.fr
Tue Dec 26 20:11:06 CET 2017


Hello Rafael,

using

/a1.data_bounds = [xmin,0;xmax,200];// how to use data_bounds with log 
plots?/

after
plot2d(x,y1,logflag="ln");

works for me. For an unknown reason, setting .data_bounds /before/ 
plotting cancels the log mode.
This is clearly a bug.

Cheers
Samuel

Le 26/12/2017 à 19:46, Rafael Guerra a écrit :
>
> Dear Scilab’ers,
>
> Season greetings.
>
> Does anyone know if it is possible to adjust the data bounds for each 
> y-axis in a semi-log plot with dual axes?
>
> The example here below has the non-working data bounding lines 
> commented out (these work for linear plots though).
>
> This problem occurs in both Scilab 5.5.2 & 6.0.0 (Win7 64).
>
> /// START OF CODE/
>
> clearall;
>
> _clf_;
>
> xmin= 1; xmax = 1e3;
>
> x= 10^_linspace_(log10(xmin),log10(xmax),100);
>
> y1= 2 + 100*log10(x).^0.5;
>
> y2= 30 + 20*log10(x);
>
> a1= newaxes();
>
> ///a1.data_bounds = [xmin,0;xmax,200];// how to use data_bounds with 
> log plots?/
>
> a1.font_foreground= color('red');
>
> plot2d(x,y1,logflag="ln");
>
> p=_gce_();
>
> p.children.foreground=5;/// red/
>
> a2= newaxes();
>
> ///a2.data_bounds = [xmin,-100;xmax,100]; // how to use data_bounds 
> with log plots?/
>
> a2.filled= "off";
>
> a2.axes_visible(1)= "off"; /// 2nd x-axis hidden/
>
> a2.y_location= "right";
>
> a2.font_foreground= color('blue');
>
> plot2d(x,y2,logflag="ln");
>
> p=_gce_();
>
> p.children.foreground=2;
>
> xgrid()
>
> /// END OF CODE/
>
> Thanks and regards,
>
> Rafael
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20171226/4f6f287f/attachment.htm>


More information about the users mailing list