09-13-2013 11:49 AM
Using proc boxlplot i want to have different colors for different treatment groups for the horizontal lines.
below is the code i am using.
/* i am using summary stats as input from the proc means */
proc boxplot history = datxxx;
plot rsl1n*nvisit=ntrt / boxconnet=mean cconnect=green cboxes=(ncolor) haxis=(0,1,2,3,4,5,6,7,8,9,10)
vref= 8 6 4 2 cvref=blue;
format nvisit visnum_.;
in the above code for example for vref=8 6 4 2 --- for 8 i want green color and for 6 blue and so on.
09-13-2013 02:10 PM
The cvref option will take a color list. Match the color IN ORDER with teh VREF option
cvref = (green blue colorfor4 colorfor2)
09-17-2013 06:35 PM
if i use cvref = (green blue ....) i get an syntax error for parenthesis.
i am using SAS 9.1.3.
one more question. how do i center align the vertical axis label. i am using defining axis and using it in proc boxplot as vaxis=axis2.
vertical axis label is not center aligned even when i mention j=c in the axis statement.
appreciate your help.
09-18-2013 11:36 AM
The CVREF accepting a list may have been a change in 9.2.
Text options such as justification in AXIS labels need to come before the text affected. This one of the common syntax misunderstanding with several of the SAS Graph statements. It is actually a feature as the label can be split into parts with font color, size, and weight changing for different pieces.
Post the offending code when possible to help diagnosis such things as there could be other issues.
a week ago - last edited a week ago
I use SAS 9.4.
ods graphics off;
axis1 label = (height = 1 'xxx') ; axis2 order = (0 to 5 by 1) label = (height = 1 'yyy') ; symbol value = dot cv=blue height = 1 ; proc boxplot data=table; plot var1*var2 / vref=3 20 cvref=(green red) haxis=axis1 vaxis=axis2; insetgroup N="N" min="Mini" (5.1) MEAN="Moyenne" (5.1) std="E.T." (5.1) Q2="Médiane" (5.1) max="Maxi" (5.1) / header = 'Statistiques descriptives' position=topoff; run;
I get a syntax error for parenthesis too.
Help me please. Thanks.