# Visualizing the amplitude and phase of a one-dimensional wave function [closed]

I want to replicate a plot I found on wikipedia:

https://en.wikipedia.org/wiki/File:QHO-coherentstate3-animation-color.gif

Which is a visualization of a function from the real numbers to the complex numbers. I started just trying to plot the absolute value of the function and then color it by its argument using Plot and ColorFunction by I couldn't quite figure out how ColorFunction works. Any help doing that, and then maybe going forward in replicating the whole thing by filling the area under the curve with the color of each point?

## closed as off-topic by m_goldberg, anderstood, MarcoB, Coolwater, José Antonio Díaz NavasFeb 13 '18 at 12:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – m_goldberg, anderstood, MarcoB, Coolwater, José Antonio Díaz Navas
If this question can be reworded to fit the rules in the help center, please edit the question.

• What article in Wikipedia does the animation you link to come from? I don't think the animation alone provides sufficient information to answer your question. – m_goldberg Feb 12 '18 at 23:28

Animate[

• Yes... that is right. You can define the color other ways too (e.g., by the function output): Function[{y}, Hue[y/10]. Or by mixtures of variables, Function[{x,y}, Hue[(x+y)/20]]. – David G. Stork Feb 13 '18 at 0:58
• @DavidG.Stork Function[{y}, Hue[y/10] is the same as Function[x, Hue[x/10], you need Function[{x, y}, Hue[y/10]. – Kuba Feb 13 '18 at 6:45