The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: voronoi plot with different colors
Replies: 1   Last Post: Dec 23, 2013 12:56 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 3
Registered: 12/20/13
voronoi plot with different colors
Posted: Dec 20, 2013 4:33 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I've got this:

n=5000; %No. of grains
col(:,:,1) = rand(n);
col(:,:,2) = rand(n);
col(:,:,3) = rand(n);
for i = 1:length(c)
if all(c{i}~=1)
patch(v(c{i},1),v(c{i},2),(col(i,j,:))); %use color col(i,j).

I want to generate voronoi diagram with different colors each grains. I'm not sure that this code is correct by using color col(i,j,:). I have an idea that I should use 24 bits color matrix in #RRGGBB form but I have no idea to mix it into this code.

Any idea?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.