0

Bar Chart

I want to modify the title of the legend, instead of 'attacktype1_txt' I want 'Attack Types'.

When using the theme() function, I can not find any parameter to modify the content of the text, just the characteristics.

  ggplot(data=gtd_top, aes( x = reorder(country_txt, country_txt, length), 
  fill=attacktype1_txt), y = length) +
    scale_x_discrete(limits=target, name="Countries") +
    scale_y_continuous("Attacks") +
    geom_bar(color="black") +
    theme(legend.title = element_text("Attack Types")) #error here

0 Answers0