BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6

Hello Everyone,

I am learning how to use PROC SGPANEL to plot data from SAS.  I would like to fit 9 panels onto one page in the output.  The code i have below puts 6 panels onto one page (I guess by default).  If I have more than 6 'panelby' values, then SAS puts 2 panels side by side and create however many pages to include the panels.  Is there a way for me to specify the number of panels per page?

ods listing close;

ods html file = 'customers.html' path='.' style=ocean;

ods graphics / reset width=600px height=400px imagename= 'Customer_Count' imagefmt=gif;

title 'Customer Count';

PROC SGPANEL data=customer_data;

PANELBY investor / novarname;

VLINE year / RESPONSE = resp_rate LINEATTRS=graphfit;

COLAXIS FITPOLICY=THIN;

ROWAXIS LABEL="Respponse";

RUN;

ods html close;

ods listing;

Thank you so much!

1 REPLY 1
ballardw
Super User

With HTML output I would increase the size of the display area. The 600x400 is pretty small for most of today's monitors and that is part of what is choking your size. Imagefmt=PNG also may give better appearance.

The options columns= and Rows=  on the Panelby statement is the basic control for appearance. If your data groups exceed the values for row and column then I usually get a new page.

Generally if I need to really control the number and content of each display I use data set option where clauses to restrict each created panel to a desired set of values and make multiple calls to procedure.

With your 9 panels example I would start with columns=3 and rows=3 ...

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 1132 views
  • 0 likes
  • 2 in conversation