How to increase size of ggplot - squeezed horizontal bar chart

I'm trying to plot some values against US states in a horizontal bar chart in GGPlot.

The code is:

g <- df %>% 
  select(Sample.Measurement, State.Name) %>% 
  group_by(State.Name) %>% 
  count() %>% 
  arrange(n) %>% 
  ggplot(., mapping = aes(x=reorder(State.Name, n), y =n))+
  geom_bar(stat = "identity", width=.8, position = position_dodge(width = .25))+
    title = "",
    y= "Frequency"


The theming element was in a bid to change the text size.

What I really want to do is extend the depth of the chart so that the individual states have more space. How do I do that?

GGplot chart

1 answer

  • answered 2018-01-11 20:30 Roman Lu┼ítrik

    Edit the chunk options, namely fig.height and fig.width.


    ```{r fig.height = 10, fig.width = 5}
    #your plot code