Error in colour_ramp(colours) : could not find function "muted"

1,778 views
Skip to first unread message

Benny Guo

unread,
Dec 1, 2016, 8:10:28 AM12/1/16
to ggplot2
在此输入代码...
p3 <- ggplot(housing,
             aes(x = State,
                 y = Home.Price.Index)) + 
  theme(legend.position="top",
        axis.text=element_text(size = 6))

(p4 <- p3 + geom_point(aes(color = Date),
                       alpha = 0.5,
                       size = 1.5,
                       position = position_jitter(width = 0.25, height = 0)))

p4 +
  scale_color_continuous(name="",
                         breaks = c(1976, 1994, 2013),
                         labels = c("'76", "'94", "'13"),
                         low = muted("blue"), high = muted("red"))


Error in colour_ramp(colours) : could not find function "muted"

Ben Bolker

unread,
Dec 1, 2016, 8:14:50 AM12/1/16
to ggp...@googlegroups.com

library(scales)

or

scales::muted

On 16-12-01 08:10 AM, Benny Guo wrote:
> |
> 在此输入代码...
> p3 <-ggplot(housing,
> --
> --
> You received this message because you are subscribed to the ggplot2
> mailing list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google
> Groups "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ggplot2+u...@googlegroups.com
> <mailto:ggplot2+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Adriano Fantini

unread,
Dec 1, 2016, 8:14:55 AM12/1/16
to Benny Guo, ggplot2
library(scales)

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com

More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages