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?

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 861 views
  • 1 like
  • 3 in conversation