source: trunk/examples/objects/api/python/plot @ 1610

Last change on this file since 1610 was 1610, checked in by dkearney, 11 years ago

updates and adding example code to python and tcl apis

File size: 7.7 KB
Line 
1Rappture.Plot
2
3constructors/destructors
4    Rappture.Plot([lib])
5    Rappture.Plot(o)
6
7methods
8    p.name([val])
9    p.path([val])
10    p.label([val])
11    p.desc([val])
12    p.hints([val])
13    p.color([val])
14    p.property(key[, val])
15    p.propremove(key)
16    p.add(x, y, fmt, name)
17    p.add(c, name)
18    p.count()
19    p.curve(name)
20    p.getNthCurve(n)
21    p.vvalue([...])
22    p.random()
23    p.diff(o)
24    p.configure(as, c)
25    p.dump(as, c)
26    p.outcome()
27    p.is()
28
29---------------------------------------
30Rappture.Plot([lib])
31    Purpose: construct a plot object
32    Input Arguments: at most 1
33        1. lib - Rappture library to associate this plot with
34    Return Value: a newly created, empty plot object
35    Notes: None
36    Code Example:
37
38Rappture.Plot(o)
39    Purpose: construct a plot object based on plot object o
40    Input Arguments: 1
41        1. o - plot object to copy
42    Return Value: a newly created plot object
43    Notes: None
44    Code Example:
45
46
47p.name([val])
48    Purpose: get/set the id name of the object
49    Input Arguments: at most 1
50        1. val - new id name
51    Return Value: the name of the object
52    Notes: if no name is set, None will be returned
53           the id name is used to identify this object from
54           all other objects and should be unique
55           val, if provided, is used to set the object name
56    Code Example:
57
58p.path([val])
59    Purpose: get/set the path of the object
60    Input Arguments: at most 1
61        1. val - new path
62    Return Value: path of the object
63    Notes: if no path is set, None will be returned
64           the path tells where this object sits in the
65           hierarchy of objects.
66           val, if provided, is used to set the object path
67    Code Example:
68
69p.label([val])
70    Purpose: get/set the label of the object
71    Input Arguments: at most 1
72        1. val - new label
73    Return Value: label of the object
74    Notes: if no label is set, None will be returned
75           the label is used by the graphical user interface.
76           val, if provided, is used to set the object label
77    Code Example:
78
79p.desc([val])
80    Purpose: get/set the description of the object
81    Input Arguments: at most 1
82        1. val - new description
83    Return Value: description of the object
84    Notes: if no description is set, None will be returned
85           the description is used by the graphical user
86           interface to describe what type of data is being
87           requested and how the input is used.
88           val, if provided, is used to set the object description
89    Code Example:
90
91p.hints([val])
92    Purpose: get/set the hints of the object
93    Input Arguments: at most 1
94        1. val - new hints
95    Return Value: hints of the object
96    Notes: if no hints are set, None will be returned
97           the hints are used by the graphical user interface
98           val, if provided, is used to set the object hints
99    Code Example:
100
101p.color([val])
102    Purpose: get/set the color of the object
103    Input Arguments: at most 1
104        1. val - new color
105    Return Value: color of the object
106    Notes: if no color is set, None will be returned
107           the color is used by the graphical user interface
108           val, if provided, is used to set the object color
109    Code Example:
110
111p.property(key[, val])
112    Purpose: get/set a generic property in the property database
113    Input Arguments: at most 2
114        1. key - property name
115        2. val - property value
116    Return Value: value of the property
117    Notes: A copy val is stored in the property database
118    Code Example:
119
120p.propremove(key)
121    Purpose: remove a property from the property database
122    Input Arguments: 1
123        1. key - property name
124    Return Value: value of the property
125    Notes: None
126    Code Example:
127
128p.add(x, y, fmt, name)
129    Purpose: add data for an xy curve to the plot
130    Input Arguments: 4
131        1. x - list/array representing the x axis
132        2. y - list/array representing the y axis
133        3. fmt - string format of the line
134        4. name - string id of the newly created curve
135    Return Value: Outcome object
136    Notes: format can be something like "g:o" to represent
137            green line, dotted line style, circle marker.
138            this follows matlab's formatting rules.
139    Code Example:
140
141p.add(c, name)
142    Purpose: add a Curve object to this Plot object
143    Input Arguments: 2
144        1. c - Curve object to add
145        2. name - id of the Curve object
146    Return Value: Outcome object
147    Notes: Curve object should not be deleted by user?
148    Code Example:
149
150p.count()
151    Purpose: retrieve the number of curves in this Plot object
152    Input Arguments: 0
153    Return Value: number of curves stored in the object
154    Notes: None
155    Code Example:
156
157p.curve(name)
158    Purpose: retrieve the curve with the id matching "name"
159    Input Arguments: 1
160        1. name - id to Curve to be retrieved
161    Return Value: Curve object matching "name" or None
162    Notes: None
163    Code Example:
164
165p.getNthCurve(n)
166    Purpose: return the n'th curve stored in the object
167    Input Arguments: 1
168        1. n - number of the curve to retrieve
169    Return Value: the n'th Curve object stored in
170                  the Plot object or None
171    Notes: None
172    Code Example:
173
174p.vvalue([...])
175    Purpose: return the value of the object after applying a
176             varying number of hints about how the value
177             should be configured
178    Input Arguments: variable numbber
179        1. variable number of hints
180    Return Value: value of the object
181    Notes: vvalue will parse out the recognisable hints from
182           va_list arg. Values stored in the object are
183           not changed. Hints should be of the form
184           hintKey=hintVal
185    Code Example:
186
187p.random();
188    Purpose: populate the object with a random value
189    Input Arguments: 0
190    Return Value: None
191    Notes: the current value of this object will be populated
192           with a random value that fits within the min and
193           max if they were specified.
194    Code Example:
195
196p.diff(o);
197    Purpose: return a list showing the differences between
198             this object and Rappture Object o
199    Input Arguments: 1
200        1. o - Rappture Object to diff against
201    Return Value: list of differences between objects
202    Notes: None
203    Code Example:
204
205p.configure(as, c)
206    Purpose: configure the object based on the data in "c".
207             use "as" to determine the type of data in "c".
208    Input Arguments: 2
209        1. as - type of data stored in "c".
210                valid values include:
211                    RPCONFIG_XML
212                    RPCONFIG_TREE
213        2. c - data to configure the object from.
214               if as is...     then c should be...
215               RPCONFIG_XML    const char *xmltext
216               RPCONFIG_TREE   RP_ParserXML *object
217    Return Value: None
218    Notes: object is configured based on values in "c"
219    Code Example:
220
221p.dump(as, c)
222    Purpose: dump the object values based to the object "c".
223             use "as" to determine how to dump the data.
224    Input Arguments: 2
225        1. as - type of data stored in "c".
226                valid values include:
227                    RPCONFIG_XML
228                    RPCONFIG_TREE
229        2. c - data to configure the object from.
230               if as is...     then c should be...
231               RPCONFIG_XML    ClientDataXml *object
232               RPCONFIG_TREE   RP_ParserXML *object
233    Return Value: None
234    Notes: None
235    Code Example:
236
237p.outcome()
238    Purpose: return the status of this object as an Outcome.
239    Input Arguments: 0
240    Return Value: status of the object as an Outcome
241    Notes: None
242    Code Example:
243
244p.is()
245    Purpose: return an integer tag describing the object.
246    Input Arguments: 0
247    Return Value: integer tag unique to all number objects
248    Notes: None
249    Code Example:
Note: See TracBrowser for help on using the repository browser.