BookmarkSubscribeRSS Feed
Emilia
Calcite | Level 5

Hi all!

I want to change the color for my clm in my regression in sgplot. I've formed a teplete for the lines (color and dashing), but don't know how I do it for the clm. 

 

proc template;
define style styles.mystyle;
parent=styles.default;
style body from body / background = white;
class graphbackground / color=white;
style GraphData1 from GraphData1 / contrastcolor=DAGRAY linestyle=5 ;
style GraphData2 from GraphData2 / contrastcolor=MEGR linestyle=4;
end;
run;

 

Thanx for you help!

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

Copied from:

Paper 095-2011

The Power to Plot: Three Ways to Enhance SG Graphical Outputs

Xiangxiang Meng, University of Cincinnati, Cincinnati, OH

http://support.sas.com/resources/papers/proceedings11/095-2011.pdf

 

In general, graphical outputs are controlled by the style elements with prefix "Graph". For instance, GraphConfidence
is for the confidence area, and GraphLegendBackground is for the background of the legend. The objected-oriented
nature of ODS style definition makes it very easy and flexible to add or adjust graphical elements in a ODS style:

*[Example 4.1] Simple examples for applying modified ODS style;
proc template;
 define style styles.LasVegas1;
   parent = styles.default;
   style GraphConfidence from GraphConfidence / color=CXE8D898;
   style GraphLegendBackground                / transparency=1;
 end;
run;
ods html style=LasVegas1;
proc sgplot data=cars_small;
  reg     x=weight y=MSRP / degree=2 clm;
  scatter x=weight y=invoice;
run; quit;

This example changes the color of the confidence area and makes the legend transparent. Note that the second
class "GraphLegendBackground" is created instead of from inheritance since no such class has been defined in the
ODS style DEFAULT.

 

Koen

Emilia
Calcite | Level 5

Thank you!!

I had to modify it since I have two groups. This worked in the end:

 

style GraphData1 from GraphData1 /color =#8C8C8C linestyle=4 contrastcolor=DAGR ;
style GraphData2 from GraphData2 /color= #BFBFBF linestyle=4 contrastcolor=DAGRAY;

 

Best/

Emilia

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1674 views
  • 0 likes
  • 2 in conversation