R legend pch mix of character and numeric

前端 未结 5 1350
忘掉有多难
忘掉有多难 2020-12-31 04:28

Is it possible to use a mix of character and number as plotting symbols in R legend?

plot(x=c(2,4,8),y=c(5,4,2),pch=16)
points(x=c(3,5),y=c(2,4),pch=\"+\")
l         


        
5条回答
  •  醉梦人生
    2020-12-31 05:00

    I bumped to this issue several time, so I wrote a tiny function below. You can use to specify the pch value, e.g.

    pch=c(15:17,s2n("|"))
    

    String to Numeric

提交回复
热议问题