I need to Blend 4 colors into one plot using for loops and nested for loops, how do i go about doing this?

I need to graph a picture of pink in the bottom left, blue in the bottom right, yellow top left and green top right, how do I make it so that these colors show, and blend together, so in the middle, the color should be between yellow green blue and pink and top middle is between blue and green? Any help will be appreciated, thanks.

1 Comment

Using for loops seems like a difficult way to do this. You could use the "patch" function, and specify different colors at each vertex like this example:
Specifiying a different color at each vertex causes MATLAB to interpolate between the colors. The above example does a good job of explaining the process.

Sign in to comment.

Answers (0)

Categories

Find more on Debugging and Improving Code in Help Center and File Exchange

Asked:

on 8 Oct 2017

Commented:

on 10 Oct 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!