Data visualization with SAS programming

Splitting a gplot into multiple pages

Reply
Contributor sfo
Contributor
Posts: 66

Splitting a gplot into multiple pages

[ Edited ]

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
Super User
Posts: 10,500

Re: Splitting a gplot into multiple pages

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.

Contributor sfo
Contributor
Posts: 66

Re: Splitting a gplot into multiple pages

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. -##
Super User
Posts: 10,500

Re: Splitting a gplot into multiple pages


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.

Contributor sfo
Contributor
Posts: 66

Re: Splitting a gplot into multiple pages

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 ;

.....

Ask a Question
Discussion stats
  • 4 replies
  • 125 views
  • 0 likes
  • 2 in conversation