BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dr2014
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

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

View solution in original post

3 REPLIES 3
DanH_sas
SAS Super FREQ

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

dr2014
Quartz | Level 8

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.

Reeza
Super User

how is this different than your question from yesterday?

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 2948 views
  • 1 like
  • 3 in conversation