Making a heatmap from a table

조회 수: 8 (최근 30일)
christiaan van Weeghel
christiaan van Weeghel 2018년 3월 16일
댓글: christiaan van Weeghel 2018년 3월 16일
I'm currently working on analysing some data, and i'd like to view this in a heatmap. I've put all my data in a table with the genes im analyzing in the rows, and the patients in the columns. the names are to the sides of the table. The data runs from 1:1 to 125:6 but when i try to make a heatmap of all this data i get the error Error using heatmap (line 48) 'XVariable' value must reference a single variable in the source table. I've tried selecting all the data using H = Heatmap(Htable, 1:64, 1:125); Does anybody know how i can create a heatmap using all the data in the table. with the genes and patientnumbers added. The table was made by using array2table(data, 'rownames', Genes, 'variablenames', patientnumbers);

채택된 답변

Guillaume
Guillaume 2018년 3월 16일
It's not clear what is supposed to go in the x and y axis of your heat map and what defines the colour.
If the x axis is supposed to be the patient number, the y axis the gene and the colour, the value at the intersection of both, then your table is not constructed correctly for it. The easiest to get your heatmap is to bypass the table and use:
heatmap(patientnumbers, Genes, data);
  댓글 수: 1
christiaan van Weeghel
christiaan van Weeghel 2018년 3월 16일
This has created a heatmap, thank you. The labels happen to be a bit too small. (but that's because its 125/64). But im sure i can sort that out. Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by