Data visualization with SAS programming

Converting a Sgplot with by to sgpanel

Accepted Solution Solved
Reply
Super Contributor
Posts: 333
Accepted Solution

Converting a Sgplot with by to sgpanel

I cant seem to solve this problem I am having, so I am hoping someone out in the community can spot my obvious syntax problem that Im not seeing. I am trying to convert a sgplot with highlow and scatter plots and a by statement to a sgpanel with panelby being the by variable. But the highlow part is not working (SAS turns the syntax red and the output only has the scatter). On this machine Im running 9.3 (TS1M2) if it matters.

The way I read the documentation is that this should be fine.

Thanks for any help!

EJ


sgpanel code.jpg

Accepted Solutions
Solution
‎05-19-2014 09:43 AM
SAS Super FREQ
Posts: 925

Re: Converting a Sgplot with by to sgpanel

On the ODS GRAPHICS statement, specify the WIDTH and/or HEIGHT. If you specify only one of them, the other is calculated internally to maintain aspect. For example:

ods graphics / width=600px height=1000px;

The units can be in the standard units supported in ODS (px, in, cm, etc.)

- Dan

View solution in original post


All Replies
SAS Super FREQ
Posts: 925

Re: Converting a Sgplot with by to sgpanel

This should work, despite the red syntax. What messages do you get in the log?

Super Contributor
Posts: 333

Re: Converting a Sgplot with by to sgpanel

Thanks for the reponse Dan. I think the red syntax just threw me down the wrong path. I think it is working, just my graph scale is two small to see the lines. So now I need to figure out how to make the taller and wider. And the panel might not work anyway since I thought the y axis would be independently adjusted for each graph but it looks like its the same for all three. Output attached.

EJ


sgpanel output.jpg
SAS Super FREQ
Posts: 925

Re: Converting a Sgplot with by to sgpanel

On the PANELBY statement, say UNISCALE=COLUMN and you will get what you want.

Super Contributor
Posts: 333

Re: Converting a Sgplot with by to sgpanel

Thanks Dan! That worked liked a charm. While we are on the subject whats the easiest way to get the output taller and wider?

EJ

Solution
‎05-19-2014 09:43 AM
SAS Super FREQ
Posts: 925

Re: Converting a Sgplot with by to sgpanel

On the ODS GRAPHICS statement, specify the WIDTH and/or HEIGHT. If you specify only one of them, the other is calculated internally to maintain aspect. For example:

ods graphics / width=600px height=1000px;

The units can be in the standard units supported in ODS (px, in, cm, etc.)

- Dan

Super Contributor
Posts: 333

Re: Converting a Sgplot with by to sgpanel

Thanks again Dan!

That was painless!

EJ


🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 477 views
  • 6 likes
  • 2 in conversation