title: More than six shapes in ggplot
body: <p>I would like to plot lines with different shapes with more than six sets of data, using discrete colors.  The problems are 1) a different legend is generated for line color and shape, but should be only one legend with the line color and shape, 2) when correcting the title for the line color legend, the color disappear. </p>
  
  <pre><code>t=seq(0,360,20)
  for (ip in seq(0,10)) {
    if (ip==0) {
      df&lt;-data.frame(t=t,y=sin(t*pi/180)+ip/2,sn=ip+100)
    } else {
      tdf&lt;-data.frame(t=t,y=sin(t*pi/180)+ip/2,sn=ip+100)
      df&lt;-rbind(df,tdf)
  
    }
  }
  head(df)
  
  # No plot
  # Error: A continuous variable can not be mapped to shape
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn,color=sn,shape=sn))
  gp &lt;- gp + labs(title = "Demo more than 6 shapes", x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line() + geom_point()
  print(gp)
  
  # No plot
  # Error: A continuous variable can not be mapped to shape (doesn't like integers)
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn,color=sn,shape=as.integer(sn)))
  gp &lt;- gp + labs(title = "Demo more than 6 shapes", x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line() + geom_point()
  print(gp)
  
  # Gives warning about 6 shapes, and only shows 6 shapes, continous sn colors
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn,color=sn,shape=as.factor(sn)))
  gp &lt;- gp + labs(title = "Only shows six shapes, and two legends, need discrete colors", 
                  x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line() + geom_point()
  print(gp)
  
  # This is close to what is desired, but correct legend title and combine legends
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn,color=as.factor(sn),shape=as.factor(sn %% 6)))
  gp &lt;- gp + labs(title = "Need to combine legends and correct legend title", x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line() + geom_point()
  print(gp)
  
  # Correct legend title, but now the line color disappears
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn,color=as.factor(sn),shape=as.factor(sn %% 6)))
  gp &lt;- gp + labs(title = "Color disappeard, but legend title changed", x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line() + geom_point()
  gp &lt;- gp + scale_color_manual("SN",values=as.factor(df$sn)) 
  print(gp)
  
  # Add color and shape in geom_line / geom_point commands, 
  gp &lt;- ggplot(df,aes(x=t,y=y,group=sn))
  gp &lt;- gp + labs(title = "This is close, but legend symbols are wrong", x="Theat (deg)", y="Magnitude")
  gp &lt;- gp + geom_line(aes(color=as.factor(df$sn))) 
  gp &lt;- gp + geom_point(color=as.factor(df$sn),shape=as.factor(df$sn %% 6))
  gp &lt;- gp + scale_color_manual("SN",values=as.factor(df$sn)) 
  print(gp)
  </code></pre>