Difference between revisions of "IXTpolygons"
m |
m |
||
Line 1: | Line 1: | ||
− | |||
IXTpolygons objects exists only in matlab and are used to store a series of shapes (with related signal values). This is useful for irregular grids (such as those used in mslice). The elements in an IXTpolygons object are: | IXTpolygons objects exists only in matlab and are used to store a series of shapes (with related signal values). This is useful for irregular grids (such as those used in mslice). The elements in an IXTpolygons object are: | ||
Line 29: | Line 28: | ||
|- | |- | ||
|'''Faces''' | |'''Faces''' | ||
− | | n x p matrix | + | | n x p integer matrix |
| Contains a list of shapes, each row is a list of numbers corresponding to the rows in the vertices field. The points that these indexes correspond to will be connected to make the required shape. There are as many rows as shapes in the object. | | Contains a list of shapes, each row is a list of numbers corresponding to the rows in the vertices field. The points that these indexes correspond to will be connected to make the required shape. There are as many rows as shapes in the object. | ||
|- | |- | ||
Line 49: | Line 48: | ||
|} | |} | ||
+ | If several different shapes are needed, then the faces array should have the number of columns required to describe the shape with the most vertices. For shapes with fewer vertices, simply put 0's in the superfluous columns (e.g. to describe a pentagon and a triangle, one might have faces [1,2,3,4,5; 5,6,7,0,0] | ||
+ | |||
+ | Each row in the vertex field is a point in the x,y plane. Each number in the faces field will refer to these rows. So if the faces matrix is [5,6,7; 6,7,10] then two triangles will be made (which share two vertices). The first triangle will have corners at coordinates (vertex(5,1) vertex(5,2)), (vertex(6,1) vertex(6,2)),(vertex(7,1) vertex(7,2)) and the second will have coordinates at (vertex(6,1) vertex(6,2)), (vertex(7,1) vertex(7,2)), (vertex(10,1) vertex(10,2)). This means that each vertex need only be described once, even if it is used by several shapes (although describing it twice will be of no concequence, just superfluous). | ||
+ | |||
+ | Each row in the signal/error matrix is a value refering to the shape in the corresponding row of the faces matrix. So signal(10) relates to the shape described by faces(10,:). | ||
− | + | For example, the following command | |
<pre> | <pre> | ||
− | test = IXTpolygons('title',[1; 2; 3], [0; 0; 0], axisdummy, [1,2; 1.5,1; 2,2; 2.5,1; 3,2],[1,2,3;2,3,4;3,4,5],axisdummy, true, axisdummy, true) | + | >> test = IXTpolygons('title',[1; 2; 3], [0; 0; 0], axisdummy,... |
− | da(test) | + | [1,2; 1.5,1; 2,2; 2.5,1; 3,2],[1,2,3;2,3,4;3,4,5],axisdummy, ... |
+ | true, axisdummy, true) | ||
+ | >> da(test) | ||
</pre> | </pre> | ||
Revision as of 10:58, 22 October 2009
IXTpolygons objects exists only in matlab and are used to store a series of shapes (with related signal values). This is useful for irregular grids (such as those used in mslice). The elements in an IXTpolygons object are:
Field | Type | Description |
---|---|---|
title | char | Title of the dataset used in plotting |
signal | n x 1 matrix | Signal data, this will be a single column, the length of the number of shapes that are in the object. |
error | n x 1 matrix | Standard error, this will be a single column, the length of the number rof shapes that are in the object. |
s_axis | IXTaxis | object containing the signal axis label and units code information |
Vertices | m x 2 matrix | A list of (x,y) points that will be used to construct the shapes |
Faces | n x p integer matrix | Contains a list of shapes, each row is a list of numbers corresponding to the rows in the vertices field. The points that these indexes correspond to will be connected to make the required shape. There are as many rows as shapes in the object. |
x_axis | IXTaxis | object containing the x axis label and units code information |
x_distribution | logical | True if signal is a distribution on x (e.g. counts/microsecond) False if signal is not a distribution on x (e.g. counts) |
y_axis | IXTaxis | object containing the y axis label and units code information |
y_distribution | logical | True if signal is a distribution on y (e.g. counts/spectrum) False if signal is not a distribution on y (e.g. counts) |
If several different shapes are needed, then the faces array should have the number of columns required to describe the shape with the most vertices. For shapes with fewer vertices, simply put 0's in the superfluous columns (e.g. to describe a pentagon and a triangle, one might have faces [1,2,3,4,5; 5,6,7,0,0]
Each row in the vertex field is a point in the x,y plane. Each number in the faces field will refer to these rows. So if the faces matrix is [5,6,7; 6,7,10] then two triangles will be made (which share two vertices). The first triangle will have corners at coordinates (vertex(5,1) vertex(5,2)), (vertex(6,1) vertex(6,2)),(vertex(7,1) vertex(7,2)) and the second will have coordinates at (vertex(6,1) vertex(6,2)), (vertex(7,1) vertex(7,2)), (vertex(10,1) vertex(10,2)). This means that each vertex need only be described once, even if it is used by several shapes (although describing it twice will be of no concequence, just superfluous).
Each row in the signal/error matrix is a value refering to the shape in the corresponding row of the faces matrix. So signal(10) relates to the shape described by faces(10,:).
For example, the following command
>> test = IXTpolygons('title',[1; 2; 3], [0; 0; 0], axisdummy,... [1,2; 1.5,1; 2,2; 2.5,1; 3,2],[1,2,3;2,3,4;3,4,5],axisdummy, ... true, axisdummy, true) >> da(test)
produces the folling plot
Currently only the da plot command works, the same commands (such as lx) can be used after the object has been plotted.