R legend pch mix of character and numeric

前端 未结 5 1348
忘掉有多难
忘掉有多难 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 04:59

    Use the numerical equivalent of the "+" character:

    plot(x=c(2,4,8),y=c(5,4,2),pch=16)
    points(x=c(3,5),y=c(2,4),pch="+")
    legend(7,4.5,pch=c(43,16),legend=c("A","B"))
    

提交回复
热议问题