# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import matplotlib.pyplot as plt;
import numpy as np;
import pandas as pd;

# %matplotlib inline
# -

x = np.linspace(0,10,20)

y = np.random.randint(0,50,20)

plt.plot(x,y)

np.sort(y)

y = np.sort(y)

plt.plot(x,y)

plt.plot(x,y,'r')

plt.plot(x,y,color='#ffb546')

plt.plot(x,y,color='#262626')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Learning Matplotlib')
plt.show()

plt.plot(x,y,'ro-',markersize=5)
plt.plot(x,y2,'b*--')

y2 = y*x

plt.subplot(1,2,1)
plt.plot(x,y,'ro-',markersize=5)
plt.subplot(1,2,2)
plt.plot(x,y2,'b*--')
plt.show()

# ### Matlab vs Matplotlib

fig = plt.figure()
axes = fig.add_axes([0.1,0.1,1,1])
axes.plot(x,y,'r')
axes.set_xlabel('xLabel')
axes.set_ylabel('yLabel')
axes.set_title('Title')

# +
fig = plt.figure()
ax1 = fig.add_axes([0,0,1,1])
ax2 = fig.add_axes([0.1,0.6,0.4,0.3])

ax1.plot(x,y,'r')
ax1.set_xlabel('xLabel')
ax1.set_ylabel('yLabel')
ax1.set_title('Title')
ax2.plot(x,y2,'b')
ax2.set_xlabel('xLabel')
ax2.set_ylabel('yLabel')
ax2.set_title('Title')
# -

fig,ax = plt.subplots(1,2)
ax[0].plot(x,y,'b')
ax[1].plot(x,y2,'r')

fig,ax = plt.subplots(figsize=(8,4),dpi=100)
ax.plot(x,y,'r')

fig,ax = plt.subplots()
ax.plot(x,y,'bH--')

plt.scatter(x,y)

plt.hist(y)

data = [np.random.normal(0,3.3,100) for std in range(0,3)]
data

plt.boxplot(data,vert=True, patch_artist=True)
import seaborn as sns;

sns.boxplot(data,orient='h')

fig,ax = plt.subplots(1,2, figsize=(10,4))
ax[0].plot(x,y,x,y2)
ax[1].plot(x,np.exp(x))
ax[1].set_yscale('log')
fig.tight_layout()



StarcoderdataJupyterScriptsDedupFiltered