Help using Base SAS procedures

Proc Gplot: Axis values

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Proc Gplot: Axis values

Hello!

Does anybody know how to change the axes values? I am plotting a series of scatterplots and when the numbers get too big sometimes they appear in scientific notation. How can I change that?

Unwanted Y-axis:

   

Desired Y-Axis

        


Accepted Solutions
Solution
‎08-05-2013 11:33 AM
Super Contributor
Posts: 543

Re: Proc Gplot: Axis values

Hi,

Without any sample data/code, I created something...

DATA HAVE;

DO I = 5000000 TO 25000000 BY 5000000;

  REVENUE = I;

  PROFIT = I/20;

  OUTPUT;

END;

DROP I;

RUN;

PROC FORMAT;

  VALUE BIG 5000000 = "5,000,000"

  10000000 = "10,000,000"

  15000000 = "15,000,000"

  20000000 = "20,000,000"

  25000000 = "25,000,000"

;

QUIT;

GOPTIONS RESET = ALL;

AXIS1 LABEL = (F = ARIAL H = 2 A = 90 "REVENUE" )

  ORDER = (5000000 TO 25000000 BY 5000000) V = (F = ARIAL H = 1.5);

PROC GPLOT DATA = HAVE;

PLOT REVENUE * PROFIT/VAXIS = AXIS1;

FORMAT REVENUE BIG.;

RUN;QUIT;

Bascially, I think you may need to use some format.

Good luck!

Anca.

View solution in original post


All Replies
Solution
‎08-05-2013 11:33 AM
Super Contributor
Posts: 543

Re: Proc Gplot: Axis values

Hi,

Without any sample data/code, I created something...

DATA HAVE;

DO I = 5000000 TO 25000000 BY 5000000;

  REVENUE = I;

  PROFIT = I/20;

  OUTPUT;

END;

DROP I;

RUN;

PROC FORMAT;

  VALUE BIG 5000000 = "5,000,000"

  10000000 = "10,000,000"

  15000000 = "15,000,000"

  20000000 = "20,000,000"

  25000000 = "25,000,000"

;

QUIT;

GOPTIONS RESET = ALL;

AXIS1 LABEL = (F = ARIAL H = 2 A = 90 "REVENUE" )

  ORDER = (5000000 TO 25000000 BY 5000000) V = (F = ARIAL H = 1.5);

PROC GPLOT DATA = HAVE;

PLOT REVENUE * PROFIT/VAXIS = AXIS1;

FORMAT REVENUE BIG.;

RUN;QUIT;

Bascially, I think you may need to use some format.

Good luck!

Anca.

Super User
Posts: 10,880

Re: Proc Gplot: Axis values

I'm guessing the the likely current format for your predicted variable is BEST8. You don't need a custom format COMMA12. should work for your displayed example.

If you aren't interested in the level of control an AXIS statement gives add  statements similar to:

Format minsalary comma12.;

label minsalary = 'Predicted';

to the proc statements.

Contributor
Posts: 45

Re: Proc Gplot: Axis values

Formatting worked! Smiley Happy

Thank you all very much!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 822 views
  • 3 likes
  • 3 in conversation