- Research article
- Open Access
Heat map visualization for electrocardiogram data analysis
BMC Cardiovascular Disorders volume 20, Article number: 277 (2020)
Most electrocardiogram (ECG) studies still take advantage of traditional statistical functions, and the results are mostly presented in tables, histograms, and curves. Few papers display ECG data by visual means. The aim of this study was to analyze and show data for electrocardiographic left ventricular hypertrophy (LVH) with ST-segment elevation (STE) by a heat map in order to explore the feasibility and clinical value of heat mapping for ECG data visualization.
We sequentially collected the electrocardiograms of inpatients in the First Affiliated Hospital of Shantou University Medical College from July 2015 to December 2015 in order to screen cases of LVH with STE. HemI 1.0 software was used to draw heat maps to display the STE of each lead of each collected ECG. Cluster analysis was carried out based on the heat map and the results were drawn as tree maps (pedigree maps) in the heat map.
In total, 60 cases of electrocardiographic LVH with STE were screened and analyzed. STE leads were mainly in the V1, V2 and V3 leads. The ST-segment shifts of each lead of each collected ECG could be conveniently visualized in the heat map. According to cluster analysis in the heat map, STE leads were clustered into two categories, comprising of the right precordial leads (V1, V2, V3) and others (V4, V5, V6, I, II, III, aVF, aVL, aVR). Moreover, the STE amplitude in 40% (24 out of 60) of cases reached the threshold specified in the STEMI guideline. These cases also could be fully displayed and visualized in the heat map. Cluster analysis in the heat map showed that the III, aVF and aVR leads could be clustered together, the V1, V2, V3 and V4 leads could be clustered together, and the V5, V6, I and aVL leads could be clustered together.
Heat maps and cluster analysis can be used to fully display every lead of each electrocardiogram and provide relatively comprehensive information.
Electrocardiography, a non-invasive and economical detection method, is widely used in clinical practice [1, 2]. An electrocardiogram (ECG) contains multiple lead data, and the combinations of different ECG lead shifts have different clinical significance [2, 3]. Therefore, in clinical research, it would be helpful for readers to analyze, understand and memorize the data and research conclusion by showing the individual ECG results for each lead . Nevertheless, for the moment, most clinical ECG studies still take advantage of traditional statistical functions, and their results are mostly presented by traditional charts, such as tables, histograms, and curves. Traditional charts have difficulty fully showing the details of each case, and only briefly quantify the proportion of target changes and the average value of the changes. Moreover, traditional charts cannot show data intuitively, which is not conducive to a synthesized understanding of the results .
A heat map is a graphical representation of data that simultaneously reveals the row and column hierarchical cluster structure in a data matrix . Different colors are used to represent the magnitude of a certain monitoring value. By virtue of the inherent sensitivity of human beings to color, heat maps transform data into a color summary, which makes the distribution and characteristics of the data clear at a glance and makes it easy to distinguish and summarize abnormalities [6, 7]. Moreover, individual data points can be grouped together based on their corresponding heat map color [6, 7]. In all, a heat map conveys complex data concisely and completely at a single glance.
At present, heat maps are mainly used to display genome sequencing results . We found that the structure of ECG data is similar to the structure of genome sequencing data. Each subject has a large number of observed values (leads vs. genes), and the observed values are quantitative (amplitude vs. gene expression level). Their high level of similarity in data structure suggests that heat maps can be applied to visualization of ECG data. Therefore, we analyzed and displayed data for left ventricular hypertrophy (LVH) with ST-segment elevation (STE) by a heat map in order to explore the feasibility and clinical value of heat map visualization and representation of ECG data. Our hypothesis was that heat maps could be used to fully display each lead of each ECG, and cluster analysis of in heat maps could help discover the potential association between different ECG leads.
We sequentially collected the electrocardiograms of inpatients in the First Affiliated Hospital of Shantou University Medical College from July 2015 to December 2015 in order to screen the cases of LVH with STE. Inclusion criteria included: 1) an ECG that conformed to Sokolow-Lyon criteria: RV5 + SV1 ≥ 4.0 mV (males), RV5 + SV1 ≥ 3.5 mV (females) ; 2) an ST-segment elevation that appeared in any ECG lead and an elevation amplitude greater than 0.05 mV ; 3) patient age older than 18 years. Exclusion criteria included confounding factors that may affect the ST-segment, such as myocardial infarction, ectopic rhythm, pacemaker implantation, myocarditis, pericarditis, congenital heart disease, or cardiomyopathy [11, 12]. Relevant ECG features, including heart rate, rhythm, STE and T waveform, were collected by cardiologists. For ECGs with STE, the magnitude of elevation was further evaluated . Continuous variables are reported as mean (SD) or median (IQR), as appropriate. Categorical variables are described with absolute and relative frequencies. The study was approved by the ethics committee of Shantou University Medical College.
Drawing the heat map
First, HemI 1.0 software (Huazhong University of Science and Technology, Hubei, China) was used to draw a heat map for displaying STE in each lead of each collected electrocardiogram . HemI software used a red, green, and blue tricolor in a 256-color mode. The inputted ST-segment data were linearly normalized as below:
NV = normalized value;
OV = original value;
Max = the maximum of all OVs;
Min = the minimum of all OVs.
The transverse axis of the heat map represented the leads of the ECG and the longitudinal axis represented the cases. Each lattice color represented an ST-segment condition, with blue representing a normal or depressed ST-segment, red representing an elevated ST-segment, and the lattice color changing from blue to red representing the extent of increase in ST-segment amplitude. Second, we analyzed the ECG leads whose elevation amplitude reached the STE threshold specified in the ST-segment elevation myocardial infarction (STEMI) guideline and then displayed them in a heat map. Each lattice color represented an STE condition. Red expressed an ST-segment magnitude meeting the thresholds specified in STEMI guidelines, while blue expressed an ST-segment magnitude that did not meet the STEMI criteria for STE.
Conducting cluster analysis
We also conducted a cluster analysis based on the heat map to discover the association of ECG lead shifts. The results of cluster analysis were drawn as tree maps (pedigree maps) in the heat map. Conventionally, the tree map was attached to the heat map and could be considered part of a heat map.
Cluster analysis techniques are classified as hierarchical and nonhierarchical clustering algorithms. The choice of a cluster analysis techniques depends on the nature of variables. In the initial step, two objects with the lowest distance are combined into a cluster. In the next step, the remaining objects are analyzed one by one, and each object is classified into the previous existing cluster or a new cluster according to its distance from the analyzed objects. The process is repeated until each object has been identified and allocated to a specific cluster. Three types of linkage criteria (average linkage clustering, minimum linkage clustering, and maximum linkage clustering) can be adopted for the hierarchical clustering algorithms (Supplementary Table S1) . The most appropriate clustering algorithm that turn out to be the most meaningful for a particular application is chosen. In this study, average linkage clustering was used to conduct a cluster analysis (Supplementary Table S1) [8, 14].
Acute coronary artery occlusion was considered in the following cases: STE > 0.1 mV in all leads other than leads V2-V3, where the following cutoff points apply: STE > 0.2 mV in men ≥40 years; STE ≥0.25 mV in men < 40 years, or STE ≥0.15 mV in women . The ST-segment shift should be present in two or more contiguous leads .
In total, 60 cases of electrocardiographic LVH with STE were screened and analyzed. We found that the STE changes in these cases appeared mainly in the V1, V2 and V3 leads. The frequency of STE in these leads was 65, 91.7 and 63.3%, and the elevation ranges were 0.15 (0.1–0.2) mV, 0.2 (0.1–0.3) mV and 0.175 (0.15–0.3) mV, respectively (Table 1). Commonly used heat map generation methods were found to be able to generate a heat map and conduct cluster analysis for these results. The STE of each lead of each collected electrocardiogram was displayed in a heat map (Fig. 1). According to the tree map in the heat map, ECG leads were clustered into two categories based on the STE condition, including the right precordial leads (V1, V2, V3) and others (V4, V5, V6, I, II, III, aVF, aVL, aVR) (Fig. 1).
The STE amplitude in some of these cases even reached the threshold specified in the STEMI guidelines . When the STEMI threshold was used to judge the STE, the STE frequencies of the V1, V2 and V3 leads were 61.67, 38.33 and 26.67% respectively. Similarly, we found that commonly used methods could generate a heat map and conduct cluster analysis successfully for these results. According to the heat map cluster analysis, the leads with STE reaching the prescribed threshold could also be clustered into three categories, which showed that the III, aVF and aVR leads could be clustered together, the V1, V2, V3 and V4 leads could be clustered together, and V5, V6, I and aVL leads could be clustered together (Fig. 2).
The traditional text-based data processing and display model has restricted the interpretation of big data in the life sciences. It is extremely difficult for traditional charts to fully display each lead of each ECG within the space of a limited paper. Current electrocardiogram studies just use traditional charts to show the proportion and average changes of each lead, but visualization technology can be helpful for audiences to understand, analyze and memorize information, and also discover important hidden information [16, 17]. A heat map is a commonly used visualization tool, which can provide clues for data mining and has wide prospects for application in the field of medical science . A heat map displays data through color depth, which is intuitive and readable, and can help non-statisticians understand and analyze data [5, 16]. In our study, we tried to apply heat map data visualization technology to display and analyze ECG data.
Previous studies have shown that the incidence of mistaken diagnosis of acute myocardial infarction in “chest pain centers” is relatively high, and the occurrence of mistaken diagnosis events is closely related to electrocardiographic LVH with STE [19,20,21]. In our paper, we analyze and display data for LVH with STE by a heat map to explore the feasibility and clinical value of heat mapping for ECG data visualization. Using heat maps to display ST- segment elevation data shows the following advantages: (1) Commonly used heat map generation methods could be easily used to generate a heat map for ST- segment elevation data. (2) Compared with traditional tables, heat maps can fully display each lead of each ECG and provide physicians with more comprehensive information. By means of heat map visualization, physicians are able to understand the ECG characteristics of LVH with STE more thoroughly [19, 22]. (3) Showing each lead of each case can help researchers locate the lesion in a specific area of the heart for each individual easily. (4) Moreover, fully displaying each lead aids in discovering combined lesions in different heart areas. (5) The details of atypical combination of lead shifts in rare cases can be shown to audiences in a heat map, which may help reduce misdiagnosis.
In our study, we also used cluster analysis to explore the combination of STE leads in patients with electrocardiographic LVH. We found that the cluster analysis applied to clinical ECG research could help researchers explore the correlation between different leads. It might help researchers locate ECG changes (primary territory affected) more easily and discover atypical combination of leads. In rare cases with atypical lead combinations, traditional methods rely on the subjective judgment of the researchers to identify clinical significance. Researchers often need to classify cases with similar clinical manifestations and then analyze their electrocardiograms to identify atypical ECG lead combination characteristics. However, heat map-based cluster analysis can provide us with an objective classification result and identify hidden interconnections of each lead. Investigators can directly obtain an atypical lead combination and then analyze relevant cases to determine if it is clinically meaningful. This provides a new analytical method for researchers. For example, the cluster analysis in our paper found that III, aVF and aVR leads could be clustered together base on ST-segment conditions in patients with LVH. This finding indicates that one should be very cautious in diagnosing acute inferior myocardial infarction in patients with LVH when STE appears in the III, aVF and aVR leads simultaneously. In summary, cluster analysis in heat map is a powerful tool for discovering the combinations of lead shifts.
Each ECG includes 12–18 leads, and provides quantitative data, such as the amplitude of the ST-segment shift, Q wave depth, and R/S ratio. Traditional charts have difficulty in fully showing such a large amount of data. For instance, a study by Shemirani et al. explored the predictive value of ECG on criminal vessels in patients with acute posterior myocardial infarction . One hundred thirty-eight cases were included in their study. If they wanted to display the data of each lead, data for 2484 leads would need to be displayed, an impossibility for a traditional chart. Thus, their paper just used tables to show the proportion and average magnitude of ECG shifts in each lead. Through reading their paper, readers can only conclude that the frequency of the ST-segment shift in the V5, V6, I and aVL leads is higher in patients with acute circumflex occlusion, while the frequency of the ST- segment shift in V1, V3R and V4R leads is higher in patients with right coronary artery occlusion. However, their paper cannot show the regularity of combination of each lead. In another study, Wu et al. found that J waves in patients with acute myocardial infarction are an independent risk factor for poor prognosis . Nonetheless, this paper could not demonstrate the combination of J wave occurrences in different leads in each case, let alone the amplitude of J waves in each lead, which is not helpful for audiences to identify high-risk cases in clinical practice. These examples illustrate the challenge of traditional charts in displaying ECG results. Previous publication has demonstrated that professional interpreting graphics with missing data tended to misinterpret the results . Viewing more complete graphics may enhance the quality of decision. Hence, a data visualization tool, such as a heat map, may be useful and necessary for these two studies to compare and distinguish each lead shift of each collected cases. The heat map facilitates easy-to-implement visualization of ECG changes and number of changed leads.
Moreover, a heat map can also help to explore the relationship between each lead through cluster analysis. Cluster analysis is a statistical analysis technique, which classifies the research objects into relatively homogeneous groups [25, 26]. Cluster analysis provides additional information to help researchers discover the interconnection of each lead. The results of cluster analysis can be drawn as tree maps in the heat map. The tree graph attached to the heat map shows the entire process of clustering and displays which leads are grouped together from the visual level . Conventionally, the tree map is attached to the heat map and could be considered part of a heat map.
For the moment, most published clinical ECG studies cannot fully display individual ECG data [16, 27]. Heat mapping might be an effective way to solve the difficulty of displaying ECG data to help readers interpret, communicate, and remember the ECG shift trends [5, 16]. Heat mapping may be used to display various features of an electrocardiogram, such as P wave duration, P wave voltage, QRS duration, QRS voltage, P-R duration and QT duration. More importantly, there is no technical threshold to produce heat maps. Our study found that commonly used heat map generation software can generate heat maps and conduct cluster analysis for ECG data without a requirement for special techniques. HemI software, R software, GraphPad prism software, online tools and even Microsoft Excel software can be used to draw heat maps easily and quickly. Therefore, together with utility (functional effectiveness) and usability (perceived ease of use), heat maps can be a useful tool for ECG data analysis. Given the importance of ECG in clinical practice, such visualization may help physicians increase knowledge of ECG and improve the quality when making decisions.
Firstly, compared with traditional tables, heat maps may not be precise enough for reporting quantitative data. However, heat maps can be used as an additional tool to display data more comprehensively and help readers better understand the results. Secondly, in our paper, we applied heat mapping to show STE in LVH cases to evaluate the value of heat mapping in ECG visualization. Since the ECG data came from our ongoing projects, our research objective, data collection and relevant conclusions are incomplete. Nevertheless, the data of LVH with STE are used as demonstration examples to confirm the advantages and feasibility of heat mapping in displaying ECG data. The main purpose of this paper was to use part of the data in our ongoing project to draw heat maps in order to verify the feasibility of using heat maps. More details of LVH findings will be published after our project is completed. Thirdly, the content of this paper may be relatively simple because it only introduces how to apply heat mapping to the visualization of ECG data. However, based on our study, heat mapping to express and analyze ECG data will be evaluated by more and more researchers, which may promote application of heat mapping to clinical ECG research. Moreover, there are several open access databases with large amount of ECG data (STAFF III ECG database, PhysioNet databases, etc.) [28, 29]. Our study may facilitate database administrators and researchers to apply heat maps to display and analyze electrogram data. To the best of our knowledge, this is the first attempt to apply heat mapping to ECG data display.
Commonly used heat map generation methods could be used to generate a heat map for ST- segment elevation data. Heat maps and cluster analysis can be used to fully display each lead of each electrocardiogram and provide relatively comprehensive information. Heat mapping is a powerful tool for data visualization in clinical electrocardiogram research.
Availability of data and materials
Raw data supporting the obtained results are available at the corresponding author.
Left ventricular hypertrophy
ST-segment elevation myocardial infarction
Mond HG. The Spectrum of ambulatory electrocardiographic monitoring. Heart Lung Circ. 2017;26(11):1160–74.
Lindow T, Birnbaum Y, Nikus K, Maan A, Ekelund U, Pahlm O. Why complicate an important task? An orderly display of the limb leads in the 12-lead electrocardiogram and its implications for recognition of acute coronary syndrome. BMC Cardiovasc Disord. 2019;19(1):13.
Cortez D, Baturova M, Lindgren A, Carlson J, Shubik YV, Olsson B, Platonov PG. Atrial time and voltage dispersion are both needed to predict new-onset atrial fibrillation in ischemic stroke patients. BMC Cardiovasc Disord. 2017;17(1):200.
Pravdic D. “who” can be found in and beyond of an electrocardiographic strip. Pacing Clin Electrophysiol. 2014;37(3):265–78.
Ohannessian R, Benet T, Argaud L, Guerin C, Guichon C, Piriou V, Rimmele T, Girard R, Gerbier-Colomban S, Vanhems P. Heat map for data visualization in infection control epidemiology: an application describing the relationship between hospital-acquired infections, simplified acute physiological score II, and length of stay in adult intensive care units. Am J Infect Control. 2017;45(7):746–9.
Wilkinson L, Friendly M. The history of the cluster heat map. Am Stat. 2009;63(2):179–84.
Kellom M, Raymond J. Using dendritic heat maps to simultaneously display genotype divergence with phenotype divergence. PLoS One. 2016;11(8):e0161292.
Deng W, Wang Y, Liu Z, Cheng H, Xue Y. HemI: a toolkit for illustrating heatmaps. PLoS One. 2014;9(11):e111988.
Devereux RB, Casale PN, Eisenberg RR, Miller DH, Kligfield P. Electrocardiographic detection of left ventricular hypertrophy using echocardiographic determination of left ventricular mass as the reference standard. Comparison of standard criteria, computer diagnosis and physician interpretation. J Am Coll Cardiol. 1984;3(1):82–7.
Ibanez B, James S, Agewall S, Antunes MJ, Bucciarelli-Ducci C, Bueno H, Caforio ALP, Crea F, Goudevenos JA, Halvorsen S, et al. 2017 ESC guidelines for the management of acute myocardial infarction in patients presenting with ST-segment elevation: the task force for the management of acute myocardial infarction in patients presenting with ST-segment elevation of the European Society of Cardiology (ESC). Eur Heart J. 2018;39(2):119–77.
Kosuge M, Uchida K, Imoto K, Hashiyama N, Ebina T, Hibi K, Tsukahara K, Maejima N, Masuda M, Umemura S, et al. Frequency and implication of ST-T abnormalities on hospital admission electrocardiograms in patients with type a acute aortic dissection. Am J Cardiol. 2013;112(3):424–9.
Larson DM, Menssen KM, Sharkey SW, Duval S, Schwartz RS, Harris J, Meland JT, Unger BT, Henry TD. “False-positive” cardiac catheterization laboratory activation among patients with suspected ST-segment elevation myocardial infarction. Jama. 2007;298(23):2754–60.
Rokos IC, French WJ, Mattu A, Nichol G, Farkouh ME, Reiffel J, Stone GW. Appropriate cardiac cath lab activation: optimizing electrocardiogram interpretation and clinical decision-making for acute ST-elevation myocardial infarction. Am Heart J. 2010;160(6):995–1003 1003.e1001–1008.
Sokal RRM, C.D. A statistical method for evaluating systematic relationships. Univ Kansas Sci Bull. 1958;38(2):1409–38.
Thygesen K, Alpert JS, Jaffe AS, Simoons ML, Chaitman BR, White HD, Katus HA, Lindahl B, Morrow DA, Clemmensen PM, et al. Third universal definition of myocardial infarction. Circulation. 2012;126(16):2020–35.
Carroll LN, Au AP, Detwiler LT, Fu TC, Painter IS, Abernethy NF. Visualization and analytics tools for infectious disease epidemiology: a systematic review. J Biomed Inform. 2014;51:287–98.
Matzen LE, Haass MJ, Divis KM, Wang Z, Wilson AT. Data visualization saliency model: a tool for evaluating abstract data visualizations. IEEE Trans Vis Comput Graph. 2018;24(1):563–73.
Fernandez NF, Gundersen GW, Rahman A, Grimes ML, Rikova K, Hornbeck P, Ma'ayan A. Clustergrammer, a web-based heatmap visualization and analysis tool for high-dimensional biological data. Scientific Data. 2017;4:170151.
Shamim S, McCrary J, Wayne L, Gratton M, Bogart DB. Electrocardiograhic findings resulting in inappropriate cardiac catheterization laboratory activation for ST-segment elevation myocardial infarction. Cardiovasc Diagn Ther. 2014;4(3):215–23.
Garvey JL, Monk L, Granger CB, Studnek JR, Roettig ML, Corbett CC, Jollis JG. Rates of cardiac catheterization cancelation for ST-segment elevation myocardial infarction after activation by emergency medical services or emergency physicians: results from the North Carolina catheterization laboratory activation registry. Circulation. 2012;125(2):308–13.
Lu N, Zhu JX, Yang PX, Tan XR. Models for improved diagnosis of left ventricular hypertrophy based on conventional electrocardiographic criteria. BMC Cardiovasc Disord. 2017;17(1):217.
Armstrong EJ, Kulkarni AR, Bhave PD, Hoffmayer KS, Macgregor JS, Stein JC, Kinlay S, Ganz P, McCabe JM. Electrocardiographic criteria for ST-elevation myocardial infarction in patients with left ventricular hypertrophy. Am J Cardiol. 2012;110(7):977–83.
Shemirani H, Nayeri-Torshizi E. Electrocardiographic characteristics of posterior myocardial infarction in comparison to angiographic findings. ARYA Atherosclerosis. 2015;11(1):30–5.
Wu CI, Chang SL, Lin CY, Vicera JJB, Lin YJ, Lo LW, Chung FP, Hu YF, Chang TY, Chao TF, et al. Clinical significance of J wave in prediction of ventricular arrhythmia in patients with acute myocardial infarction. J Cardiol. 2019;73(5):351–7.
Boudier A, Curjuric I, Basagana X, Hazgui H, Anto JM, Bousquet J, Bridevaux PO, Dupuis-Lozeron E, Garcia-Aymerich J, Heinrich J, et al. Ten-year follow-up of cluster-based asthma phenotypes in adults. A pooled analysis of three cohorts. Am J Respir Crit Care Med. 2013;188(5):550–60.
Dunn H, Quinn L, Corbridge SJ, Eldeirawi K, Kapella M, Collins EG. Cluster analysis in nursing research: an introduction, historical perspective, and future directions. West J Nurs Res. 2018;40(11):1658–76.
Driscoll T, Gabbard JL, Mao C, Dalay O, Shukla M, Freifeld CC, Hoen AG, Brownstein JS, Sobral BW. Integration and visualization of host-pathogen data related to infectious diseases. Bioinformatics (Oxford, England). 2011;27(16):2279–87.
Laguna P, Sornmo L. The STAFF III ECG database and its significance for methodological development and evaluation. J Electrocardiol. 2014;47(4):408–17.
Silva I, Moody GB. An open-source toolbox for analysing and processing physioNet databases in MATLAB and octave. J Open Res Software. 2014;2(1):e27.
The authors gratefully acknowledge Dr. Stanley L. Lin and Dr. Xiaohan Chen for English language editing.
The authors acknowledge that the present research was sponsored by Medical Scientific Research Foundation of Guangdong Province of China (A2019219), Science and Technology Plan Project of Shantou City (Shantou  No. 5–7), and Strategic Fund for Science and Technology Innovation in Guangdong Province (Vertical Collaborative Management Direction) (2018–157-42). All funding bodies were not involved in the study design, data collection, analysis and interpretation of data, or writing of the manuscript.
Ethics approval and consent to participate
The study was approved by the ethics committee of Shantou University Medical College. The need for consent was waived because of the retrospective data. Dr. Xiansheng Huang granted administrative permissions to access the raw data.
Consent for publication
The authors declare that they have no competing interests.
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
About this article
Cite this article
Guo, H., Zhang, W., Ni, C. et al. Heat map visualization for electrocardiogram data analysis. BMC Cardiovasc Disord 20, 277 (2020). https://doi.org/10.1186/s12872-020-01560-8
- Heat map
- Data analysis