File: setMarkAndLineProperties.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (76 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
function setMarkAndLineProperties(e,h);

markersTable=tlist(['markers';
'.'
'+'
'x'
'f'
'd'
'^'
'v'
'o'
'*'
's'
'>'
'<'],0,1,2,4,5,6,7,9,10,11,12,13)

lineStyleTable=tlist(['lineStyles';
'-'
'--'
'-.'
'.-'
':'],1,2,5,5,4);

ax=e;

while ax.type~='Axes'
   ax=ax.parent;
end

win=ax.parent;

e_mark=e;
e_line=e;
if or(h.typeOfPlot==['quiver' 'quiver3'])
  e_mark=e.children(2:3);
  e_line=e.children([1 3]);  
end

if h.Color~='default'
  if or(h.typeOfPlot==['quiver' 'quiver3'])
    e.children(1).segs_color=0*e.children(1).segs_color+findColorIndex(win,h.Color);
    e.children(3).foreground=findColorIndex(win,h.Color);
  else
    e.foreground=findColorIndex(win,h.Color);
  end    
end

if h.Marker~='none'
  set(e_mark,'mark_mode','on');
  set(e_mark,'mark_style',markersTable(h.Marker));
  set(e_mark,'mark_size_unit','point');
  set(e_mark,'mark_size',h.MarkerSize);
  _mec=h.MarkerEdgeColor;
  _mfc=h.MarkerFaceColor;
  if _mec=='default'
    _mec=ax.user_data.ColorOrder(:,1);
  end  
  if _mfc=='none'
     set(e_mark,'mark_background',0);
  else
    set(e_mark,'mark_background',findColorIndex(win,_mfc));
  end
  set(e_mark,'mark_foreground',findColorIndex(win,_mec));
else
  set(e_mark,'mark_mode','off');
end

if h.LineStyle=='none'
  set(e_line,'line_mode','off');
elseif h.LineStyle~='default'
  set(e_line,'line_style',lineStyleTable(h.LineStyle));
end 
set(e_line,'thickness',h.LineWidth);


endfunction