0
選擇性地工作,我有(如圖吹塑)繪製在曲線線的字。我不知道我怎麼會text()
內有srt
有條件地這樣操作:控制在文本「SRT」()來作爲R
SRT =用於繪製的字,其x值比「-2」 SRT = -45,比「+2」較大較小,srt =「45」,否則srt =「0」?
我的R代碼在圖片下方。
這裏是我的R代碼裏面:
curve(dnorm(x), -4, 4, bty = 'n', yaxt = 'n')
x.on.curve = seq(-4, 4, len = 21)
y.on.curve = dnorm(x.on.curve)
text(x.on.curve, y.on.curve, "Data", col = 'green', font = 2, pos = 3, xpd = T)
## This is where I want "srt" to work