Help using Base SAS procedures

proc sgplot - axis scale and tick marks

Accepted Solution Solved
Reply
Occasional Contributor kc
Occasional Contributor
Posts: 14
Accepted Solution

proc sgplot - axis scale and tick marks

How do I keep the scale of y-axis from 0 to 10 but only display tick values at 2 4 6 8. Essentially, I want to have 5 intervals (from 0 to 10) instead of 3, so my scatter plot is placed in the middle of the graph instead of being more spread out.

My dataset has only 4 observations at (2 4 6 8). Please find an attachment with display of plots.


Accepted Solutions
Solution
‎10-15-2015 03:47 PM
Super Contributor
Posts: 256

Re: proc sgplot - axis scale and tick marks

Hi,

 

Try adding offsetmix = 1 and offsetmax = 1 into the yaxis statement along with values = (2 4 6 8).

 

Thanks.

View solution in original post


All Replies
Trusted Advisor
Posts: 1,137

Re: proc sgplot - axis scale and tick marks

Hi,

In the sgplot you could use statement as below

yaxis min=0 max=10 values=( 2 4 6 8 );

this is an untested code , may help you

Thanks
Jag
Thanks,
Jag
Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: proc sgplot - axis scale and tick marks

Posted in reply to Jagadishkatam

I did run this code below with no luck. 

Solution
‎10-15-2015 03:47 PM
Super Contributor
Posts: 256

Re: proc sgplot - axis scale and tick marks

Hi,

 

Try adding offsetmix = 1 and offsetmax = 1 into the yaxis statement along with values = (2 4 6 8).

 

Thanks.

Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: proc sgplot - axis scale and tick marks

Worked perfectly, thanks!
Super Contributor
Posts: 256

Re: proc sgplot - axis scale and tick marks

You're welcome.
🔒 This topic is solved and locked.

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

Discussion stats
  • 5 replies
  • 923 views
  • 1 like
  • 3 in conversation