ggplot2 Color Scale Over Affected by Outliers

后端 未结 3 1866
夕颜
夕颜 2021-02-13 23:22

I\'m having difficulty with a few outliers making the color scale useless.

My data has a Length variable that is based in a range, but will usually have a few much large

3条回答
  •  無奈伤痛
    2021-02-13 23:25

    From my comment, see ?cut

    x$colors <- cut(x$Length, breaks=c(0,500,1000,1300,max(x$Length)))
    
    g <- ggplot(data=x,aes(x=date,y=factor(stateabbr),color=colors)) +
        geom_point() + 
        opts(title="Date and State") + 
        xlab("Date") + 
        ylab("State")
    

提交回复
热议问题