Sample 25526: Using patterns and joins in contour plots with PROC GCONTOUR
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 14.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GCTPATRN |
| TITLE: GCTPATRN-Using Patterns and Joins in Contour Plots |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GCONTOUR AXIS LEGEND |
| PROCS: GCONTOUR |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red cyan lipk lime)
ftext=swissb htitle=5 htext=4;
/* Create data set WORK.SWIRL */
data swirl;
do x=-5 to 5 by 0.25;
do y=-5 to 5 by 0.25;
if x+y=0 then z=0;
else z=(x*y)*((x*x-y*y)/(x*x+y*y));
output;
end;
end;
run;
/* Define title and footnote for first plot */
title1 'Simple Contour Plot';
footnote h=3 j=r 'GCTPATR1';
/* Show the contour plot */
proc gcontour data=swirl;
plot y*x=z;
run;
/* Redefine title and footnote for second plot */
title1 'Representing Contour Levels with Patterns';
footnote h=3 j=r 'GCTPATR2';
/* Show the contour plot */
proc gcontour data=swirl;
plot y*x=z / pattern
coutline=gray
ctext=blue;
run;
/* Redefine title and footnote for third plot */
title1 'Joining the Patterns in a Contour Plot';
footnote h=3 j=r 'GCTPATR3';
/* Define axis and legend characteristics */
axis1 label=none value=('-5' ' ' '0' ' ' '5')
color=red width=3;
axis2 label=none value=('-5' ' ' '0' ' ' '5')
color=red width=3;
legend frame;
/* Show the contour plot */
proc gcontour data=swirl;
plot y*x=z / pattern
join
haxis=axis1
vaxis=axis2
legend=legend1;
run;
quit;
This example demonstrates the differences between using lines and patterns to represent contour levels.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GCONTOUR Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Contour
|
| Date Modified: | 2005-08-27 03:03:19 |
| Date Created: | 2005-05-23 14:13:18 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |