<jupyter_start><jupyter_text>This is clunky in notebooks, but hovering will give the x/y of the bar. Use zooming to make this more responsive.<jupyter_code>fig, ax = plt.subplots()
ax.bar(list(counter.keys()), list(counter.values()))
fig.suptitle('Amount of string references by function, sorted by address')
ax.set_xlabel('Functions (mangled)')
ax.set_ylabel('Number of embedded strings')
ax.set_xticks(ticks=[])
mplcursors.cursor(hover=True)
fig;
# bytes as y-axis instead.
byte_counter = defaultdict(int)
for k, v in addr_func_d.items():
    bites = d[k][1]
    for value in v:
        byte_counter[value] += bites
temp_d = {}
for k in counter:
    temp_d[k] = byte_counter[k]
byte_counter = temp_d

fig, ax = plt.subplots()

ax.bar(list(byte_counter.keys()), list(byte_counter.values()))
fig.suptitle('Function byte usage, sorted by address')
ax.set_xlabel('Functions (mangled)')
ax.set_ylabel('Amount of bytes it references')
ax.set_xticks(ticks=[])
mplcursors.cursor(hover=True)

fig;
# sort this one by increasing
sorted_byte_counter = {k: v for k, v in sorted(
    byte_counter.items(), key=itemgetter(1))}
fig, ax = plt.subplots()

ax.set_yscale('log')
ax.bar(list(sorted_byte_counter.keys()), list(sorted_byte_counter.values()))

fig.suptitle('Functions sorted by byte usage')
ax.set_xlabel('Functions (mangled)')
ax.set_ylabel('Amount of bytes (log scale)')
ax.set_xticks(ticks=[])
mplcursors.cursor(hover=True)
fig;
# x-axis being strings (could dereference these strings)
# y-axis being amount of times referenced
sym_magnitudes = {}
for k, v in addr_func_d.items():
    sym_magnitudes[k] = len(v)

fig, ax = plt.subplots()

ax.bar(list(sym_magnitudes.keys()), list(sym_magnitudes.values()))
fig.suptitle('Amount of times strings are referenced')
ax.set_xlabel('Strings')
ax.set_ylabel('Number of references')
ax.set_xticks(ticks=[])
mplcursors.cursor(hover=True)
fig;<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1433804290947148, 'fraction_numerical': 0.0010465724751439038, 'mean_word_length': 6.134328358208955, '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': '156891', 'license': 'MIT', 'n_tokens_mistral': 695, 'n_tokens_neox': 676, 'n_words': 167, 'path': 'earlgrey-nexysvideo-analysis(risc-v).ipynb', 'repo_name': 'barneyga/tock-embedded-data', 'size': '1911'}