How to make my own color scale (ColorData) on Mathematica

Click For Summary
SUMMARY

This discussion focuses on creating custom color scales in Mathematica, specifically for users transitioning from gnuplot. The user aims to replicate a gnuplot color palette using RGB values stored in a text file. Key insights include the need to import RGB data correctly, as demonstrated by a reference to a Stack Overflow post that utilizes HDF5 format for color data. The user is advised to use the Import function in Mathematica with the appropriate format to achieve the desired outcome.

PREREQUISITES
  • Familiarity with Mathematica's Import function
  • Understanding of RGB color models
  • Basic knowledge of HDF5 file format
  • Experience with gnuplot color palettes
NEXT STEPS
  • Research how to use Mathematica's Import function with different file formats
  • Learn about RGB color model specifications in Mathematica
  • Explore HDF5 data handling in Mathematica
  • Investigate creating custom color functions in Mathematica
USEFUL FOR

Mathematica users, data visualization specialists, and anyone transitioning from gnuplot seeking to customize color scales in their plots.

abonatto
Messages
13
Reaction score
0
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?
 
Last edited:
Physics news on Phys.org
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!
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K