Resources

New Distribution Option for Using Colors

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CAPCOLOR                                            */
 /*   TITLE: New Distribution Option for Using Colors            */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Capability Analysis,                                */
 /*   PROCS: CAPABILITY                                          */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC: Each distribution now has a COLOR= option that      */
 /*          allows you to specify the color of that curve.      */
 /*                                                              */
 /****************************************************************/
   options ps=60 ls=80 nodate;

   data one;
      input x @@;
      cards;
      0.04   0.10   0.24   0.22   0.07
      0.50   1.52   0.79   0.57   0.18
      1.44   0.45   0.64   1.70   0.03
      0.96   0.60   0.30   0.85   0.73
      0.18   0.62   1.03   0.49   1.47
      1.84   1.13   1.56   1.38   1.11
      0.37   1.12   0.51   0.03   0.45
      0.77   0.79   0.52   0.52   0.55
      1.04   0.58   0.78   1.62   0.40
      1.43   0.36   2.05   0.30   1.51
      1.69   0.61   0.48   2.43   0.31
      0.19   1.03   1.18   0.19   1.42
      0.22   0.40   1.30   0.80   0.85
      0.24   1.04   0.80   1.54   0.55
      0.07   0.47   0.08   1.06   0.33
      0.70   1.76   0.90   0.74   0.07
      0.40   0.64   0.59   0.05   0.57
      1.75   1.10   0.37   0.64   1.06
      0.63   0.20   1.28   0.36   0.23
      0.09   1.01   0.39   1.89   1.45
      ;

 /*--------------------------------------------------------------
    To control the color of the distribution lines in earlier
     releases, you had to specify the following SYMBOL statements
   --------------------------------------------------------------*/

   symbol1 c=white;
   symbol2 c=white;
   symbol3 c=white;
   symbol4 c=white;
   symbol5 c=red;
   symbol6 c=white;
   symbol7 c=white;
   symbol8 c=yellow;

 /*--------------------------------------------------------------
   Now all you need is the COLOR= option
   --------------------------------------------------------------*/

   title 'Distribution Color Options';

   proc capability data=one noprint;
      var x;
      histogram / lognormal(color=red)
                  gamma(color=yellow)
                  legend = legend1
                  cfill  = green
                  cframe = gray;
      legend1 cframe=gray cborder=black;
      run;

   goptions reset=all;