plotSetLineSymbol#
Purpose#
Sets the symbols displayed on the plotted points of a graph.
Format#
- plotSetLineSymbol(&myPlot, newSymbol[, symbolWidth])#
- Parameters:
&myPlot (struct pointer) – A
plotControlstructure pointer.newSymbol (matrix or string array) –
new line symbol settings. Options include:
-1
noneNo symbol.
0
circleCircle.
1
squareSquare.
2
diamondDiamond.
3
triangle_upUpward pointing triangle.
4
triangle_downDownward pointing triangle.
5
triangleTriangle.
6
triangle_leftLeftward pointing triangle.
7
triangle_rightRightward pointing triangle.
8
plusPlus sign.
9
x10
hlineHorizontal line.
11
vlineVertical line.
12
starStar.
13
star2Six-pointed star.
14
hexagonHexagon.
symbolWidth (scalar) – Optional argument, width to draw line symbols.
Examples#
Example 1: Basic usage with string names#
// Declare plotControl structure
struct plotControl myPlot;
// Initialize plotControl structure
myPlot = plotGetDefaults("xy");
// Set line 1 to have no symbol
// Set line 2 to display a circle at each plotted point.
plotSetLineSymbol(&myPlot, "none" $| "circle", 5);
// Create data
x = seqa(0.1, 0.1, 50);
y = sin(x)~cos(x);
// Plot the data with the new line symbols
plotXY(myPlot, x, y);
Example 2: Using numeric values#
// Declare plotControl structure
struct plotControl myPlot;
// Initialize plotControl structure
myPlot = plotGetDefaults("xy");
// Set markers: circle for line 1, diamond for line 2, triangle for line 3
plotSetLineSymbol(&myPlot, 0 | 2 | 3, 8);
// Create data
x = seqa(0.1, 0.1, 50);
y = sin(x)~cos(x)~sin(x+1);
// Plot the data with the new line symbols
plotXY(myPlot, x, y);
Remarks#
By default, markers are hollow (unfilled). Use plotSetFill() to fill the markers with a solid color or pattern.
Note
This function sets an attribute in a plotControl structure. It does not
affect an existing graph, or a new graph drawn using the default
settings that are accessible from the
menu.
See also
Functions plotGetDefaults(), plotSetFill(), plotSetLineColor()