Skip to main content

3.6) Symbols


In the previous example, we simply plotted two lines of data without using any symbols for the data points. However, IDL allows you to plot data points using symbols instead of or as well as a line joining the points, using the "psym" keyword in the call to "plot" or "oplot".

plot, x, y, psym = 1
oplot, x, y, psym = 1

IDL has seven pre-defined plotting symbols and also allows you to define your own.

PSYM= Plotting Symbol
1 Plus Sign (+)
2 Asterisk (*)
3 Dor (.)
4 Diamond
5 Triangle
6 Square
7 X
8 User Defined

Adding a minus sign (-) in front of the PSYM number will join the points together with a line (E.g., psym = -1). Edit simple_plot.pro adding different symbols to the plot and oplot lines.

plot, x, x2, psym = -1
plot, x, x3, linestyle = 1, psym = -2

As you can see in the above example, you can combine keywords and so change both the line style and plotting symbol, in one command. You can also plot the data in a different colour using the "color" keyword and setting it equal to a colour index.

oplot, x, x3, color=254