Giter Club home page Giter Club logo

myriad's Introduction

myriad

About

Myriad Pro-based theme for ggplot, providing theme_myriad_semi(), theme_myriad_map() and theme_myriad_nymap(). All based on Myriad Pro SemiCondensed face, with Myriad Pro Condensed also available for labels inside the plot area.

Note that this repo does not include the Myriad font files (the .otf files), which are owned by Adobe. You may already have them installed on your computer, or they may have come bundled with your copy of Acrobat Reader or other Adobe software.

Usage

When creating PDFs, use with showtext.

library(tidyverse)
library(ggrepel)
library(showtext)
showtext_opts(dpi = 300)
showtext_auto()

library(myriad)

# Semi variant
import_myriad_semi()

# Condensed for in-graph text
import_myriad_condensed()

# ggplot theme
theme_set(theme_myriad_semi())

Basic Test

p <- ggplot(mtcars, 
            aes(x = wt, y = mpg)) + 
  geom_point() + 
  labs(x = "Weight", y = "Miles per Gallon", 
       title = "This is the title", subtitle = "This is the subtitle", 
       caption = "This is the caption")  

p

Check PDF works

ggsave("man/figures/ggfont-test-myrnew-2.pdf", p, width = 6, height = 4)

With labels (using Myriad Pro Condensed)

out <- mtcars |>
  mutate(car = rownames(mtcars)) |> 
  as_tibble() |> 
  ggplot(aes(x = wt, y = mpg, label = car)) + 
  geom_text_repel(family = "Myriad Pro Condensed") +
  facet_wrap(~ cyl) + 
  labs(title = "Title", 
       subtitle = "Subtitle")

out
#> Warning: ggrepel: 6 unlabeled data points (too many overlaps). Consider
#> increasing max.overlaps

Check PDF works

ggsave("man/figures/ggfont-test-myrnew-3.pdf", out, width = 12, height = 8)

myriad's People

Contributors

kjhealy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.