[英]3d plot or contourplot of 3-tuples where x&y are NOT in a grid and NOT equally spaced in R
[英]Generating values of x,y for equally spaced x in an interval
我是R語言的新手,我想生成x,y的值以進行最低平滑度的繪制。 我想在給定函數的間隔中生成相等間隔的x值。
例如,我想生成該函數的值:
f(x) = 5x^3 - 2x^2 -2x +1
在[-5,5]的間隔內。
(請注意,我的背景是生物學,所以我不太了解技術知識!)
你的意思是這樣的
f1 <- function(x) (5*x)^3 - (2*x)^2 - 2*x + 1
seqx <- seq(-5,5, by = 0.1)
plot(seqx, f1(seqx), pch = 20)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.