Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Palettable Cubehelix Demo
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cubehelix Color Maps in Palettable\n",
"\n",
"Cubehelix was designed by [D.A. Green](http://adsabs.harvard.edu/abs/2011arXiv1108.5083G) to provide a color mapping that would degrade gracefully to grayscale without losing information. This quality makes Cubehelix very useful for continuous colour scales in scientific visualizations that might be printed in grayscale at some point. [James Davenport](http://github.com/jradavenport/cubehelix) popularized Cubehelix among `matplotlib` users, and now this iteration brings Cubehelix to [Palettable's beautiful API](https://jiffyclub.github.io/palettable/) for managing color maps."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Cubehelix functionality is contained within the `palettable.cubehelix` name space, and shares the same API as `palettable.tableau`, `palettable.brewer.sequential`, `palettable.qualitative`, `palettable.diverging`, and `palettable.wesandersen`, for instance."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from palettable import cubehelix"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Making your own Cubehelix Maps\n",
"\n",
"Unlike other color maps, Cubehelix is entirely algorithmic. Thus you can make your own map by instantiating a `Cubehelix` class. For example, to make a color palette with 5 colors:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks1087ea72-b5c9-410e-a7f7-f2f3a24b4de4 td {border: 1px solid white;}</style><table id=\"blocks1087ea72-b5c9-410e-a7f7-f2f3a24b4de4\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (135, 59, 98)\" style=\"width: 100px; height: 100px;background-color: rgb(135, 59, 98);\"></td><td title=\"Index: [0, 1]&#10;Color: (126, 98, 203)\" style=\"width: 100px; height: 100px;background-color: rgb(126, 98, 203);\"></td><td title=\"Index: [0, 2]&#10;Color: (63, 181, 207)\" style=\"width: 100px; height: 100px;background-color: rgb(63, 181, 207);\"></td><td title=\"Index: [0, 3]&#10;Color: (101, 231, 116)\" style=\"width: 100px; height: 100px;background-color: rgb(101, 231, 116);\"></td><td title=\"Index: [0, 4]&#10;Color: (233, 213, 117)\" style=\"width: 100px; height: 100px;background-color: rgb(233, 213, 117);\"></td></tr></tbody></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cube = cubehelix.Cubehelix(n=5, start_hue=240., end_hue=-300.,min_sat=1., max_sat=2.5,\n",
" min_light=0.3, max_light=0.8, gamma=.9)\n",
"cube.show_as_blocks()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Cubehelix docstring provides some guidance on how to build custom Cubehelix maps."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Representation of a Cubehelix color map with matplotlib compatible\n",
" views of the map.\n",
"\n",
" Parameters\n",
" ----------\n",
" name : str, optional\n",
" Name of the color map (defaults to ``'custom_cubehelix'``).\n",
" start : scalar, optional\n",
" Sets the starting position in the RGB color space. 0=blue, 1=red,\n",
" 2=green. Default is ``0.5`` (purple).\n",
" rotation : scalar, optional\n",
" The number of rotations through the rainbow. Can be positive\n",
" or negative, indicating direction of rainbow. Negative values\n",
" correspond to Blue->Red direction. Default is ``-1.5``.\n",
" start_hue : scalar, optional\n",
" Sets the starting color, ranging from [-360, 360]. Combined with\n",
" `end_hue`, this parameter overrides ``start`` and ``rotation``.\n",
" This parameter is based on the D3 implementation by @mbostock.\n",
" Default is ``None``.\n",
" end_hue : scalar, optional\n",
" Sets the ending color, ranging from [-360, 360]. Combined with\n",
" `start_hue`, this parameter overrides ``start`` and ``rotation``.\n",
" This parameter is based on the D3 implementation by @mbostock.\n",
" Default is ``None``.\n",
" gamma : scalar, optional\n",
" The gamma correction for intensity. Values of ``gamma < 1`` emphasize\n",
" low intensities while ``gamma > 1`` emphasises high intensities.\n",
" Default is ``1.0``.\n",
" sat : scalar, optional\n",
" The uniform saturation intensity factor. ``sat=0`` produces grayscale,\n",
" while ``sat=1`` retains the full saturation. Setting ``sat>1``\n",
" oversaturates the color map, at the risk of clipping the color scale.\n",
" Note that ``sat`` overrides both ``min_stat`` and ``max_sat`` if set.\n",
" min_sat : scalar, optional\n",
" Saturation at the minimum level. Default is ``1.2``.\n",
" max_sat : scalar, optional\n",
" Satuation at the maximum level. Default is ``1.2``.\n",
" min_light : scalar, optional\n",
" Minimum lightness value. Default is ``0``.\n",
" max_light : scalar, optional\n",
" Maximum lightness value. Default is ``1``.\n",
" n : scalar, optional\n",
" Number of discrete rendered colors. Default is ``256``.\n",
" reverse : bool, optional\n",
" Set to ``True`` to reverse the color map. Will go from black to\n",
" white. Good for density plots where shade -> density.\n",
" Default is ``False``.\n",
"\n",
" \n"
]
}
],
"source": [
"print(cubehelix.Cubehelix.__doc__)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pre-made Cubehelix Maps\n",
"\n",
"Of course, you can also use a number of off-the-shelf color maps. These pre-made cubehelix maps have 256 computed colors, so they are ideal for continuous color scales. Like the other color maps in Palettable, the cubehelix maps are available from the `palettable.cubehelix` namespace.\n",
"\n",
"Here is a listing of color map names:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"classic sequential \n",
"perceptual_rainbow sequential \n",
"purple sequential \n",
"jim_special sequential \n",
"red sequential \n",
"cubehelix1 sequential \n",
"cubehelix2 sequential \n",
"cubehelix3 sequential \n"
]
}
],
"source": [
"cubehelix.print_maps()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And examples:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAsJJREFUeJzt1kGSnDAMBVBJcP8jj7MAbNM9Sdaqei8L3PpuKkPG/GRE\njACAZs6IiIqKiIjKjIiIjIrKe3ZnmWuWc3/Ndea6znUcf81izo5tvbLPfVEVkcd7lhVR+b0vIkbW\nXMf9c0VVjG0dETEq5z1Wltf8Xj/ZmsX67v35O/tYXw9krfdrjfe+Glt+//8ix5aN+0feso9Z7rP8\nmVnms+9n7suPfZXrc+33i4jKn5nXtr9ivL57bPuOLTue78Y7O3Js65jZ/S++srh/aV/fjThHzPy6\n5rbvuuH++Rz52n9GxnE/9JVlnPfsmLP6z+yYs+f6Pbv+RETUzLZZrFl9zGqcUfnMzncW51znlmWe\nr/2Z6+nkNov8xyzX07sG53Ye7yyPiNrW93U861r7n9mYZ/SIcedfWR3Xed5mo45tvc782M/1ne3r\nJ/tttrL472w/8/uZ/jzfoyLuX7/3mX+y5wzPV9X42hc55ust5vnd188Zje18b/f7S1Y55qtxvfrG\neqVur7Sv2Xptrr/uzPJ7Fjn7ZWUZdT+cleVrfWX1y7563QsAWlFgALSkwABoSYEB0JICA6AlBQZA\nSwoMgJYUGAAtKTAAWlJgALSkwABoSYEB0JICA6AlBQZASwoMgJYUGAAtKTAAWlJgALSkwABoSYEB\n0JICA6AlBQZASwoMgJYUGAAtKTAAWlJgALSkwABoSYEB0JICA6AlBQZASwoMgJYUGAAtKTAAWlJg\nALSkwABoSYEB0JICA6AlBQZASwoMgJYUGAAtKTAAWlJgALSkwABoSYEB0JICA6AlBQZASwoMgJYU\nGAAtKTAAWlJgALSkwABoSYEB0JICA6AlBQZASwoMgJYUGAAtKTAAWlJgALSkwABoSYEB0JICA6Al\nBQZASwoMgJYUGAAtKTAAWlJgALSkwABoSYEB0JICA6AlBQZAS38AJVRujlqsGAoAAAAASUVORK5C\nYII=\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.classic.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAn9JREFUeJzt1Utu3DAQBNAmJ7fKdXKYnFrMYvQhJRlZF/DeZuTuImUb\nhqtV1SgACPOrqurv7z/fr1r7flSvVn2P7LPWq/ZZ22fV5lw/73jO5nPrrKrvd1/vqurL/vrenmfP\n59Zu+V6jbrvpZzjOjZd759mY7r+e9930exj7O97yo73kas6tZ8cy28/2n3f/nfX/5M7991XbsquX\ne+t277Xfzvx0ZpnVbXadO3dT5pqN52y5dzxnfaz3LXfcdn2cs+pX/jqz79pYzlyzZ+5857nbHvk6\n3zlqtG2dzbnpbL3kvp/b+vxjfqv2kmuvuXXW6pk/MzXPxrk7zpzvrG3ZV1X1+ewt36Z8P3Y1nrM2\nzrO9xpnr7WV2e8ex+/7XuHLH/fP+nrs+5zPfz8+SqzU/xnN2e66q+iy5epz9TLvjz+96/5Gfz7Yz\nP++vO9rt3rbsjzs+1R6zZ74983PubTY9V1W1MeX2t80/AwDEUWAARFJgAERSYABEUmAARFJgAERS\nYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJg\nAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAA\nRFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABE\nUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERS\nYABEUmAARFJgAERSYABEUmAARFJgAERSYABE+gcp+cvEQP+UuAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.perceptual_rainbow.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAeNJREFUeJzt1UFuIyEUQEGayf2vPLOJZCdg3BMpiydVbRzhD3R7kXeN\nMf4OAIj5GGOM65rjy+f4s6yNa27mNmvXuvc0f//cF2vj2t91zTFOZzztO9+1mRvrd+td1+bc62nv\nm7nN2uM5ruU51t/1Ou/d3rU798b827vOa4/f5s78etd4+Zzr3vN7neb+f+23zn38PX48P5e5V8/+\n7Y55+O722u6ucX6veTrj8d3urrnMPb/PnXNvrs17c/P4HLv3/3resrbdu7vr2xnzzbnPa3Ndm5u5\n3zp3NzfG+PxPBQAxAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJ\nAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJ\nGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRg\nACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoAB\nkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZAkoABkCRgACQJGABJAgZA0j8lGASOGIX1yAAAAABJ\nRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.purple.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAlRJREFUeJzt1UFu3DAQRcFuIve/crIYSyJFZgJk94GqjQcU1ZTGhl9X\n1e8CgDC/qqpGj6qq6vr8HD3uz/1zbdR4Pk/7r7XTvn7N7R7PvV9mdJ9nXJ/r277553+uVfc2r/p0\nfj/XxnptnrHsH4e1a9/o7ZnqOmPM+3uZUaOXZ79nvdZ67GfVNO95h+navO8+a19bPl/v/773MO96\nnL+fVdta3a8/z1339ZjPfe+v6buuL2et1+9Lh3nPe1wjDjOm+/a12s6f1+b97191z89z+Mrffy7L\n2nFf/3Xf4c9mnbH9efXXe49rtf5uxvE59rmfff0z49k/ep93OmOb+7NnmTtdm9/xOnMc9p3uvc4a\n2/P2cv3e916r03OO473bc8zn3//zn2v39zVdO++7/jc/53+ujX/MeO6b7/m8/9jO6pq68ZpxfW8A\nEEXAAIgkYABEEjAAIgkYAJEEDIBIAgZAJAEDIJKAARBJwACIJGAARBIwACIJGACRBAyASAIGQCQB\nAyCSgAEQScAAiCRgAEQSMAAiCRgAkQQMgEgCBkAkAQMgkoABEEnAAIgkYABEEjAAIgkYAJEEDIBI\nAgZAJAEDIJKAARBJwACIJGAARBIwACIJGACRBAyASAIGQCQBAyCSgAEQScAAiCRgAEQSMAAiCRgA\nkQQMgEgCBkAkAQMgkoABEEnAAIgkYABEEjAAIgkYAJEEDIBIAgZAJAEDIJKAARBJwACIJGAARBIw\nACIJGACRBAyASAIGQCQBAyCSgAEQScAAiCRgAEQSMAAiCRgAkQQMgEh/ADk5BI5sJovSAAAAAElF\nTkSuQmCC\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.jim_special.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAlhJREFUeJzt1Uty4zAMBUCQyf2vPLNwJH6T/avq3tgGIZCyVX6tqv4V\nAIT5rqpqrdfyWl9nrfVqdan9vO911p7+/seMPtVufaPWlj2ePcf7dsx4anNPP84218aMY1616q0t\n9/p8ns82ekb/fe54bXtt2Wtd++x16693/fcZdTlTHX0/Hz/fTY3373mf9WnGfM1nbTrLu7buu95X\nTfcw5h+1ds5tbV0f39N57e/9Y+6yV19n3M45zztf23XGrf/Pvj7m1X5tP/trWmtv41zb+9r12tq+\nk5rP2Le16V7r7W/L+pg71vd5555tOee7uP3A7VKbH85x7bnX0nN7OI6z3R7Y80dc5r19U897/2dt\nntX6/nD0aY9+1p5r51nTf+l7ju1/vlqfnpepNu/x9F+ufT7fanv/b3179lT1au3ruPazAgCBBBgA\nkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACR\nBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEE\nGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQY\nAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgA\nkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACRBBgAkQQYAJEEGACR/gOTuQSO7f4wvQAA\nAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.red.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAodJREFUeJzt1cGOrCAQBVAK5/8/uX0LRUHN29/knA10VUE6nRlutdb2\nBgBh/lprrer4MNZerVX/qE370TvHrtrX3Dzzv9o21573tta259mlVud8nXfVXTvXre7advX6cuaq\nXWf6VOvrfeNzzb1pvrZ37TqzTbXtuueoHd9+nTvWmu6tUavt7k+9mu4bvdFvS+3vdd+x2Zb93fuo\nPeZa/6jNc33Uju+4f/T26tN+9Pq133u/7h37a51q7dXr7/n+UauaanX1ftN+9O7+Y92+e2P/O7/i\nUWuPuXb9gd+9df9av2rbvtRab23v+7U/evv0j3X2ap/O7O/1Y74+5qrWWvW9tZr2rR0z8/7Re9d+\nV61/zPUxX2t/9J5z17qcHb15bvxs+/32LGfbMre1/fPNO3rzfeO9uefu97DuWt1v2tw/5qc37/Wm\nTW9fvd+5e36u9ffc15s3zY21nrXq05t2rOtbdtbqfg/HHccbNc6svfG7AEAUAQZAJAEGQCQBBkAk\nAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQB\nBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEG\nQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZA\nJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAk\nAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkAkAQZAJAEGQCQBBkCkf6IYX44irJqmAAAAAElFTkSuQmCC\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.cubehelix1.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAoxJREFUeJzt1Utu5TgQBMAqau5/ZKsXlijqY8w6gYiN9JL16IbdqOyq\n2gsAwvxXVVXj+NRd8/M43o9Hjb6ydX5m/c563M9Gv7MeH/Pj+rfcsuX9POvxmNv+Puvt/j7ntv+d\n6yXrWrKq6h6f2XhmNWrM9+34NWzVxy/0mr++O599zYzH/OjxzurKtiXbzrk+z9a5MefOz9vxH+Ar\n22bWy/lxtvft/Hyu7/fn8t4f2e9f47ij/s66lu/e50bvH2f7/N6Yd+zzbPR9bvT+vq/3Gsv5eseo\nfWbr8539vLJe5rp/5lmfc+Nnzr3ml7Me9zvWrOb8Pr+zZrf3qqrlef7cNavnXNc7G4/3qtrHfv0B\njrN97p6qfdSf8/uyl95z9/Nz/prr2x179+vefdl9V3btqFu23lNVNcZvXrXML3tpfGXjuOOd3Xba\neO6tdUfez/pjz61Zz2zZc8ve6md223nj/qxt7pev7NwVve6tdUc+dtRv0q/s9wkAgRQYAJEUGACR\nFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEU\nGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQY\nAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgA\nkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACR\nFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkRQYAJEUGACRFBgAkf4BwsJTjpw4zIAAAAAASUVO\nRK5CYII=\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.cubehelix2.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAoxJREFUeJzt1sGOozAQBNDGJv//wxPYw2JiILN7Lum9i5tqEs1oJNcs\nVbUXAIRZq6qqHU/9ONttfmTLlC23bKnq7ZZNz+c8nefcp6zf3utVS7+9N2d/f5XL85iX9XOOufVn\nVuO91/UzY7e8nllVVb2+Z/P3nbsj279kNWX77fvm5y+79Zj7Ps5e6zGvxx/uku39POe5qup1Prcp\na2c278fudfwbNM51r0f2+iX71+6R/fbZer63fvnsY3dka231qu342bdnVu8zW5fPXFXV61117OvY\nXZ9vu0v288nmeZztnv08s/n5225kbc5un23vZ9bn7P3JxnP/sjvnbcq2Z9ZvWdumbL+9v3/Z7VVt\nf2bjjjqzmrJ6Zufdt0y7253Wl9qO7DzbUu/jntva2LXajvtqO3ffsj7t+iXbp2yfdmPej3tm/y0b\n8+1e3Jf/3Ifn2Wu53WXLsp7ZMrLq03w927RrUzbPY9fP+bijql/mcX7mdtmNPx8ARFFgAERSYABE\nUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERS\nYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJg\nAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAA\nRFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABE\nUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARPoD7O6SjsHgJC0AAAAASUVO\nRK5CYII=\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.cubehelix3.show_continuous_image()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Of course, you can can reverse any color map by appending `_r` to the map's name."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAABICAYAAACX+KDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAAqBJREFUeJzt1stu6zgQBNCW7f//YVPkLKIHZenOvoBzslC7mjaMBGBl\nqapRABDmU1XVRquqqrX69vz72eeqqj5lfdr1apesV7vMVVVjOjN+slGtxnb+yEarsX2nmrIaf+dq\n3412nauOM8toVb1t85ktfdpX1dLXx+y1Z9vz1ddaej/m67Of89qnrN+zY/77v+G99mN+rdNzm2vb\nHa/Xae41ZdN8y5YpW65ZX+7Z+jpfz/O+66+fc6+q9X3N+lP2PrO+797/3l2yz5n1p+zz897PmY2f\n8+P9vBtP2fuajc91rqqq9/1cza/vu3XLWv39btp4n/O2+9brzJbXLftun9a2P813yr7LufvNvvM8\nPW/nludz/7d7ytrjub59v75l6zTvu/U48z3m89luWat1n+uerUvbdq1qud4vl9ePuz37Trt9/5CN\nOZvnOu+q+t6z8ZS1n8+r693X13v2cx9Wb9d53+3vPT5jzvq5m+d9d2S/z3Gdq6rWfs7znbbfYX26\n346s7tl63W03CwBkUWAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERS\nYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJg\nAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAA\nRFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABE\nUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERSYABEUmAARFJgAERS\nYABE+g+kYnagyfcn3gAAAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cubehelix.cubehelix3_r.show_continuous_image()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.8"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment