<jupyter_start><jupyter_text>Set color- http://matplotlib.org/2.0.2/api/colors_api.html<jupyter_code>X_1 = range(100)
Y_1 = [value for value in X]

X_2 = range(100)
Y_2 = [value + 100 for value in X]

plt.plot(X_1, Y_1, color="#000000")
plt.plot(X_2, Y_2, c="c")

plt.show()<jupyter_output><empty_output><jupyter_text>Set linestyle- https://matplotlib.org/examples/lines_bars_and_markers/linestyles.html<jupyter_code>plt.plot(X_1, Y_1, c="b", linestyle="dashed")
plt.plot(X_2, Y_2, c="r", ls="dotted")

plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed")
plt.plot(X_2, Y_2, color="r", linestyle="dotted")

plt.title("Two lines")
plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed")
plt.plot(X_2, Y_2, color="r", linestyle="dotted")

plt.title('$y = \\frac{ax + b}{test}$')
plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed")
plt.plot(X_2, Y_2, color="r", linestyle="dotted")

plt.title('$y = ax+b$')
plt.xlabel('$x_line$')
plt.ylabel('y_line')

plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed")
plt.plot(X_2, Y_2, color="r", linestyle="dotted")

plt.text(50, 70, "Line_1")
plt.annotate(
    'line_2', xy=(50, 150), xytext=(20, 175),
    arrowprops=dict(facecolor='black', shrink=0.05))

plt.title('$y = ax+b$')
plt.xlabel('$x_line$')
plt.ylabel('y_line')

plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed", label='line_1')
plt.plot(X_2, Y_2, color="r", linestyle="dotted", label='line_2')
plt.legend(shadow=True, fancybox=False, loc="upper right")

plt.title('$y = ax+b$')
plt.xlabel('$x_line$')
plt.ylabel('y_line')


plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed", label='line_1')
plt.plot(X_2, Y_2, color="r", linestyle="dotted", label='line_2')
plt.legend(shadow=True, fancybox=True, loc="lower right")


plt.grid(True, lw=0.4, ls="--", c=".90")
plt.xlim(-1000, 2000)
plt.ylim(-1000, 2000)

plt.show()
plt.plot(X_1, Y_1, color="b", linestyle="dashed", label='line_1')
plt.plot(X_2, Y_2, color="r", linestyle="dotted", label='line_2')

plt.grid(True, lw=0.4, ls="--", c=".90")
plt.legend(shadow=True, fancybox=True, loc="lower right")
plt.xlim(-100, 200)
plt.ylim(-200, 200)
plt.savefig("test.png", c="a")
plt.show()<jupyter_output><empty_output><jupyter_text>Scatter<jupyter_code>data_1 = np.random.rand(512, 2)
data_2 = np.random.rand(512, 2)

plt.scatter(data_1[:,0], data_1[:,1], c="b", marker="x")
plt.scatter(data_2[:,0], data_2[:,1], c="r", marker="o")

plt.show()
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2 
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()<jupyter_output><empty_output><jupyter_text>Bar chart<jupyter_code>data = [[5., 25., 50., 20.],
        [4., 23., 51., 17],
        [6., 22., 52., 19]]

X = np.arange(0,8,2)
plt.bar(X + 0.00, data[0], color = 'b', width = 0.50)
plt.bar(X + 0.50, data[1], color = 'g', width = 0.50)
plt.bar(X + 1.0, data[2], color = 'r', width = 0.50)
plt.xticks(X+0.50, ("A","B","C", "D"))
plt.show()
data = np.array([[5., 25., 50., 20.],
        [4., 23., 51., 17],
        [6., 22., 52., 19]])

color_list = ['b', 'g', 'r']
data_label = ["A","B","C"]
X = np.arange(data.shape[1])
X
data = np.array([[5., 5., 5., 5.],
        [4., 23., 51., 17],
        [6., 22., 52., 19]])

for i in range(3):
    plt.bar(X, data[i], bottom = np.sum(data[:i], axis=0), 
            color = color_list[i], label=data_label[i])
plt.legend()
plt.show()


A = [5., 30., 45., 22.]
B = [5, 25, 50, 20]

X = range(4)

plt.bar(X, A, color = 'b')
plt.bar(X, B, color = 'r', bottom = 60)
plt.show()
women_pop = np.array([5, 30, 45, 22])
men_pop = np.array([5, 25, 50, 20])
X = np.arange(4)

plt.barh(X, women_pop, color = 'r')
plt.barh(X, -men_pop, color = 'b')
plt.show()
X = np.arange(100)
plt.hist(X,bins=5)
plt.show()

data = np.random.randn(100,5)
plt.boxplot(data)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24967824967824967, 'fraction_numerical': 0.07027027027027027, 'mean_word_length': 4.852409638554217, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '369941', 'license': 'MIT', 'n_tokens_mistral': 2023, 'n_tokens_neox': 1770, 'n_words': 336, 'path': 'inflearn_machine_learning/code/ch6/1_basic_plot.ipynb', 'repo_name': 'Junhojuno/TIL', 'size': '3885'}