I would like to remove the first n colors from a colormap without losing the original number of colours
<pre><code>from matplotlib import cm
import seaborn as sns
import matplotlib.pyplot as plt
</code></pre>

<p>Here is the original colormap</p>

<pre><code>cmap = [cm.inferno(x)[:3] for x in range(0,256)]
sns.palplot(cmap)
</code></pre>

<p><a href="http://i.stack.imgur.com/VewIo.png" rel="nofollow"><img src="http://i.stack.imgur.com/VewIo.png" alt="enter image description here"></a></p>

<p>My preferred outcome is something along the lines the colormap shown below, <strong>except</strong> with original number of colours </p>

<pre><code>cmap2 = [cm.inferno(x)[:3] for x in range(0,256)][100:]
sns.palplot(cmap2)
</code></pre>

<p><a href="http://i.stack.imgur.com/rg5Mv.png" rel="nofollow"><img src="http://i.stack.imgur.com/rg5Mv.png" alt="enter image description here"></a></p>

<p>I believe that by "same resolution" you mean that you want 256 colors in the palette. I would actually think of this as having a different resolution from the original palette in sense that the values are closer together in the color space. In any case, I think you can get what you want by doing:</p>

<pre><code>import numpy as np
import seaborn as sns
from matplotlib import cm

x = np.linspace(.3, 1, 256)
pal = cm.inferno(x)
sns.palplot(pal)
</code></pre>

<p><a href="http://i.stack.imgur.com/LfOoj.png" rel="nofollow"><img src="http://i.stack.imgur.com/LfOoj.png" alt="enter image description here"></a></p>

python matplotlib seaborn colormap