Announcement

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

  • How to make subgraphs on the same row

    graph bar (percent) countme, over(dif) by(weekday)

    I am plotting very simple subgroup bar chart by weekdays. Monday, Tuesday, and Wednesday are the first row and then Thursday, Friday on the second row.
    Is there a way to make them all on the same row? Tried xsize and aspectratio but only worked for the subgraphs not the entire graph.

  • #2
    Code:
    graph bar (percent) countme, over(dif) by(weekday, row(1))
    Also, try

    Code:
    graph bar (percent) countme, over(dif) over(weekday)
    
    graph hbar (percent) countme, over(dif) over(weekday)

    Comment


    • #3
      Originally posted by Nick Cox View Post
      Code:
      graph bar (percent) countme, over(dif) by(weekday, row(1))
      Also, try

      Code:
      graph bar (percent) countme, over(dif) over(weekday)
      
      graph hbar (percent) countme, over(dif) over(weekday)
      Thanks! The x axis (0-20) became unreadable (too small and character overlapped) when I use either option you gave.
      I set xsize to maximum (20) and still no luck.

      Comment


      • #4
        What is dif?

        If it is categorical, try tabplot (Stata Journal). If it is numeric, switch to twoway bar — although you will need to calculate your percents first.

        For more on tabplot search this forum for mentions.

        Comment

        Working...
        X