BookmarkSubscribeRSS Feed
AW_Carter
Calcite | Level 5

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



 

 SGPlot6.png
5 REPLIES 5
Rick_SAS
SAS Super FREQ

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.

 

AW_Carter
Calcite | Level 5
AH! The second confidence band is white!


... I'm not actually sure how to change the confidence band color from white. Suggestions?


Thank you!

-Amanda
Rick_SAS
SAS Super FREQ

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.

AW_Carter
Calcite | Level 5
Thank you!


It looks like I edited the style.journal by accident-- can I restore the default sytle.journal?



Best,

Amanda
Ksharp
Super User

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;

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1556 views
  • 2 likes
  • 3 in conversation