首页  编辑  

Python中matplotlib中使用RGB自定义调色板的方法

Tags: /Python/   Date Created:
How to use customize palette(colormap) in Python/matplotlib?
Python/Matplotlib自定义调色板(colormap)的方法,使用RGB:
调色板(colormap)是[(r,g,b), (r,g,b), (r,g,b)...]的格式。

例如,下面会创建一个Iron(FLIR Tools Iron颜色方案)的自定义Colormap:
clist = [
		(0x00/0xff,0x00/0xff,0x0a/0xff), (0x00/0xff,0x00/0xff,0x14/0xff), (0x00/0xff,0x00/0xff,0x1e/0xff), (0x00/0xff,0x00/0xff,0x25/0xff), (0x00/0xff,0x00/0xff,0x2a/0xff),
		(0x00/0xff,0x00/0xff,0x2e/0xff), (0x00/0xff,0x00/0xff,0x32/0xff), (0x00/0xff,0x00/0xff,0x36/0xff), (0x00/0xff,0x00/0xff,0x3a/0xff), (0x00/0xff,0x00/0xff,0x3e/0xff),
		(0x00/0xff,0x00/0xff,0x42/0xff), (0x00/0xff,0x00/0xff,0x46/0xff), (0x00/0xff,0x00/0xff,0x4a/0xff), (0x00/0xff,0x00/0xff,0x4f/0xff), (0x00/0xff,0x00/0xff,0x52/0xff),
		(0x01/0xff,0x00/0xff,0x55/0xff), (0x01/0xff,0x00/0xff,0x57/0xff), (0x02/0xff,0x00/0xff,0x59/0xff), (0x02/0xff,0x00/0xff,0x5c/0xff), (0x03/0xff,0x00/0xff,0x5e/0xff),
		(0x04/0xff,0x00/0xff,0x61/0xff), (0x04/0xff,0x00/0xff,0x63/0xff), (0x05/0xff,0x00/0xff,0x65/0xff), (0x06/0xff,0x00/0xff,0x67/0xff), (0x07/0xff,0x00/0xff,0x69/0xff),
		(0x08/0xff,0x00/0xff,0x6b/0xff), (0x09/0xff,0x00/0xff,0x6e/0xff), (0x0a/0xff,0x00/0xff,0x70/0xff), (0x0b/0xff,0x00/0xff,0x73/0xff), (0x0c/0xff,0x00/0xff,0x74/0xff),
		(0x0d/0xff,0x00/0xff,0x75/0xff), (0x0d/0xff,0x00/0xff,0x76/0xff), (0x0e/0xff,0x00/0xff,0x77/0xff), (0x10/0xff,0x00/0xff,0x78/0xff), (0x12/0xff,0x00/0xff,0x79/0xff),
		(0x13/0xff,0x00/0xff,0x7b/0xff), (0x15/0xff,0x00/0xff,0x7c/0xff), (0x17/0xff,0x00/0xff,0x7d/0xff), (0x19/0xff,0x00/0xff,0x7e/0xff), (0x1b/0xff,0x00/0xff,0x80/0xff),
		(0x1c/0xff,0x00/0xff,0x81/0xff), (0x1e/0xff,0x00/0xff,0x83/0xff), (0x20/0xff,0x00/0xff,0x84/0xff), (0x22/0xff,0x00/0xff,0x85/0xff), (0x24/0xff,0x00/0xff,0x86/0xff),
		(0x26/0xff,0x00/0xff,0x87/0xff), (0x28/0xff,0x00/0xff,0x89/0xff), (0x2a/0xff,0x00/0xff,0x89/0xff), (0x2c/0xff,0x00/0xff,0x8a/0xff), (0x2e/0xff,0x00/0xff,0x8b/0xff),
		(0x30/0xff,0x00/0xff,0x8c/0xff), (0x32/0xff,0x00/0xff,0x8d/0xff), (0x34/0xff,0x00/0xff,0x8e/0xff), (0x36/0xff,0x00/0xff,0x8e/0xff), (0x38/0xff,0x00/0xff,0x8f/0xff),
		(0x39/0xff,0x00/0xff,0x90/0xff), (0x3b/0xff,0x00/0xff,0x91/0xff), (0x3c/0xff,0x00/0xff,0x92/0xff), (0x3e/0xff,0x00/0xff,0x93/0xff), (0x3f/0xff,0x00/0xff,0x93/0xff),
		(0x41/0xff,0x00/0xff,0x94/0xff), (0x42/0xff,0x00/0xff,0x95/0xff), (0x44/0xff,0x00/0xff,0x95/0xff), (0x45/0xff,0x00/0xff,0x96/0xff), (0x47/0xff,0x00/0xff,0x96/0xff),
		(0x49/0xff,0x00/0xff,0x96/0xff), (0x4a/0xff,0x00/0xff,0x96/0xff), (0x4c/0xff,0x00/0xff,0x97/0xff), (0x4e/0xff,0x00/0xff,0x97/0xff), (0x4f/0xff,0x00/0xff,0x97/0xff),
		(0x51/0xff,0x00/0xff,0x97/0xff), (0x52/0xff,0x00/0xff,0x98/0xff), (0x54/0xff,0x00/0xff,0x98/0xff), (0x56/0xff,0x00/0xff,0x98/0xff), (0x58/0xff,0x00/0xff,0x99/0xff),
		(0x5a/0xff,0x00/0xff,0x99/0xff), (0x5c/0xff,0x00/0xff,0x99/0xff), (0x5d/0xff,0x00/0xff,0x9a/0xff), (0x5f/0xff,0x00/0xff,0x9a/0xff), (0x61/0xff,0x00/0xff,0x9b/0xff),
		(0x63/0xff,0x00/0xff,0x9b/0xff), (0x64/0xff,0x00/0xff,0x9b/0xff), (0x66/0xff,0x00/0xff,0x9b/0xff), (0x68/0xff,0x00/0xff,0x9b/0xff), (0x6a/0xff,0x00/0xff,0x9b/0xff),
		(0x6c/0xff,0x00/0xff,0x9c/0xff), (0x6d/0xff,0x00/0xff,0x9c/0xff), (0x6f/0xff,0x00/0xff,0x9c/0xff), (0x70/0xff,0x00/0xff,0x9c/0xff), (0x71/0xff,0x00/0xff,0x9d/0xff),
		(0x73/0xff,0x00/0xff,0x9d/0xff), (0x75/0xff,0x00/0xff,0x9d/0xff), (0x77/0xff,0x00/0xff,0x9d/0xff), (0x78/0xff,0x00/0xff,0x9d/0xff), (0x7a/0xff,0x00/0xff,0x9d/0xff),
		(0x7c/0xff,0x00/0xff,0x9d/0xff), (0x7e/0xff,0x00/0xff,0x9d/0xff), (0x7f/0xff,0x00/0xff,0x9d/0xff), (0x81/0xff,0x00/0xff,0x9d/0xff), (0x83/0xff,0x00/0xff,0x9d/0xff),
		(0x84/0xff,0x00/0xff,0x9d/0xff), (0x86/0xff,0x00/0xff,0x9d/0xff), (0x87/0xff,0x00/0xff,0x9d/0xff), (0x89/0xff,0x00/0xff,0x9d/0xff), (0x8a/0xff,0x00/0xff,0x9d/0xff),
		(0x8b/0xff,0x00/0xff,0x9d/0xff), (0x8d/0xff,0x00/0xff,0x9d/0xff), (0x8f/0xff,0x00/0xff,0x9c/0xff), (0x91/0xff,0x00/0xff,0x9c/0xff), (0x93/0xff,0x00/0xff,0x9c/0xff),
		(0x95/0xff,0x00/0xff,0x9c/0xff), (0x96/0xff,0x00/0xff,0x9b/0xff), (0x98/0xff,0x00/0xff,0x9b/0xff), (0x99/0xff,0x00/0xff,0x9b/0xff), (0x9b/0xff,0x00/0xff,0x9b/0xff),
		(0x9c/0xff,0x00/0xff,0x9b/0xff), (0x9d/0xff,0x00/0xff,0x9b/0xff), (0x9f/0xff,0x00/0xff,0x9b/0xff), (0xa0/0xff,0x00/0xff,0x9b/0xff), (0xa2/0xff,0x00/0xff,0x9b/0xff),
		(0xa3/0xff,0x00/0xff,0x9b/0xff), (0xa4/0xff,0x00/0xff,0x9b/0xff), (0xa6/0xff,0x00/0xff,0x9a/0xff), (0xa7/0xff,0x00/0xff,0x9a/0xff), (0xa8/0xff,0x00/0xff,0x9a/0xff),
		(0xa9/0xff,0x00/0xff,0x99/0xff), (0xaa/0xff,0x00/0xff,0x99/0xff), (0xab/0xff,0x00/0xff,0x99/0xff), (0xad/0xff,0x00/0xff,0x99/0xff), (0xae/0xff,0x01/0xff,0x98/0xff),
		(0xaf/0xff,0x01/0xff,0x98/0xff), (0xb0/0xff,0x01/0xff,0x98/0xff), (0xb0/0xff,0x01/0xff,0x98/0xff), (0xb1/0xff,0x01/0xff,0x97/0xff), (0xb2/0xff,0x01/0xff,0x97/0xff),
		(0xb3/0xff,0x01/0xff,0x96/0xff), (0xb4/0xff,0x02/0xff,0x96/0xff), (0xb5/0xff,0x02/0xff,0x95/0xff), (0xb6/0xff,0x02/0xff,0x95/0xff), (0xb7/0xff,0x03/0xff,0x95/0xff),
		(0xb8/0xff,0x03/0xff,0x95/0xff), (0xb9/0xff,0x04/0xff,0x95/0xff), (0xba/0xff,0x04/0xff,0x95/0xff), (0xba/0xff,0x04/0xff,0x94/0xff), (0xbb/0xff,0x05/0xff,0x93/0xff),
		(0xbc/0xff,0x05/0xff,0x93/0xff), (0xbd/0xff,0x05/0xff,0x93/0xff), (0xbe/0xff,0x06/0xff,0x92/0xff), (0xbf/0xff,0x06/0xff,0x92/0xff), (0xbf/0xff,0x06/0xff,0x92/0xff),
		(0xc0/0xff,0x07/0xff,0x91/0xff), (0xc0/0xff,0x07/0xff,0x91/0xff), (0xc1/0xff,0x08/0xff,0x90/0xff), (0xc1/0xff,0x09/0xff,0x90/0xff), (0xc2/0xff,0x0a/0xff,0x8f/0xff),
		(0xc3/0xff,0x0a/0xff,0x8e/0xff), (0xc3/0xff,0x0b/0xff,0x8e/0xff), (0xc4/0xff,0x0c/0xff,0x8d/0xff), (0xc5/0xff,0x0c/0xff,0x8c/0xff), (0xc6/0xff,0x0d/0xff,0x8b/0xff),
		(0xc6/0xff,0x0e/0xff,0x8a/0xff), (0xc7/0xff,0x0f/0xff,0x89/0xff), (0xc8/0xff,0x10/0xff,0x88/0xff), (0xc9/0xff,0x11/0xff,0x87/0xff), (0xca/0xff,0x12/0xff,0x86/0xff),
		(0xca/0xff,0x13/0xff,0x85/0xff), (0xcb/0xff,0x13/0xff,0x85/0xff), (0xcb/0xff,0x14/0xff,0x84/0xff), (0xcc/0xff,0x15/0xff,0x82/0xff), (0xcd/0xff,0x16/0xff,0x81/0xff),
		(0xce/0xff,0x17/0xff,0x80/0xff), (0xce/0xff,0x18/0xff,0x7e/0xff), (0xcf/0xff,0x18/0xff,0x7c/0xff), (0xcf/0xff,0x19/0xff,0x7b/0xff), (0xd0/0xff,0x1a/0xff,0x79/0xff),
		(0xd1/0xff,0x1b/0xff,0x78/0xff), (0xd1/0xff,0x1c/0xff,0x76/0xff), (0xd2/0xff,0x1c/0xff,0x75/0xff), (0xd2/0xff,0x1d/0xff,0x74/0xff), (0xd3/0xff,0x1e/0xff,0x72/0xff),
		(0xd3/0xff,0x20/0xff,0x71/0xff), (0xd4/0xff,0x21/0xff,0x6f/0xff), (0xd4/0xff,0x22/0xff,0x6e/0xff), (0xd5/0xff,0x23/0xff,0x6b/0xff), (0xd5/0xff,0x24/0xff,0x69/0xff),
		(0xd6/0xff,0x25/0xff,0x67/0xff), (0xd7/0xff,0x26/0xff,0x65/0xff), (0xd8/0xff,0x27/0xff,0x64/0xff), (0xd8/0xff,0x28/0xff,0x62/0xff), (0xd9/0xff,0x2a/0xff,0x60/0xff),
		(0xda/0xff,0x2b/0xff,0x5e/0xff), (0xda/0xff,0x2c/0xff,0x5c/0xff), (0xdb/0xff,0x2e/0xff,0x5a/0xff), (0xdb/0xff,0x2f/0xff,0x57/0xff), (0xdc/0xff,0x2f/0xff,0x54/0xff),
		(0xdd/0xff,0x30/0xff,0x51/0xff), (0xdd/0xff,0x31/0xff,0x4e/0xff), (0xde/0xff,0x32/0xff,0x4a/0xff), (0xde/0xff,0x33/0xff,0x47/0xff), (0xdf/0xff,0x34/0xff,0x44/0xff),
		(0xdf/0xff,0x35/0xff,0x41/0xff), (0xdf/0xff,0x36/0xff,0x3d/0xff), (0xe0/0xff,0x37/0xff,0x3a/0xff), (0xe0/0xff,0x38/0xff,0x37/0xff), (0xe0/0xff,0x39/0xff,0x33/0xff),
		(0xe1/0xff,0x3a/0xff,0x30/0xff), (0xe2/0xff,0x3b/0xff,0x2d/0xff), (0xe2/0xff,0x3c/0xff,0x2a/0xff), (0xe3/0xff,0x3d/0xff,0x26/0xff), (0xe3/0xff,0x3e/0xff,0x23/0xff),
		(0xe4/0xff,0x3f/0xff,0x20/0xff), (0xe4/0xff,0x41/0xff,0x1d/0xff), (0xe4/0xff,0x42/0xff,0x1c/0xff), (0xe5/0xff,0x43/0xff,0x1b/0xff), (0xe5/0xff,0x44/0xff,0x19/0xff),
		(0xe5/0xff,0x45/0xff,0x18/0xff), (0xe6/0xff,0x46/0xff,0x16/0xff), (0xe7/0xff,0x47/0xff,0x15/0xff), (0xe7/0xff,0x48/0xff,0x14/0xff), (0xe7/0xff,0x49/0xff,0x13/0xff),
		(0xe8/0xff,0x4a/0xff,0x12/0xff), (0xe8/0xff,0x4c/0xff,0x10/0xff), (0xe8/0xff,0x4c/0xff,0x0f/0xff), (0xe9/0xff,0x4d/0xff,0x0e/0xff), (0xe9/0xff,0x4d/0xff,0x0d/0xff),
		(0xea/0xff,0x4e/0xff,0x0c/0xff), (0xea/0xff,0x4f/0xff,0x0c/0xff), (0xeb/0xff,0x50/0xff,0x0b/0xff), (0xeb/0xff,0x51/0xff,0x0a/0xff), (0xeb/0xff,0x52/0xff,0x0a/0xff),
		(0xeb/0xff,0x53/0xff,0x09/0xff), (0xec/0xff,0x54/0xff,0x09/0xff), (0xec/0xff,0x56/0xff,0x08/0xff), (0xec/0xff,0x57/0xff,0x08/0xff), (0xec/0xff,0x58/0xff,0x08/0xff),
		(0xed/0xff,0x59/0xff,0x07/0xff), (0xed/0xff,0x5a/0xff,0x07/0xff), (0xed/0xff,0x5b/0xff,0x06/0xff), (0xee/0xff,0x5c/0xff,0x06/0xff), (0xee/0xff,0x5c/0xff,0x05/0xff),
		(0xee/0xff,0x5d/0xff,0x05/0xff), (0xee/0xff,0x5e/0xff,0x05/0xff), (0xef/0xff,0x5f/0xff,0x04/0xff), (0xef/0xff,0x60/0xff,0x04/0xff), (0xef/0xff,0x61/0xff,0x04/0xff),
		(0xef/0xff,0x62/0xff,0x04/0xff), (0xf0/0xff,0x63/0xff,0x03/0xff), (0xf0/0xff,0x64/0xff,0x03/0xff), (0xf0/0xff,0x65/0xff,0x03/0xff), (0xf1/0xff,0x66/0xff,0x03/0xff),
		(0xf1/0xff,0x66/0xff,0x03/0xff), (0xf1/0xff,0x67/0xff,0x03/0xff), (0xf1/0xff,0x68/0xff,0x03/0xff), (0xf1/0xff,0x69/0xff,0x02/0xff), (0xf1/0xff,0x6a/0xff,0x02/0xff),
		(0xf1/0xff,0x6b/0xff,0x02/0xff), (0xf1/0xff,0x6b/0xff,0x02/0xff), (0xf2/0xff,0x6c/0xff,0x01/0xff), (0xf2/0xff,0x6d/0xff,0x01/0xff), (0xf2/0xff,0x6e/0xff,0x01/0xff),
		(0xf3/0xff,0x6f/0xff,0x01/0xff), (0xf3/0xff,0x70/0xff,0x01/0xff), (0xf3/0xff,0x71/0xff,0x01/0xff), (0xf3/0xff,0x72/0xff,0x01/0xff), (0xf4/0xff,0x73/0xff,0x00/0xff),
		(0xf4/0xff,0x74/0xff,0x00/0xff), (0xf4/0xff,0x75/0xff,0x00/0xff), (0xf4/0xff,0x76/0xff,0x00/0xff), (0xf4/0xff,0x77/0xff,0x00/0xff), (0xf4/0xff,0x78/0xff,0x00/0xff),
		(0xf4/0xff,0x7a/0xff,0x00/0xff), (0xf5/0xff,0x7b/0xff,0x00/0xff), (0xf5/0xff,0x7c/0xff,0x00/0xff), (0xf5/0xff,0x7e/0xff,0x00/0xff), (0xf5/0xff,0x7f/0xff,0x00/0xff),
		(0xf6/0xff,0x80/0xff,0x00/0xff), (0xf6/0xff,0x81/0xff,0x00/0xff), (0xf6/0xff,0x82/0xff,0x00/0xff), (0xf7/0xff,0x83/0xff,0x00/0xff), (0xf7/0xff,0x84/0xff,0x00/0xff),
		(0xf7/0xff,0x85/0xff,0x00/0xff), (0xf7/0xff,0x86/0xff,0x00/0xff), (0xf8/0xff,0x87/0xff,0x00/0xff), (0xf8/0xff,0x88/0xff,0x00/0xff), (0xf8/0xff,0x88/0xff,0x00/0xff),
		(0xf8/0xff,0x89/0xff,0x00/0xff), (0xf8/0xff,0x8a/0xff,0x00/0xff), (0xf8/0xff,0x8b/0xff,0x00/0xff), (0xf8/0xff,0x8c/0xff,0x00/0xff), (0xf9/0xff,0x8d/0xff,0x00/0xff),
		(0xf9/0xff,0x8d/0xff,0x00/0xff), (0xf9/0xff,0x8e/0xff,0x00/0xff), (0xf9/0xff,0x8f/0xff,0x00/0xff), (0xf9/0xff,0x90/0xff,0x00/0xff), (0xf9/0xff,0x91/0xff,0x00/0xff),
		(0xf9/0xff,0x92/0xff,0x00/0xff), (0xf9/0xff,0x93/0xff,0x00/0xff), (0xfa/0xff,0x94/0xff,0x00/0xff), (0xfa/0xff,0x95/0xff,0x00/0xff), (0xfa/0xff,0x96/0xff,0x00/0xff),
		(0xfb/0xff,0x98/0xff,0x00/0xff), (0xfb/0xff,0x99/0xff,0x00/0xff), (0xfb/0xff,0x9a/0xff,0x00/0xff), (0xfb/0xff,0x9c/0xff,0x00/0xff), (0xfc/0xff,0x9d/0xff,0x00/0xff),
		(0xfc/0xff,0x9f/0xff,0x00/0xff), (0xfc/0xff,0xa0/0xff,0x00/0xff), (0xfc/0xff,0xa1/0xff,0x00/0xff), (0xfd/0xff,0xa2/0xff,0x00/0xff), (0xfd/0xff,0xa3/0xff,0x00/0xff),
		(0xfd/0xff,0xa4/0xff,0x00/0xff), (0xfd/0xff,0xa6/0xff,0x00/0xff), (0xfd/0xff,0xa7/0xff,0x00/0xff), (0xfd/0xff,0xa8/0xff,0x00/0xff), (0xfd/0xff,0xaa/0xff,0x00/0xff),
		(0xfd/0xff,0xab/0xff,0x00/0xff), (0xfd/0xff,0xac/0xff,0x00/0xff), (0xfd/0xff,0xad/0xff,0x00/0xff), (0xfd/0xff,0xae/0xff,0x00/0xff), (0xfe/0xff,0xaf/0xff,0x00/0xff),
		(0xfe/0xff,0xb0/0xff,0x00/0xff), (0xfe/0xff,0xb1/0xff,0x00/0xff), (0xfe/0xff,0xb2/0xff,0x00/0xff), (0xfe/0xff,0xb3/0xff,0x00/0xff), (0xfe/0xff,0xb4/0xff,0x00/0xff),
		(0xfe/0xff,0xb5/0xff,0x00/0xff), (0xfe/0xff,0xb6/0xff,0x00/0xff), (0xfe/0xff,0xb8/0xff,0x00/0xff), (0xfe/0xff,0xb9/0xff,0x00/0xff), (0xfe/0xff,0xb9/0xff,0x00/0xff),
		(0xfe/0xff,0xba/0xff,0x00/0xff), (0xfe/0xff,0xbb/0xff,0x00/0xff), (0xfe/0xff,0xbc/0xff,0x00/0xff), (0xfe/0xff,0xbd/0xff,0x00/0xff), (0xfe/0xff,0xbe/0xff,0x00/0xff),
		(0xfe/0xff,0xc0/0xff,0x00/0xff), (0xfe/0xff,0xc1/0xff,0x00/0xff), (0xfe/0xff,0xc2/0xff,0x00/0xff), (0xfe/0xff,0xc3/0xff,0x00/0xff), (0xfe/0xff,0xc4/0xff,0x00/0xff),
		(0xfe/0xff,0xc5/0xff,0x00/0xff), (0xfe/0xff,0xc6/0xff,0x00/0xff), (0xfe/0xff,0xc7/0xff,0x00/0xff), (0xfe/0xff,0xc8/0xff,0x00/0xff), (0xfe/0xff,0xc9/0xff,0x01/0xff),
		(0xfe/0xff,0xca/0xff,0x01/0xff), (0xfe/0xff,0xca/0xff,0x01/0xff), (0xfe/0xff,0xcb/0xff,0x01/0xff), (0xfe/0xff,0xcc/0xff,0x02/0xff), (0xfe/0xff,0xcd/0xff,0x02/0xff),
		(0xfe/0xff,0xce/0xff,0x03/0xff), (0xfe/0xff,0xcf/0xff,0x04/0xff), (0xfe/0xff,0xcf/0xff,0x04/0xff), (0xfe/0xff,0xd0/0xff,0x05/0xff), (0xfe/0xff,0xd1/0xff,0x06/0xff),
		(0xfe/0xff,0xd3/0xff,0x08/0xff), (0xfe/0xff,0xd4/0xff,0x09/0xff), (0xfe/0xff,0xd5/0xff,0x0a/0xff), (0xfe/0xff,0xd6/0xff,0x0a/0xff), (0xfe/0xff,0xd7/0xff,0x0b/0xff),
		(0xfe/0xff,0xd8/0xff,0x0c/0xff), (0xfe/0xff,0xd9/0xff,0x0d/0xff), (0xff/0xff,0xda/0xff,0x0e/0xff), (0xff/0xff,0xda/0xff,0x0e/0xff), (0xff/0xff,0xdb/0xff,0x10/0xff),
		(0xff/0xff,0xdc/0xff,0x12/0xff), (0xff/0xff,0xdc/0xff,0x14/0xff), (0xff/0xff,0xdd/0xff,0x16/0xff), (0xff/0xff,0xde/0xff,0x19/0xff), (0xff/0xff,0xde/0xff,0x1b/0xff),
		(0xff/0xff,0xdf/0xff,0x1e/0xff), (0xff/0xff,0xe0/0xff,0x20/0xff), (0xff/0xff,0xe1/0xff,0x22/0xff), (0xff/0xff,0xe2/0xff,0x24/0xff), (0xff/0xff,0xe2/0xff,0x26/0xff),
		(0xff/0xff,0xe3/0xff,0x28/0xff), (0xff/0xff,0xe4/0xff,0x2b/0xff), (0xff/0xff,0xe4/0xff,0x2e/0xff), (0xff/0xff,0xe5/0xff,0x31/0xff), (0xff/0xff,0xe6/0xff,0x35/0xff),
		(0xff/0xff,0xe6/0xff,0x38/0xff), (0xff/0xff,0xe7/0xff,0x3c/0xff), (0xff/0xff,0xe8/0xff,0x3f/0xff), (0xff/0xff,0xe9/0xff,0x43/0xff), (0xff/0xff,0xea/0xff,0x46/0xff),
		(0xff/0xff,0xeb/0xff,0x49/0xff), (0xff/0xff,0xeb/0xff,0x4d/0xff), (0xff/0xff,0xec/0xff,0x50/0xff), (0xff/0xff,0xed/0xff,0x54/0xff), (0xff/0xff,0xee/0xff,0x57/0xff),
		(0xff/0xff,0xee/0xff,0x5b/0xff), (0xff/0xff,0xee/0xff,0x5f/0xff), (0xff/0xff,0xef/0xff,0x63/0xff), (0xff/0xff,0xef/0xff,0x67/0xff), (0xff/0xff,0xf0/0xff,0x6a/0xff),
		(0xff/0xff,0xf0/0xff,0x6e/0xff), (0xff/0xff,0xf1/0xff,0x72/0xff), (0xff/0xff,0xf1/0xff,0x77/0xff), (0xff/0xff,0xf1/0xff,0x7b/0xff), (0xff/0xff,0xf2/0xff,0x80/0xff),
		(0xff/0xff,0xf2/0xff,0x85/0xff), (0xff/0xff,0xf2/0xff,0x8a/0xff), (0xff/0xff,0xf3/0xff,0x8e/0xff), (0xff/0xff,0xf4/0xff,0x92/0xff), (0xff/0xff,0xf4/0xff,0x96/0xff),
		(0xff/0xff,0xf4/0xff,0x9a/0xff), (0xff/0xff,0xf5/0xff,0x9e/0xff), (0xff/0xff,0xf5/0xff,0xa2/0xff), (0xff/0xff,0xf5/0xff,0xa6/0xff), (0xff/0xff,0xf6/0xff,0xaa/0xff),
		(0xff/0xff,0xf6/0xff,0xaf/0xff), (0xff/0xff,0xf7/0xff,0xb3/0xff), (0xff/0xff,0xf7/0xff,0xb6/0xff), (0xff/0xff,0xf8/0xff,0xba/0xff), (0xff/0xff,0xf8/0xff,0xbd/0xff),
		(0xff/0xff,0xf8/0xff,0xc1/0xff), (0xff/0xff,0xf8/0xff,0xc4/0xff), (0xff/0xff,0xf9/0xff,0xc7/0xff), (0xff/0xff,0xf9/0xff,0xca/0xff), (0xff/0xff,0xf9/0xff,0xcd/0xff),
		(0xff/0xff,0xfa/0xff,0xd1/0xff), (0xff/0xff,0xfa/0xff,0xd4/0xff), (0xff/0xff,0xfb/0xff,0xd8/0xff), (0xff/0xff,0xfc/0xff,0xdb/0xff), (0xff/0xff,0xfc/0xff,0xdf/0xff),
		(0xff/0xff,0xfd/0xff,0xe2/0xff), (0xff/0xff,0xfd/0xff,0xe5/0xff), (0xff/0xff,0xfd/0xff,0xe8/0xff), (0xff/0xff,0xfe/0xff,0xeb/0xff), (0xff/0xff,0xfe/0xff,0xee/0xff),
		(0xff/0xff,0xfe/0xff,0xf1/0xff), (0xff/0xff,0xfe/0xff,0xf4/0xff), (0xff/0xff,0xff/0xff,0xf6/0xff)
	]; 
