Previous Page | Next Page

The PLOT Procedure

Example 5: Plotting Data on a Logarithmic Scale


Procedure features:

PLOT statement option

HAXIS=


This example uses a DATA step to generate data. The PROC PLOT step shows two plots of the same data: one plot without a horizontal axis specification and one plot with a logarithmic scale specified for the horizontal axis.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=40;
 Note about code
data equa;
   do Y=1 to 3 by .1;
      X=10**y;
      output;
   end;
run;
 Note about code
proc plot data=equa hpercent=50;
 Note about code
    plot y*x;
    plot y*x / haxis=10 100 1000;
 Note about code
    title 'Two Plots with Different';
    title2 'Horizontal Axis Specifications';
run;

Output

                            Two Plots with Different                           1
                         Horizontal Axis Specifications

     Plot of Y*X.  A=1, B=2, and so on.              Plot of Y*X.  A=1, B=2, and so on.



  Y |                                       Y |
    |                                         |
3.0 +                                A    3.0 +                                A
2.9 +                         A           2.9 +                              A
2.8 +                    A                2.8 +                             A
2.7 +                A                    2.7 +                           A
2.6 +             A                       2.6 +                          A
2.5 +          A                          2.5 +                        A
2.4 +        A                            2.4 +                      A
2.3 +      A                              2.3 +                     A
2.2 +     A                               2.2 +                   A
2.1 +    A                                2.1 +                  A
2.0 +   A                                 2.0 +                A
1.9 +   A                                 1.9 +              A
1.8 +  A                                  1.8 +             A
1.7 +  A                                  1.7 +           A
1.6 + A                                   1.6 +          A
1.5 + A                                   1.5 +        A
1.4 + A                                   1.4 +      A
1.3 + A                                   1.3 +     A
1.2 + A                                   1.2 +   A
1.1 +A                                    1.1 +  A
1.0 +A                                    1.0 +A
    |                                         |
    -+---------------+---------------+        -+---------------+---------------+
     0              500           1000        10              100           1000

                     X                                         X




Previous Page | Next Page | Top of Page