{"id":362,"date":"2016-07-27T13:00:44","date_gmt":"2016-07-27T11:00:44","guid":{"rendered":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/?p=362"},"modified":"2016-07-27T13:03:22","modified_gmt":"2016-07-27T11:03:22","slug":"saving-text-elements-as-svg-in-r","status":"publish","type":"post","link":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/2016\/07\/27\/saving-text-elements-as-svg-in-r\/","title":{"rendered":"Saving text elements as svg in R"},"content":{"rendered":"<p><strong>A helpful note<\/strong><\/p>\n<p>Saving text elements via the default svg-drivers of <em>R<\/em> (e.g., <em>grDevices::svg<\/em>, <em>Cairo::CairoSVG<\/em>) often results in the text being saved as paths instead of genuine text elements. Downstream svg-editors (such as <em>Inkscape<\/em>) may thus only allow you to move single letters but not edit them as text elements (which slashes the point of being a text element).<\/p>\n<p>Fortunately, the R package <em><a href=\"https:\/\/cran.r-project.org\/web\/packages\/svglite\/\" target=\"_blank\">svglite<\/a><\/em> contains an svg-driver that saves text elements as such.<\/p>\n<div style=\"background-color: #ffebdb\">\n<p style=\"padding-left: 30px\"><code>library(svglite)<br \/>\nsvglite(outF, width=12, height=7, standalone=TRUE)<br \/>\n# your figure code here<br \/>\ndev.off()<br \/>\n<\/code><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A helpful note Saving text elements via the default svg-drivers of R (e.g., grDevices::svg, Cairo::CairoSVG) often results in the text being saved as paths instead of genuine text elements. Downstream svg-editors (such as Inkscape) may thus only allow you to move single letters but not edit them as text elements (which slashes the point of [&hellip;]<\/p>\n","protected":false},"author":2306,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/users\/2306"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":3,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/362\/revisions\/365"}],"wp:attachment":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}