Python 9 pyplot

 0    22 flashcards    swiatangielskiego
download mp3 print play test yourself
 
Question Answer
import wykresów
start learning
import matplotlib. pyplot as plt
wykres dwie osie blue circle lub red plus
start learning
plt. plot(x, y, 'bo') plt. plot(x, y, 'r+') plt. plot(x, y, 'bo', x, y, 'r+')
wykres słupkowy pionowy
start learning
plt. bar(x, y, yerr=variance, color='blue')
wykres słupkowy poziomy
start learning
plt. barh(x, y, xerr=variance, color='blue')
wykres słupkowy podwójny
start learning
plt. bar(x, y, 0.3, color='red', label='Label1') plt. bar(x + 0.3, y, 0.3, color='blue', label='Label2')
wykres kołowy
start learning
plt. pie(lista, explode=explode, labels=firms, shadow=True, startangle=45)
wykres histogram
start learning
plt. hist(x, 10)
wykres rozproszony
start learning
plt. scatter(x, y)
tytuł wykresu
start learning
plt. title='asd1'
legenda wykresu i po prawej stronie
start learning
plt. legend() plt. legend(title='Firms') plt. axis('equal')
tytuł osi x y
start learning
plt. xlabel('X') plt. ylabel('Y')
wykresy wyświetlane jednocześnie
start learning
plt. figure(1, figsize=(10, 10)) plt. plot(x, y, 'bo')
kilka wykresów na jednej figurze
start learning
plt. figure(1, figsize=(10, 10)) plt. subplot(2, 2, 1) plt. plot(x, y, 'bo')
tytuł kilku wykresów
start learning
plt. suptitle('Sub title')
wyświetl wykres
start learning
plt. show()
wykres rozproszony na bazie df
start learning
df. plot(kind='scatter', x='kolumna', y='kolumna', title=")
histogram na bazie df
start learning
df['kolumna']. plot(kind='hist', title='Score')
wykres słupkowy na bazie df
start learning
df['kolumna']. plot(kind='bar') barh
wykres kołowy na bazie df
start learning
df['kolumna']. plot(kind='pie')
pudelkowy na bazie df
start learning
df['kolumna']. plot(kind='box')
wykres subplot
start learning
fig, axes = plt. subplots(nrows=2, ncols=2) df. plot(ax=axes[0, 0], kind='hist')
kolorowanie wykresu rozproszonego
start learning
plt. scatter(df. col1, df. col2, c=colors) colors = np. array(["#f442bf", "#6e41f4", "#f4dc41"])[df[1]. cat. codes]

You must sign in to write a comment