ParametricPlot – Problem with ColorFunction

I am unhappy with the following mapping:

ParametricPlot[{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (ColorData[“DarkRainbow”][#3] &),
ImagePadding -> 20,
ImageSize -> 400,
PlotPoints -> 30]

because of the distinct coloring of its left and right part.
I found a certain fix with this:

ParametricPlot[{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (Blend[{Red, Green, Yellow, Blue, LightBlue, Blue,
Yellow, Green, Red}, #3] &),
ImagePadding -> 20,
ImageSize -> 400,
PlotPoints -> 30]

But I really would prefer to use one of the inbuilt gradients to
color my figure according to its polygon size or “mesh density”.

Thanks in advance for your suggestions.

=================

  

 

Something like (Hue[#3] &)?
– R. M.♦
Jul 11 ’14 at 16:04

1

 

ColorFunction -> (ColorData[“DarkRainbow”][Abs[2 #3 – 1]] &)
– Rahul
Jul 11 ’14 at 22:12

  

 

Mr. Coward: I don’t particularly care, but could you give a reason for downvoting my question?
– eldo
Jul 11 ’14 at 22:22

  

 

If you don’t care then why call them a coward and ask for a reason?
– Rahul
Jul 11 ’14 at 22:26

  

 

@RahulNarain – Maybe I’m naive – but what is “witch-hunting for downvoters” ? I spent an hour to find a solution myself (to no avail), and received excellent answers so far.
– eldo
Jul 11 ’14 at 22:47

=================

2 Answers
2

=================

You could do

ParametricPlot[
{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (ColorData[“DarkRainbow”][If[#3 < .5, 1 - #3, #3]] &), ImagePadding -> 20,
ImageSize -> 400, PlotPoints -> 30]

  

 

“small fishes” – but somehow I wasn’t able to catch them 🙂
– eldo
Jul 11 ’14 at 23:00

ParametricPlot[
{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (ColorData[“TemperatureMap”][Abs[2 #3/Pi]] &),
ColorFunctionScaling -> False,
ImagePadding -> 20,
ImageSize -> 400,
PlotPoints -> 30,
Mesh -> Automatic]

ParametricPlot[
{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (ColorData[“TemperatureMap”][1 – Abs[2 #4/Pi]] &),
ColorFunctionScaling -> False,
ImagePadding -> 20,
ImageSize -> 400,
PlotPoints -> 30,
Mesh -> Automatic]

ParametricPlot[
{Re@Sin[u + I v], Im@Sin[u + I v]},
{u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2},
ColorFunction -> (ColorData[“TemperatureMap”][
1 – ((1 – Abs[2 #3/Pi])^2 + Abs[2 #4/Pi]^2)] &),
ColorFunctionScaling -> False,
ImagePadding -> 20,
ImageSize -> 400,
PlotPoints -> 30,
Mesh -> Automatic]