Wolfram mathematica 在Mathematica中,如何使插值与ListLinePlot?;

Wolfram mathematica 在Mathematica中,如何使插值与ListLinePlot?;,wolfram-mathematica,interpolation,Wolfram Mathematica,Interpolation,首先,我从 ListPlot用于插值的方法是将每个坐标作为列表索引的函数进行插值。我认为ListLinePlot可以决定应该采用哪种插值顺序。 如果我将InterpolationOrder->3更改为InterpolationOrder->1,我的数据的插入更像ListLinePlot的绘图。 以下是数据和代码: mypoint = {{1.3336020610508064`, 0.05630827677109675`}, {1.5103543939292194`, 0.0579055028

首先,我从 ListPlot用于插值的方法是将每个坐标作为列表索引的函数进行插值。我认为ListLinePlot可以决定应该采用哪种插值顺序。 如果我将InterpolationOrder->3更改为InterpolationOrder->1,我的数据的插入更像ListLinePlot的绘图。 以下是数据和代码:

mypoint = {{1.3336020610508064`, 
0.05630827677109675`}, {1.5103543939292194`, 
0.05790550283922009`}, {1.6927497417380886`, 
0.07151008153610137`}, {1.840047310044461`, 
0.11741226450605104`}, {1.9209270855795286`, 
0.2726755425789721`}, {1.953407919235778`, 
2.0759615023390294`}, {1.9550995254889463`, 0.7164793699550908`}};
interpcut[r_, x_] := Module[{s}, s = SortBy[r, First];
Piecewise[{{0, x < First[s][[1]]}, {0, 
 x > Last[s][[1]]}, {Interpolation[r, InterpolationOrder -> 3][x],
  True}}]];
Interpolation1[x_] := interpcut[mypoint, x];
ListPlot[mypoint, PlotStyle -> Orange]
ListLinePlot[mypoint, PlotStyle -> Orange]
Plot[Interpolation1[x], {x, 1.3, 2}, PlotRange -> All, 
 PlotStyle -> Orange]
那么,有没有什么方法可以像ListLinePlot那样插入数据并绘制它呢?或者有没有办法让我的插值更“聪明”,这样它也可以决定插值顺序本身? 以下是数据和代码:

mypoint = {{1.3336020610508064`, 
0.05630827677109675`}, {1.5103543939292194`, 
0.05790550283922009`}, {1.6927497417380886`, 
0.07151008153610137`}, {1.840047310044461`, 
0.11741226450605104`}, {1.9209270855795286`, 
0.2726755425789721`}, {1.953407919235778`, 
2.0759615023390294`}, {1.9550995254889463`, 0.7164793699550908`}};
interpcut[r_, x_] := Module[{s}, s = SortBy[r, First];
Piecewise[{{0, x < First[s][[1]]}, {0, 
 x > Last[s][[1]]}, {Interpolation[r, InterpolationOrder -> 3][x],
  True}}]];
Interpolation1[x_] := interpcut[mypoint, x];
ListPlot[mypoint, PlotStyle -> Orange]
ListLinePlot[mypoint, PlotStyle -> Orange]
Plot[Interpolation1[x], {x, 1.3, 2}, PlotRange -> All, 
 PlotStyle -> Orange]
mypoint={{{1.3336020610508064`,
0.05630827677109675`}, {1.5103543939292194`, 
0.05790550283922009`}, {1.6927497417380886`, 
0.07151008153610137`}, {1.840047310044461`, 
0.11741226450605104`}, {1.9209270855795286`, 
0.2726755425789721`}, {1.953407919235778`, 
2.0759615023390294`}, {1.9550995254889463`, 0.7164793699550908`}};
intercut[r,x]:=Module[{s},s=SortBy[r,First];
分段[{0,xLast[s][[1]},{Interpolation[r,Interpolation-order->3][x],
真}}]];
插值1[x_z]:=interpcut[mypoint,x];
ListPlot[mypoint,PlotStyle->Orange]
ListLinePlot[mypoint,PlotStyle->Orange]
Plot[Interpolation1[x],{x,1.3,2},PlotRange->All,
打印样式->橙色]
谢谢, Jzm

关于@agentp问题:

mypoint1 = {{1.3336020610508064`, 
0.05630827677109675`}, {1.5103543939292194`, 
0.05790550283922009`}, {1.6927497417380886`, 
0.07151008153610137`}, {1.840047310044461`, 
0.11741226450605104`}, {1.9209270855795286`, 
0.2726755425789721`}, {1.953407919235778`, 
2.0759615023390294`}, {1.9550995254889463`, 0.7164793699550908`}};
interpcut[r_, x_] := Module[{s},(*sort array by x coord*)s = SortBy[r, First];
Piecewise[{{0, x < First[s][[1]] + 0.002}, {0, 
 x > Last[s][[1]] - 0.002}, {Interpolation[r][x], True}}]];
Group1point = ListPlot[mypoint1, PlotStyle -> Red];
Group1Interpolation[x_] := interpcut[mypoint1, x];
Group1line = Plot[Group1Interpolation[x], {x, 1.3, 2}, PlotRange -> All, PlotStyle -> Red];
Show[{Group1point, Group1line}, Frame -> True, ImageSize -> 500]
mypoint1={{1.3336020610508064`,
0.05630827677109675`}, {1.5103543939292194`, 
0.05790550283922009`}, {1.6927497417380886`, 
0.07151008153610137`}, {1.840047310044461`, 
0.11741226450605104`}, {1.9209270855795286`, 
0.2726755425789721`}, {1.953407919235778`, 
2.0759615023390294`}, {1.9550995254889463`, 0.7164793699550908`}};
intercut[r,x]:=Module[{s},(*sort array by x coord*)s=SortBy[r,First];
分段[{0,xLast[s][[1]]-0.002},{Interpolation[r][x],True}];
Group1point=ListPlot[mypoint1,PlotStyle->Red];
Group1Interpolation[x_]:=intercut[mypoint1,x];
Group1line=Plot[Group1Interpolation[x],{x,1.3,2},PlotRange->All,PlotStyle->Red];
显示[{Group1point,Group1line},帧->真,图像大小->500]

ListLinePlot
的默认插值顺序是1,如果设置
InterpolationOrder->1
,则得到完全相同的绘图。(好像你知道,你在问什么?)我认为ListLinePlot可以自动更改插值。我相信agentp是正确的,在
ListLinePlot
中没有关于
插值顺序的自动逻辑。我在你引用的答案中使用了值3,因为这是问题所要求的。文档实际上说默认值为“无”。如果有一个例子,它不是简单地在两个点之间画一条直线,我们会感兴趣地看到。应该在