Hi,
There is no GUI way to change this color palette.
Nonetheless, it is possible to edit these colors once the plot is exported as a
.page file.
The export of a signal view to a
.page file is not working for all releases. Only the
git repository provides this feature bug free.
Just for fun, here are the steps I used to modify the colors of the windows in the attached plot.
First start to save a signal plot in
.page file (e.g. batlow.page). Then, extract the files inside the
.page file and convert
contents.xml to ASCII encoding.
Code: Select all
$ tar xvfpz batlow.page
bin_data_1000
bin_data_1001
bin_data_1002
contents.xml
$ iconv -f utf16 -t ascii contents.xml > signals.xml
Extract the starting and ending times of all time windows.
Code: Select all
$grep "<TimeWindow start.*color=\"" -o signals.xml | tee wins
<TimeWindow start="20000101000000.000000" end="20000101000400.000000" color="
<TimeWindow start="20000101000400.000000" end="20000101000800.000000" color="
<TimeWindow start="20000101000800.000000" end="20000101001200.000000" color="
...
Count the number of time windows.
I have three signals (see attached plot), each of them with the same number of windows. Hence, there are 90 windows per signal and they are the same sets. Restrict the number to 90.
Code: Select all
head -n 90 wins > tmp; mv tmp wins
We have to build a color palette with 90 colors. For instance, show the properties of plot inside
geopsy, go to Layers tab, under Palette section, define the number of colors and select the wanted colors (e.g. sardine for rainbow colors). Click on Color and save the color palette (e.g. win.pal). Untar the .pal file and convert it to ASCII.
Code: Select all
$ tar xvfpz win.pal
contents.xml
$ iconv -f utf16 -t ascii contents.xml > colors.xml
Extract the 90 color codes.
Code: Select all
$ grep -E -o "#[0-9a-f]{16}" colors.xml | tee colors
Build the list of time windows with the new colors.
Code: Select all
$ paste -d "" wins colors | awk '{print $0 "\"/>"}' | tee wins-new
Get the line numbers where the blocks of TimeWindow appear in the original file.
Code: Select all
$ grep -n "TimeWindowList" signals.xml
194: <TimeWindowList signalIndex="0">
285: </TimeWindowList>
286: <TimeWindowList signalIndex="1">
377: </TimeWindowList>
378: <TimeWindowList signalIndex="2">
469: </TimeWindowList>
Modify the original file.
Code: Select all
(
head -n 194 signals.xml
cat wins-new
echo -e -n "</TimeWindowList>\n<TimeWindowList signalIndex=\"1\">\n"
cat wins-new
echo -e -n "</TimeWindowList>\n<TimeWindowList signalIndex=\"2\">\n"
cat wins-new
tail -n +469 signals.xml
) > contents.xml
Rebuild the original .page file with the binary segments.
Code: Select all
$ tar cvfpz rainbow.page contents.xml bin_data_1000 bin_data_1001 bin_data_1002
contents.xml
bin_data_1000
bin_data_1001
bin_data_1002
Get the final result in a .png image.
Code: Select all
$ figue rainbow.page -e rainbow.png
This a "manual" edition of the original file but this process can be automated (e.g. extract the line numbers where to insert the new code).