Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: ColorMap + Noisy Double Gaussian + Histogram
Replies: 1   Last Post: Sep 16, 2013 11:48 AM

Advanced Search

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

Posts: 11
Registered: 6/18/12
ColorMap + Noisy Double Gaussian + Histogram
Posted: Sep 14, 2013 10:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 rainbow-like 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 by-hand 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.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.