<jupyter_start><jupyter_text>HW1. Contour Plot- Left\begin{equation*}Z = sinX + sinY\quad(X = [-2\pi, 2\pi], Y = [-2\pi, 2\pi])\end{equation*}- Right\begin{equation*}Z = Xe^{-X^2-Y^2}\quad(X = [-2, 2], Y = [-2, 2])\end{equation*}<jupyter_code># 필요한 library import
import numpy as np
import matplotlib.pyplot as plt
# plot할 수식, 축범위 생성
a = np.linspace(-2*np.pi,2*np.pi)
b = np.linspace(-2*np.pi,2*np.pi)
A,B = np.meshgrid(a,b)

d = np.linspace(-2,2)
e = np.linspace(-2,2)
D,E = np.meshgrid(d,e)

X = np.sin(A) + np.sin(B)
Y = D*np.exp(-D**2-E**2)
# Contour plot
plt.figure(figsize = (8,4))

plt.subplot(121)
C = plt.contour(A,B,X,10, cmap=plt.cm.Reds, linewidth=0.5)
plt.clabel(C, inline=1, fontsize=10)
plt.title('Z = sinX + sinY')
plt.xlabel('X')
plt.ylabel('Y')

plt.subplot(122)
C = plt.contour(D,E,Y,10, cmap=plt.cm.Blues, linewidth=0.5)
plt.clabel(C, inline=1, fontsize=10)
plt.title(r'$Z=Xe^{-X^2-Y^2}$')
plt.xlabel('X')
plt.ylabel('Y')

plt.tight_layout()
plt.show()<jupyter_output>C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'
  s)
{'fraction_non_alphanumeric': 0.22555066079295155, 'fraction_numerical': 0.04405286343612335, 'mean_word_length': 4.947643979057592, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '324964', 'license': 'MIT', 'n_tokens_mistral': 584, 'n_tokens_neox': 564, 'n_words': 91, 'path': 'Introduction to Atomospheric Chemistry/IAC_HW1.ipynb', 'repo_name': 'Choiwonbin/SNU', 'size': '1135'}