<div dir="ltr"><div><div><div>Hi matplotlib users,<br><br></div>I was wondering if anyone knows a way to modify the Reds and Greens colormap such that the lower end of the colormaps is not a mixture of white and red or green, but black and red or green respectively. <br><br></div>I tried to do this by making the image RGB, with my data only in the red or green channel, but matplotlib only supports int8 but my images have higher dynamic range, and they lose resolution if I cast them from int16 to int8. Here's the code:<br><br><div style="margin-left:40px">def color(img):<br>    x, y = img.shape<br>    c = np.zeros((x, y, 3), dtype=np.uint8)<br>    c[:, :, 0] = img<br>    return c</div><br></div>Thank you and best regards,<br><div><div><div><div><div><div><div><div><div><div class="gmail_signature">Kesavan</div>
</div></div></div></div></div></div></div></div></div></div>