Hi All,
I trying to develop the scatter plot by using proc sgplot.
Min and max values are negative to positive , i wan to show 0 on in the y-axis.
proc sgplot data=have;
scatter y=pct x=dur/group=col
yaxis values=(&min to &max by 10);
...
...
run;
for example min is -140 & max is 200
I want yaxis like below
-140 -120 -100 -80 -60 -40 -20 0 20 40 60 80 100 120 140 160 180 200
Thanks
Sam
You shown values of -130 -110 -90 -70 -50 -30 -10 10 30 50 70 90 110 130 150 170 190 are because you are using BY 20.
yaxis values = (-130 to -10 by 20 0 10 to 190 by 20) may work.
Simplier might be (-140 to 200 by 20) so 0 appears as a multiple of 20 added to -140.
You are missing a semicolon at the end of the Scatter statement.
If you are getting errors please post them.
If the results are just not showing all the values then it may be a result of the amount of space your default graph has available.
If something else, then post data in a data step and the complete proc code you have used.
Hi ,
Thank you for the response!!!
I am not getting the errors. Missing semicolon is a typo.
i am using :
yaxis values=(&min to &max by 5);
My values on the plot is getting like this
-130 -110 -90 -70 -50 -30 -10 10 30 50 70 90 110 130 150 170 190
want:
-130 -110 -90 -70 -50 -30 -10 0 10 30 50 70 90 110 130 150 170 190
You shown values of -130 -110 -90 -70 -50 -30 -10 10 30 50 70 90 110 130 150 170 190 are because you are using BY 20.
yaxis values = (-130 to -10 by 20 0 10 to 190 by 20) may work.
Simplier might be (-140 to 200 by 20) so 0 appears as a multiple of 20 added to -140.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.