Group Abstract Group Abstract

Message Boards Message Boards

How to modify the code to make the function image clear?

Posted 2 years ago

How to modify the code so that the abscissa and ordinate of the original function and derivative function are adaptive in the same coordinate system so that the displayed image size is appropriate and the form of the function image can be felt as a whole

ClearAll@f;

f[x_] := Log[x]/-x^2

Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 1}, PlotLabels -> labels, PlotRange -> All, 
  ImageSize -> 700, AspectRatio -> 1, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: Lee Tao
5 Replies
Posted 2 years ago

Set to equal horizontal and vertical coordinates

ClearAll@f;

f[x_] := x Log[x]
Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 5}, PlotLabels -> labels, ImageSize -> 700, 
  AspectRatio -> Automatic, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: Lee Tao
Posted 2 years ago

enter image description here

POSTED BY: Lee Tao
Posted 2 years ago
ClearAll@f;

f[x_] := Log[x]/-x^2
Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 13}, PlotLabels -> labels, ImageSize -> 700, 
  AspectRatio -> 1, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: Lee Tao
Posted 2 years ago

The problem is that the functions depend inversely on x so they diverge as x -> 0. Try removing PlotRange -> All.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

The previous effect is like this, which obviously does not meet the requirements

enter image description here

POSTED BY: Lee Tao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard