Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

A Comsol tip: How to create your own color table

Please login with a confirmed email address before reporting spam

Hey All,

I always wanted to have my own color tables, and now I do :) Here's how:

Look under COMSOL4.0a/data/colortables

You will see lot of files which you're familiar with the name. Now duplicate one, and call it waterstyle.txt.

If you open it, you will see something like this:


% Continuous
0 0 0.5
0 0 1
0 0.5 1
0 1 1
0.5 1 0.5
1 1 0
1 0.5 0
1 0 0
0.5 0 0

These are RGB values on each rows. You can check by clicking here: bit.ly/b1wa8Z

Well, the rest is easy. Create your own numbers and then restart Comsol. I use it to have reverse order of color table, e.g. to imitate the "reverse" option we had in Comsol 3.5.

Have fun,
Danial

2 Replies Last Post 2016年7月24日 GMT-4 17:16

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年8月24日 GMT-4 14:38
This was extremely helpful and exactly what I was looking for. Have you by any chance found a way to change the line scale when exporting an image of the model to increase the line weights and make them more visible similar to what was available in 3.5a? Thank you.
-Matt
This was extremely helpful and exactly what I was looking for. Have you by any chance found a way to change the line scale when exporting an image of the model to increase the line weights and make them more visible similar to what was available in 3.5a? Thank you. -Matt

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年7月24日 GMT-4 17:16
Very cool.

I just created this wraparound Hue table that works OK for phase. Just OK because arg() wraps phase modulo +/- Pi and there's a visible "seam" through Red. Still, it's better than Rainbow.

% Continuous
1. 0. 0.
1. 0.1935483870967742 0.
1. 0.3870967741935484 0.
1. 0.5806451612903226 0.
1. 0.7741935483870968 0.
1. 0.967741935483871 0.
0.8387096774193549 1. 0.
0.6451612903225806 1. 0.
0.45161290322580644 1. 0.
0.25806451612903225 1. 0.
0.06451612903225806 1. 0.
0. 1. 0.12903225806451613
0. 1. 0.3225806451612903
0. 1. 0.5161290322580645
0. 1. 0.7096774193548387
0. 1. 0.9032258064516129
0. 0.9032258064516129 1.
0. 0.7096774193548387 1.
0. 0.5161290322580645 1.
0. 0.3225806451612903 1.
0. 0.12903225806451613 1.
0.06451612903225806 0. 1.
0.25806451612903225 0. 1.
0.45161290322580644 0. 1.
0.6451612903225806 0. 1.
0.8387096774193549 0. 1.
1. 0. 0.967741935483871
1. 0. 0.7741935483870968
1. 0. 0.5806451612903226
1. 0. 0.3870967741935484
1. 0. 0.1935483870967742
1. 0. 0.
Very cool. I just created this wraparound Hue table that works OK for phase. Just OK because arg() wraps phase modulo +/- Pi and there's a visible "seam" through Red. Still, it's better than Rainbow. % Continuous 1. 0. 0. 1. 0.1935483870967742 0. 1. 0.3870967741935484 0. 1. 0.5806451612903226 0. 1. 0.7741935483870968 0. 1. 0.967741935483871 0. 0.8387096774193549 1. 0. 0.6451612903225806 1. 0. 0.45161290322580644 1. 0. 0.25806451612903225 1. 0. 0.06451612903225806 1. 0. 0. 1. 0.12903225806451613 0. 1. 0.3225806451612903 0. 1. 0.5161290322580645 0. 1. 0.7096774193548387 0. 1. 0.9032258064516129 0. 0.9032258064516129 1. 0. 0.7096774193548387 1. 0. 0.5161290322580645 1. 0. 0.3225806451612903 1. 0. 0.12903225806451613 1. 0.06451612903225806 0. 1. 0.25806451612903225 0. 1. 0.45161290322580644 0. 1. 0.6451612903225806 0. 1. 0.8387096774193549 0. 1. 1. 0. 0.967741935483871 1. 0. 0.7741935483870968 1. 0. 0.5806451612903226 1. 0. 0.3870967741935484 1. 0. 0.1935483870967742 1. 0. 0.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.