我想绘制一个U-Pb等时线,它基本上是一个xy图,每个数据点周围有一个错误省略号以指示该数据点的精度。下面是我想要实现的,唯一的区别是,我有更多的数据点的例子:在R中绘制错误省略号
我有对称的+和 - 在X和Y空间中的每个数据点错误我想用它来指示错误椭圆的形状。
以下是我到目前为止编写的代码。这绘制了我的数据,但不是错误省略号,我目前有错误条。
# Select data file.
fname<-file.choose()
# Rename imported data file.
upbiso <- read.table(file=fname, header= TRUE)
# Attaches data file as default data source.
attach(upbiso)
# Reads and display column headers in console.
names(upbiso)
# Sets margins around plot.
par(mar=c(5,5,4,2))
# Plots 238U/206Pb vs 207Pb/206Pb with superscript notation for isotopic masses, xlim and ylim sets min and max limit for axes, las rotates y axis labels, cex.lab increases the size of the axis labels.
plot(UPb, PbPb, xlab = expression({}^238*"U/"*{}^206*"Pb"), ylab = expression({}^207*"Pb/"*{}^206*"Pb"), xlim = c(0,2500),ylim = c(0, 1), las=1, cex.lab = 1.5)
# Opens Oceanographic package to run errorbars function and runs 1 sigma percent error bars for x-y co-ordinates.
library(oce)
errorbars(UPb,PbPb,UPbErrP,PbPbErrP, percent=T)
我该如何去取代带有错误省略号的错误条?
这里是一个Google文档链接到我的数据是.txt格式。
https://docs.google.com/file/d/0B75P9iT4wwlTNUpQand2WVRWV2s/edit?usp=sharing
列是UPb
,UPbErrP
(上UPB误差在1西格玛%),UPbErrAbs
(上UPB绝对误差),然后将用于PbPb
数据再次相同。
如果你需要我澄清任何事情只是让我知道,我会尽我所能
嗨克里斯,欢迎SO。您发布问题的格式只需要代表其他人的时间和精力即可*将您的数据存入*。相反,请专注于重现您的问题的小型重复性示例。将'dput(head(mydata))'的输出作为代码块粘贴会有所帮助。见[这篇文章](http://stackoverflow.com/q/5963269/1478381)如何使一个伟大的可重复的例子... – 2013-03-14 14:03:38
嗨西蒙,感谢有关礼仪的领导。正如你可以告诉我对R和stackoverflow是全新的,所以我试图尽我所能解释我自己并给出例子和数据集。我会记住dput命令和您为未来发布的链接! – cjms85 2013-03-14 14:31:07
没问题。看看这个答案有多快 - 一个格式正确的问题无法解决。欢迎来到SO的喜悦! – 2013-03-14 14:33:53