Skip to content

Commit d1d638b

Browse files
committed
tinyplot 已经发布在 CRAN 上
1 parent d76f08a commit d1d638b

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

.github/workflows/bookdown.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ jobs:
1919
- name: Install Quarto
2020
uses: quarto-dev/quarto-actions/setup@v2
2121
with:
22-
version: 1.4.550
22+
version: 1.4.555
2323

2424
- uses: r-lib/actions/setup-r@v2
2525
with:
2626
use-public-rspm: true
27-
r-version: '4.4.0'
28-
extra-repositories: 'https://grantmcdermott.r-universe.dev'
27+
r-version: '4.4.1'
2928

3029
- uses: r-lib/actions/setup-r-dependencies@v2
3130

DESCRIPTION

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,4 @@ Suggests:
8080
Enhances:
8181
sp (>= 2.0-0)
8282
SystemRequirements: pgf (>= 3.00)
83-
Additional_repositories:
84-
https://grantmcdermott.r-universe.dev
8583
BugReports: https://github.com/XiangyunHuang/msg2nd/issues

visualization-graphics.qmd

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -533,22 +533,34 @@ tinyplot(Sepal.Length ~ Sepal.Width | Species,
533533
on.exit(par(op), add = TRUE)
534534
```
535535

536-
还可以绘制其它类型的图形,如分组密度曲线图等
536+
还可以绘制其它类型的图形,如分组密度曲线图、分面散点图等
537537

538538
```{r}
539-
#| label: fig-tinyplot-density
540-
#| fig-cap: tinyplot 包绘制密度曲线图
541-
#| fig-width: 5
539+
#| label: fig-tinyplot-others
540+
#| fig-cap: tinyplot 包的分组和分面功能
541+
#| fig-subcap:
542+
#| - 分组密度曲线图
543+
#| - 分面散点图
544+
#| fig-width: 6
542545
#| fig-height: 5
543546
#| fig-showtext: true
547+
#| layout-ncol: 1
548+
#| layout-nrow: 2
544549
545-
with(iris, tinyplot(
546-
density(Sepal.Length), by = Species,
547-
bg = "by", # 分组填充
550+
tinyplot(
551+
~ Petal.Length | Species, data = iris,
552+
type = "density",
553+
fill = "by", # 分组填充
548554
grid = TRUE, # 背景网格
549-
palette = "Tableau 10",
550-
legend = list("topright", bty = "o") # 右上角图例
551-
))
555+
palette = "Tableau 10"
556+
)
557+
558+
tinyplot(
559+
Petal.Width ~ Petal.Length | Sepal.Length, data = iris,
560+
facet = ~ Species, # 分面
561+
grid = TRUE, pch = 19, frame = TRUE,
562+
palette = terrain.colors # 生成调色板的函数指定配色
563+
)
552564
```
553565

554566
### plot3D 包 {#sec-graphics-plot3D}

0 commit comments

Comments
 (0)