November 2016
Beginner to intermediate
941 pages
21h 55m
English
Let's look at how to visualize heat maps in this recipe. This is a pictorial representation of data where two groups are associated point by point. The individual values that are contained in a matrix are represented as color values in the plot.
import numpy as np import matplotlib.pyplot as plt
# Define the two groups group1 = ['France', 'Italy', 'Spain', 'Portugal', 'Germany'] group2 = ['Japan', 'China', 'Brazil', 'Russia', 'Australia']
# Generate some random values data = np.random.rand(5, 5)
# Create a figure fig, ax = plt.subplots()
# Create the heat map heatmap = ax.pcolor(data, ...