File: cycleColorsLineStyle.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 (65 lines) | stat: -rw-r--r-- 1,185 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
function  h=cycleColorsLineStyle(hin,n)
    	
h=hin;
ax=h.parent;
win=ax.parent;
currCol=ax.user_data.currentColor;
currLinest=ax.user_data.currentLineStyle;
cmap=ax.user_data.ColorOrder;
linest=ax.user_data.LineStyleOrder;

steplinecol=%f;
stepmarkercol=%f;
steplinest=%f;

if h.MarkerEdgeColor=="default" & h.Marker~="none"
  h.MarkerEdgeColor=cmap(currCol(2),:);
  stepmarkercol=%t;
end

if h.LineStyle~="none"
 if h.LineStyle=="default"
   h.LineStyle=linest(currLinest);
 end
 if h.Color=="default"
   h.Color=cmap(currCol(1),:);
   steplinecol=%t;
 else
   steplinest=%t;   
 end 
end

if steplinecol
  currCol(1)=currCol(1)+1;
  if currCol(1)>size(cmap,1)
    currCol(1)=1;
    steplinest=%t;
  end
end

if stepmarkercol
  currCol(2)=currCol(2)+1;
  if currCol(2)>size(cmap,1)
    currCol(2)=1;
  end
end

if steplinest
  currLinest=currLinest+1;
  if currLinest>size(linest(:),1)
    currLinest=1;
  end
end

ax.user_data.currentColor=currCol;
ax.user_data.currentLineStyle=currLinest;

simplemap=win.user_data.simpleColorTable;

for ppty=["Color", "MarkerEdgeColor","MarkerFaceColor"]
   if or(h(ppty)==simplemap(1))
       h(ppty)=simplemap(h(ppty));
   end
end

endfunction