How to Create a Publication-Quality Heatmap in Python

<p>Heatmaps can be used as informative figures to convey quantitative data. They can be used to convey data in an easy-to-read format providing a concise data summary.</p> <p>Python has a number of tools to facilitate the production of publication quality heatmaps. These include the Seaborn and Matplotlib libraries, in addition to the subplot2grid libraries which can provide a convenient way to organise data in a heatmap.</p> <p>In this tutorial, I will detail the steps required to produce a heatmap which focuses on the presence/absence of key elements. To do this, I will use a CSV file containing fictitious data about a selection of bacterial isolates. These bacterial strains have a number of features including antibiotic resistance genes, virulence genes, and certain capsule types. A heatmap will allow the quick inspection and comparison between the various strains.</p> <p>While the example used focuses on bacterial strains, the techniques applied can be used more broadly for other datasets to help you visualised your data using a heatmap. Throughout the following tutorial, all images are by the author.</p> <h2>Objective</h2> <p>To create a publication quality heatmap displaying the presence/absence of key genes from fictitious bacterial strains.</p> <p>This tutorial will use the following csv file, &lsquo;Bacterial_strain_heatmap_tutorial_data.csv&rsquo; available from the&nbsp;Github repository.</p> <p><a href="https://towardsdatascience.com/how-to-create-a-publication-quality-heatmap-in-python-e4a7feb3c079">Click Here</a></p>