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

Rafael Guerra jrafaelbguerra at hotmail.com
Tue Dec 26 19:46:51 CET 2017


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
clear all;
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/46c4ee0d/attachment.htm>


More information about the users mailing list