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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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