Group Abstract Group Abstract

Message Boards Message Boards

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

Using function definition in plot caption?

Posted 3 years ago

Suppose I have defined f[z_]=z^2-4. Then I want to create a parametric plot for the function f (which I am able to do), that has the caption "f(z) = z²-4", i.e., I want to join the string "f(z) = " with the parsed output how the function f was defined before. How can I do that?

POSTED BY: Jakob Scholbach
2 Replies
Posted 3 years ago
POSTED BY: Rohit Namjoshi
Posted 3 years ago

Hi Jakob,

Here is one way

ClearAll@f    
f[z_] := z^2 - 4;

Plot[f[x], {x, 0, 4},
 PlotLabel -> Row[{HoldForm@TraditionalForm@f[x], " = ", TraditionalForm@f[x]}]]

enter image description here

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