<jupyter_start><jupyter_text>Heighway Dragon
 Imports<jupyter_code>from dragon import heighway_dragon
from matplotlib import rcParams, pyplot as plt

rcParams['text.usetex'] = True
directory = "../fig/"<jupyter_output><empty_output><jupyter_text>Plot
 Steps<jupyter_code>def plot(ax, i):
    x, y = heighway_dragon((0, 1), (0, 0), i)

    ax.plot(x[:len(x)//2 + 1], y[:len(y)//2 + 1], 'b')
    ax.plot(x[len(x)//2:], y[len(y)//2:], 'r')

    ax.set_axis_off()
    ax.set_aspect("equal")
    ax.set_title("Step " + str(i))
fig, axs = plt.subplots(3, 3)
fig.tight_layout()

axs = axs.flatten()
for i in range(9):
    axs[i].set_aspect("equal")
    plot(axs[i], i + 1)

plt.savefig(directory + "heighway.pdf", bbox_inches="tight")<jupyter_output><empty_output><jupyter_text>Large<jupyter_code>fig, ax = plt.subplots()

x, y = heighway_dragon((0, 1), (0, 0), 16)
plt.plot(x[:len(x)//2 + 1], y[:len(y)//2 + 1], 'b', lw=0.3)
plt.plot(x[len(x)//2:], y[len(y)//2:], 'r', lw=0.3)

ax.set_axis_off()
plt.savefig("../fig/heighway-large.pdf", bbox_inches = "tight")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21711711711711712, 'fraction_numerical': 0.02702702702702703, 'mean_word_length': 4.315789473684211, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '615669', 'license': 'MIT', 'n_tokens_mistral': 536, 'n_tokens_neox': 511, 'n_words': 80, 'path': 'ps1-fractals/p2-heighway-dragon/heighway-dragon.ipynb', 'repo_name': 'slhshamloo/comp-phys', 'size': '1110'}