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

christophk christoph.knappe at gmail.com
Tue Nov 15 23:44:21 CET 2016


Hello folks,

sorry for spamming this forum. I came across another interesting problem:
Consider the following code example:

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]);
set(a,"x_location","origin")
set(a,"y_location","origin")
a.x_label.text = "x axis";
a.x_label.position = [-0.5770492 -1.2550725];
a.y_label.text = "y axis";
a.y_label.position = [-9.084153 -0.0956522];

In this example I have chosen the x- and y- axis to go through the origin
[0,0]. However, I didn't like the axis ticks and axis labels to be inside
the box as they come into the way of my data points. I found out how to move
the axis labels back to the outside of the graph. The coordinates here are a
bit clunky as I just copy-pasted the location coordinates manually from an
earlier run when x_location and y_location were set to "bottom" and "left" 

Here is the problem: I couldn't find a property of "current_axes" that
allows me to move the axis ticks out of the graph again. Is it possible at
all to move the axis ticks out of the graph while leaving the axes where
they are? I want them back at their position where they were when the axes
are set to be at the bottom and left.

If moving the axis ticks alone is not possible, I suppose a proper
work-around would be to leave the axes locations at "bottom" and "left" and
instead draw two perpendicular lines through the origin of the graph. Those
would need to be dynamic though to find the origin position in the graph by
themselves. Does anyone know how to do this?



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



More information about the users mailing list