How to change complex dot color cyclically using a colormap?
1 view (last 30 days)
Show older comments
See the plot below. I want to plot each complex point on the cycle with a unique color. How do I do this?
I thought that the coloring would be possible to do if one calculates how many points there are in each cycle and then assign a color from the jet colormap for them. I just don't know how to combine this info in a script. These are the tools I have thought about using:
skip=floor(theta/(2*pi));%find the number of full turns that are skipped. This could be used to find the limits for each cycle and therefore to calculate the amount of points in the cycle and for assigning different colors for each points on the cycle in question according to their values. I think the calculation of the points in each cycle would require some if-lines that I don't know... The command is something like "Calculate all skip values for all thetas in order of their increasing value. If skip changes, calculate the amount of skip-1 values, define individual colors from the colormap for each of the values, and continue onwards until the end of theta sequence."
me=mod(theta,2*pi); %could be used to assign the coloring order of the points in the cycle i.e. and therefore assign the color value as a function of their value. Maybe unnecessary as the if-part above could also assign the value order in each cycle.
theta = linspace(0,1,500); x = exp(theta).*sin(100*theta); y = exp(theta).*cos(100*theta); figure; plot(real(e),imag(e),'k.')
0 Comments
Answers (0)
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!