Multicoloring a 3-D plot

2 views (last 30 days)
Duncan Luiten
Duncan Luiten on 23 Apr 2012
I'm making a 3-d plot with the plot3() command. However my plot is essentialy going to be for a chaotic double pendulum. in short, it's going to be an absolute mess. To help simplify where each curve is going, I've decided to color code the line so it starts at blue and makes it's way through the spectrum to red.
Does anyone know of a way to make a plot line continuously change color? I know there are other 3-d graphs with this option but I'm really trying to get one for plot3().
Thanks a lot.

Accepted Answer

Walter Roberson
Walter Roberson on 23 Apr 2012
plot3() cannot do it, not by itself. Each lineseries object that it generates must be a single color. You can break the series into shorter lines each of a constant color. If you want any one line segment to shade between colors, then you need to replace the lines with very thin patch() objects; I know people have posted code for that, but I've lost track of the posting.

More Answers (0)

Categories

Find more on Graphics Object Properties 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!