mode = matplotlib.colors.ListedColormap(clist)  # 根据颜色列表,创建调色板
img = cv2.imdecode(np.fromfile(src, dtype=np.uint8), 0)
plt.imshow(img, cmap = mode)
以下是原始颜色:
var iron_palette = ["#00000a","#000014","#00001e","#000025","#00002a","#00002e","#000032","#000036","#00003a","#00003e","#000042","#000046","#00004a","#00004f","#000052","#010055","#010057","#020059","#02005c","#03005e","#040061","#040063","#050065","#060067","#070069","#08006b","#09006e","#0a0070","#0b0073","#0c0074","#0d0075","#0d0076","#0e0077","#100078","#120079","#13007b","#15007c","#17007d","#19007e","#1b0080","#1c0081","#1e0083","#200084","#220085","#240086","#260087","#280089","#2a0089","#2c008a","#2e008b","#30008c","#32008d","#34008e","#36008e","#38008f","#390090","#3b0091","#3c0092","#3e0093","#3f0093","#410094","#420095","#440095","#450096","#470096","#490096","#4a0096","#4c0097","#4e0097","#4f0097","#510097","#520098","#540098","#560098","#580099","#5a0099","#5c0099","#5d009a","#5f009a","#61009b","#63009b","#64009b","#66009b","#68009b","#6a009b","#6c009c","#6d009c","#6f009c","#70009c","#71009d","#73009d","#75009d","#77009d","#78009d","#7a009d","#7c009d","#7e009d","#7f009d","#81009d","#83009d","#84009d","#86009d","#87009d","#89009d","#8a009d","#8b009d","#8d009d","#8f009c","#91009c","#93009c","#95009c","#96009b","#98009b","#99009b","#9b009b","#9c009b","#9d009b","#9f009b","#a0009b","#a2009b","#a3009b","#a4009b","#a6009a","#a7009a","#a8009a","#a90099","#aa0099","#ab0099","#ad0099","#ae0198","#af0198","#b00198","#b00198","#b10197","#b20197","#b30196","#b40296","#b50295","#b60295","#b70395","#b80395","#b90495","#ba0495","#ba0494","#bb0593","#bc0593","#bd0593","#be0692","#bf0692","#bf0692","#c00791","#c00791","#c10890","#c10990","#c20a8f","#c30a8e","#c30b8e","#c40c8d","#c50c8c","#c60d8b","#c60e8a","#c70f89","#c81088","#c91187","#ca1286","#ca1385","#cb1385","#cb1484","#cc1582","#cd1681","#ce1780","#ce187e","#cf187c","#cf197b","#d01a79","#d11b78","#d11c76","#d21c75","#d21d74","#d31e72","#d32071","#d4216f","#d4226e","#d5236b","#d52469","#d62567","#d72665","#d82764","#d82862","#d92a60","#da2b5e","#da2c5c","#db2e5a","#db2f57","#dc2f54","#dd3051","#dd314e","#de324a","#de3347","#df3444","#df3541","#df363d","#e0373a","#e03837","#e03933","#e13a30","#e23b2d","#e23c2a","#e33d26","#e33e23","#e43f20","#e4411d","#e4421c","#e5431b","#e54419","#e54518","#e64616","#e74715","#e74814","#e74913","#e84a12","#e84c10","#e84c0f","#e94d0e","#e94d0d","#ea4e0c","#ea4f0c","#eb500b","#eb510a","#eb520a","#eb5309","#ec5409","#ec5608","#ec5708","#ec5808","#ed5907","#ed5a07","#ed5b06","#ee5c06","#ee5c05","#ee5d05","#ee5e05","#ef5f04","#ef6004","#ef6104","#ef6204","#f06303","#f06403","#f06503","#f16603","#f16603","#f16703","#f16803","#f16902","#f16a02","#f16b02","#f16b02","#f26c01","#f26d01","#f26e01","#f36f01","#f37001","#f37101","#f37201","#f47300","#f47400","#f47500","#f47600","#f47700","#f47800","#f47a00","#f57b00","#f57c00","#f57e00","#f57f00","#f68000","#f68100","#f68200","#f78300","#f78400","#f78500","#f78600","#f88700","#f88800","#f88800","#f88900","#f88a00","#f88b00","#f88c00","#f98d00","#f98d00","#f98e00","#f98f00","#f99000","#f99100","#f99200","#f99300","#fa9400","#fa9500","#fa9600","#fb9800","#fb9900","#fb9a00","#fb9c00","#fc9d00","#fc9f00","#fca000","#fca100","#fda200","#fda300","#fda400","#fda600","#fda700","#fda800","#fdaa00","#fdab00","#fdac00","#fdad00","#fdae00","#feaf00","#feb000","#feb100","#feb200","#feb300","#feb400","#feb500","#feb600","#feb800","#feb900","#feb900","#feba00","#febb00","#febc00","#febd00","#febe00","#fec000","#fec100","#fec200","#fec300","#fec400","#fec500","#fec600","#fec700","#fec800","#fec901","#feca01","#feca01","#fecb01","#fecc02","#fecd02","#fece03","#fecf04","#fecf04","#fed005","#fed106","#fed308","#fed409","#fed50a","#fed60a","#fed70b","#fed80c","#fed90d","#ffda0e","#ffda0e","#ffdb10","#ffdc12","#ffdc14","#ffdd16","#ffde19","#ffde1b","#ffdf1e","#ffe020","#ffe122","#ffe224","#ffe226","#ffe328","#ffe42b","#ffe42e","#ffe531","#ffe635","#ffe638","#ffe73c","#ffe83f","#ffe943","#ffea46","#ffeb49","#ffeb4d","#ffec50","#ffed54","#ffee57","#ffee5b","#ffee5f","#ffef63","#ffef67","#fff06a","#fff06e","#fff172","#fff177","#fff17b","#fff280","#fff285","#fff28a","#fff38e","#fff492","#fff496","#fff49a","#fff59e","#fff5a2","#fff5a6","#fff6aa","#fff6af","#fff7b3","#fff7b6","#fff8ba","#fff8bd","#fff8c1","#fff8c4","#fff9c7","#fff9ca","#fff9cd","#fffad1","#fffad4","#fffbd8","#fffcdb","#fffcdf","#fffde2","#fffde5","#fffde8","#fffeeb","#fffeee","#fffef1","#fffef4","#fffff6"];