Hi group,
I'm having trouble with some of the style attributes in SGPLOT. I am trying to customize a regression plot with 2 groups, that includes confidence bands/ limits. I have been able to get the figure very close to how I'd like it, however, one of my regression lines is missing a confidence band (that was there when I had all the default options).
Here is my code:
ods html style=Journal;
proc sgplot data=Haley_July;
styleattrs datacontrastcolors=(black grey)
datasymbols=(circle triangle)
datalinepatterns=(solid);
reg y=r4 x=yolk_mom/group=season CLM CLI;
xaxis label= 'Maternal Yolk Allocation';
yaxis label= 'Yolk Conversion Efficiency';
run;quit
I don't think there is anything intrinsically wrong with your plot statement. Run the following and see if you can see both CLM regions:
ods html style=Journal;
proc sgplot data=sashelp.class;
styleattrs datacontrastcolors=(black grey)
datasymbols=(circle triangle)
datalinepatterns=(solid);
reg y=weight x=height/group=sex CLM CLI;
run;
One thing to be aware of, when you set the line color to grey, it might not show up against the CLM. You might want to use
datacontrastcolors=(grey lightgrey)
or some similar choice.
Maybe the missing CLM is white? To help "find" the missing CLM, try (temporarily) adding
wallcolor=lightpink
to the STYLEATTRS statement.
Did you edit the journal style?
Use
proc template;
list styles.journal;
run;
to determine if you are running the "official" style in SASHELP.TMPLMST or whether you are running a private copy.
There are also the Journal1a, Journal2, Journal2a, Journal3, and Journal3a styles.
I'm going to move this to the Graphics Community where more style experts can weigh in.
You could try other style like HTMLBLUE.and change color of clm .
ods html style=htmlblue;
proc sgplot data=sashelp.class;
styleattrs datacontrastcolors=(black grey)
datasymbols=(circle triangle)
datalinepatterns=(solid);
reg y=weight x=height/group=sex CLM CLI clmattrs=(color=blue);
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.