Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Michael
Posts:
12
Registered:
6/18/12


ColorMap + Noisy Double Gaussian + Histogram
Posted:
Sep 14, 2013 10:58 AM


Hello everyone,
I have a possibly interesting query! I think my question may be confusing but keep in mind this isn't a math question or an assignment.. I just want to play around a =nd make a pretty image with your help!
I'd like to build a picture of a two gaussians added together (but the peaks far enough away to distinguish).
I'd like to histogram the results :) and then apply something like a different color to every bin (in a rainbowlike order!) ROYGBIV or some cyclic version i.e. red ain't gotta be the first color. But if possible I'd like ot have the ability to cycle the colors (as in ROYGBIV or IVROYGB GBIVROY) in some way would be neat but it may be too difficult or not worth anyone's time!
My starting point is something like:
%% mab double gaussian histogram color % Same results... rng('default');
% 1000 samples  should be enough points (even for second gaussian) oneGaussian = randn(1,1000);
% I need another gaussian (but with different randomly created values... % But I want to be able to get consistent results each time
% Build Histogram hist(oneGaussian,59); % 59 is my favorite number and it looks good to me
This isn't much as a starting point, I'm going to keep playing around.. the 'randn' help seems to be pretty great for a lot of this... I'll need to byhand tune the x location of each gaussian, then I'll probably play around with the height of each (if that's possible, I suppose I could weight each gaussian with another to spread them and stretch them...)
To summarize: 1) Two different shaped (repeatably made) gaussians 2) Histogrammed together so it looks bimodal 3) Add a rainbow/similar color effect across the bins (I know the least about this!)
Thanks in advance!
Truly, M. A. B.



