sc_colors#
Handle colors and colormaps.
- Highlights:
Adds colormaps including
'turbo'
,'parula'
, and'orangeblue'
sc.hex2rgb()
/sc.rgb2hex()
: convert between different color conventionssc.vectocolor()
: map a list of sequential values onto a list of colorssc.gridcolors()
: map a list of qualitative categories onto a list of colors
Functions
Alias to |
|
Shift the hue of the colors being fed in. |
|
A little helper function to convert e.g. [0.53, 0.74, 0.15] to a pleasing shade of green. |
|
A little helper function to convert e.g. '87bc26' to a pleasing shade of green. |
|
Shortcut to Matplotlib's rgb_to_hsv method, accepts a color triplet or a list/array of color triplets. |
|
Shortcut to Matplotlib's hsv_to_rgb method, accepts a color triplet or a list/array of color triplets. |
|
This function converts a vector (i.e., 1D array) of N values into an Nx3 matrix of color values according to the current colormap. |
|
Map an N-dimensional array of values onto the current colormap. |
|
Create a qualitative "color map" by assigning points according to the maximum pairwise distance in the color cube. |
|
Alias to Matplotlib's TwoSlopeNorm. |
|
Add a colorbar to a plot that does not support one by default. |
|
Demonstrate a color map using simulated elevation data, shown in both 2D and 3D. |
|
This function generates a map based on ascending height. |
|
This function generators a two-color map, blue for negative, red for positive changes, with grey in the middle. |
|
Create a map similar to Viridis, but brighter. |
|
NOTE: as of Matplotlib 3.4.0, this colormap is included by default, and will soon be removed from Sciris. |
|
Map colors onto bands of hue and saturation, with lightness mapped linearly. |
|
Create an orange-blue colormap; most like RdYlBu but more pleasing. |