how to change brightness when using pcolor

Hi,
I´m trying to visualize newton fractals with Matlab. For that I´ve created two matrices A and B where A contains the number of the zero and the other the number of iterations. Then I used pcolor to visualize these but unfortunately I´m only able to display either A (then everything is red, green or blue) or B and not both like on this picture for example: http://upload.wikimedia.org/wikipedia/commons/6/6a/Julia-set_N_z3-1.png
How can I adjust the brightness of the points in A corresponding with B?
Thanks a lot!

2 Comments

Should brighter correspond to more iterations or to fewer iterations?
Maximilian
Maximilian on 24 Dec 2012
Edited: Maximilian on 24 Dec 2012
the more iterations the brighter it should be (but it would be interesting to know how to realize the other way, too)

Sign in to comment.

Answers (2)

I don't know what A and B are, but try using image() instead of pcolor(). One reason being that pcolor does not display all the elments of your matrix as pixels on the screen. Try this
pcolor(magic(4));
How many tiles do you see? 4 by 4 like you'd expect? No, there's only 3 by 3. So use image() or imshow() and then apply a colormap with colormap().
For each color type, have a pair of vectors: a base RGB color, and a per-iteration RGB increment (possibly signed).
bases(ColNum,:) + iterations .* increments(ColNum,:)

Categories

Asked:

on 23 Dec 2012

Community Treasure Hunt

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

Start Hunting!