1
drawaxis Scilab Group Scilab Function drawaxis
3
drawaxis - draw an axis
7
// options: x,y,dir,sub_int,fontsize,format_n,seg,textcolor,ticscolor,tics
10
: used to specify the tics direction. string can be chosen among
11
'u','r','d','l' and 'l' is the default value. the values
12
'u','r','d','l' stands respectively for up, right, down, left
15
: A flag which describes how the tics are given. string can be chosen
16
among 'v','r', and 'i', and, 'v' is the default value
18
x,y : two vectors which give tics positions.
21
: A string matrix, which, when given, gives the string to be drawn along
22
the axis at tics positions.
25
: specifies the fontsize to use for displaying values along the axis.
26
Default value is -1 which stands for current fontsize
29
: format to use for displaying numbers along the axis
32
: A flag which controls the display of the base segment of the axis
36
: an integer which gives the number of sub-intervals to draw between
40
: specify the color to use for displaying values along the axis. Default
41
value is -1 which stands for current color.
44
: specify the color to use for tics drawing. Default value is -1 which
45
stands for current color.
48
drawaxis is used to draw an axis in vertical or horizontal direction.
49
the direction of the axis is given by dir dir = 'u' or 'd' gives a
50
horizontal axis with tics going up ('u') or down ('d'). dir = 'r' or
51
'l' give a vertical axis with tics going right ('r') or left ('l'). x
52
and y give the axis tics positions. If the axis is horizontal then y
53
must be a scalar or can be omitted and x is a Scilab vector. The meaning
54
of x is controlled by tics.
56
If tics='v' then x gives the tics positions along the x-axis.
58
If tics='r' then x must be of size 3. x=[xmin,xmax,n] and n gives the
61
If tics='i' then x must be of size 4, x=[k1,k2,a,n]. then xmin=k1*10^a,
62
xmax=k2*10^a and n gives the number of intervals
64
If y is omitted then the axis will be positioned at the top of the frame
65
if dir='u' or at the bottom if dir='d' By default, numbers are drawn
66
along the axis. They are drawn using a default format which can be
67
changed with format_n. It is also possible to display given strings and
68
not numbers, this is done if val is provided. The size of val must match
72
plot2d(1:10,1:10,1,"020")
74
drawaxis(x=2:7,y=4,dir='u',tics='v')
75
// horizontal axis on top of the frame
76
drawaxis(x=2:7,dir='u',tics='v')
77
// horizontal axis at the bottom of the frame
78
drawaxis(x=2:7,dir='d',tics='v')
80
// horizontal axis given by a range
81
drawaxis(x=[2,7,3],y=4,dir='d',tics='r')
84
drawaxis(x=4,y=2:7,dir='r',tics='v')
85
drawaxis(x=2,y=[2,7,3],dir='l',tics='r')
86
drawaxis(y=2:7,dir='r',tics='v')
87
drawaxis(y=2:7,dir='l',tics='v')
89
// horizontal axis with strings displayed at tics positions
90
drawaxis(x=2:7,y=8,dir='u',tics='v',val='A'+string(1:6));
91
// vertical axis with strings displayed at tics positions
92
drawaxis(x=8,y=2:7,dir='r',tics='v',val='B'+string(1:6));
94
// horizontal axis given with a 'i' range.
95
drawaxis(x=[2,5,0,3],y=9,dir='u',tics='i');
96
drawaxis(x=9,y=[2,5,0,3],dir='r',tics='i',sub_int=5);
98
// horizontal axis again
99
drawaxis(x=2:7,y=4,dir='u',tics='v',fontsize=10,textcolor=9,ticscolor=7,seg=0,sub_int=20)