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

classic Classic list List threaded Threaded
3 messages Options
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

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

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


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Adjusting data bounds of semi-log plot with dual axes

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

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



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Adjusting data bounds of semi-log plot with dual axes

Hello Samuel,

 

Thanks a lot for your help.

This was a tricky bug and I am glad that there is a solution.

 

Regards,

Rafael

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users