Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Line Attributes (MathScript RT Module)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Use the MathScript RT Module line attributes to change the appearance of line objects in LabVIEW MathScript plots. MathScript displays a line by connecting data points in a plot. To create and return a new line object, use the following MathScript RT Module functions: line, loglog, plot, plot3d, semilog_x, or semilog_y.

Details

Examples

Characteristics

The following table lists the MathScript RT Module line attributes and their characteristics.

Attribute NameDescriptionPossible ValuesPermissions
'Color'Specifies the color of the plot line. The default is [0, 0, 1], or blue.Color attributeRead/Write
'LineStyle' Specifies the style of the plot line.
  • '-' (default)—Uses solid lines.
  • '--'—Uses dashed lines.
  • ':'—Uses dotted lines.
  • '-.'—Uses dashed and dotted lines.
Read/Write
'LineWidth'Specifies the width of the plot line. Values range from 0 to 5. The default is 1.IntegerRead/Write
'Marker'Specifies the style of the points.
  • 'none' (default)—Does not display points.
  • '.'—Marks points with dots.
  • 'o'—Marks points with circles.
  • 'x'—Marks points with crosses.
  • '+'—Marks points with plus signs.
  • '*'—Marks points with asterisks.
  • 's'—Marks points with squares.
  • 'd'—Marks points with diamonds.
Read/Write
'MarkerSize'Specifies the size of the points. Values range from 0 to 5. The default is 1.IntegerRead/Write
'Type'Returns the type of the object. Possible types include line, plot area, plot window, and text objects.StringRead Only
'Visible'Specifies whether to display the plot line.
  • 'off'
  • 'on' (default)
Read/Write
'XData'Specifies the x-coordinates of the data. The default is an empty array.ArrayRead/Write
'YData'Specifies the y-coordinates of the data. The default is an empty array.ArrayRead/Write
'ZData'Specifies the z-coordinates of the data. The default is an empty array.ArrayRead/Write

The following table lists the MathScript RT Module line attributes that are ignored when specified.

Attribute NameDescriptionPossible ValuesPermissions
'EraseMode'Specifies the way of erasing the line.
  • 'normal' (default)
  • 'none'
  • 'xor'
  • 'background'
Read/Write

Details

Use an RGB triple or a string to specify a valid color attribute. An RGB triple is an array of three values that specify the intensities of the red, green, and blue components of the color. Each element in the array must fall in the range [0, 1]. If you specify a string, the color attribute accepts the following values.

'b'Blue
'c'Cyan
'g'Green
'k'Black
'm'Magenta
'r'Red
'w'White
'y'Yellow

Examples

X = 1:10;
loglog(2.^X, 3.^X, 'Color', 'm', 'Marker', 's', 'MarkerSize', 4)

X = sin(0:0.1:100);
obj = plot(X, 'Color', [0.8, 0, 0.8])
set (obj, 'LineStyle', ':')

t = 0:0.1:2*pi;
obj = plot(t(1), sin(t(1)));
hold on
obj1 = plot(t(1), sin(t(1)), 'ro');
axis([0, 2*pi, -1, 1])
for i = 2:length(t);
     xx = get(obj, 'XData');
     yy = get(obj, 'YData');
     set(obj, 'XData', [xx, t(i)], 'YData', [yy, sin(t(i))]);
     set(obj1, 'XData', t(i), 'YData', sin(t(i)));
end


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit