Skip to content

Instantly share code, notes, and snippets.

View fcunhaneto's full-sized avatar

Francisco Cunha Neto fcunhaneto

View GitHub Profile
@fcunhaneto
fcunhaneto / golang-linked-list.go
Created February 17, 2018 14:58 — forked from maksadbek/golang-linked-list.go
golang linked list implementation
package main
import "fmt"
type Node struct {
prev *Node
next *Node
key interface{}
}
@fcunhaneto
fcunhaneto / plotagem-simples.py
Last active September 5, 2018 11:49
matplot-pandas-1
import numpy as np
import matplotlib.pyplot as plt
"""
Plotagem de uma reta simples f(x) = 2x
"""
arr1 = np.array([1, 2, 3, 4, 5, 6, 7 ,8, 9, 10])
arr2 = np.array([2, 4, 6, 8, 10, 12, 14 ,16, 18, 20])
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-simples-label.py
Last active September 5, 2018 11:50
Matplot reta simples com labels
import numpy as np
import matplotlib.pyplot as plt
"""
Acrescentando Grid
"""
arr1 = np.array([1, 2, 3, 4, 5, 6, 7 ,8, 9, 10])
arr2 = np.array([2, 4, 6, 8, 10, 12, 14 ,16, 18, 20])
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-simples-grid.py
Last active September 5, 2018 11:51
Acrescentando labels a figuras com Matplot
import numpy as np
import matplotlib.pyplot as plt
"""
Acrescentando Grid
"""
arr1 = np.array([1, 2, 3, 4, 5, 6, 7 ,8, 9, 10])
arr2 = np.array([2, 4, 6, 8, 10, 12, 14 ,16, 18, 20])
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-simples-duas.py
Last active September 5, 2018 11:51
Matplot mais de uma linha em um gráfico.
import numpy as np
import matplotlib.pyplot as plt
"""
Mais de uma linha no gráfico
"""
x = np.arange(1, 11)
print(x)
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-simples-cores.py
Last active September 5, 2018 11:52
Criando e colorindo retas com Matplot.
import numpy as np
import matplotlib.pyplot as plt
"""
Escolhendo cores para as retas
"""
x = np.arange(1, 11)
print(x)
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-titulo-legendas.py
Last active September 5, 2018 11:52
Matplot inserindo titulo e legenda nos gráficos.
import numpy as np
import matplotlib.pyplot as plt
"""
Inserindo titulo e legendas
"""
x = np.arange(1, 11)
print(x)
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / retas-titulo-legenda.py
Last active September 5, 2018 11:52
Inserindo titulo e legendas.
import numpy as np
import matplotlib.pyplot as plt
"""
Inserindo titulo e legendas
"""
x = np.arange(1, 11)
print(x)
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / reta-legendas-centro.py
Last active September 5, 2018 11:53
Matplot selecionando posição das legendas
import numpy as np
import matplotlib.pyplot as plt
"""
Selecionando posição das legendas
"""
x = np.arange(1, 11)
print(x)
plt.figure(figsize=(6, 4))
@fcunhaneto
fcunhaneto / matplot-pandas-1.py
Last active September 4, 2018 17:04
Pandas lendo arquivos .csv
import pandas as pl
import matplotlib.pyplot as plt
"""
Lendo um arquivo .csv com pandas e criando um pandas data frame
"""
dataframe = pl.read_csv('/home/francisco/Projects/Pycharm/matplot-pandas-tutorial'
'/files/annual-real-gnp-us-1909-to-1970.csv')
plt.figure(figsize=(8, 6))