Sample 35864: Change line colors and styles for PROC SGPLOT output
This sample illustrates how to use styles and options to change the line color and style in output created by PROC SGPLOT.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses PROC TEMPLATE to change the line color for grouped data and the LINEATTRS= option to change the line color for non-grouped data.
proc template;
define style styles.mystyle;
parent=styles.default;
style GraphData1 from GraphData1 /
contrastcolor=orange linestyle=1;
style GraphData2 from GraphData2 /
contrastcolor=purple linestyle=1;
end;
run;
ods listing close;
ods html file='test.html' path='.' style=styles.mystyle;
ods graphics on / reset imagename='linestyle' imagefmt=gif width=600px height=400px border=off;
proc sgplot data=sashelp.class;
reg x=weight y=height / group=sex degree=3;
reg x=weight y=height / lineattrs=(color=blue pattern=dash)
markerattrs=(color=black symbol=circlefilled);
run;
ods html close;
ods listing;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to use styles and options to change the line color and style in output created by PROC SGPLOT.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGPLOT
|
Date Modified: | 2009-05-22 11:12:19 |
Date Created: | 2009-05-08 14:58:05 |
Operating System and Release Information
SAS System | SAS/GRAPH | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |