turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS/GRAPH and ODS Graphics
- /
- Some of tick values have bee thinned in SAS Gplot,...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-12-2016 04:35 AM - edited 07-12-2016 04:37 AM

plot of the odds ratios and their 95% confidence intervals created using SAS PROC SGPLOT,

but some of the tick values have been thinned. How plot the figure without remove or thinned tick values ?

Thanks a lot!

```
title "SGPLOT: Forest Plot";
proc sgplot data=excel_b;
scatter x=oddsratioest y=effect / xerrorlower=lowercl
xerrorupper=uppercl
markerattrs=or
(symbol=DiamondFilled size=5);
refline 1 / axis=x;
xaxis label="OR and 95% CI " min=0.9;
yaxis label="Covariates";
run;
```

Accepted Solutions

Solution

07-12-2016
07:52 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-12-2016 05:34 AM

With that many discrete vertical labels, there isn't enough room to plot them all without labels overlapping (which SGPLOT tries to avoid). You can

1. Decrease the font size for the tick values. Probably size=8 is about the smallest that can be read.

2. Increase the vertical size of the plot. Plots can stretch arbitrarily long.

3. Do both

To decrease the font size, use

YAXIS / valueattrs=(size=8);

To increase the vertical dimension of the graph, use the following BEFORE the call to PROC SGPLOT, For example:

ods graphics / width=500px height=800px;

Another option: Since you have two stages, you could use PROC SGPANEL to create a panel of plots, one for each stage.

All Replies

Solution

07-12-2016
07:52 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-12-2016 05:34 AM

With that many discrete vertical labels, there isn't enough room to plot them all without labels overlapping (which SGPLOT tries to avoid). You can

1. Decrease the font size for the tick values. Probably size=8 is about the smallest that can be read.

2. Increase the vertical size of the plot. Plots can stretch arbitrarily long.

3. Do both

To decrease the font size, use

YAXIS / valueattrs=(size=8);

To increase the vertical dimension of the graph, use the following BEFORE the call to PROC SGPLOT, For example:

ods graphics / width=500px height=800px;

Another option: Since you have two stages, you could use PROC SGPANEL to create a panel of plots, one for each stage.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-12-2016 09:22 AM

Also, you can use FITPOLICY=none for the yaxis.