识别曲线中的点 [英] Identifying points in a curve

查看:81
本文介绍了识别曲线中的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得这是一个简单的问题...

I feel like this is an easy question...

如何识别图形中的坐标?我绘制了一些数据,使用unireg(uniReg程序包)绘制样条曲线,并希望从某个点提取数据.

How do you identify coordinates in a figure? I plotted some data, used unireg (the uniReg package) to make a spline curve, and want to pull out the data from a point.

library(uniReg)
P0mM <- read.table(text="
Time           FeuM
0.04    138.8181818
   7    1258.636364
  14    1320.545455
  21     2110.37037
  28    13730.37037
  35    1550.909091",header=TRUE)

z=seq(min(P0mM$Time),max(P0mM$Time),length=201)
uf=with(P0mM,unireg(Time,FeuM,g=5,sigma=1))
plot(FeuM~Time,P0mM,ylim=c(0,16000),ylab="Fe2+ uM", xlab="Time", main="0mM P")
lines(z,uf$unimod.func(z))

我能够找到曲线的y最大值(14444)

I was able to find the max y value of the curve (which is 14444)

max((uf$unimod.func(z)))

我想确定这在x轴上发生的位置. (应该是30岁左右,但我想确切地说).

I want to identify where on the x axis this happens. (Should be around 30, but I want to be exact).

您如何做到的?

谢谢!

推荐答案

似乎类似于optimiseoptimize的情况(取决于您与英国或美​​国英语的相似程度):

Seems like a case for optimise or optimize (depending on your affinity with British or American English):

optimise(uf$unimod.func, maximum=TRUE, interval=range(P0mM$Time))
#$maximum
#[1] 29.27168
#
#$objective
#         [,1]
#[1,] 14444.85

这篇关于识别曲线中的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