fontMPlus

ggplot2 themes based on M+ fonts

https://github.com/bhaskarvk/fontmplus

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

ggplot2 ggplot2-themes hrbrthemes r rstats
Last synced: 6 months ago · JSON representation

Repository

ggplot2 themes based on M+ fonts

Basic Info
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 0
Archived
Topics
ggplot2 ggplot2-themes hrbrthemes r rstats
Created almost 9 years ago · Last pushed over 8 years ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(fig.retina=2, fig.path = "README_figs/README-")
```

```{r, echo = FALSE}
description <- readLines(system.file("DESCRIPTION", package='fontMPlus'))
rvers <- stringr::str_match(grep("R \\(", description, value = TRUE), "[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}")[1,1]
version <- gsub(" ", "", gsub("Version:", "", grep("Version:", description, value = TRUE)))
```

[![Project Status: Active – The project is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-green.svg)](/commits/master)  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![keybase verified](https://img.shields.io/badge/keybase-verified-brightgreen.svg)](https://gist.github.com/bhaskarvk/46fbf2ba7b5713151d7e) [![Travis-CI Build Status](https://travis-ci.org/bhaskarvk/fontMPlus.svg?branch=master)](https://travis-ci.org/bhaskarvk/fontMPlus) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/bhaskarvk/fontMPlus?branch=master&svg=true)](https://ci.appveyor.com/project/bhaskarvk/fontMPlus) [![minimal R version](https://img.shields.io/badge/R%3E%3D-`r rvers`-6666ff.svg)](https://cran.r-project.org/) [![packageversion](https://img.shields.io/badge/Package%20version-`r version`-orange.svg?style=flat-square)](commits/master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/fontMPlus)](https://cran.r-project.org/package=fontMPlus) [![](http://cranlogs.r-pkg.org/badges/grand-total/fontMPlus)](http://cran.rstudio.com/web/packages/fontMPlus/index.html)
 
## M+ FONTS Based `ggplot2` Themes.

This is an add-on package for the [hrbrthemes](https://github.com/hrbrmstr/hrbrthemes) package. It provides seven ggplot2 themes based on [M+ FONTS](http://mplus-fonts.osdn.jp/about-en.html). 

The M+ fonts are a font family under the Free license. You can use, copy, and distribute them, with or without modification, either commercially or noncommercially. The font family provides multilingual glyphs.
The fonts provide Kana, over 5,000 Kanji, Basic Latin, Latin-1 Supplement, Latin Extended-A, and IPA Extensions glyphs. Most of the Greek, Cyrillic, Vietnamese, and extended glyphs and symbols are included too.
So the fonts are in conformity with ISO-8859-1, 2, 3, 4, 5, 7, 9, 10, 13, 14, 15, 16, Windows-1252, T1, and VISCII encoding.

In order to keep the R package size under 5MB, which is a CRAN requirement, we include only the basic Latin glyphs with R package. But you can clone this repo and use complete glyph set as described in the documentation of `import_mplus()` function.

The package is released under MIT License while the M+ fonts are released under a [license](http://mplus-fonts.osdn.jp/about-en.html#license) that permits free usage, distribution, modification both commercially and non-commercially.

### Installation

```{r install,eval=FALSE}

install.packages('hrbrthemes')

if(!require(devtools)) {
  install.packages("devtools")
}
devtools::install_github('bhaskarvk/fontMPlus')


# Required only once to import basic latin glpyh fonts included with this package.
fontMPlus::import_mplus()

# To import complete glyph set including Kana/Kanji glyphs use one of the two approaches below.
# NOTE: You don't need to do this if you don't need Kana/Kanji glyphs.

# Download and extract https://osdn.net/projects/mplus-fonts/downloads/62344/mplus-TESTFLIGHT-062.tar.xz/ to some directory.
fontMPlus::import_mplus(font_dir='directory containing M+ fonts')

# OR

# git clone this repo.
# cd fontMPlus (where fontMPlus is the directory where you have cloned this repo)
fontMPlus::import_mplus(font_dir='data-raw/complete-glpyhs')
```

The `fontMPlus::import_mplus()` call will import the M+ fonts in your `extrafont` database. You will then need to install the M+ fonts in the directory mentioned in the output of that call as per your operating system's way of installing fonts.

### Usage

#### M+ C Type 1

```{r c1, fig.retina=2}
library(ggplot2)
library(fontMPlus)

gg <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point() +
  labs(x="Fuel efficiency (mpg)", y="Weight (tons)",
       title="Seminal ggplot2 scatterplot example",
       subtitle="A plot that is only useful for demonstration purposes",
       caption="Brought to you by the letter 'g'")

gg + theme_ipsum_mplus_c1()
```

#### M+ C Type 2

```{r c2, fig.retina=2}
gg + theme_ipsum_mplus_c2()
```

#### M+ P Type 1

```{r p1, fig.retina=2}
gg + theme_ipsum_mplus_p1()
```

#### M+ P Type 2

```{r p2, fig.retina=2}
gg + theme_ipsum_mplus_p2()
```

#### M+ M Type 1

```{r m1, fig.retina=2}
gg + theme_ipsum_mplus_m1()
```

#### M+ M Type 2

```{r m2, fig.retina=2}
gg + theme_ipsum_mplus_m2()
```

#### M+ MN Type 1

```{r mn1, fig.retina=2}
gg + theme_ipsum_mplus_mn1()
```

### Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

Owner

  • Name: BK
  • Login: bhaskarvk
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 9
  • Total Committers: 2
  • Avg Commits per committer: 4.5
  • Development Distribution Score (DDS): 0.111
Top Committers
Name Email Commits
Bhaskar Karambelkar b****k@g****m 8
Patrick Kennedy p****e@u****u 1
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
cran.r-project.org: fontMPlus

Additional 'ggplot2' Themes Using 'M+' Fonts

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 0
Rankings
Forks count: 21.9%
Stargazers count: 24.2%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 40.2%
Downloads: 89.7%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.0.0 depends
  • extrafont * imports
  • ggplot2 * imports
  • hrbrthemes * imports
  • knitr * suggests
  • rmarkdown * suggests
  • stringr * suggests