Message Boards Message Boards

1 Reply
0 Total Likes
View groups...
Share this post:

Is this something about DensityPlot[]?

Posted 9 years ago

Hello Group:

This works: (* directly from the help page *)

DensityPlot[Arg[Sqrt[x + I y]], {x, -3, 3}, {y, -3, 3} ]

I want to define the inner function myself with:

f[a_, b_] := a + I b

(* this forum software is removing the underscore in the functions definition ?!?!?..should be f[Placeholder[a], Placeholder[b]]:=a+ I b *)

But then this does not work:

DensityPlot[Arg[Sqrt[f]], {x, -3, 3}, {y, -3, 3} ]

Neither does any of these:

DensityPlot[Evaluate[Arg[Sqrt[f]]], {x, -3, 3}, {y, -3, 3} ]

DensityPlot[Arg[Sqrt[f]], {a, -3, 3}, {b, -3, 3} ]

DensityPlot[Evaluate[Arg[Sqrt[(#1 + I #2) &]]], {x, -3, 3}, {y, -3, 3}]

I have been confused in the past to know when Evaluate[] was needed. It usually fixes these wierd cases.

Thanks in advance.

POSTED BY: Aeyoss Antelope

You need to give arguments to your function f, otherwise evaluation of f fails as you noted

    f[a_,b_]:= a + I b

    DensityPlot[Arg[Sqrt[f[x,y]]], {x, -3, 3}, {y, -3, 3} ]

B.t.w. this forum software has a help post about post's formatting READ FIRST: How to post and use Wolfram Community and the link appears prominently near the top of the page.

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract