# ---
# 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
# ---

# + papermill={"duration": 0.024222, "end_time": "2021-01-10T16:03:17.569908", "exception": false, "start_time": "2021-01-10T16:03:17.545686", "status": "completed"} tags=[]
import matplotlib.pyplot as plt
import numpy as np

# + [markdown] papermill={"duration": 0.011109, "end_time": "2021-01-10T16:03:17.592837", "exception": false, "start_time": "2021-01-10T16:03:17.581728", "status": "completed"} tags=[]
# # Videoaula

# + papermill={"duration": 0.174697, "end_time": "2021-01-10T16:03:17.778706", "exception": false, "start_time": "2021-01-10T16:03:17.604009", "status": "completed"} tags=[]
from IPython.display import YouTubeVideo
YouTubeVideo("DT02qw14Xzk")

# + papermill={"duration": 0.022433, "end_time": "2021-01-10T16:03:17.813592", "exception": false, "start_time": "2021-01-10T16:03:17.791159", "status": "completed"} tags=[]
plt.rcParams.update({'font.size':14})

# + papermill={"duration": 0.027191, "end_time": "2021-01-10T16:03:17.853653", "exception": false, "start_time": "2021-01-10T16:03:17.826462", "status": "completed"} tags=[]
x = np.arange(5)
x

# + papermill={"duration": 0.026073, "end_time": "2021-01-10T16:03:17.892995", "exception": false, "start_time": "2021-01-10T16:03:17.866922", "status": "completed"} tags=[]
poupanca = [1500, 32000, 54000, 2300, 91000]
poupanca

# + papermill={"duration": 0.933889, "end_time": "2021-01-10T16:03:18.840310", "exception": false, "start_time": "2021-01-10T16:03:17.906421", "status": "completed"} tags=[]
plt.bar(x,poupanca,color = 'limegreen',edgecolor = 'teal',linewidth = 2,\
       hatch = '*')
plt.ylabel('Poupança (R$)',fontsize = 18)
plt.savefig('GraficoBarras.png',dpi = 600,bbox_inches = 'tight')
plt.show()

# + [markdown] papermill={"duration": 0.013817, "end_time": "2021-01-10T16:03:18.868773", "exception": false, "start_time": "2021-01-10T16:03:18.854956", "status": "completed"} tags=[]
# {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

# + papermill={"duration": 0.023998, "end_time": "2021-01-10T16:03:18.906864", "exception": false, "start_time": "2021-01-10T16:03:18.882866", "status": "completed"} tags=[]
pessoas = ['Ana','Pedro','Paulo','Carla', 'Andre']
pessoas

# + papermill={"duration": 0.991699, "end_time": "2021-01-10T16:03:19.913103", "exception": false, "start_time": "2021-01-10T16:03:18.921404", "status": "completed"} tags=[]
plt.bar(x,poupanca,color = 'limegreen',edgecolor = 'teal',linewidth = 2,\
       hatch = '*')
plt.xticks(x,pessoas,rotation = 45)
plt.ylabel('Poupança (R$)',fontsize = 18)
plt.savefig('GraficoBarras.png',dpi = 600,bbox_inches = 'tight')
plt.show()

# + papermill={"duration": 0.023553, "end_time": "2021-01-10T16:03:19.952497", "exception": false, "start_time": "2021-01-10T16:03:19.928944", "status": "completed"} tags=[]
from matplotlib.ticker import FuncFormatter


# + papermill={"duration": 0.024336, "end_time": "2021-01-10T16:03:19.992718", "exception": false, "start_time": "2021-01-10T16:03:19.968382", "status": "completed"} tags=[]
def mil(x,pos):
    return f'R$ {x*1e-3:.1f}k'


# + papermill={"duration": 0.025974, "end_time": "2021-01-10T16:03:20.034759", "exception": false, "start_time": "2021-01-10T16:03:20.008785", "status": "completed"} tags=[]
formatter = FuncFormatter(mil)

# + papermill={"duration": 0.924, "end_time": "2021-01-10T16:03:20.975204", "exception": false, "start_time": "2021-01-10T16:03:20.051204", "status": "completed"} tags=[]
fig,ax = plt.subplots()
ax.yaxis.set_major_formatter(formatter)
barras = plt.bar(x,poupanca,color = 'mediumorchid',edgecolor = 'plum',linewidth = 2,\
       hatch = '*')
barras[0].set_hatch('+')
barras[1].set_hatch('o')
barras[4].set_hatch('/')
plt.xticks(x,pessoas,rotation = 45)
plt.ylabel('Poupança',fontsize = 18)
plt.savefig('GraficoBarras.png',dpi = 600,bbox_inches = 'tight')
plt.show()

# + papermill={"duration": 0.01726, "end_time": "2021-01-10T16:03:21.009735", "exception": false, "start_time": "2021-01-10T16:03:20.992475", "status": "completed"} tags=[]


StarcoderdataJupyterScriptsDedupFiltered