MMA作图遇到困难 RT
mathematica吧
全部回复
仅看楼主
level 4
N瓶老白干 楼主
如何用MMA实现如matlab中的这种局部放大图呢 ,除了用绘图工具,可以用代码实现吗
2023年03月30日 14点03分 1
level 9
一个例子
f[x_] = Sum[Sin[3^n x]/2^n, {n, 0, 20}];
x1 = x /. FindRoot[f[x] == -1, {x, -2.1}];
x2 = x /. FindRoot[f[x] == -1, {x, -1.1, -1}];
g = Plot[f[x], {x, x1, x2}, AspectRatio -> Automatic, Axes -> False,
Frame -> True, FrameTicks -> None];
{y1, y2} = Last[PlotRange /. FullOptions[g]];
Plot[Sum[Sin[3^n x]/2^n, {n, 0, 20}], {x, -Pi, Pi},
Epilog -> {Line[{{{x2, y2 + 0.1}, {-0.5, 0.5}}, {{x1,
y2 + 0.1}, {-3.5, 0.5}}, {{x1, y1}, {x2, y1}, {x2,
y2 + 0.1}, {x1, y2 + 0.1}, {x1, y1}}}],
Inset[g, {-0.5, 0.5}, {Right, Bottom}, 3]},
PlotRange -> {{-4, 4}, {-3, 3}}, AspectRatio -> Automatic]
2023年03月31日 03点03分 2
蟹蟹 我去研究研究[吐舌]
2023年03月31日 12点03分
吧务
level 15
基础思路就如2楼所说,另参
《Find inset bounding box in plot coordinates》
mathematica.stackexchange.com/q/140090/1871
《Magnifying Glass on a Plot》
mathematica.stackexchange.com/q/100691/1871
2023年04月01日 02点04分 3
好的好的 谢谢[哈哈]
2023年05月02日 07点05分
1