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!
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
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.