Skip to content

Commit

Permalink
change some image link (#32)
Browse files Browse the repository at this point in the history
* Update 09-graphs-ggplot2.Rmd

change image link

* Update 09-graphs-ggplot2.Rmd
  • Loading branch information
fei0810 authored Aug 18, 2021
1 parent 09f9246 commit 0a77be4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions book/09-graphs-ggplot2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2097,15 +2097,15 @@ scale_colour_manual(values=cbPalette)


```{r, fig.cap="色盲友好调色板", echo=F}
knitr::include_graphics("http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/colorblind_palette.jpg")
knitr::include_graphics("https://kaopubear-1254299507.cos.ap-shanghai.myqcloud.com/picgo/202108181124226.png")
```

#### 颜色选择

默认情况下,离散比例的颜色围绕 HSL 色环均匀分布。例如,如果有两种颜色,那么它们将从圆圈上的相对点中选择; 如果有三种颜色,它们在色环上将相隔 120° 等等。用于不同级别的颜色如下所示:

```{r, fig.cap="均匀色环", echo=F}
knitr::include_graphics("http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/figure/unnamed-chunk-7-1.png")
knitr::include_graphics("https://kaopubear-1254299507.cos.ap-shanghai.myqcloud.com/picgo/202108181126387.png")
```

默认颜色选择使用 `scale_fill_hue()``scale_colour_hue()`。 例如,在以下情况下添加这些命令是多余的:
Expand Down Expand Up @@ -2185,13 +2185,13 @@ ggplot(df, aes(x=xval, y=yval, colour=yval)) + geom_point() +
颜色可以指定为十六进制 RGB 三元组合,例如 `#0066CC`。 前两位数字是红色,接下来的两位是绿色,最后两位是蓝色。 每个值的范围从 00 到 FF,以十六进制(base-16)表示,在 base-10 中等于 0 和 255。 例如,在下表中,`#FFFFFF` 为白色,`#990000` 为深红色。

```{r, fig.cap="色码图", echo=F}
knitr::include_graphics("http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/hextable.png")
knitr::include_graphics("https://kaopubear-1254299507.cos.ap-shanghai.myqcloud.com/picgo/202108181126059.png")
```

> 色码图来源于 [http://www.visibone.com](http://www.visibone.com/)
#### RColorBrewer 调色板图表

```{r, fig.cap="调色板图表", echo=F}
knitr::include_graphics("http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/figure/unnamed-chunk-14-1.png")
knitr::include_graphics("https://kaopubear-1254299507.cos.ap-shanghai.myqcloud.com/picgo/202108181127063.png")
```

0 comments on commit 0a77be4

Please sign in to comment.