File: TitleLabel.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 (116 lines) | stat: -rw-r--r-- 3,007 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2004-2006 - INRIA - Farid Belahcene
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at    
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt

function TitleLabel(varargin)
// TITLELABEL function
// is used by the functions title, xlabel, ylabel, zlabel

[lhs,rhs]=argn(0);

//CurColor = 0; // current color used if no color specified via LineSpec
// nor PropertyName

ListArg = varargin;
titlelabel = ListArg(1);
ListArg(1) = null(); // remove this parameter from the list

//detect and set the current axes now:
if type(ListArg(1)) == 9
  hdle = ListArg(1);
  if (hdle.type == "Axes")
    sca(ListArg(1));
    ListArg(1) = null(); // remove this parameter from the list
  else
    disp("Handle should be an Axes handle")
    return;
  end
elseif  typeof(ListArg(1)) == 'pltlibH'
  hdle=ListArg(1).handle;
  if (hdle.type == "Axes")
    sca(ListArg(1).handle);
    ListArg(1) = null(); // remove this parameter from the list
  else
    disp("Handle should be an Axes handle")
    return;
  end
end

monaxe = get('current_axes');

nv = size(ListArg);
// detect and set the string now:
if  type(ListArg(1))== 10 & modulo(nv,2) == 1 then
  st = ListArg(1);
  execstr("monaxe."+ titlelabel +".text"+"=st")
  ListArg(1) = null();
  nv=nv-1 
else
 error("wrong input argument")
end

T=[];

//given_data = 2;

for k=1:nv
  T(k,1) = type(ListArg(k))
end

given_data = 0;
P1 = 0;

for i=1:nv
  if T(i) == 1
    given_data = given_data +1;
  else
    P1 = i;  // Position of the first PropertyName field
    break;
  end
end


// delay the drawing commands
// smart drawlater
current_figure=get('current_figure');
cur_draw_mode = current_figure.immediate_drawing;
current_figure.immediate_drawing = 'off';


// set some defaults here
// current_figure=get('current_figure')(); // already init. before
// current_figure.color_map=jetcolormap(64); // bad choice -> init must be done somewhere else.

colormap_size = size(current_figure.color_map,1);

///////////////////////////////////
//Global Property treatment      //
//PropertyName and PropertyValue //
///////////////////////////////////

// P1 is the position of the first PropertyName field.
Property = P1;

current_surface = gce(); // get the newly created fac3d

current_titlelabel=get(monaxe,titlelabel)
//monaxe.axes_visible = ["on","on","on"]
//current_surface.mark_size_unit='point';

while ((Property <> 0) & (Property <= nv-1))
  setTitleLabelProperty(ListArg(Property),ListArg(Property+1),current_titlelabel,current_figure,cur_draw_mode)
  //setLabelProperty(ListArg(Property),ListArg(Property+1),monaxe.title,current_figure,cur_draw_mode)
  Property = Property+2;
end

//postponed drawings are done now !
// smart drawnow
ResetFigureDDM(current_figure, cur_draw_mode);


endfunction