Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1987 views
  • 2 likes
  • 3 in conversation