Message Boards Message Boards

0
|
2387 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Assigning three colors to a curve in ParametricPlot3D using PlotStyle?

Posted 2 years ago

Why does this not work?

ParametricPlot3D[{t, t, t}, {t, 0, 3},  PlotStyle -> {If[1 <= t <= 2, Red, Green]}]
POSTED BY: Mariano Gonzalez
2 Replies

Hi Rohit Thank you for your help.

POSTED BY: Mariano Gonzalez
Posted 2 years ago

Hi Mariano,

You need to use a ColorFunction to do that. e.g.

ParametricPlot3D[{t, t, t}, {t, 0, 3}, 
 ColorFunction -> Function[{x, y, z, u}, If[Between[x, {1, 2}], Red, Green]],
 ColorFunctionScaling -> False]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract