Just in case other users happen to encounter similar issues, here are my five cents on the topic:
Looking at the
EnhancedVolcano() code, I don't see why there would be different fonts in the labels; they should all have the same basic font (which may or may not be Arial-like; see below) because the main function seems to rely on
ggplot2::geom_text() for generating the labels.
ggplot2::geom_text() uses the "sans" family of fonts per default. You can learn a lot about the details in the documentation and here
To find out which font will be used on your computer for the "sans" entry, you can try
X11Fonts()$sans if you're working on a Mac or Linux-based OS. More here
In my case, the output looks like this:
Therefore, my plots are labeled with Helvetica, which is essentially Arial (see below for more on that).
You could indeed ask the author of
EnhancedVolcano to expose the font family parameter of
ggplot2::geom_text() to the user -- this is best done via github --> issues where you can ask for a new feature with the package.
A quicker solution may be to try the base R PDF export function with specifying the font family:
ggp <- EnhancedVolcano(...)
pdf("ggp.pdf", family = "Helvetica") # Apply pdf function
pdf() typically offers support for standard Adobe fonts (and URW equivalents), which does NOT include Arial (the closest will be Helvetica -- I dare the reviewer to spot the difference although they do exist)
these are fonts you can specify via the
family parameter: "AvantGarde", "Bookman", "Courier", "Helvetica", "Helvetica-Narrow", "NewCenturySchoolbook", "Palatino" and "Times"; "URWGothic", "URWBookman", "NimbusMon", "NimbusSan" (synonym "URWHelvetica"), "NimbusSanCond", "CenturySch", "URWPalladio" and "NimbusRom" (synonym "URWTimes").
This also means that even if
EnhancedVolcano exposed the
ggplot2::geom_text() parameter to change the font family manually, you'd be stuck with whatever is available on your system. If you truly want to go down the rabbit hole of installing additional fonts, you will have to look into additional packages, such as
extrafont. I do not recommend this, though.
In brief: Make sure your settings for the "sans" family specify "Helvetica" (or "Arial", of course).
The easiest solution, btw, might be to simply specify your own labels via
subtitle parameters because I'm suspecting that the issue the reviewer has may be with the use of
bquote as the default setting and the subsequent proper display of mathematical notation which some reviewers may not be used to anymore. However, even those font settings simply rely on your environment setting:
The fonts used are taken from the current font family, and so can be set by par(family=) in base graphics, and gpar(fontfamily=) in package grid.
Reference: plotmath docu