03-15-2017 09:25 AM
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.
define style styles.mystyle;
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;
Thanx for you help!
03-15-2017 10:43 AM
The Power to Plot: Three Ways to Enhance SG Graphical Outputs
Xiangxiang Meng, University of Cincinnati, Cincinnati, OH
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.
03-16-2017 06:16 AM
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;