0

I'm working with RStudio and using the nVennR package to create diagrams to visualize data, but the .SVG file produced comes out completely skewed in Adobe Illustrator CC. What can I do to make it display properly?

I've used the example code provided in the nVennR vignette and everything goes smoothly until I output the .SVG file.

    install.packages("nVennR")
    library(nVennR)
    sas <- subset(exampledf, SAS == "Y")$Employee
    python <- subset(exampledf, Python == "Y")$Employee
    rr <- subset(exampledf, R == "Y")$Employee
    myV <- plotVenn(list(SAS=sas, PYTHON=python, R=rr), nCycles = 2000, outFile = "TestExample.svg", systemShow = TRUE)

The above code opens the produced .SVG file, but the shapes don't look anything like the way they should. The file written with outFile still doesn't work.

I installed the Magick package and was able to use it to display the diagram in the Viewer pane, so it seems that RStudio is able to pump out everything properly, there just seems to be an issue when opening it with Illustrator.

    install.packages("magick")
    install.packages("rsvg")
    library(magick)
    myVprint <- image_read_svg('TestExample.svg', width = 1000)
    print(myVprint)

EDIT 2019-Jul-03: SOLUTION FOUND

Realized that I was missing the grImport2 package, which let's me run showSVG(MBplot, outFile = "MBplot.svg") and outputs a plot in the Plot pane. From there, exporting as a PDF through the pane gives a file that's completely editable in Illustrator. Still going to use Magick to view it as I go since the image appears much sharper.

In case anyone else has run into this issue, I'll leave this question up.

lobati
  • 9,284
  • 5
  • 40
  • 61

1 Answers1

0

The grImport2 package will let you run showSVG(MBplot, outFile = "MBplot.svg") and outputs a plot in the Plot pane. From there, exporting as a PDF through the pane gives a file that's completely editable in Illustrator.