Reputation: 11
I have a dataframe in the following format with 10 rows of data (listed below). This is a list of obese children in Birmingham (England) by districts.
I am plotting this data in a barchart using ggplot2. On the X-Axis i have the district names y-Axis has the obese rate
the data bars show the obese rate in each district.
I have also added a benchmark line to compare Birminghams data against the districts. I have also plotted the upper and lower confidence intervals.
My Problem is-
How do i display the legends for this barchart? I belive because it is a single data item that the legends are not turning on? how do i turn on the legends?
I have changed geom_bar (show.legend = TRUE) but still i am unable to view the legends for this bar chart.
I would be most grateful for any help on this. Best Wishes MD from a sunny Birmingham.
COLUMN NAMES
Districts (Names of districts)
Obese (rates of obese)
LL (Lower CI)
UL (Upper CI)
Birmingham (Cities obese rates for comparing)
(10 rows of data in total)
Upvotes: 0
Views: 33
Reputation: 11
The following question seems related to your question: Show legend for bar plot in ggplot
Generally, a legend is shown when you use a fill, which you do not use.
Upvotes: 1