extrafont | Tools for using fonts in R graphics | User Interface library
kandi X-RAY | extrafont Summary
kandi X-RAY | extrafont Summary
The extrafont package makes it easier to use fonts other than the basic PostScript fonts that R uses. Fonts that are imported into extrafont can be used with PDF or PostScript output files. On Windows, extrafont will also make system fonts available for bitmap output.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of extrafont
extrafont Key Features
extrafont Examples and Code Snippets
Community Discussions
Trending Discussions on extrafont
QUESTION
Trying to understand why grid.text("Name") displays in my RStudio plots window but doesn't render on PDF output.
...ANSWER
Answered 2022-Apr-15 at 22:27With reference to this link grid finds font when run in console but not when rendering Rmd using specific pdf function will solve the issue.
QUESTION
I am trying to create an interactive scatterplot using ggplotly. This will include a scatterplot with the interactivity to highlight each point's country name, and a line of best fit. However, when I add the text argument to my ggplot (in order to create interactive labels) it removes the line of best fit. I have tried to isolate the text argument to just the geom_point function, as suggested in a previous stack overflow post, but this does not solve the issue.
Would someone be able to offer a solution?
Thanks in advance.
My data includes a column for country name, a column for its gdp and a column for its world happiness index score ranging from 1 - 8.
Just as a randomly generated example:
NAME gdp happiness_score Argentina 10000 6 Canada 600000 8My code is as follows:
...ANSWER
Answered 2022-Apr-07 at 16:38You should assign your NAME
to the label
command in the aes
and add a geom_text
to show the names to the plots. You can use the following code:
QUESTION
I'm trying to write up a report and simply want to include a .jpeg image in my write up. However, whenever i knit together my document, I get the following error:
...ANSWER
Answered 2022-Mar-28 at 17:25I had the same issue and it seems you will need to pass the absolute path. See this .
Instead of using here
maybe try using normalizePath
in include_graphics
.
So omit your call here()
, which may not be propagating across chunks (I don't know, because I can't see your chunks), and do:
QUESTION
I would like to change the font type for my plot title and also the data label to make my plot a little less "dull". I have tried font_import()
alongside family="Comic Sans MS"
(amongst other failed efforts) but nothing seems to alter the font type. I have researched other similar question responses but yet to figure out where I am going wrong. Below is my code:
ANSWER
Answered 2022-Mar-23 at 15:47You can run in the theme
command, text = element_text(family = "Comic Sans MS")
to change the font. You can run this code:
QUESTION
I've written a function to share among colleagues for graphing, and my organization prefers Calibri to the ggplot2 default Arial for the text. If I were the only person who'd be using this function, I would first do this at the top of my script:
...ANSWER
Answered 2021-Sep-29 at 03:29Here is one potential approach to determine whether Calibri is installed and 'useable':
QUESTION
I have an rmarkdown file for which I want to change the font to a custom font (not native to Windows). What I did so far:
- I got the .ttf file(s) for the font and installed them on Windows. I can actually access it now in Word, so that part worked.
- I edited the YAML part pf my rmarkdown file to reference the font. When I try this with fonts native to Windows (Arial, etc.) this works, so in general the code itself should not be wrong.
EDIT: I found that it also does not work for some of the pre-installed windows fonts, like Bahnschrift (which might be german-specific)
- I tried on 2 different PCs and both with lualatex and xelalatex. As described below I also tried extrafont for the plots and it doesnt recognize the font either.
Here YAML code: the rest of the rmarkdown is really just the unchanged template. Round Style
is just an example.
ANSWER
Answered 2021-Jul-09 at 10:09The line header-includes:
is missing. Try with the following header:
QUESTION
ANSWER
Answered 2021-May-31 at 00:27This looks like an xy problem to me, but here is one way to generate the plot you are trying to replicate:
QUESTION
I have a Rmarkdown file that uses 3 libraries: extrafont
,ggplot2
,dplyr
. I have to generate a PDF after knitting this document. But it gives me an error as below:
ANSWER
Answered 2021-May-23 at 08:54The issue is with family = "Arial Narrow"
If you remove family = "Arial Narrow"
in these two lines:
annotate("text", x = c(7.8, 0.3), y = c(0.3, 7.8), label = c("italic(x)", "italic(y)"), parse = TRUE, size = 6, family = "Arial Narrow")+
text = element_text(size = 18, family = "Arial Narrow"))
The knitting to pdf will work:
QUESTION
ANSWER
Answered 2021-May-22 at 18:09How is this?
Create a new column using dplyr::mutate
, which is conditional upon the x-coordinates (for example, but it could be anything). Then, use this column within aes
to control the shape size.
Also, you can use scale_shape_manual
and scale_colour_manual
to manually control the shape and colours. It's not clear to me what shape you want but you would just need to change the arguments in scale_shape_manual
.
EDIT:
Since you specifically need a different symbol, then you need to use geom_text
instead.
QUESTION
I'm trying to use unicode symbols as geom_point shapes in ggplot. It mostly works as expected, but one symbol (▶, "\u25b6") doesn't show in the RStudio plot and in a pdf none of the symbols show up. Here's my example (the data show user input during listening to music):
...ANSWER
Answered 2021-May-12 at 07:59The emojifont
package fixes this.
Here's an example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install extrafont
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page