BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sami1234
Fluorite | Level 6

Hi,

 

I am using the below code for creating the graph, however, it's not producing the correct axis's.

 

proc sgpanel data=plot3;
panelby trtan / onepanel columns=3 rows=3 novarname spacing=1;
styleattrs
datacontrastcolors=(red blue black)
datalinepatterns=(1)
datasymbols=(circlefilled trianglefilled triangledownfilled);
scatter x=atptn y=mean / yerrorlower=lower yerrorupper=upper
group=paramn groupdisplay=cluster ;
series x=newatptn y=mean / group=paramn groupdisplay=cluster;
rowaxis fitpolicy=thin grid valuesformat=best2.0 values=(40 to 150 by 5) grid ;
colaxis fitpolicy=thin grid values=(10 to 18 by 1) ;

 

Sami1234_0-1680591829916.png

 

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

FITPOLICY=THIN tells SAS the rules you want to use in not displaying all of the X or Y axis values because of the number of values or the lengths displayed will not fit into the default space allocated. Removing it may show more values.

 

You may also need to add TYPE=DISCRETE to force the axis to have properties of a discrete axis to show all of the values.

You might also need to consider use of VALUESROTATE option or increasing the size of the graph display area if the there is text collision due to length of the values.

View solution in original post

8 REPLIES 8
sbxkoenk
SAS Super FREQ

I have moved this to "Graphics Programming" board.

 

Are you complaining about the double asterisk on the Y-axes?

 

Thanks,

Koen

Sami1234
Fluorite | Level 6
Actaully double asterisk on the Y-axes is removved by changing the best3., however X-axis are not populating correctly. Thanks for your reply
ballardw
Super User

FITPOLICY=THIN tells SAS the rules you want to use in not displaying all of the X or Y axis values because of the number of values or the lengths displayed will not fit into the default space allocated. Removing it may show more values.

 

You may also need to add TYPE=DISCRETE to force the axis to have properties of a discrete axis to show all of the values.

You might also need to consider use of VALUESROTATE option or increasing the size of the graph display area if the there is text collision due to length of the values.

Sami1234
Fluorite | Level 6

Hi,

 

Many thanks, it does work.

Would you please let me know how to change the jitter width?

 

Ksharp
Super User
Try JITTERWIDTH= option.

proc sgplot data=sashelp.class;
scatter x=weight y=height/jitter jitterwidth=1;
run;
Sami1234
Fluorite | Level 6

Thanks for your reply.

 

When I use the suggested code in SGPANEL, it's producing the below, however, I would like to move the whole line a bit closer.

Sami1234_0-1680691817694.png

 

Sami1234
Fluorite | Level 6

Actually, it worked by setting the clusterwidth in both scatter and series line.

Thank you all for your input.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1654 views
  • 4 likes
  • 4 in conversation