Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 784241b

Browse files
committed
edited
1 parent 430786d commit 784241b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

_posts/ggplot2/2019-07-30-geom_hex.Rmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Let's flip the colour scheme so that lighter colours denote larger numbers than
7272
```{r, results='hide'}
7373
library(plotly)
7474
75+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
76+
7577
p <- ggplot(english_french, aes(x=engperc,y=frenperc)) +
7678
geom_hex() +
7779
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +
@@ -97,6 +99,8 @@ In the previous graphs, each observation represented a single census subdivision
9799
```{r, results='hide'}
98100
library(plotly)
99101
102+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
103+
100104
p <- ggplot(english_french, aes(x=engperc, y=frenperc, weight=total)) +
101105
geom_hex() +
102106
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +
@@ -123,6 +127,8 @@ We can modify the graph's appearance - for example, if the grey background makes
123127
```{r, results='hide'}
124128
library(plotly)
125129
130+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
131+
126132
p <- ggplot(english_french, aes(x=engperc,y=frenperc, weight=total)) +
127133
geom_hex(bins = 20) +
128134
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +

_posts/ggplot2/2019-07-30-geom_hex.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Let's flip the colour scheme so that lighter colours denote larger numbers than
7272
```r
7373
library(plotly)
7474

75+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
76+
7577
p <- ggplot(english_french, aes(x=engperc,y=frenperc)) +
7678
geom_hex() +
7779
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +
@@ -96,6 +98,8 @@ In the previous graphs, each observation represented a single census subdivision
9698
```r
9799
library(plotly)
98100

101+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
102+
99103
p <- ggplot(english_french, aes(x=engperc, y=frenperc, weight=total)) +
100104
geom_hex() +
101105
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +
@@ -120,6 +124,8 @@ We can modify the graph's appearance - for example, if the grey background makes
120124
```r
121125
library(plotly)
122126

127+
english_french <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/english_french.csv",stringsAsFactors = FALSE)
128+
123129
p <- ggplot(english_french, aes(x=engperc,y=frenperc, weight=total)) +
124130
geom_hex(bins = 20) +
125131
scale_fill_gradient(low="lightblue1",high="darkblue",trans="log10") +

0 commit comments

Comments
 (0)