mathematica直线拟合时如何将散点图与直线都显示出来
data1={{0.13,5.05},{0.14,6.03},{0.15,7.01},{0.15,8.03},{0.16,9.04},{0.17,10.03},{0.18...
data1 = {{0.13, 5.05}, {0.14, 6.03}, {0.15, 7.01}, {0.15, 8.03}, {0.16, 9.04}, {0.17, 10.03}, {0.18, 11.02}, {0.19, 12.00}} fun1 = Fit[data1, {1, x}, x] f = Plot[fun1, {x, 5.05, 12.00}] g = ListPlot[data1] Show[f, g] 这样不能画到一张图上。。求解!!
展开
2个回答
展开全部
范围!范围!请问 10的100次方加上10的100次方分之一等于多少?想过计算机如何处理这个问题吗?
你的问题这样做就可以了,注意我的和你的在哪个地方有不同呢?
data1 = {{0.13, 5.05}, {0.14, 6.03}, {0.15, 7.01}, {0.15,
8.03}, {0.16, 9.04}, {0.17, 10.03}, {0.18, 11.02}, {0.19, 12.00}};
{min, max} = {Min[#[[1]] & /@ data1], Max[#[[1]] & /@ data1]}
f = Plot[fun1, {x, min, max}];
g = ListPlot[data1, PlotStyle -> {Red}];
Show[{f, g}]
你的问题这样做就可以了,注意我的和你的在哪个地方有不同呢?
data1 = {{0.13, 5.05}, {0.14, 6.03}, {0.15, 7.01}, {0.15,
8.03}, {0.16, 9.04}, {0.17, 10.03}, {0.18, 11.02}, {0.19, 12.00}};
{min, max} = {Min[#[[1]] & /@ data1], Max[#[[1]] & /@ data1]}
f = Plot[fun1, {x, min, max}];
g = ListPlot[data1, PlotStyle -> {Red}];
Show[{f, g}]
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询