-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from noradno/dev
Dev
- Loading branch information
Showing
27 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ Imports: | |
ggplot2, | ||
grDevices, | ||
jsonlite, | ||
showtext, | ||
sysfonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' Wrapper function to load norad theme | ||
#' | ||
#'@param ... Additional arguments | ||
#'@export | ||
#'@name ggnorad | ||
|
||
ggnorad <- function(...) { | ||
|
||
showtext::showtext_auto() | ||
|
||
sysfonts::font_add(family = "Arimo", | ||
regular = "fonts/Arimo-Regular.ttf", | ||
bold = "fonts/Arimo-Bold.ttf", | ||
italic = "fonts/Arimo-Italic.ttf", | ||
bolditalic = "fonts/Arimo-BoldItalic.ttf") | ||
sysfonts::font_add(family = "EB Garamond", | ||
regular = "fonts/EBGaramond-Regular.ttf", | ||
bold = "fonts/EBGaramond-Bold.ttf", | ||
italic = "fonts/EBGaramond-Italic.ttf", | ||
bolditalic = "fonts/EBGaramond-BoldItalic.ttf") | ||
|
||
ggplot2::update_geom_defaults("path", list(linewidth = 1)) | ||
|
||
ggplot2::theme_set(theme_norad()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
# noradplot <img src="man/figures/sticker.png" align="right" width="120" /> | ||
# noradplot <img src="man/figures/sticker.png" align="right" width="120"/> | ||
|
||
## Overview | ||
|
||
Norads colour palette and plot style for creating ggplot2 graphics. | ||
|
||
## Example | ||
- Use `theme_norad()` to add norad style | ||
|
||
- Use `scale_*` functions to add norad colour palette | ||
|
||
## Examples | ||
|
||
``` r | ||
|
||
library(ggplot2) | ||
library(noradplot) | ||
|
||
ggnorad() | ||
|
||
ggplot(mpg, aes(displ, hwy, color = class)) + | ||
geom_point() + | ||
theme_norad() + | ||
scale_color_norad() | ||
scale_color_norad() + | ||
labs(title = "This is the title", | ||
subtitle = "This is the slightly longer subtitle", | ||
caption = "This is the caption") | ||
``` | ||
|
||
![](man/figures/README-example-1.png)<!-- --> | ||
|
||
Credits: Based on Simon Jackson’s blog post: Creating corporate colour | ||
palettes for ggplot2, BBC BBC Visual and Data Journalism cookbook for R | ||
graphics: <https://bbc.github.io/rcookbook/> and Meghan Halls blog post | ||
Creating Custom colour palettes for ggplot2: | ||
## Credits | ||
|
||
Based on Simon Jackson’s blog post: Creating corporate colour palettes | ||
for ggplot2, BBC BBC Visual and Data Journalism cookbook for R graphics: | ||
<https://bbc.github.io/rcookbook/> and Meghan Halls blog post Creating | ||
Custom colour palettes for ggplot2: | ||
<https://meghan.rbind.io/blog/2022-10-11-creating-custom-color-palettes-with-ggplot2/> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.