Comments (9)
I usually do:
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Roboto Condensed", subtitle="This is a subtitle") +
theme_ipsum_rc() -> gg
ggsave("plot.pdf", gg, device = cairo_pdf)
when targeting PDF
from hrbrthemes.
I have a similar problem trying to use roboto condensed (via theme_ipsum_rc) in an Rmarkdown document -> pdf.
from hrbrthemes.
Just to add a simple solution that worked well for me: Specify cairo_pdf
as your dev device for the PDF document. This is especially useful if you plan on exporting to multiple formats and don't want the overhead of switching between (say) PDF and PNG figures for (say) PDF and HTML output.
Example of relevant YAML section:
output:
pdf_document:
dev: cairo_pdf
<other pdf options>
html_document:
<html options>
from hrbrthemes.
Thx for trying out the pkg and taking the time to file an issue/question!
Can you post the output of sessionInfo()
?
from hrbrthemes.
In retrospect, that may not matter.
Please try:
---
title: "hrbrthemes testbed"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r message=FALSE}
library(hrbrthemes)
library(tidyverse)
library(Cairo)
extrafont::loadfonts()
```
### Arial Narrow
```{r dev="cairo_pdf"}
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Arial Narrow", subtitle="This is a subtitle") +
theme_ipsum()
```
### Roboto Condensed
```{r dev="cairo_pdf"}
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Roboto Condensed", subtitle="This is a subtitle") +
theme_ipsum_rc()
```
from hrbrthemes.
And, I just pushed a change that makes this easier.
Assuming RStudio use,
- File -> New File -> R Markdown
- From Template
- ipsum PDF Template
- From Template
Will start off a new document with everything above so you don't need to cut/paste from other docs.
from hrbrthemes.
This was a rly helpful question and will likely ease the pain of many others. If you're inclined, would you mind forking the pkg and adding yourself to the DESCRIPTION
file as a contributor? I can do it as well if you provide the necessary DESCRIPTION info fields. No worries if not, but this was a good thing to inquire about and cause the addition for.
from hrbrthemes.
Many thinks for having me as a contributor. I forked the repository and added my coordinate. Sorry btw for mistinking typing my answer, it was quite diffucult to read :)
from hrbrthemes.
Any idea how to do this for outputting a single plot to pdf?
I tried
Cairo::CairoPDF("plot.pdf")
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Roboto Condensed", subtitle="This is a subtitle") +
theme_ipsum_rc()
dev.off()
But I don't get the robo font.
plot.pdf
from hrbrthemes.
Related Issues (20)
- Dark (FT) Roboto RMarkdown template
- Install errors HOT 2
- More thorough font installation/config documentation & helpers HOT 5
- The example charts contain a different fill than the defaults HOT 1
- Gridlines and Grid Labels are Out of Alignment HOT 1
- Gridlines and Axis Labels are Out of Alignment HOT 1
- theme_ipsun fonts not working HOT 1
- Dot Plots in hrbrthemes HOT 5
- Error: lazy-load database ... hrbrthemes.rdb' is corrupt HOT 2
- Unable to export to pdf for some fonts HOT 1
- Broken image gallery HOT 1
- theme_modern_rc() overwrites default point color HOT 1
- supporting applying `hrbrthemes` themes to labels in `ggplot2` HOT 1
- systemfonts package not gett HOT 2
- **CLOSE** Mac Change Font Family HOT 3
- Missing images on doc site? HOT 1
- gdtools dependency/suggests no more needed HOT 1
- hrbrthemes::theme_ipsum_rc(), issue HOT 2
- Change to new cran checks badge URL HOT 1
- Found a typo in pkgdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hrbrthemes.