Re: using scale_linetype_manual

87 views
Skip to first unread message

Brandon Hurr

unread,
Oct 26, 2012, 3:49:27 PM10/26/12
to Shulman, Stanley A. (CDC/NIOSH/DART), ggplot2, ggplot2-dev
Yeah... this looks really broken Stanley. I'm guessing bug. 

#redoing this in ggplot() format...
ggplot(data=msleep, aes(x=brainwt, y=bodywt, linetype=factor(vore)), group=vore)+ geom_line()
Error in grid.Call.graphics(L_lines, x$x, x$y, index, x$arrow) : 
  invalid hex digit in 'color' or 'lty'

It actually did plot something and I can see the lines when I change the quartz() window size, but the axes, axes titles, and other parts are all missing. geom_point() does work in the same format.

> levels(msleep$vore)
[1] "carni"   "herbi"   "insecti" "omni"   

Not sure what to tell you... I don't have an answer. 

On Fri, Oct 26, 2012 at 8:29 PM, Shulman, Stanley A. (CDC/NIOSH/DART) <sa...@cdc.gov> wrote:

plot <- qplot(brainwt, bodywt, data=msleep, log=”xy”)

 

does this help?

 

From: Brandon Hurr [mailto:brando...@gmail.com]
Sent: Friday, October 26, 2012 3:03 PM
To: Shulman, Stanley A. (CDC/NIOSH/DART); ggplot2
Subject: Re: using scale_linetype_manual

 

I mean, can you provide what "plot" is? I can't replicate it without the book unless you tell me what the data is. 

 

I'm guessing that in plot they are using geom_point(), but there might not be a geom_line().  

 

B

 

 

On Fri, Oct 26, 2012 at 7:59 PM, Shulman, Stanley A. (CDC/NIOSH/DART) <sa...@cdc.gov> wrote:

Thanks for the reply.

I must be doing something wrong.

 

When I enter the following :

 

plot  + aes(shape=vore) + scale_shape_manual(value=c(1,2,6,0,23))

 

the data are plotted with five different symbols, one for each of five groups.

 

When the change is made from shapes to linetypes,

 

plot  + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3,4))

 

no lines appear.  The values 0,1,2,3,4 are allowed identifiers for different kinds of lines. I am confused.

 

That is my problem.  Any thoughts?

 

 

 

From: Brandon Hurr [mailto:brando...@gmail.com]
Sent: Friday, October 26, 2012 2:47 PM
To: Shulman, Stanley A. (CDC/NIOSH/DART)
Cc: ggp...@googlegroups.com
Subject: Re: using scale_linetype_manual

 

Can you provide more context or a working example? I left my ggplot2 book at work. 

On Fri, Oct 26, 2012 at 6:12 PM, stan <sa...@cdc.gov> wrote:

When use the example on p. 108 of the Wickam "ggplot2" text,  and inlcude the follwoing line:

 plot  + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3,4))

 

the output plots no lines.

I must be using the manual function incorrectly.

 

Any suggestions?

 

  

--
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

 

 


Reply all
Reply to author
Forward
0 new messages