Hi All,
I am novice to ggplot topic. I am getting the error while executing the below ggplot script. Please help me on how to fix it. Below is my ggplot script.
Thanks @FJCC for the reply . I want to have color in geom_point() only as I have multiple geom and want to have different color each geom. In the above script, i have mentioned only one geom.
Coming to my issue: I see the error only when i add it outside of aesthetic as mentioned in the above script , but when i write the color inside the aesthetic as shown below, I am not getting. ggplot(data = humans, mapping = aes(x = mass, y = height)) + geom_point(aes(color = "BMI"), size = 4)
Can someone please explain what exactly aesthetic will do present inside the geom_point. Aesthetic inside the plot will be inherited to geom but here it doesn't makes sense to write the script inside the geom.
Thanks.
aesthetics define a mapping between a charting feature , like colour, and something else; that something else can most usefully be a symbol, representing a column in your data; i.e. if your data has a BMI column, then each entry can get its own colour.
However, BMI is a symbol and "BMI" is a literal string of text that says BMI, and therefore only once colour can be associated with a single unchanging text value of "BMI"
do you want the BMI symbol or BMI as text ?