BookmarkSubscribeRSS Feed
sfo
Quartz | Level 8 sfo
Quartz | Level 8

Hello,

 

I need to display 200+ distinct subjects on yaxis but my graph is cutting. Is there a way to either display all the subejcts in one plot or maybe split the graph to display say 50 subjects per graph? I am using SAS 9.2

 

Thanks


graph example.png
4 REPLIES 4
ballardw
Super User

As a minimum show all of the graphics options, statements (axis symbol pattern) and the gplot code used. Some actual example data to illustrate what you have would also help.

Also when you say "page" do mean something like an RTF or PDF page? What size page if so.

 

Somewhat generic options could be:

Increase the size of the plot area with goptions hsize and vsize options, reduce the size of the markers shown (symbol)

To create separate charts with fewer subjects easiest would be to add a variable to indicate a display group assignment, sort the data by that variable and then use a BY statement in Proc Gplot using the variable.

sfo
Quartz | Level 8 sfo
Quartz | Level 8
Thanks for the reply.

By "page" I mean separate PDF page.

I am not sure if I can share my data in this forum.

##- Please type your reply above this line. Simple formatting, no
attachments. -##
ballardw
Super User

@sfo wrote:
Thanks for the reply.

By "page" I mean separate PDF page.

I am not sure if I can share my data in this forum.

##- Please type your reply above this line. Simple formatting, no
attachments. -##

Any example data that shows the same behavior.

But as a minimum show the code, graphics options, axis and symbols statements you are using.

By Group processing should create a separate graph per group which I would expect to appear on separate pages if the size of the graph is at least half the vertical size of your pdf page.

sfo
Quartz | Level 8 sfo
Quartz | Level 8

Below is the graphic and symbol options, hope this will help

 

goptions YMAX=1500 in vsize=1000 in hsize=1000 in;

 

/*vertical axis option*/

axis3 label = (a=90 f=arial h=3 " Subject")
length = 100
style = 1
width = 5
color = black
offset = (0 cm, 0 cm)
order = 0 to %eval(&NSub+1)
major = (h=0.75 w=6) minor=(h=0.5 n=6)
value = (%do i=1 %to &NSub;
tick=1 h=1 ' '
tick=%eval(&i+1) h=1 "&&N&i" /* N is the maco variable that contains the subject number */
%end;
tick=%eval(&NSub+1) h=1 ' ');

 

/*Symbol option*/

goptions display hby=2 fby=arial;
goptions colors=();

 

symbol1 w=0.5 h=0.5 v=dot c=black ;
symbol2 w=0.5 h=0.5 v=dot c=red ;
symbol3 w=0.5 h=0.5 v=dot c=blue ;
symbol4 w=0.5 h=0.5 v=dot c=green ;

.....

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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
  • 4 replies
  • 1794 views
  • 0 likes
  • 2 in conversation