<jupyter_start><jupyter_text>Create a heat map with matplotlib<jupyter_code>import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

%matplotlib inline
plt.rcParams["figure.figsize"] = (12, 9)
# Create random(ish) data.
rng = np.random.RandomState(42)
values = rng.randint(1, 1000, size=(6, 6))
data = pd.DataFrame(values, columns=list("ABCDEF"), index=list("GHIJKL"))
print(data)
# Create the heat map.
plt.pcolormesh(data.values, cmap="Oranges", linewidth=1, edgecolor="white")
# Reverse the y axis so that the first row of the data frame is at the top of the chart.
plt.gca().invert_yaxis()
# Update the x and y tick labels.
plt.xticks(np.arange(6) + 0.5, data.columns, fontsize=16)
plt.yticks(np.arange(6) + 0.5, data.index, fontsize=16)
# Add labels for each data point.
for x in range(6):
    for y in range(6):
        plt.text(x + 0.5, y + 0.5, data.iloc[y, x], va="center", ha="center", fontsize=16)
# Add a colour bar.
plt.colorbar()

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.148, 'fraction_numerical': 0.031, 'mean_word_length': 4.923076923076923, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '83069', 'license': 'Unlicense', 'n_tokens_mistral': 404, 'n_tokens_neox': 377, 'n_words': 110, 'path': 'matplotlib - heat map.ipynb', 'repo_name': 'mostlyoxygen/notes', 'size': '1000'}