How to use With inside a ContourPlot in mathematica?
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.
精彩评论