MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Adding Colorfunction causing poor plot quality


I want to understand why adding a ColorFunction seems to worsen the 
resolution of my graphics.  I have two side-by-side animations, one of 
which is a complex function Psi, where the shape is the square modulus 
and the ColorFunction is Arg[Psi].

I have the following:

Clear[Psi, X, anima, dx0, dk, k0]
DynamicModule[{dk, k0, Psi, anima}, dk = .5; dx0 = 0.5/dk;

  Psi[x_, k0_, t_] :=
   1/((4 Pi^2 dk^2)^(1/4)) (
    2 E^((k0^2 t - 2 k0 x - 2 I dk^2 x^2)/(2 I - 4 dk^2 t))
      Sqrt[Pi])/Sqrt[1/dk^2 + 2 I t];

  anima[x_, k0_] :=

    GraphicsRow[{Plot[Abs[Psi[x, k0, t]]^2, {x, -20, 20},
       PlotRange -> {{-20, 20}, {0, 1.1}}, Filling -> Axis,
       ColorFunction -> (Hue[(Arg[Psi[#1, k0, t]])/(2 Pi)] &),
       ColorFunctionScaling -> False, PerformanceGoal -> "Quality",
       PlotPoints -> 10, MaxRecursion -> 3],

       Plot[Sqrt[1 + T^2/(4 dx0^4)], {T, 0, t},
        PlotStyle -> {Thick, Blue}, PlotRange -> {{0, 15}, {0, 7.5}}],
       Plot[dk T/dx0, {T, 0, 15},
        PlotStyle -> {Black, Dashed, Thick}]]}, ImageSize -> 600],

    {t, 0.0001, 15}, AnimationRunning -> False];

  Manipulate[anima[x, k0],
   Style["Wavepacket Center", Bold,
    16], {{k0, 0,
     Style["\!\(\*SubscriptBox[\"k\", \"0\"]\)", 14]}, -1.25, 1.25,
    Appearance -> "Labeled", ImageSize -> Small},
   ControlPlacement -> Left, SaveDefinitions -> True]]

The resolution on both plots isn't great. I've tried adjusting both 
PlotPoints and MaxRecursion, but it doesn't seem to improve the 
quality at all, it only makes the animation controls (Play/Pause) more 
slow to respond when clicked. I see the same problems if I change the 
ColorFunction to something simpler like "Rainbow".

However, if I remove the options ColorFunction and 
ColorFunctionScaling, the plots are not jagged, the resolution is 
great, and the animation smoother.

1. Is there another way to add a ColorFunction to such a filled plot?
2. Why should adding a colorfunction to the first element of my 
GraphicsRow (which worsens the resolution), also worsen the resolution 
of the second element of my GraphicsRow?

Thanks in advance,

  • Prev by Date: Re: The Principle "Everything is an expression"
  • Next by Date: Adding Colorfunction causing poor plot quality
  • Previous by thread: Re: Bug Report: Excessively thin Thin?
  • Next by thread: Adding Colorfunction causing poor plot quality