Skip to content

Commit b36148d

Browse files
authored
Update matplotlib_seaborn.md
1 parent b2ad816 commit b36148d

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

data_visualization/matplotlib_seaborn.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ pd.set_option('max_columns', 200)
2020
nba = pd.read_excel("NBA_team_data.xlsx")
2121
```
2222

23+
## Visualizations
2324

24-
## Bar chart
25+
#### Bar chart
2526

2627
```
2728
nba_graph = nba[['TEAM','W']] \
@@ -33,3 +34,31 @@ plt.xlabel('Wins')
3334
plt.title('Number of victories by Team')
3435
plt.show()
3536
```
37+
38+
39+
#### Scatter plot with Matplotlib
40+
41+
```
42+
nba.plot(kind='scatter',
43+
x = 'W',
44+
y = 'PTS',
45+
title = 'Wins vs Points')
46+
plt.show()
47+
```
48+
49+
50+
#### Scatter plot with Seaborn
51+
52+
```
53+
nba_scatter = sns.scatterplot(
54+
x = 'W',
55+
y = 'PTS',
56+
hue = 'L',
57+
data=nba
58+
)
59+
60+
nba_scatter.set_title('Wins vs. Points')
61+
plt.show()
62+
```
63+
64+
plt.show()```

0 commit comments

Comments
 (0)