Scripting Guide > Data Tables > Rows > Assign Colors and Markers to Rows
发布日期: 11/15/2021

Assign Colors and Markers to Rows

You can use the Colors and Markers messages to assign (or change) colors and markers used for rows. These settings mostly affect graphs produced from the data table. Both messages expect numeric arguments to choose which color or marker to use. For more information about how numbers correspond to colors and markers, see Colors and Markers.

dt << Colors( 3 );  // set selected rows to red
dt << Markers( 2 ); // pick the X marker for selected rows

As with other row messages, you can stack selection and other messages together:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 12 ) // select the youngest subjects
	 << Colors( 8 ) << Markers( 8 ); // and use purple open circles for them

Color by Column sets colors according to the values of a column that you specify, and Marker by Column works similarly:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Color by Column( :age );
dt << Marker by Column( :age );

Here are additional, named arguments:

Continuous Scale (Color by Column only) Assigns colors in a chromatic sequential fashion based on the values in the highlighted column.

Reverse Scale Reverses the color scheme in use.

Make Window with Legend Creates a separate window with a legend.

Excluded Rows Applies the row states to excluded rows.

Marker Theme Specifies the marker type.

Color Theme Specifies the color theme.

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).