Skip to main content

3.5) Line Styles


You can set the style of the line used by using the "linestyle" keyword in the call to plot or oplot.

plot, x, y, linestyle = 1
oplot, x, y, linestyle = 2

IDL has 6 line styles which you can use (0-5), they are:

Index Line Style
0 Solid
1 Dotted
2 Dashed
3 Dash Dot
4 Dash Dot Dot
5 Long Dashes

So in our previous example, if we want to plot the second line as a dotted line, we simply replace the oplot command with the following:

oplot, x, x3, linestyle=1