<jupyter_start><jupyter_text>https://pbpython.com/bullet-graph.html<jupyter_code>import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.ticker import FuncFormatter

%matplotlib inline
# display a palette of 5 shades of green
sns.palplot(sns.light_palette("green", 5))
# 8 different shades of purple in reverse order
sns.palplot(sns.light_palette("purple", 8, reverse=True))
# define the values we want to plot
limits = [80, 100, 150] # 3 ranges: 0-80, 81-100, 101-150
data_to_plot = ("Example 1", 105, 120) #“Example” line with a value of 105 and target line of 120
# blues color palette
palette = sns.color_palette("Blues_r", len(limits))
# build the stacked bar chart of the ranges
fig, ax = plt.subplots()
ax.set_aspect('equal')
ax.set_yticks([1])
ax.set_yticklabels([data_to_plot[0]])
ax.axvline(data_to_plot[2], color="gray", ymin=0.10, ymax=0.9)

prev_limit = 0
for idx, lim in enumerate(limits):
    ax.barh([1], lim-prev_limit, left=prev_limit, height=15, color=palette[idx])
    prev_limit = lim
# Draw the value we're measuring
ax.barh([1], data_to_plot[1], color='black', height=5)
ax.axvline(data_to_plot[2], color="gray", ymin=0.10, ymax=0.9)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1375, 'fraction_numerical': 0.050833333333333335, 'mean_word_length': 6.023391812865497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '246', 'license': 'MIT', 'n_tokens_mistral': 496, 'n_tokens_neox': 449, 'n_words': 119, 'path': 'styling/bullet_graph.ipynb', 'repo_name': 'TillMeineke/machine_learning', 'size': '1200'}