diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index f89dda6b1..7ac45e6b3 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -18,6 +18,7 @@ from mathics.core.attributes import A_HOLD_ALL, A_PROTECTED from mathics.core.builtin import Builtin from mathics.core.convert.expression import to_mathics_list +from mathics.core.definitions import Definitions from mathics.core.evaluation import Evaluation from mathics.core.systemsymbols import Symbol, SymbolPlotRange, SymbolSequence @@ -143,9 +144,10 @@ def eval( class ComplexPlot3D(_Plot3D): """ + :Domain coloring:https://en.wikipedia.org/wiki/Domain_coloring :WMA link: https://reference.wolfram.com/language/ref/ComplexPlot3D.html
-
'Plot3D'[$f$, {$z$, $z_{min}$, $z_{max}$}] +
'ComplexPlot3D'[$f$, {$z$, $z_{min}$, $z_{max}$}]
creates a three-dimensional plot of the magnitude of $f$ with $z$ ranging from $z_{min}$ to \ $z_{max}$ with surface colored according to phase @@ -154,6 +156,14 @@ class ComplexPlot3D(_Plot3D): for a list of Plot options.
+ 'ComplexPlot' allows to visualize the changes both in the phase and \ + the module of a complex function: + + In the neighbourhood of the poles, the module of a rational function \ + grows without limit, and the phase varies between $-\\Pi$ to $\\Pi$ + an integer number of times: + >> ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I}] + = ... """ summary_text = "plots one or more complex functions as a 3D surface" @@ -166,9 +176,10 @@ class ComplexPlot3D(_Plot3D): class ComplexPlot(_Plot3D): """ + :Domain coloring:https://en.wikipedia.org/wiki/Domain_coloring :WMA link: https://reference.wolfram.com/language/ref/ComplexPlot.html
-
'Plot3D'[$f$, {$z$, $z_{min}$, $z_{max}$}] +
'ComplexPlot'[$f$, {$z$, $z_{min}$, $z_{max}$}]
creates two-dimensional plot of $f$ with $z$ ranging from $z_{min}$ to \ $z_{max}$ colored according to phase @@ -177,6 +188,12 @@ class ComplexPlot(_Plot3D): for a list of Plot options.
+ 'ComplexPlot' allows to visualize the changes in the phase of a \ + complex function. + In the neighbourhood of the poles, the module of a rational function \ + the phase varies between $-\\Pi$ to $\\Pi$ an integer number of times. + >> ComplexPlot[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I}] + = ... """ summary_text = "plots a complex function showing phase using colors" @@ -189,6 +206,8 @@ class ComplexPlot(_Plot3D): class ContourPlot(_Plot3D): """ + :heat map:https://en.wikipedia.org/wiki/Heat_map + :contour map:https://en.wikipedia.org/wiki/Contour_line :WMA link: https://reference.wolfram.com/language/ref/ContourPlot.html
'Contour'[$f$, {$x$, $x_{min}$, $x_{max}$}, {$y$, $y_{min}$, $y_{max}$}] @@ -200,6 +219,19 @@ class ContourPlot(_Plot3D): for a list of Plot options.
+ Colorize the regions where a function takes values close to different \ + integer values + >> ContourPlot[x - y^3, {x, -2, 2}, {y, -1, 1}, AspectRatio->Automatic] + = ... + + The same, but with a finer division: + >> ContourPlot[x^2 - y^2, {x, -2, 2}, {y, -1, 1}, Contours->10] + = ... + + Plot curves where the real and the imaginary part of a function take + specific values: + >> ContourPlot[{Re[Sin[x + I y]] == 5, Im[Sin[x + I y]] == 0}, {x, -10, 10}, {y, -10, 10}] + = ... """ requires = ["skimage"]