[Scilab-users] moving axis ticks around orthogonally to their axes?

christophk christoph.knappe at gmail.com
Wed Nov 16 19:41:53 CET 2016


Hello again,

thanks all for your feedback - I managed to come a long way by use of your
input. 
Phillip, your example was nice, but it turned out that the axes were on a
different layer when attempting a zoom on the graph, nothing zoomed except
for the new axis ticks. They also had false labels from 0 to 1 displayed for
some reason. However your input got me going and so I tried until I found a
working solution.

I now use "drawaxis" to create my extra axis lines through [0,0], see the
altered example code below. One problem I encountered though was that the
properties of drawaxis did not include a line thickness property. Is there a
way to change the line thickness for "drawaxis"? There is nothing to be
found on this in the Scilab help, right?:
https://help.scilab.org/docs/6.0.0/en_US/drawaxis.html
I tried to change the parent line thickness (see last line in the example)
but my drawaxes were not affected by this.

x = linspace(-2*%pi,2*%pi,201);
y = cos(x);
plot2d(x,y,2)
a=get("current_axes");

set(a,"box","on");
set(a,"grid",[1 1]);
a.x_label.text = "x axis";
a.y_label.text = "y axis";
a.tight_limits = ["on","on","on"];

// drawing two extra axes bx and by through [0,0], each having just two
ticks
//bx and by are children of a
bx=drawaxis(x=min(x):(max(x)-min(x)):max(x),y=0,dir='u',tics='v');
by=drawaxis(x=0,y=min(y):(max(y)-min(y)):max(y),dir='r',tics='v');

// overwriting with two empty tick labels
bx.tics_labels = [" ", " "]
by.tics_labels = [" ", " "]

// make the extra axes clip so they do not extend outside the box when
zooming the graph
bx.clip_state = "on"
by.clip_state = "on"

// this does not affect the line thickness of bx and by - neither do they
have their own line thickness properties AFAIKS.
set(a,"thickness",1.5)



--
View this message in context: http://mailinglists.scilab.org/moving-axis-ticks-around-orthogonally-to-their-axes-tp4034989p4035003.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list