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
- /
- manipulate chart area using proc gchart

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

03-19-2015 10:16 AM

Hi,

I am working with a sas dataset called 'final' and I need to create a bar chart of the frequencies(y-axis) for the individual values in the variable var1(x-axis). There are hundred such values with little differences in their values by decimal points.

var1 |

1.65 |

4.83 |

6.14 |

6.56 |

8.35 |

9.22 |

9.57 |

10.23 |

10.67 |

11.98 |

45.23 |

67.54 |

34.53 |

I used proc ghcart and my code is

proc gchar data=final;

vbar var1;

run;

This gives me a very crowded chart and I need to increase the chart area to be able to show all 100 values. Please advice on how I can manipulate the chart area. Should I use another procedure ? Als, I am using SAS 9.4

Thanks.

Accepted Solutions

Solution

03-19-2015
10:32 AM

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

03-19-2015 10:32 AM

Given the width of these value strings, and the number of values, you might want to consider using an HBAR instead of a VBAR. AS for changing the size of the graph, using the XPIXELS/YPIXELS options on the GOPTIONS statement. For example:

goptions xpixels=600 ypixels=1000;

Hope this helps!

Dan

All Replies

Solution

03-19-2015
10:32 AM

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

03-19-2015 10:32 AM

Given the width of these value strings, and the number of values, you might want to consider using an HBAR instead of a VBAR. AS for changing the size of the graph, using the XPIXELS/YPIXELS options on the GOPTIONS statement. For example:

goptions xpixels=600 ypixels=1000;

Hope this helps!

Dan

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

03-19-2015 12:22 PM

Thanks DanH. I will work on your suggestions and will consider HBAR as well. @Reeza. its different from the last one because the gchart gives me a distribution of the values by frequency. Its almost equivalent to the histogram by proc univariate , but I get individual bars here. Just plotting the individual values by id was not helping me (proc sgplot) and wasn't giving any information on the shape of the distribution. Basically I am looking to do 2 charts for distribution one by univariate procedure and other by gchart.

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

03-19-2015 10:33 AM

how is this different than your question from yesterday?