How to plot a normal distribution by labeling specific parts of the x-axis?

后端 未结 7 1852
轻奢々
轻奢々 2020-12-03 00:01

I am using the following code to create a standard normal distribution in R:

x <- seq(-4, 4, length=200)
y <- dnorm(x, mean=0, sd=1)
plot(x, y, type=\"         


        
7条回答
  •  -上瘾入骨i
    2020-12-03 00:28

    In general case, for example: Normal(2, 1)

    f <- function(x) dnorm(x, 2, 1)
    plot(f, -1, 5)
    

    This is a very general, f can be defined freely, with any given parameters, for example:

    f <- function(x) dbeta(x, 0.1, 0.1)
    plot(f, 0, 1)
    

提交回复
热议问题