plotSetLineStyle#
Purpose#
Sets the line styles for a graph.
Format#
- plotSetLineStyle(&myPlot, newStyle)#
- Parameters:
&myPlot (struct pointer) – A
plotControlstructure pointer.newStyle (matrix or string array) –
new line styles. Options include:
1
solidSolid line.
2
dashDash line.
3
dotDot line.
4
dashdotDash-Dot line.
5
dashdotdotDash-Dot-Dot line.
Examples#
Example 1: Basic usage with string names#
// Declare plotControl structure
struct plotControl myPlot;
// Initialize plotControl structure
myPlot = plotGetDefaults("xy");
// Set line 1 as a solid line, line 2 as dashed
plotSetLineStyle(&myPlot, "solid" $| "dash");
// Create data
x = seqa(0.1, 0.1, 50);
y = sin(x)~cos(x);
// Plot the data with the new line styles
plotXY(myPlot, x, y);
Example 2: Using numeric values#
// Declare plotControl structure
struct plotControl myPlot;
// Initialize plotControl structure
myPlot = plotGetDefaults("xy");
// Set line 1 as solid, line 2 as dash,
// line 3 as dot, line 4 as dash-dot, line 5 as dash-dot-dot
plotSetLineStyle(&myPlot, seqa(1, 1, 5));
// Create data
x = seqa(0.1, 0.1, 50);
y = sin(x)~cos(x)~sin(x+1)~cos(x+1)~sin(x+2);
// Plot the data with the new line styles
plotXY(myPlot, x, y);
Remarks#
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(), plotSetTitle(), plotSetLineSymbol()