<jupyter_start><jupyter_text>Default subplots fig : 1 ax: 1, 1<jupyter_code>fig, ax = plt.subplots()
ax.plot(x, y1, label="sine wave")
ax.plot(x, y2, label="linear line")
ax.plot(x, y3, label="quadratic curve")

ax.legend(fontsize="small", loc="upper center", ncol=3)

ax.set_title("three functions", fontsize="medium")
ax.set_xlabel("x values", fontsize="small")
ax.set_ylabel("y values", fontsize="small")

plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>fig : 1 ax: 2, 1<jupyter_code>fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1)
ax1.plot(x, y1, label="sine wave")
ax2.plot(x, y2, label="linear line")
ax2.plot(x, y3, label="quadratic curve")

ax1.legend(fontsize="small", loc="upper center", ncol=1)
ax2.legend(fontsize="small", loc="upper center", ncol=2)

ax1.set_title("sine wave", fontsize="medium")
# ax1.set_xlabel("x values", fontsize="small")
ax1.set_ylabel("y values", fontsize="small")

# ax2.set_title("non-wave plot", fontsize="medium")
ax2.set_xlabel("x values", fontsize="small")
ax2.set_ylabel("y values", fontsize="small")

plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>fig : 1 ax : 2, 1 share x-axis<jupyter_code>fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, sharex=True)
                                                #share x-axis
ax1.plot(x, y1, label="sine wave", color="green")
ax2.plot(x, y2, label="linear line")
ax2.plot(x, y3, label="quadratic curve")

ax1.legend(fontsize="small", loc="upper center", ncol=1)
ax2.legend(fontsize="small", loc="upper center", ncol=2)

ax1.set_title("sine wave", fontsize="medium")
# ax1.set_xlabel("x values", fontsize="small")
ax1.set_ylabel("y values", fontsize="small")

# ax2.set_title("non-wave plot", fontsize="medium")
ax2.set_xlabel("x values", fontsize="small")
ax2.set_ylabel("y values", fontsize="small")

plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>fig : 2<jupyter_code>fig1, ax1 = plt.subplots()
fig2, ax2 = plt.subplots()

ax1.plot(x, y1, label="sine wave", color="green")
ax2.plot(x, y2, label="linear line")
ax2.plot(x, y3, label="quadratic curve")

ax1.legend(fontsize="small", loc="upper center", ncol=1)
ax2.legend(fontsize="small", loc="upper center", ncol=2)

ax1.set_title("sine wave", fontsize="medium")
ax1.set_xlabel("x values", fontsize="small")
ax1.set_ylabel("y values", fontsize="small")

ax2.set_title("non-wave plot", fontsize="medium")
ax2.set_xlabel("x values", fontsize="small")
ax2.set_ylabel("y values", fontsize="small")

plt.tight_layout()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19229272090307512, 'fraction_numerical': 0.028804982483456597, 'mean_word_length': 7.006230529595015, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '399052', 'license': 'Apache-2.0', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1027, 'n_words': 185, 'path': 'Subplots.ipynb', 'repo_name': 'chentalen2021/Matplotlib', 'size': '2569'}