<ggplot: (383084815)>
English
Graphics
English
The little monkey hangs confidently by a branch.
Graphics
<ggplot: (383084815)>
English
Article: The
Adjective: little
Noun: monkey
Verb: hangs
Adverb: Confidently
Proposition: by
Noun: a branch
Graphics
geom_line
geom_point
plotnine
Date: data to be plotted
economics
economics
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 574 entries, 0 to 573
Data columns (total 6 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 date 574 non-null datetime64[ns]
1 pce 574 non-null float64
2 pop 574 non-null int64
3 psavert 574 non-null float64
4 uempmed 574 non-null float64
5 unemploy 574 non-null int64
dtypes: datetime64[ns](1), float64(3), int64(2)
memory usage: 27.0 KB
economics
economics
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 574 entries, 0 to 573
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 date 574 non-null datetime64[ns]
1 pce 574 non-null float64
2 pop 574 non-null int64
3 psavert 574 non-null float64
4 uempmed 574 non-null float64
5 unemploy 574 non-null int64
6 year 574 non-null int64
7 month 574 non-null int64
dtypes: datetime64[ns](1), float64(3), int64(4)
memory usage: 36.0 KB
economics
Every column is a variable.
Every row is an observation.
Every cell is a single value.
economics
Aesthetic means “something you can see”.
position (i.e., on the x and y axes)
color (“outside” color)
fill (“inside” color)
shape (of points)
Actual marks we put on a plot
source: https://nbisweden.github.io/RaukR-2019/ggplot/presentation/ggplot_presentation.html#17
mpg
manufacturer | model | displ | year | cyl | trans | drv | cty | hwy | fl | class | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | audi | a4 | 1.8 | 1999 | 4 | auto(l5) | f | 18 | 29 | p | compact |
1 | audi | a4 | 1.8 | 1999 | 4 | manual(m5) | f | 21 | 29 | p | compact |
2 | audi | a4 | 2.0 | 2008 | 4 | manual(m6) | f | 20 | 31 | p | compact |
3 | audi | a4 | 2.0 | 2008 | 4 | auto(av) | f | 21 | 30 | p | compact |
4 | audi | a4 | 2.8 | 1999 | 6 | auto(l5) | f | 16 | 26 | p | compact |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
229 | volkswagen | passat | 2.0 | 2008 | 4 | auto(s6) | f | 19 | 28 | p | midsize |
230 | volkswagen | passat | 2.0 | 2008 | 4 | manual(m6) | f | 21 | 29 | p | midsize |
231 | volkswagen | passat | 2.8 | 1999 | 6 | auto(l5) | f | 16 | 26 | p | midsize |
232 | volkswagen | passat | 2.8 | 1999 | 6 | manual(m5) | f | 18 | 26 | p | midsize |
233 | volkswagen | passat | 3.6 | 2008 | 6 | auto(s6) | f | 17 | 26 | p | midsize |
234 rows × 11 columns
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 234 entries, 0 to 233
Data columns (total 11 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 manufacturer 234 non-null category
1 model 234 non-null category
2 displ 234 non-null float64
3 year 234 non-null int64
4 cyl 234 non-null int64
5 trans 234 non-null category
6 drv 234 non-null category
7 cty 234 non-null int64
8 hwy 234 non-null int64
9 fl 234 non-null category
10 class 234 non-null category
dtypes: category(6), float64(1), int64(4)
memory usage: 14.0 KB
displ - a car’s engine size, in litres.
hwy - a car’s fuel efficiency on the highway, in miles per gallon (mpg)
Subplots that each display one subset of the data.
Visualize AirPassengers dataset.
Dataset: available at https://thiyanga-spatiotemporal.netlify.app/posts/data/