Hi there,
I am doing a boxplot and I am having issues differentiating vertical line colours. It seems like I can't get each line (2 of them...at 12 and at 5) to be different colours. Please see code below.
proc boxplot data=eval.pop;
plot latest_reg*seclatest_reg_cat/ vref=12 5 vreflabels= "90th percentile" "Target" cvref= red green;
inset min mean max stddev/
header = "Overall statistics"
pos= tm;
insetgroup min max/
header = "Extremes by performance";
label latest_ref= "Last reported reg rate";
label seclatest_ref_cat ="Performance based on second last reg rate";
run;
@kthartma wrote:
Hi there,
I am doing a boxplot and I am having issues differentiating vertical line colours. It seems like I can't get each line (2 of them...at 12 and at 5) to be different colours. Please see code below.
proc boxplot data=eval.pop;
plot latest_reg*seclatest_reg_cat/ vref=12 5 vreflabels= "90th percentile" "Target" cvref= red green;
inset min mean max stddev/
header = "Overall statistics"
pos= tm;
insetgroup min max/
header = "Extremes by performance";
label latest_ref= "Last reported reg rate";
label seclatest_ref_cat ="Performance based on second last reg rate";
run;
You don't do yourself favors by not posting the errors generated by your code. CVREF is going to allow a single color for all the reference lines. If you want to have different colors either go to annotate data set, probably not the best way, or move to SGPLOT with the VBOX or HBOX plot and as many REFLINE statements as needed. If you need all of the inset/ header/post options then you may have to settle for single color reference lines or go with annotate.
@kthartma wrote:
Hi there,
I am doing a boxplot and I am having issues differentiating vertical line colours. It seems like I can't get each line (2 of them...at 12 and at 5) to be different colours. Please see code below.
proc boxplot data=eval.pop;
plot latest_reg*seclatest_reg_cat/ vref=12 5 vreflabels= "90th percentile" "Target" cvref= red green;
inset min mean max stddev/
header = "Overall statistics"
pos= tm;
insetgroup min max/
header = "Extremes by performance";
label latest_ref= "Last reported reg rate";
label seclatest_ref_cat ="Performance based on second last reg rate";
run;
You don't do yourself favors by not posting the errors generated by your code. CVREF is going to allow a single color for all the reference lines. If you want to have different colors either go to annotate data set, probably not the best way, or move to SGPLOT with the VBOX or HBOX plot and as many REFLINE statements as needed. If you need all of the inset/ header/post options then you may have to settle for single color reference lines or go with annotate.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.