Skip to content

Commit 717ed84

Browse files
committed
Update 01. Scatter Plots.md
1 parent 6158c6b commit 717ed84

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

ggplot2/01. Scatter Plots.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ summary(diamonds)
3131
```
3232

3333
```r
34-
colnames(diamonds)
35-
```
34+
>colnames(diamonds)
3635

37-
```
38-
"carat" "cut" "color" "clarity" "depth" "table" "price" "x" "y" "z"
36+
"carat" "cut" "color" "clarity" "depth" "table" "price" "x" "y" "z"
3937
```
4038

4139
```r
@@ -49,10 +47,9 @@ data=diamonds[sample(1:nrow(diamonds),2000),]
4947
The `ggplot2` package by *Hadley Wickham* follows a layer by layer plot building philosophy. In order to build a plot using `ggplot2` , the ideal way is to think in terms of plotting layers.
5048

5149
**The steps involved in creating a plot are as follows:**
52-
53-
+**Step 1:** Add dataset: `ggplot(data)`
54-
+**Step 2:** Add geometry(layer): `geom_point(x,y)`
55-
+**Step 3:** Add Plot title/change axes scales/faceting
50+
* **Step 1:** Add dataset: `ggplot(data)`
51+
* **Step 2:** Add geometry(layer): `geom_point(x,y)`
52+
* **Step 3:** Add Plot title/change axes scales/faceting
5653

5754
####Plot 01####
5855

@@ -61,10 +58,10 @@ The `ggplot2` package by *Hadley Wickham* follows a layer by layer plot building
6158

6259
Here:
6360

64-
+`data` is a sample of 2000 observations from diamonds dataset.
65-
+The `null` plot is initialised by using `ggplot()`
66-
+To create a scatterplot, we use `geom_point()` as geometry/layer
67-
+To add plot title we use `ggtitle()`
61+
* `data` is a sample of 2000 observations from diamonds dataset.
62+
* The `null` plot is initialised by using `ggplot()`
63+
* To create a scatterplot, we use `geom_point()` as geometry/layer
64+
* To add plot title we use `ggtitle()`
6865

6966

7067
```r

0 commit comments

Comments
 (0)