DATA Step, Macro, Functions and more

GPLOT - create curve instead of points

Reply
Regular Contributor
Posts: 202

GPLOT - create curve instead of points

[ Edited ]

Hello everyone,

 

How to draw the curve line in stead of dots in this graph? also how to make the axis scales looks better?

 

Thanks!

data have;
input age $1-6 value;
cards;
0-1	1.823963682
1-5	3.027834607
5-10	9.444323403
10-15	15.86313325
15-20	22.2666938
20-25	28.48689472
25-30	34.61049863
30-35	40.8857274
35-40	47.14276882
40-45	53.33288701
45-50	59.39282965
50-55	65.24955141
55-60	70.77393144
60-65	75.92202747
65-70	80.66435999
70-75	84.99938899
75-80	89.14446952
80-85	92.91545641
85-90	96.06852158
90-95	98.44391012
95-100	99.70534076
100+	100.75
;
run;

proc gplot data=have;
   plot value*age ;
run;
quit;
Super User
Posts: 17,780

Re: glot

Can you use SGPLOT instead? It produces better quality graphs. 

 

If so, use a SERIES statement to get a line graph. If you want a best fit curve see the REG and/or SPLINE statements in SGPLOT. 

 

To control the axis using SGPLOT see the XAXIS and YAXIS statements. 

Regular Contributor
Posts: 202

Re: glot

[ Edited ]

Thank you!

Can we export the graph of gplot to excel file? If yes, how?

 

Thanks!

Super User
Posts: 3,102

Re: glot

Here is how you find the documentation that will answer your questions. In the website sas.support.com type in the search words gplot procedure 9.4 and press the search button. You will then find this link:

 

http://support.sas.com/documentation/cdl/en/graphref/69717/HTML/default/viewer.htm#n1e0onjgevom4kn1h...

 

 Included in the link are examples and syntax that will answer your questions.

Ask a Question
Discussion stats
  • 3 replies
  • 132 views
  • 2 likes
  • 3 in conversation