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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.