PDA

View Full Version : How to make my own color scale (ColorData) on Mathematica


abonatto
May26-11, 09:51 AM
Dear All,

I started to use Mathematica to make some plots I usually did with gnuplot. I know it has some great color schemes, but I would like to be able to use the same I was using in gnuplot.

The question is: how could I create a color scheme? In gnuplot I just used the following command set palette model RGB file "FILE.TXT", and the FILE.TXT has the RGB color info:

0.00000 0.00000 0.00000 0.00000
0.25000 0.00000 0.00000 1.00000
...
1.00000 1.00000 1.00000 1.00000

Any suggestions?

Simon_Tyler
May27-11, 09:23 PM
This question was basically answered at
http://stackoverflow.com/questions/5753508/custom-colorfunction-colordata-in-arrayplot-and-similar-functions

There the OP was looking at Matlab RGB color data, but the idea is the same.

abonatto
May28-11, 08:42 AM
Hi Simon: thanks for your help!

The post is really about what I am looking for. I just have not figured out (yet) how to import my data file with RGB color " coordinates": his file (colorMapJet.mat) has a HDF5 format:

cMap = Transpose@Import["path-to-colorMapJet.mat", {"HDF5",
"Datasets", "cMap"}];

and mine should be (I think) imported like a table; I changed the format {"Table", ...} but it did not work.

I will keep trying: thanks again!