デモンストレーション付きのノートブックを作成したいと思います。
SlopeInterceptDemonstration[{mmin_, mmax_}, {bmin_, bmax_}] :=
Module[{xmax, xmin},
xmax = Max[Abs[bmin + mmin], Abs[bmax + mmax]]*1.2;
xmin = - xmax;
Manipulate[
Plot[m*x + b, {x, xmin, xmax}, AspectRatio -> 1, PlotRange -> {xmin, xmax}],
{{m, mmin, "m"}, mmin, mmax, 0.1}, {{b, bmin, "b"}, bmin, bmax, 0.1}]
];
単純な呼び出し ( SlopeInterceptDemonstration[{-2, 2}, {-5, 5}] ) を評価してノートブックを保存し、新しいカーネルで再度開いた場合、xmin と xmax がわからないため、デモは表示されません。
Plot 内でこれらの変数の評価を強制する方法はありますか?