Você está na página 1de 1

Scater plot

import matplotlib.pyplot as plt

x = [1,2,3,4,5,6,7,8]
y = [5,2,4,2,1,4,5,2]

plt.scatter(x,y, label='skitscat', color='k', s=25, marker="o")

plt.xlabel('x')
plt.ylabel('y')
plt.title('Interesting Graph\nCheck it out')
plt.legend()
plt.show()

Subplot
import random
import matplotlib.pyplot as plt
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
def create_plots():
xs = []
ys = []

for i in range(10):
x=i
y = random.randrange(10)

xs.append(x)
ys.append(y)
return xs, ys

ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212)

x,y = create_plots()
ax1.plot(x,y)
x,y = create_plots()
ax2.plot(x,y)
plt.show()

Você também pode gostar