```python
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
import numpy as np
import sympy as sym
```


```python
def f(X, Y):
    return X**2 + 2*Y**2
```


```python
X1 = np.arange(-5, 5, 0.1) # -5 ile +5 arasında 0.1'er artan 100 nokta
Y1 = np.arange(-5, 5, 0.1) # -5 ile +5 arasında 0.1'er artan 100 nokta
Z1 = np.zeros(len(X1))

for i in range(len(X1)):
    Z1[i] = X1[i]**2 + 2*Y1[i]**2 # x^2 + 2*y^2
    
X1, Y1 = np.meshgrid(X1, Y1)
Z1 = f(X1, Y1)
```

### Surface Plots


```python
fig = plt.figure()
ax = plt.axes(projection='3d')
ax.plot_surface(X1, Y1, Z1, rstride=1, cstride=1, 
                cmap='viridis', edgecolor='none')
ax.set_title('surface')
plt.show()
```


```python
ax.view_init(60, 35)
fig
```

### Three-dimensional Contour Plots


```python
fig = plt.figure()
ax = plt.axes(projection='3d')
ax.contour3D(X1, Y1, Z1, 50, cmap='binary')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z');
plt.show()
```


```python
ax.view_init(60, 35)
fig
```

### Two-dimensional Contour Plots


```python
plt.figure()
cs = plt.contour(X1, Y1, Z1)
plt.clabel(cs, inline=1, fontsize=10)
plt.title('Two-dimensional contour plot')
plt.show()
```


```python

```

62ea2fe886ebaf10c33fcc9d888a82e9ddcad807
ipynb
Jupyter Notebook
Data Visualization.ipynb
fzehracetin/optimization-techniques
ff5f91b2b387e89e75d6727f3185552b064e280e
Apache-2.0
2020-07-21T12:59:51.000Z
2020-07-21T12:59:51.000Z
Data Visualization.ipynb
fzehracetin/optimization-techniques
ff5f91b2b387e89e75d6727f3185552b064e280e
Apache-2.0
Data Visualization.ipynb
fzehracetin/optimization-techniques
ff5f91b2b387e89e75d6727f3185552b064e280e
Apache-2.0
Qwen/Qwen-72B
1. YES
2. YES