Saving .pdf with symbols and italic font

159 views
Skip to first unread message

Aric Schultz

unread,
May 30, 2017, 2:25:12 PM5/30/17
to ggplot2
Hi all, sorry if this has been answered before, but I haven't been able to find a suitable solution after quite a bit of googling.

I need to save figures as PDFs, with axis labels including both symbols and italic font. Rstudio won't save the symbols unless I use cairo_pdf(). But cairo_pdf won't save italic font...is there a way to have both. I'm trying to label discrete groups on the Y-axis: WT, WT∆myosin, WT∆myosin + MYOSIN etc...The journal I'm submitting to requires PDF figures, and gene knockouts (myosin in this case) need to be italicized. 

I've specified my labels as follows:
my.labels <- c(expression(paste("WT∆", italic('myosin')),
                       expression(paste("∆", italic('myosin'), '+MYOSIN'))
)

They look great until saving with cairo, then the italic formatting is lost.

Cheers,

tric...@uni-bremen.de

unread,
May 30, 2017, 2:44:47 PM5/30/17
to ggp...@googlegroups.com
Is this possibly of any help?
https://stackoverflow.com/questions/42722446/r-crashes-upon-exporting-ggplot-objects-with-unicode-in-axis-expression

Zitat von Aric Schultz <rockc...@gmail.com>:

> Hi all, sorry if this has been answered before, but I haven't been able to
> find a suitable solution after quite a bit of googling.
>
> I need to save figures as PDFs, with axis labels including both symbols and
> italic font. Rstudio won't save the symbols unless I use cairo_pdf(). But
> cairo_pdf won't save italic font...is there a way to have both. I'm trying
> to label discrete groups on the Y-axis: WT, WT∆*myosin, *WT∆*myosin *+
> MYOSIN etc...The journal I'm submitting to requires PDF figures, and gene
> knockouts (myosin in this case) need to be italicized.
>
> I've specified my labels as follows:
> my.labels <- c(expression(paste("WT∆", italic('myosin')),
> expression(paste("∆", italic('myosin'), '+MYOSIN'))
> )
>
> They look great until saving with cairo, then the italic formatting is lost.
>
> Cheers,
>
> --



Aric Schultz

unread,
May 30, 2017, 2:51:38 PM5/30/17
to ggplot2
Hi thanks for your suggestion.

To anyone reading this it has been resolved.

The problem was in how I was specifying the delta symbol...
WRONG = expression(paste("WT∆", italic("myosin")))
RIGHT   =  expression(paste("WT", Delta, italic("myosin")))

Cheers,
Reply all
Reply to author
Forward
0 new messages