Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customization of Bar Graph

    I have created a stacked bar graph to look at my main categorical variable which has Yes/No Responses.
    I want to look at these responses by another categorical variable where there 5 options.

    My code looks like:
    graph bar, over(YesNo) by(CatOptions) stack asyvars blabel(bar, size(vsmall)format(%4.1f))

    I am still learning how to customize and would like to change 2 things:
    1. Given that there are 5 options, the graph output places 3 bar graphs in one row and 2 on a bottom row. How do I get all of them on the same row or all on one column? even if it means they need to look smaller?
    2. The 5 options are automatically labeled at the top and I can't figure out how to make that specific font smaller because one of the categories I am sorting by has a very long label and it looks very cramped (the blabel I have above doesn't change the size of what I want to do) How do I change the font size of the category labels?

  • #2
    1. Given that there are 5 options, the graph output places 3 bar graphs in one row and 2 on a bottom row. How do I get all of them on the same row or all on one column? even if it means they need to look smaller?

    Code:
    graph bar, over(YesNo) by(CatOptions, col(5)) stack asyvars blabel(bar, size(vsmall)format(%4.1f))



    The 5 options are automatically labeled at the top and I can't figure out how to make that specific font smaller because one of the categories I am sorting by has a very long label and it looks very cramped (the blabel I have above doesn't change the size of what I want to do) How do I change the font size of the category labels?
    Code:
    graph bar, over(YesNo) by(CatOptions, col(5)) stack asyvars blabel(bar, size(vsmall)format(%4.1f)) subtitle( ,size(8pt))
    Change the 8 to # where #<8 makes the font size smaller and #> 8, larger. A data example might have expedited a response or even provided you with alternative ways to graph your data, so for your future posts, aim to provide a data example using the dataex command (see FAQ Advice #12 for details)

    Comment

    Working...
    X