Colors, Lines, and Markers


Next: Log Scale Up: Aesthetics Previous: Vertical Plots

Colors, Lines, and Markers

The default mode of PLT is to plot group 1 with color index 1, group 2 with color index 2, etc. The COlor ? command can be used to generate a list of the default colors used to plot each color index. The command COlor 3 ON 2 will cause color index 3 to be used with group 2 is plotted. With the PGPLOT default colors, this means that group 2 will now be plotted in green. It is important to realize that the COlor command changes the color index and only indirectly, the color.

Due to historical accident the COlor command can be used to prevent plot groups from being plotted. This is because color 0 corresponds to no-color or invisible. Thus COlor 0 ON 2 will suppress the plotting of group 2. A cleaner way to do this is with the command COlor OFf 2. A COlor OFf command followed by a COlor ON command will restore the original color index. The R Y (with no arguments) command only uses plot groups that are visible to determine the default scale. For example, assume you are working with 6 plot groups and the values of groups 1 to 5 all lie in the range of 0.0 to 1.0, whereas the values in group 6 all lie near 100,000. For this example, the commands

PLT> COlor OFF 6
PLT> R Y
would redraw the graph, and the default y range will lie between 0.0 and 1.0.

In the above examples, PLT drew a line between the points being plotted. If you wish to display the plot with markers, then you should turn on the plotting of markers with

PLT> MArk ON
PLT> P
For this example, the line connecting the various points disappears and only markers will be drawn. PLT draws a line when (a) all attributes (LIne, MArker, and Errors) are OFF or (b) the line attribute is ON. Thus if you want both the connecting line and markers to appear, then you need to turn on the LIne attribute with
PLT> LIne ON
PLT> P

The command MArker Size 2 can be used to make the markers twice as big. The default marker style for all plot groups is type 2 as this marker plots very quickly. To change the style of the marker, try MArker 9 ON 2 to use marker style 9 when plotting group 2. The command MArker ? will display a table of marker styles.



next up previous contents
Next: Log Scale Up: Aesthetics Previous: Vertical Plots



Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov