Skip to main content
Question

Issues importing R plots in SVG format

  • December 6, 2022
  • 3 replies
  • 431 views

NM1

Hello!

I’m trying to drag-and-drop an SVG plot into Figma

But the result is this:

The file renders wonderfully well in Inkscape and a web browser.

This makes Figma really hard to use in our case.

How can this be fixed?

3 replies

NM1
  • Author
  • 2 replies
  • December 6, 2022

It seems Figma is closing the paths, then filling them with black, and ignoring stroke colors.

The paths are not closed in the original SVG.


NM1
  • Author
  • 2 replies
  • December 6, 2022

The issue can be circumvented by:

  • Opening the R SVG plot in Inkscape,
  • For preserving text as text:
    • ungroup all elements (using “Ctrl+Shift+G”)
    • select a text element and select same object type (Edit → Select Same → Object Type, or “Alt+Shift+A”)
    • invert the selection (using Edit → Object to path or “!”),
  • Convert selected objects to paths (using Path → Object to path, or "Ctr+Shift+C).

Having to do this for each plot is really annoying 😕 it would be nice if it just worked…


You can use ggsave with device=svg (Note, not device=“svg”)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings