Skip to content

Commit cd73882

Browse files
useR! presentation tweaks (#487)
* news * typos while we're at it * typo * mobile fix? * reset theme * tweak types slide * nicer grid vs graphics figs and transition * nicer errorbar example * remove slide numbers for appendix * remove fragment
1 parent cfbd44d commit cd73882

File tree

5 files changed

+58
-39
lines changed

5 files changed

+58
-39
lines changed

NEWS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ where the formatting is also better._
1111
- Added support for "bubble" scatter plots, allowing for point size scaling via
1212
an appropriate `cex` argument (e.g., a continuous variable from your dataset).
1313
Simultaneously enables dual-legend support for combined size + color mappings.
14-
The updated `?type_points` helpfile contains several examples.
14+
The updated `?type_points` documentation contains several examples.
1515
(#433 @grantmcdermott)
1616
- Improved horizontal legend spacing, as well as multicolumn legend support. A
1717
new example in the "Tips & tricks" vignettes demonstrates the latter.
@@ -48,6 +48,11 @@ where the formatting is also better._
4848
correct parameters and spacing. (#475, #481 @grantmcdermott)
4949
- Custom `cex` theme settings are now reset correctly. (#482 @grantmcdermott)
5050

51+
### Documentation
52+
53+
- @grantmcdermott's _useR! 2025_ **tinyplot** presentation has been added to the
54+
website as a standalone
55+
[vignette](https://grantmcdermott.com/tinyplot/vignettes/useR2025/useR2025.html).
5156

5257
### Internals
5358

vignettes/useR2025/_extensions/grantmcdermott/clean/clean.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,21 @@ $selection-bg: #26351c !default;
277277
.reveal table th,
278278
.reveal table td {
279279
border: none; /* Remove internal row lines */
280-
padding: .23em; /* Adjust padding as needed */
280+
padding: .23em .46em; /* Adjust padding as needed */
281281
text-align: left; /* Adjust text alignment as needed */
282282
font-weight: lighter; /* Lighter font weight for main table text */
283283
}
284284

285-
/* Adds a bottom border to the table header row for distinction */
285+
/* Add top border to first row and bottom border to last row only */
286+
.reveal table thead th,
287+
.reveal .slides table tr:first-child td {
288+
border-top: 2px solid #D3D3D3;
289+
}
290+
286291
.reveal table thead th,
287292
.reveal .slides table tr:last-child td,
288293
.reveal .slides table {
289-
border-bottom: 2px solid #D3D3D3; /* Dark grey color for the bottom border */
294+
border-bottom: 2px solid #D3D3D3;
290295
}
291296

292297
/* Make column headers bold */
80.3 KB
Loading
77.6 KB
Loading

vignettes/useR2025/useR2025.qmd

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
---
22
# title: tinyplot
3-
# subtitle: Lightweight extension of the base R graphics system
4-
# format: clean-revealjs
53
title: "<br/><br/><br/>"
64
subtitle: Lightweight extension of the base R graphics system
75
format:
86
clean-revealjs:
97
title-slide-attributes:
108
data-background-image: "img/background.png"
11-
# clean-revealjs:
12-
# # logo: img/logo.svg
13-
# title-slide-attributes:
14-
# data-background-image: "img/background.png"
9+
data-background-size: contain
1510
execute:
1611
echo: true
1712
author:
@@ -270,19 +265,24 @@ But going beyond the defaults is often (much) more work that I want to do.
270265

271266
### R has two low-level graphics systems
272267

273-
::: {.r-stack}
274-
![Note: Adapted from @murrell2023updates.](img/rgraphics.png)
268+
![](img/rgraphics.png)
275269

276-
![Note: Adapted from @murrell2023updates.](img/rgraphics2.png){.fragment}
277-
:::
270+
## grid vs graphics (redux) {visibility="uncounted" auto-animate=true}
278271

272+
### R has two low-level graphics systems
273+
274+
![](img/rgraphics2.png)
275+
276+
## grid vs graphics (redux) {visibility="uncounted" auto-animate=true}
277+
278+
### R has two low-level graphics systems
279+
280+
![](img/rgraphics2.png)
279281

280-
::: {.fragment}
281282
**tinyplot** goals:
282283

283284
1. Make base R graphics more user-friendly.
284-
2. Improved feature parity vs. grid-based 📦s like **ggplot2** and **lattice**.
285-
:::
285+
2. Improved feature parity vs. grid-based 📦s like **ggplot2** and **lattice**.
286286

287287
## Origin story 🤝
288288

@@ -523,19 +523,25 @@ plt(
523523
## tinyplot API
524524
### types
525525

526-
All tinyplot types can be passed as either a:
526+
tinyplot types can be passed as either a _string_ or _function_:
527527

528-
- _string_ (`"p"`, `"density`, `"lm"`, ...), or
529-
- _function_ (`type_points()`, `type_density()`, `type_lm()`, ...)
528+
| | | | | |
529+
|-----|:----|:----|:----|:----|
530+
| _string_ | `"p"` | `"density"` | `"lm"` | `"<name>"` |
531+
| _function_ | `type_points()` | `type_density()` | `type_lm()` | `type_<name>()` |
530532

531-
In general, the functional equivalents are denoted `type_*()` and support direct argument passing for customization, e.g.
533+
\
534+
535+
::: {.fragment}
536+
The function variants all take the form `type_<name>` and support type-specific
537+
argument passing for customization, e.g.
532538

533539
```{r}
534-
?type_lm
535-
args(type_lm)
540+
# ?type_lm # full documentation
541+
str(type_lm) # available args
536542
```
537-
::: {.callout-note}
538-
Custom args can also be passed through `plt(...)`, so long as there isn't a top-level clash.
543+
544+
P.S. Type args can also be passed via `plt(...)` _if_ there's no top-level clash.
539545
:::
540546

541547
## tinyplot API
@@ -821,8 +827,8 @@ plt(
821827
#| fig-width: 6
822828
#| fig-asp: 1
823829
824-
mod = lm(body_mass ~ species + sex,
825-
data = penguins)
830+
mod = lm(weight ~ 0 + Time + Diet,
831+
data = ChickWeight)
826832
coefs = data.frame(
827833
names(coef(mod)),
828834
coef(mod),
@@ -898,6 +904,11 @@ plt(Month ~ Temp | Temp,
898904
)
899905
```
900906

907+
```{r}
908+
#| include: false
909+
tinytheme()
910+
```
911+
901912
# Conclusions
902913

903914
## Advantages of tinyplot {#sec-adv}
@@ -920,7 +931,7 @@ For the longer version: [[tinyplot pros]{.button}](#sec-pros)
920931
- Custom layout
921932
- Missing features
922933

923-
For the longer version: [[tinyplot pros]{.button}](#sec-cons)
934+
For the longer version: [[tinyplot cons]{.button}](#sec-cons)
924935

925936
## Acknowledgements
926937

@@ -966,17 +977,17 @@ Many other contributors, feedback providers, and a sources of inspiration.
966977
::: {#refs}
967978
:::
968979

969-
# Bonus: Tinyplot pros {#sec-pros}
980+
# Bonus: Tinyplot pros {#sec-pros visibility="uncounted"}
970981

971-
## Concise
982+
## Concise {visibility="uncounted"}
972983

973984
### The formula API gives bang for buck
974985

975986
![](img/briggs.png)
976987

977988
_P.S. Thanks to Ryan for letting me use this screenshot._
978989

979-
## Concise
990+
## Concise {visibility="uncounted"}
980991

981992
### The formula API gives bang for buck
982993

@@ -1018,7 +1029,7 @@ plt(
10181029

10191030
_(That's about 1/3 fewer characters.)_
10201031

1021-
## Concise
1032+
## Concise {visibility="uncounted"}
10221033

10231034
### Concision is even starker vs. vanilla base plot
10241035

@@ -1044,7 +1055,7 @@ Adapted from @viechtbauer2025tinyplot.
10441055

10451056
::::
10461057

1047-
## Lightweight
1058+
## Lightweight {visibility="uncounted"}
10481059

10491060
### Base R only
10501061

@@ -1063,9 +1074,9 @@ Very fast to install and play with in webR / WebAssembly. ([Try it!](https://web
10631074
[[Back to main]{.button}](#sec-adv)
10641075

10651076

1066-
# Bonus: Tinyplot cons {#sec-cons}
1077+
# Bonus: Tinyplot cons {#sec-cons visibility="uncounted"}
10671078

1068-
## Layering gotchas
1079+
## Layering gotchas {visibility="uncounted"}
10691080

10701081
### Scaling is fixed by the first layer
10711082

@@ -1078,7 +1089,7 @@ plt_add(type = "lm")
10781089
This is a limitation of **graphics** "canvas" logic. (Workarounds: Change layer order, or use `x/ylim`.)
10791090
:::
10801091

1081-
## Layering gotchas
1092+
## Layering gotchas {visibility="uncounted"}
10821093

10831094
### Can't combine `file` with `plt_add` (yet)
10841095

@@ -1096,18 +1107,16 @@ I'm hoping to provide a native solution in the future, but workarounds for now:
10961107
- Open/close the appropriate graphics device manually, e.g. `png("myplot.png"); plt(...); plt_add(...); dev.off() `
10971108
:::
10981109

1099-
## Missing features
1110+
## Missing features {visibility="uncounted"}
11001111

11011112
I hope that I have convinced you that **tinyplot** covers a _lot_ of ground.
11021113

11031114
- The API should also be very stable. I expect few (if any) breaking changes from here on out.
11041115

1105-
::: {.fragment}
11061116
Still, **tinyplot** is a relatively young project and there are some features and plot types that we don't support (yet). Some things coming down the pike:
11071117

11081118
- bubble plots ([#433](https://github.com/grantmcdermott/tinyplot/pull/433))
11091119
- dodged elements ([#406](https://github.com/grantmcdermott/tinyplot/issues/406))
11101120
- maps ([#210](https://github.com/grantmcdermott/tinyplot/issues/210))
1111-
:::
11121121

11131122
[[Back to main]{.button}](#sec-disadv)

0 commit comments

Comments
 (0)