Skip to content

a very particular plot

3 messages · Ian Bentley, Jeff Newmiller, Ista Zahn

#
Ggplot will only produce legends based on factors. Integers are not factors.
"Ian Bentley" <ian.bentley at gmail.com> wrote:

            
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
#
Hi all,
Maybe I missed some crucial context (I did not follow the example all
the way through). But of course ggplot will make legends based on
integers. For example:

dat <- data.frame(x=sample(1:10, 100, replace=TRUE),
                  y=sample(1:10, 100, replace=TRUE),
                  z=sample(1:10,100, replace=TRUE)
                  )

str(dat)

ggplot(dat, aes(x=x, y=y, color=z)) + geom_point()

-Ish

On Wed, Jul 14, 2010 at 10:45 AM, Jeff Newmiller
<jdnewmil at dcn.davis.ca.us> wrote: