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: 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 ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: ColorMap + Noisy Double Gaussian + Histogram
Posted: Sep 16, 2013 11:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Michael " <> wrote in message
> 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!


for k = 1:length(colormap)
M = colormap;
colormap(M([2:end, 1], :)) % move one row to the other end of the

Colormaps in MATLAB are just matrices, and can be manipulated like any other
matrix. You may be interested in the COLORMAPEDITOR, which will let you
tweak to choose exactly your "rainbow" colormap, since I don't think such a
colormap is included with MATLAB.

Steve Lord
To contact Technical Support use the Contact Us link on

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.