Skip to content

using color as an additional variable in ggplot2 #144

@myazdani

Description

@myazdani

I am trying to plot an additional variable using colour:

p = ggplot(mds, aes(x = coord.1, y = coord.2, label = City, colour = Division)) + geom_text()

This works fine in Rstudio and produces:
screen shot 2014-11-12 at 9 34 34 am

FYI, the head of my data looks like this

head(mds)
State City coord.1 coord.2 X2013.rank Division
1 Alabama HUNTSVILLE 1.561284 0.2228790 126 East South Central
2 Alabama MOBILE 6.088862 0.8343259 122 East South Central
3 Alabama BIRMINGHAM 9.978292 -3.6507234 101 East South Central
4 Alabama MONTGOMERY 15.454877 -4.8520206 111 East South Central
5 Arizona TUCSON 23.225289 -0.4438650 33 Mountain
6 Arizona PEORIA -7.283954 9.1252792 149 Mountain

Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions