开发者

How to use With inside a ContourPlot in mathematica?

开发者 https://www.devze.com 2022-12-08 20:10 出处:网络
I want to use something like: ContourPlot [Abs[z-1] == 2] and to define z as being = x + iy I saw somewhere an example like that with the With function, but I can\'t find it anymore and all my trie

I want to use something like:

ContourPlot [Abs[z-1] == 2]

and to define z as being = x + iy

I saw somewhere an example like that with the With function, but I can't find it anymore and all my tries ar开发者_如何学编程e not being successful.


Yes, you can. You just need to be sure to either put the With outside of the ContourPlot:

With[{z = x + I y},
   ContourPlot[Abs[z - 1] == 2, {x, -2, 2}, {y, -2, 2}]]

You can also use Evaluate:

ContourPlot[
  With[{z = x + I y}, Abs[z - 1] == 2] // Evaluate, {x, -2, 2}, {y, -2, 2}]

This is generally the case with plotting functions, which almost always evaluate their arguments in a non-standard way.

0

精彩评论

暂无评论...
验证码 换一张
取 消