Reputation: 115
I used the following script to make the graph below
hypttauplot <- qplot(fuclin_csf, fitHYPTTAU, data=selTAU, geom=c("smooth"),
method="glm", color='black', linetype=BL_HYPT) +
theme_classic() + xlab("Time (years)") + ylab("Tau (pg/ml)") +
scale_x_continuous(expand=c(0,0)) +
ggtitle("A. Hypertension") +
theme(legend.position = "none")
But now my questions is: why are the lines red instead of black? And how can I change them to black?
Upvotes: 3
Views: 4002
Reputation: 68849
You have to use I()
to set the aesthetics manually in qplot()
, e.g. colour=I("black")
(setting vs. mapping of aesthetics).
# mapping
qplot(carat, price, data=diamonds, color="black")
# equivalent to ggplot(data=diamonds, aes(carat, price, color="black")) + geom_point()
# setting
qplot(carat, price, data=diamonds, color=I("black"))
# equivalent to ggplot(data=diamonds, aes(carat, price), color="black") + geom_point()
You can use scale_colour_manual
to specify an own set of mappings.
Upvotes: 5