Proper color selection ensures figures are accessible, publication-ready, and effectively communicate data patterns.
# R
install.packages(c('viridis', 'RColorBrewer', 'ggsci', 'colorspace'))# Python
pip install matplotlib seabornTell your AI agent what you want to do:
- "Apply a colorblind-friendly palette to my plot"
- "Use a diverging color scheme for my heatmap"
- "Get the Nature journal color palette"
"Apply viridis colors to my heatmap"
"Use a colorblind-safe palette for my categorical data"
"Use the Nature journal color palette for my figure"
"Apply Cell-style colors to my plot"
"Create a custom palette matching my lab colors (#1A5276, #F39C12, #27AE60)"
"Generate a gradient from blue to red for my heatmap"
"Use a diverging palette centered at zero for my log2FC data"
"Apply a sequential palette for my p-value heatmap"
- Identify the data type (continuous, diverging, categorical)
- Select appropriate palette type
- Apply palette to the visualization
- Ensure accessibility (colorblind-friendly)
- Test visual contrast
| Data Type | Palette Type | Examples |
|---|---|---|
| Continuous (0 to max) | Sequential | viridis, Blues |
| Centered (-x to +x) | Diverging | RdBu, coolwarm |
| Categories | Qualitative | Set1, tab10, npg |
- Avoid red-green combinations (colorblind unfriendly)
- Use viridis or cividis for safe continuous palettes
- Test with colorblind simulators
- Use consistent colors throughout all figures in a paper
- Check journal requirements (some require CMYK for print)
- data-visualization/ggplot2-fundamentals - Apply palettes
- data-visualization/heatmaps-clustering - Heatmap colors