Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Here is another method based on RegionPlot[], similar to rm's solution. There are a few wrinkles in this version, however:

  1. I use PolarPlot[] to generate the ticks for me. (I know about the hidden functions behind the generation of the polar ticks, but I couldn't figure how to use them directly.)

  2. I use the saturation and brightness arguments of Hue[] to generate the meshes as part of the color function. The idea was stolen adapted from the solutions of Heike and Simon in this answerthis answer, but I did change a few things around.

Now, on to the routine:

hueWithMesh[x_, y_, hx_: 1/10, hr_: 1/8, ht_: 1/24, r1_: 2/5, r2_: 1/2, g_: 1/5] := Block[{ph = Arg[x + I y]/π, s, b}, s = r1 + (1 - r1) Abs[(Mod[2 Abs[x + I y]/hr, 2, 1] - 2) (Mod[ph/ht, 2, 1] - 2)]^g; b = r2 + (1 - r2) Abs[(Mod[2 x/hx, 2, 1] - 2) (Mod[2 y/hx, 2, 1] - 2)]^g; Hue[ph/2 - 1/12, s, Max[1 - s^2, b]]] Show[PolarPlot[1/Sqrt[2], {t, -π, π}, MaxRecursion -> 0, PlotPoints -> 6, PlotRange -> 1, PlotStyle -> None, PolarAxes -> Automatic], RegionPlot[Abs[x + I y] <= 1, {x, -1, 1}, {y, -1, 1}, BoundaryStyle -> None, ColorFunction -> (hueWithMesh[#1, #2] &), ColorFunctionScaling -> False, Frame -> False, PlotPoints -> 200], PlotRange -> All] 

a gridded color wheel

As you might notice from the implementation of hueWithMesh[], the parameters hr, ht, and hx all control the spacing in the rectangular and polar meshes, while r1, r2, and g all control the saturation/brightness for the meshes. You can tweak these parameters to your taste.

Here is another method based on RegionPlot[], similar to rm's solution. There are a few wrinkles in this version, however:

  1. I use PolarPlot[] to generate the ticks for me. (I know about the hidden functions behind the generation of the polar ticks, but I couldn't figure how to use them directly.)

  2. I use the saturation and brightness arguments of Hue[] to generate the meshes as part of the color function. The idea was stolen adapted from the solutions of Heike and Simon in this answer, but I did change a few things around.

Now, on to the routine:

hueWithMesh[x_, y_, hx_: 1/10, hr_: 1/8, ht_: 1/24, r1_: 2/5, r2_: 1/2, g_: 1/5] := Block[{ph = Arg[x + I y]/π, s, b}, s = r1 + (1 - r1) Abs[(Mod[2 Abs[x + I y]/hr, 2, 1] - 2) (Mod[ph/ht, 2, 1] - 2)]^g; b = r2 + (1 - r2) Abs[(Mod[2 x/hx, 2, 1] - 2) (Mod[2 y/hx, 2, 1] - 2)]^g; Hue[ph/2 - 1/12, s, Max[1 - s^2, b]]] Show[PolarPlot[1/Sqrt[2], {t, -π, π}, MaxRecursion -> 0, PlotPoints -> 6, PlotRange -> 1, PlotStyle -> None, PolarAxes -> Automatic], RegionPlot[Abs[x + I y] <= 1, {x, -1, 1}, {y, -1, 1}, BoundaryStyle -> None, ColorFunction -> (hueWithMesh[#1, #2] &), ColorFunctionScaling -> False, Frame -> False, PlotPoints -> 200], PlotRange -> All] 

a gridded color wheel

As you might notice from the implementation of hueWithMesh[], the parameters hr, ht, and hx all control the spacing in the rectangular and polar meshes, while r1, r2, and g all control the saturation/brightness for the meshes. You can tweak these parameters to your taste.

Here is another method based on RegionPlot[], similar to rm's solution. There are a few wrinkles in this version, however:

  1. I use PolarPlot[] to generate the ticks for me. (I know about the hidden functions behind the generation of the polar ticks, but I couldn't figure how to use them directly.)

  2. I use the saturation and brightness arguments of Hue[] to generate the meshes as part of the color function. The idea was stolen adapted from the solutions of Heike and Simon in this answer, but I did change a few things around.

Now, on to the routine:

hueWithMesh[x_, y_, hx_: 1/10, hr_: 1/8, ht_: 1/24, r1_: 2/5, r2_: 1/2, g_: 1/5] := Block[{ph = Arg[x + I y]/π, s, b}, s = r1 + (1 - r1) Abs[(Mod[2 Abs[x + I y]/hr, 2, 1] - 2) (Mod[ph/ht, 2, 1] - 2)]^g; b = r2 + (1 - r2) Abs[(Mod[2 x/hx, 2, 1] - 2) (Mod[2 y/hx, 2, 1] - 2)]^g; Hue[ph/2 - 1/12, s, Max[1 - s^2, b]]] Show[PolarPlot[1/Sqrt[2], {t, -π, π}, MaxRecursion -> 0, PlotPoints -> 6, PlotRange -> 1, PlotStyle -> None, PolarAxes -> Automatic], RegionPlot[Abs[x + I y] <= 1, {x, -1, 1}, {y, -1, 1}, BoundaryStyle -> None, ColorFunction -> (hueWithMesh[#1, #2] &), ColorFunctionScaling -> False, Frame -> False, PlotPoints -> 200], PlotRange -> All] 

a gridded color wheel

As you might notice from the implementation of hueWithMesh[], the parameters hr, ht, and hx all control the spacing in the rectangular and polar meshes, while r1, r2, and g all control the saturation/brightness for the meshes. You can tweak these parameters to your taste.

Source Link

Here is another method based on RegionPlot[], similar to rm's solution. There are a few wrinkles in this version, however:

  1. I use PolarPlot[] to generate the ticks for me. (I know about the hidden functions behind the generation of the polar ticks, but I couldn't figure how to use them directly.)

  2. I use the saturation and brightness arguments of Hue[] to generate the meshes as part of the color function. The idea was stolen adapted from the solutions of Heike and Simon in this answer, but I did change a few things around.

Now, on to the routine:

hueWithMesh[x_, y_, hx_: 1/10, hr_: 1/8, ht_: 1/24, r1_: 2/5, r2_: 1/2, g_: 1/5] := Block[{ph = Arg[x + I y]/π, s, b}, s = r1 + (1 - r1) Abs[(Mod[2 Abs[x + I y]/hr, 2, 1] - 2) (Mod[ph/ht, 2, 1] - 2)]^g; b = r2 + (1 - r2) Abs[(Mod[2 x/hx, 2, 1] - 2) (Mod[2 y/hx, 2, 1] - 2)]^g; Hue[ph/2 - 1/12, s, Max[1 - s^2, b]]] Show[PolarPlot[1/Sqrt[2], {t, -π, π}, MaxRecursion -> 0, PlotPoints -> 6, PlotRange -> 1, PlotStyle -> None, PolarAxes -> Automatic], RegionPlot[Abs[x + I y] <= 1, {x, -1, 1}, {y, -1, 1}, BoundaryStyle -> None, ColorFunction -> (hueWithMesh[#1, #2] &), ColorFunctionScaling -> False, Frame -> False, PlotPoints -> 200], PlotRange -> All] 

a gridded color wheel

As you might notice from the implementation of hueWithMesh[], the parameters hr, ht, and hx all control the spacing in the rectangular and polar meshes, while r1, r2, and g all control the saturation/brightness for the meshes. You can tweak these parameters to your taste.