Adam Carr
2010-Dec-30 22:59 UTC
[R] pdf() Export Problem: Circles Interpreted as Fonts from ggplot2 Graphics
Good Evening: I am putting together a large report with plots created in R, V 2.12.0. Most of the plots are created using ggplot2 V0.8.9. I use R's pdf() command to export the plot to a pdf file. I am exporting the plots and attempting to edit the title text in?Inkscape?primarily because ggplot2 does not support superscript or subscript formatting in the title text. For the report I am working on these formats are essential. I am running the R version mentioned above and Inkscape 0.48 on a Windows XP machine with the following system details: OS Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 3 Build 2600 System Type X86-based PC Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~1995 Mhz BIOS Version/Date LENOVO 7LETB7WW (2.17 ), 4/25/2008 Total Physical Memory 4,096.00 MB Available Physical Memory 1.62 GB Total Virtual Memory 2.00 GB Available Virtual Memory 1.96 GB Page File Space 8.69 GB I do not think this is a ggplot2-specific problem. I use a simple version of the pdf() command to export the file that includes the file name and path only. The PDF looks fine actually, it is the restriction on text editing caused by Adobe's intepretation of the graphic that is the problem. I have attached two files to this email: 1. An R-exported pdf file exactly as it looks as opened in Adobe Reader V9. This file is named exportforinkscapeforum.pdf. 2. An example of the way the plot appears after I import it into Inkscape. This file is named Example of How Imported File Appears in Inkscape.pdf. The problem I have is that when I import the pdf into Inkscape the solid, filled circles on the plot are converted to the lower case letter q. I read about similar problems on R-help.org and other R-related sites, but the descriptions I found seemed to indicate that the lower case q was visible in the pdf file when opened with Adobe or other viewers. This does not seem to be my problem. I posted this problem to the Inkscape forum and received a reply suggesting that Adobe is interpreting the solid, filled circles not as solid, filled circles but as font objects. The user who replied suggested that I look for the Zpf Dingbat font embedded in the PDF and it is in fact there. This is the font Adobe is applying to my solid, filled circles. Apparently there are known issues with Inkscape's ability to import fonts via PDF and the problem is documented on their bug list. The Inkscape user asked if there was any way that R could be coerced to use actual circles or paths for the points. I am not aware of a way to do this so any input from anyone here would be greatly appreciated. To briefly return to my main problem: if there is another way to edit the main title text to include a superscripted character (in my particular case it is Unicode character 00AE, the registered trademark sign) I would appreciate the insight. Any help on this issue would be appreciated. Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: Example of How Imported PDF Looks in Inkscape.pdf Type: application/pdf Size: 97244 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101230/8d92ba79/attachment.pdf> -------------- next part -------------- A non-text attachment was scrubbed... Name: exportforinkscapeforum.pdf Type: application/pdf Size: 35370 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101230/8d92ba79/attachment-0001.pdf>
David Winsemius
2010-Dec-31 00:07 UTC
[R] pdf() Export Problem: Circles Interpreted as Fonts from ggplot2 Graphics
You could try using the Symbol font's solid circle as pch , octmode 267, if I am reading the output from the TestChars function on the points help page correctly. BTW, I opened your document in GIMP and it shows "q"'s as well. -- david. On Dec 30, 2010, at 5:59 PM, Adam Carr wrote:> Good Evening: > > I am putting together a large report with plots created in R, V > 2.12.0. Most of > the plots are created using ggplot2 V0.8.9. I use R's pdf() command > to export > the plot to a pdf file. I am exporting the plots and attempting to > edit the > title text in Inkscape primarily because ggplot2 does not support > superscript or > subscript formatting in the title text. For the report I am working > on these > formats are essential. > > > I am running the R version mentioned above and Inkscape 0.48 on a > Windows XP > machine with the following system details: > > OS Name Microsoft Windows XP Professional > Version 5.1.2600 Service Pack 3 Build 2600 > System Type X86-based PC > Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~1995 Mhz > BIOS Version/Date LENOVO 7LETB7WW (2.17 ), 4/25/2008 > Total Physical Memory 4,096.00 MB > Available Physical Memory 1.62 GB > Total Virtual Memory 2.00 GB > Available Virtual Memory 1.96 GB > Page File Space 8.69 GB > > I do not think this is a ggplot2-specific problem. > > I use a simple version of the pdf() command to export the file that > includes the > file name and path only. The PDF looks fine actually, it is the > restriction on > text editing caused by Adobe's intepretation of the graphic that is > the problem. > > I have attached two files to this email: > > 1. An R-exported pdf file exactly as it looks as opened in Adobe > Reader V9. This > file is named exportforinkscapeforum.pdf. > > 2. An example of the way the plot appears after I import it into > Inkscape. This > file is named Example of How Imported File Appears in Inkscape.pdf. > > The problem I have is that when I import the pdf into Inkscape the > solid, filled > circles on the plot are converted to the lower case letter q. I read > about > similar problems on R-help.org and other R-related sites, but the > descriptions I > found seemed to indicate that the lower case q was visible in the > pdf file when > opened with Adobe or other viewers. This does not seem to be my > problem. > > > I posted this problem to the Inkscape forum and received a reply > suggesting that > Adobe is interpreting the solid, filled circles not as solid, filled > circles but > as font objects. The user who replied suggested that I look for the > Zpf Dingbat > font embedded in the PDF and it is in fact there. This is the font > Adobe is > applying to my solid, filled circles. Apparently there are known > issues with > Inkscape's ability to import fonts via PDF and the problem is > documented on > their bug list. > > The Inkscape user asked if there was any way that R could be coerced > to use > actual circles or paths for the points. I am not aware of a way to > do this so > any input from anyone here would be greatly appreciated. > > To briefly return to my main problem: if there is another way to > edit the main > title text to include a superscripted character (in my particular > case it is > Unicode character 00AE, the registered trademark sign) I would > appreciate the > insight. > > > Any help on this issue would be appreciated. > > Adam > > > <Example of How Imported PDF Looks in > Inkscape > .pdf > > > < > exportforinkscapeforum > .pdf>______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT
Hadley Wickham
2010-Dec-31 00:51 UTC
[R] pdf() Export Problem: Circles Interpreted as Fonts from ggplot2 Graphics
> The Inkscape user asked if there was any way that R could be coerced to use > actual circles or paths for the points. I am not aware of a way to do this so > any input from anyone here would be greatly appreciated.pdf(..., useDingbats = F) Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
David Winsemius
2010-Dec-31 02:10 UTC
[R] pdf() Export Problem: Circles Interpreted as Fonts from ggplot2 Graphics
?points pdf(file="aplot.pdf") plot(1,1, pch=183, font=5) dev.off() On Dec 30, 2010, at 5:59 PM, Adam Carr wrote:> Good Evening: > > I am putting together a large report with plots created in R, V > 2.12.0. Most of > the plots are created using ggplot2 V0.8.9. I use R's pdf() command > to export > the plot to a pdf file. I am exporting the plots and attempting to > edit the > title text in Inkscape primarily because ggplot2 does not support > superscript or > subscript formatting in the title text. For the report I am working > on these > formats are essential. >David Winsemius, MD West Hartford, CT
Dennis Murphy
2010-Dec-31 03:01 UTC
[R] pdf() Export Problem: Circles Interpreted as Fonts from ggplot2 Graphics
Hi Adam: On Thu, Dec 30, 2010 at 2:59 PM, Adam Carr <adamlcarr@yahoo.com> wrote:> Good Evening: > > I am putting together a large report with plots created in R, V 2.12.0. > Most of > the plots are created using ggplot2 V0.8.9. I use R's pdf() command to > export > the plot to a pdf file. I am exporting the plots and attempting to edit the > title text in Inkscape primarily because ggplot2 does not support > superscript or > subscript formatting in the title text. For the report I am working on > these > formats are essential. >I have a counterexample to your claim that ggplot2 does not support superscript or subscript formatting in the title :) df <- data.frame(u = (1:10)^2, v = exp(seq(0, 4.5, by = 0.5))) g <- ggplot(df, aes(u, v)) g + geom_point() + opts(title = expression(x[1]^2~~'and'~~e^y)) g + geom_point() + opts(title = expression(x[1]^2~~'and'~~e^y)) + xlab(expression(x[1]^2)) + ylab(expression(e^y)) ...unless I'm misunderstanding what you mean by 'formatting' subscripts and superscripts. If so, some elaboration of the problem would be helpful. HTH, Dennis> > I am running the R version mentioned above and Inkscape 0.48 on a Windows > XP > machine with the following system details: > > OS Name Microsoft Windows XP Professional > Version 5.1.2600 Service Pack 3 Build 2600 > System Type X86-based PC > Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~1995 Mhz > BIOS Version/Date LENOVO 7LETB7WW (2.17 ), 4/25/2008 > Total Physical Memory 4,096.00 MB > Available Physical Memory 1.62 GB > Total Virtual Memory 2.00 GB > Available Virtual Memory 1.96 GB > Page File Space 8.69 GB > > I do not think this is a ggplot2-specific problem. > > I use a simple version of the pdf() command to export the file that > includes the > file name and path only. The PDF looks fine actually, it is the restriction > on > text editing caused by Adobe's intepretation of the graphic that is the > problem. > > I have attached two files to this email: > > 1. An R-exported pdf file exactly as it looks as opened in Adobe Reader V9. > This > file is named exportforinkscapeforum.pdf. > > 2. An example of the way the plot appears after I import it into Inkscape. > This > file is named Example of How Imported File Appears in Inkscape.pdf. > > The problem I have is that when I import the pdf into Inkscape the solid, > filled > circles on the plot are converted to the lower case letter q. I read about > similar problems on R-help.org and other R-related sites, but the > descriptions I > found seemed to indicate that the lower case q was visible in the pdf file > when > opened with Adobe or other viewers. This does not seem to be my problem. > > > I posted this problem to the Inkscape forum and received a reply suggesting > that > Adobe is interpreting the solid, filled circles not as solid, filled > circles but > as font objects. The user who replied suggested that I look for the Zpf > Dingbat > font embedded in the PDF and it is in fact there. This is the font Adobe is > applying to my solid, filled circles. Apparently there are known issues > with > Inkscape's ability to import fonts via PDF and the problem is documented on > their bug list. > > The Inkscape user asked if there was any way that R could be coerced to use > actual circles or paths for the points. I am not aware of a way to do this > so > any input from anyone here would be greatly appreciated. > > To briefly return to my main problem: if there is another way to edit the > main > title text to include a superscripted character (in my particular case it > is > Unicode character 00AE, the registered trademark sign) I would appreciate > the > insight. > > > Any help on this issue would be appreciated. > > Adam > > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >[[alternative HTML version deleted]]
Maybe Matching Threads
- [fdo] Inkscape BOF @ Siggraph LOS ANGELES - MON, AUG 9, 4-5 PM
- pdf() device uses fonts to represent points - data alteration?
- PDFs and SVGs containing rasterGrobs don't display correctly in some other software
- Options for generating editable figures?
- [PATCH] Update the 5 year logo to 10 year logo