import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()

# ----- プロットデータ作成 -----
x1 = np.linspace(-10, 10, 128)
y1 = np.sin(x1)

# ----- プロット -----
plt.rcParams["font.size"] = 18
plot_ex = fig.add_subplot(1,1,1)
plot_ex.set_title("$y=\sin(x)$")
plot_ex.set_xlabel(r"$\theta$ [deg]", fontsize=20, fontname='serif')
plot_ex.set_ylabel("Amplitude",       fontsize=20, fontname='serif')
plot_ex.tick_params(axis='both', length=10, which='major')
plot_ex.tick_params(axis='both', length=5,  which='minor')
plot_ex.set_xlim([-10, 10])
plot_ex.set_ylim([-1.2,1.2])
plot_ex.minorticks_on()
kwargs_ex = {'markeredgecolor':'black', 'markerfacecolor':'red'}
plot_ex.plot(x1, y1, marker='o', markersize=8, **kwargs_ex)

# ----- スクリーン表示 -----
fig.tight_layout()
plt.show()

# ----- pdf 作成 -----
fig.savefig('plot_ex.pdf', orientation='portrait', \
            transparent=False, bbox_inches=None, frameon=None)
fig.clf()
