Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Plotting points on a graph.

Posted 12 years ago
POSTED BY: Kim Helliwell
2 Replies
Posted 12 years ago

Can you find reasonable examples that still break this and you can't see a way to patch it?

In[1]:= f[x_] := x Exp[-3 x];
p1 = Plot[f[x], {x, 0, 1}];
v = x /. {ToRules[Reduce[D[f[x], x] == 0, x]], ToRules[Reduce[D[f[x], {x, 2}] == 0, x]]};
If[VectorQ[v], p2 = Graphics[{{PointSize[Large], Map[Point[{#, f[#]}] &, v]}}]; Show[p1, p2], Show[p1]]

Out[4]= ...PlotSnipped...

In[5]:= f[x_] := (x - 3) (x - 2) (x - 1);
p1 = Plot[f[x], {x, 0, 4}];
v = x /. {ToRules[Reduce[D[f[x], x] == 0, x]], ToRules[Reduce[D[f[x], {x, 2}] == 0, x]]};
If[VectorQ[v], p2 = Graphics[{{PointSize[Large], Map[Point[{#, f[#]}] &, v]}}]; Show[p1, p2], Show[p1]]

Out[8]= ...PlotSnipped...

In[9]:= f[x_] := Exp[x];
p1 = Plot[f[x], {x, 0, 1}];
v = x /. {ToRules[Reduce[D[f[x], x] == 0, x]], ToRules[Reduce[D[f[x], {x, 2}] == 0, x]]};
If[VectorQ[v], p2 = Graphics[{{PointSize[Large], Map[Point[{#, f[#]}] &, v]}}]; Show[p1, p2], Show[p1]]

Out[12]= ...PlotSnipped...

If everything seems to work then can you package it into your function without it somehow breaking?

POSTED BY: Bill Simpson
Posted 12 years ago

Thanks, Bill. This probably gives me what I need.

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