1
$\begingroup$

I have a set of functions of two variables, which are defined via a coordinate change. Now I want to visualize them on the image of the coordinates. I can do this in 3D with ParametricPlot3D:

x =   1/3 ( 
 Exp[2 Pi I #[[1]]] + Exp[2 Pi I #[[2]]] + 
  Exp[-2 Pi I (#[[1]] + #[[2]])]) &; 
y = 1/3 ( 
 Exp[- 2 Pi I #[[1]]] + Exp[-2 Pi I #[[2]]] + 
  Exp[2 Pi I (#[[1]] + #[[2]])]) &;
xr = 1/2 ( x @ {#1, #2} + y @ {#1, #2}) &;
yr = 1/(2 I ) ( x@ {#1, #2} - y @ {#1, #2}) &;
T[n_, m_] := 
1/6 ( Exp[ 2 Pi I (m #1 - n #2)] +  Exp[ 2 Pi I (-n #1 + m #2)] + 
  Exp[2 Pi I ((m + n) #1 + n #2)] + 
  Exp[ 2 Pi I (n #1 + (n + m) #2)] + 
  Exp[ 2 Pi I ((-n - m) #1 - m #2)] + 
  Exp[ 2 Pi I (-m #1 - (n + m) #2)]) &;
ParametricPlot3D[{Re[xr[u, v]], Re[yr[u, v]], Re[T[2, 0][u, v]]}, {u, 
0, 1}, {v, 0, 1}]

But I would prefer a 2D density plot. I can not use regions, as I do not want to calculate the inverse map of the coordinate change. What would be the easiest way to achieve this?

Thanks in advance!

$\endgroup$
  • $\begingroup$ You can use ColorFunction with your ParametricPlot3D to get the density plot look, and drop the z cooordinate. $\endgroup$ – Thies Heidecke Jul 21 '17 at 16:01
2
$\begingroup$

You can use the ColorFunction option to RegionPlot for this:

ParametricPlot[{Re[xr[u, v]], Re[yr[u, v]]}, {u, 0, 1}, {v, 0, 1}, 
 ColorFunction -> Function[{x, y, u, v}, Hue@Re[T[2, 0][u, v]]], 
 PlotPoints -> 30]

By using two coordinates as the arguments to RegionPlot, you get the desired deltoid area. Then the function Re@T is encoded in ColorFunction. To get a better quality display, it may be necessary to add MaxRecursion -> 4

This yields the following:

$\endgroup$
  • $\begingroup$ This one seems to be perfect. Thanks. $\endgroup$ – Bastian Seifert Jul 21 '17 at 17:52
3
$\begingroup$

Just drop the z-function:

DensityPlot[{Re[xr[u, v]], Re[yr[u, v]]}, {u, 0, 1}, {v, 0, 1}]

enter image description here

Something like this?

ParametricPlot3D[{Re[xr[u, v]], Re[yr[u, v]], Re[T[2, 0][u, v]]}, {u, 
  0, 1}, {v, 0, 1},
 ViewPoint -> {0, 0, Infinity},
 ColorFunction -> "Rainbow"]

enter image description here

$\endgroup$
  • $\begingroup$ No I want the z-values to be displayed as density in the image of the maps xr[u,v], yr[u,v] (a deltoid). So the function to be displayed is T[n,m] and the coordinates are xr, yr. $\endgroup$ – Bastian Seifert Jul 21 '17 at 15:51
  • $\begingroup$ Yes the modified answer would be fine :) I did not accept this as an answer, as the one of Jens is nicer, and I can only accept one, but yours is also good. $\endgroup$ – Bastian Seifert Jul 21 '17 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.