简体   繁体   English

车包中的散点图()格式

[英]scatterplot() formatting in car package

I want to differs the component of the scatterplot.我想区分散点图的组成部分。

  • the points
  • the regression line (in green)回归线(绿色)
  • the smoothed conditional spread (in red dashed line)平滑的条件传播(红色虚线)
  • the non-parametric regression smooth (solid line, red)非参数回归平滑(实线,红色)

The output should be like this输出应该是这样的在此处输入图片说明

But my code is:但我的代码是:

scatterplot(wt ~ mpg, data = mtcars)

and the output is like this输出是这样的在此处输入图片说明

anybody knows how to change the formatting color like the picture 1任何人都知道如何更改格式颜色,如图片 1

You should be able to specify the colors:您应该能够指定颜色:

scatterplot(wt ~ mpg, data = mtcars, col=c("green3", "red", "black"))

(These are the default colors; see ?scatterplot .) (这些是默认颜色;请参阅?scatterplot 。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM