Using colors in IDLDr. Peter R. Young, 5-Sep-2025 This document gives some suggestions for setting colors in IDL when using IDL plot objects (not direct graphics). The routines mentioned below are available in the GitHub repository https://github.com/pryoung/idl_misc. Colors for the color blindScientific figures are often difficult to interpret for color blind people, particularly if red and green are used. Paul Tol gives advice on what colors are good for the color blind, and his website is at: https://sronpersonalpages.nl/~pault/. This site is blocked at my workplace, however, so you can also check the following: https://cran.r-project.org/web/packages/khroma/vignettes/tol.html. The company Enchroma has an online color blind test if you want to check your own eyesight. The Tol color tablesPaul Tol gives RGB numbers for five color schemes that he recommends using when creating line plots for color blind people. I have implemented these in the IDL routine color_tol.pro that is available in the GitHub repository listed above. As an example of how to use this routine, consider the code below: IDL> p=color_tol(/example) which generates the plot below. This shows the color options for the default "vibrant" color scheme. You can then use one of these colors for a plot by doing:
IDL> p=plot(findgen(5),color=color_tol('teal'),thick=3) The five color schemes are: Vibrant: (default) seven colors (blue, cyan, teal,
orange, red, magenta, grey). To select one of the other color schemes, use a keyword. For example, /high_contrast or /muted. AIA color tablesThe routine aia_rgb_table can be used to obtain an AIA color table in a format that can be used for IDL plot objects. For example: IDL> p=image(img,rgb_table=aia_rgb_table(193)) will plot the image using the AIA 193 color table. The routine aia_rgb_table is a wrapper to the routine aia_lct that is provided by the AIA team. Matplotlib color tablesThe Python package Matplotlib provides some striking color tables for images. Five of the most common tables have been implemented in the IDL routine matplotlib_rgb_table, available in the GitHub repository listed above. The five options are:
These can be selected by doing, e.g., IDL> p=image(img,rgb_table=matplotlib_rgb_table(/viridis)) The example below shows an AIA 193 image displayed with the Magma color table. Page maintained by Dr Peter R Young. |