〓 Mathematica 3 〓
■ このスレッドは過去ログ倉庫に格納されています
0438132人目の素数さん
2006/12/18(月) 02:08:37つまりこういうことかな。
f1[x_] := x^2; x1 = 1.9; offset1 = {1.2, 0}; label1 = "二次関数";
f2[x_] := x; x2 = 1.8; offset2 = {1.2, 0}; label2 = "一次関数";
f3[x_] := Sqrt[x]; x3 = 1.4; offset3 = {-1, 0.4}; label3 = "無理関数";
boxLeft = 2.2; boxTop = 4; boxHeight = 1.2; boxWidth = 1.4;
graphLabel[f_, pt_, offset_] :=
Text["y=" <> ToString[InputForm[f[x]]], {pt, f[pt]}, offset]
graphTableLabel[f_, position_, tableLabel_] :=
Text["y=" <>ToString[InputForm[f[x]]]<>" "<>tableLabel, position, {-1, 0}];
g = Plot[{f1[x], f2[x], f3[x]}, {x, 0, 2}, DisplayFunction -> Identity];
new = ReplacePart[g, Append[g[[1]], {graphLabel[f1, x1, offset1],
graphLabel[f2, x2, offset2], graphLabel[f3, x3, offset3]}], 1];
labelTable = Graphics[{Line[{{boxLeft, boxTop},{boxLeft + boxWidth, boxTop},
{boxLeft + boxWidth, boxTop - boxHeight}, {boxLeft, boxTop - boxHeight},
{boxLeft, boxTop}}],
graphTableLabel[f1, {boxLeft + 0.1, boxTop - 0.3}, label1],
graphTableLabel[f2, {boxLeft + 0.1, boxTop - 0.6}, label2],
graphTableLabel[f3, {boxLeft + 0.1, boxTop - 0.9}, label3]}];
Show[{new, labelTable}, AspectRatio->Automatic,
ImageSize->400, DisplayFunction->$DisplayFunction];
■ このスレッドは過去ログ倉庫に格納されています