规范化矩阵色图中的每一列MATLAB

时间:2016-04-23 10:45:28

标签: matlab matrix colors

我正在使用MATLAB绘制以下数据矩阵的色彩图:

1010.89914200000    1006.07847500000    1013.91775300000    1016.37012500000    1012.64447500000    1005.15384200000    998.323644400000    1007.09643600000    1010.39007800000    1010.71070000000    1007.75920300000    1003.43986900000    1001.77407500000    1000.93290600000    1009.19935000000    1010.79651100000    1006.15733600000    1001.08001400000    1006.62765600000    1008.98760600000    1012.59690300000    1014.13669400000    1012.41850000000    1002.83265600000
1010.20939200000    1006.22354400000    1014.13985000000    1016.01628600000    1012.16700600000    1004.47184200000    1000.64279200000    1006.93063300000    1009.98950000000    1010.53409400000    1007.46695300000    1003.07056100000    1001.31949400000    1001.61572800000    1009.12864700000    1010.45935000000    1006.24603900000    1001.40907500000    1006.31782500000    1009.00493300000    1012.13883300000    1013.93106700000    1011.88797800000    1003.01553600000
1009.70062500000    1006.35064700000    1014.37573900000    1015.70891100000    1011.51357800000    1003.79413100000    1001.69951400000    1006.79389200000    1009.72253100000    1010.41560600000    1007.01026100000    1002.91738300000    1000.86708100000    1002.11736400000    1009.09675300000    1009.98591400000    1005.46058600000    1000.94756700000    1006.18716400000    1008.73213100000    1012.14396700000    1013.51734400000    1010.97627200000    1003.29271400000
1009.45768300000    1006.17825800000    1014.67340300000    1015.64428600000    1011.30645600000    1003.37367500000    1001.93843600000    1006.59857800000    1009.45626700000    1010.25717800000    1006.66668100000    1003.00867800000    1001.13924400000    1002.74437200000    1009.14411900000    1009.62172200000    1005.50861100000    1000.11247800000    1006.11126700000    1008.63767200000    1012.11852500000    1013.46424200000    1010.52458300000    1003.95781100000
1009.26808100000    1006.29626900000    1014.67797500000    1015.67235600000    1011.20240600000    1003.14341400000    1000.42042500000    1006.97025800000    1009.47529700000    1010.42883100000    1006.41034400000    1003.31582500000    1001.22851700000    1003.87331700000    1009.01971100000    1009.26751700000    1004.97643300000    1000.38995600000    1006.25921900000    1008.81359400000    1012.25596700000    1013.53560600000    1010.21200300000    1004.63438300000
1009.71863900000    1006.81711100000    1014.88478900000    1016.09375300000    1011.26197200000    1003.11559200000    1000.71963300000    1007.50932500000    1009.46868300000    1010.70578900000    1006.41695000000    1003.87943100000    1001.47584700000    1004.88967200000    1009.38281100000    1009.50196100000    1005.06519200000    1001.66275800000    1006.49482200000    1009.35829200000    1012.54210000000    1013.92888300000    1009.72913100000    1005.35431100000
1010.74544400000    1007.71330600000    1015.30482800000    1016.41307200000    1011.40723900000    1003.05097800000    1001.88330600000    1007.78023100000    1009.79253600000    1011.11156400000    1006.55320300000    1004.49287800000    1001.40507500000    1005.91256700000    1009.88450300000    1009.38280000000    1004.75816700000    1003.58816900000    1006.68395600000    1009.83212800000    1012.71196100000    1014.27383300000    1009.46791900000    1005.91156100000
1011.06202800000    1008.61448600000    1016.07176900000    1016.77051900000    1011.43023100000    1002.91816900000    1003.01835800000    1008.37585300000    1010.16145800000    1011.46680800000    1006.80956900000    1004.88291700000    1001.64883900000    1006.73743100000    1010.37819200000    1009.44031900000    1005.11520300000    1004.70793600000    1007.29316900000    1010.53632800000    1013.30822200000    1014.53464700000    1009.54564700000    1006.43934700000
1011.16811700000    1009.12379400000    1016.69230000000    1017.09807500000    1011.42089200000    1002.90685800000    1003.45940000000    1008.64450600000    1010.42875300000    1011.61208900000    1006.92791100000    1004.99500600000    1001.85114700000    1007.48185600000    1010.74164700000    1009.37652200000    1005.22774400000    1005.74404200000    1008.04547500000    1011.20978900000    1013.70315600000    1014.90081400000    1009.46251700000    1007.25164700000
1010.77128100000    1009.35747200000    1016.79156100000    1016.94504400000    1011.34709700000    1002.68326400000    1004.21865300000    1008.90464200000    1010.65171700000    1011.66855800000    1006.76375000000    1004.84766700000    1001.64799400000    1007.95280800000    1011.15295600000    1008.96945800000    1004.99150800000    1006.73475300000    1008.30754700000    1011.69105600000    1014.00060300000    1015.01862800000    1009.08597500000    1007.85208300000
1010.13805300000    1009.61241400000    1016.74593600000    1016.61859700000    1011.07230300000    1002.35865300000    1004.26001400000    1008.88295800000    1010.48621700000    1011.41217200000    1006.14741900000    1004.82872800000    1001.26854200000    1008.04161100000    1011.11477800000    1008.65341400000    1004.63091100000    1007.43303300000    1008.40434700000    1011.74642800000    1014.01016900000    1014.80443600000    1008.33869400000    1007.93218300000
1009.50911900000    1009.62698100000    1016.46591900000    1015.96478900000    1010.07972200000    1001.85613100000    1004.44510800000    1008.68885000000    1009.90488600000    1010.78808600000    1005.41067200000    1004.68175000000    1000.73121900000    1007.96492200000    1011.01123900000    1008.22990300000    1003.85685000000    1007.24613600000    1008.27287800000    1012.14434200000    1013.92860000000    1014.61665800000    1007.55034400000    1008.09293300000
1008.70381100000    1009.61384700000    1015.81295800000    1015.06458300000    1008.88961700000    1000.62531700000    1004.21893300000    1008.20705000000    1009.58456400000    1010.16761700000    1004.43428100000    1004.27616900000    1000.27990000000    1007.68135000000    1010.75977200000    1007.51076700000    1002.70041700000    1006.61412500000    1008.12120300000    1012.10416700000    1013.70059700000    1014.09623100000    1006.09171400000    1008.05956900000
1008.02154700000    1009.64861100000    1015.14255300000    1014.23098600000    1008.14283900000    999.389411100000    1004.11294400000    1008.03047200000    1009.17975600000    1009.66578900000    1003.65600000000    1003.73793600000    999.649786100000    1007.55710300000    1010.73914200000    1006.48525600000    1001.60153900000    1006.51005600000    1007.86194700000    1011.76237200000    1013.33892200000    1013.76143300000    1004.98931400000    1007.96544700000
1007.77482500000    1009.85345300000    1014.92648900000    1013.59322500000    1007.68484400000    998.743208300000    1004.23994200000    1008.15078900000    1009.14176900000    1009.13383600000    1003.04438300000    1003.35990600000    999.229216700000    1007.35725800000    1010.77036400000    1006.11508100000    1001.06650600000    1006.27331900000    1008.08580600000    1011.76860000000    1013.18307200000    1013.39113600000    1003.78306100000    1007.80175600000
1007.69477800000    1010.25384700000    1014.99210800000    1013.30303900000    1007.45265800000    998.250572200000    1004.45173600000    1008.31279400000    1009.06058100000    1008.82283300000    1002.55153300000    1003.10945300000    999.019630600000    1007.24711700000    1010.81812500000    1006.09366700000    1000.98814200000    1006.25510800000    1008.09595800000    1011.79827200000    1013.07516400000    1013.10823300000    1003.03183900000    1008.06458600000
1007.77405000000    1010.73199400000    1015.15546900000    1013.15583900000    1007.25787500000    997.884352800000    1004.75770600000    1008.85976700000    1009.25861700000    1008.55503600000    1002.43732200000    1002.93201900000    998.928380600000    1007.53712200000    1010.76891400000    1006.20278600000    1000.95717200000    1006.24851400000    1008.26927500000    1011.92516700000    1013.04778600000    1012.83340000000    1002.36345600000    1008.45907200000
1008.10153900000    1011.22165600000    1015.49348900000    1013.28646400000    1007.37516700000    997.841966700000    1005.30818900000    1009.36494400000    1009.81374200000    1008.59688100000    1002.46048900000    1003.12547200000    998.873250000000    1008.09001100000    1010.74253600000    1006.00015800000    1001.09626700000    1006.44443300000    1008.61596400000    1012.13335000000    1013.32301100000    1012.72540800000    1001.82905800000    1008.71992200000
1008.42932800000    1012.08600000000    1015.93560300000    1013.55619200000    1007.18396400000    997.877988900000    1005.97368300000    1009.70238900000    1010.35090600000    1008.72040000000    1002.82235000000    1003.50095000000    998.968997200000    1008.71467200000    1011.18516100000    1006.09722800000    1001.00105000000    1006.51150600000    1008.80134200000    1012.38964200000    1013.64155000000    1012.74316400000    1001.41934400000    1008.87543300000
1008.61755800000    1012.61210000000    1016.07700000000    1013.93586700000    1007.27577800000    997.712516700000    1006.77127200000    1010.00605300000    1010.65426700000    1008.88601400000    1003.20735600000    1003.72689700000    999.271758300000    1009.20620300000    1011.16123600000    1006.69687200000    1000.70609700000    1006.79953300000    1009.01541700000    1012.91482800000    1014.02131100000    1012.95065300000    1001.67870000000    1009.32203600000
1008.56708100000    1012.99515000000    1016.33867800000    1013.68418100000    1007.24658600000    997.281041700000    1007.01185000000    1010.30151400000    1010.94030600000    1008.70953300000    1003.34373100000    1004.04526700000    999.558302800000    1009.36840300000    1011.30540300000    1006.56111700000    1000.80576400000    1007.06003900000    1009.30639400000    1013.20931400000    1014.27723600000    1013.05665800000    1001.85187500000    1009.70395300000
1008.29791700000    1013.28623100000    1016.51517200000    1014.03927800000    1006.84327200000    997.159275000000    1007.09736400000    1010.48451100000    1010.96097800000    1008.46591400000    1003.29630300000    1003.91275300000    1000.09343100000    1009.50430800000    1011.42889700000    1006.72751400000    1000.51083900000    1007.10306100000    1009.37503100000    1013.39047200000    1014.59432200000    1013.03755800000    1002.26636900000    1010.06034200000
1008.21371700000    1013.59691400000    1016.65878900000    1013.99910800000    1006.30900300000    997.142713900000    1007.04279200000    1010.75180300000    1011.00974400000    1008.16542800000    1003.24316900000    1003.42274700000    1000.31632800000    1009.49489200000    1011.19880800000    1007.23048900000    1000.05682200000    1007.13264700000    1009.40641100000    1013.34435800000    1014.59523900000    1012.99997500000    1002.45651400000    1010.21388600000
1007.63143900000    1013.69220800000    1016.52085600000    1013.28099200000    1005.84439200000    997.479972200000    1007.22611700000    1010.59871900000    1010.82017800000    1007.92970300000    1003.35441900000    1002.36780800000    1000.54393300000    1009.14068600000    1011.02388300000    1007.05475600000    1000.35642800000    1006.99240300000    1009.16368100000    1013.13141400000    1014.49421400000    1012.86652200000    1002.60169400000    1010.12598900000

使用:

imagesc(data)

现在我需要按以下方式分别对每列进行标准化:找到每列的最大值并设置它的颜色,找到每列的最低值并设置它的颜色。 所以最后我需要一个颜色图,它对于每个局部最大值和最小列都具有相同的颜色。

我对绘图很陌生,所以我尝试在这里和网上寻找标准化的色彩映射,但没有找到任何可以帮助我的东西。

1 个答案:

答案 0 :(得分:1)

您无法使用色彩图严格执行此操作,因为色彩图全局应用于图像,而一列中用于局部最大值的颜色将应用于 all 具有该值的元素,无论它们是否是它们各自列的局部最大值。

相反,您可以规范化数据的每一列,然后显示该列。

%// Subtract off the minimum of each column
D = bsxfun(@minus, data, min(data, [], 1));

%// Divide by the maximum
D = bsxfun(@rdivide, D, max(D, [], 1));

%// Display the result
imagesc(D);

enter image description here