Jump to content
tinyheero

SVG from R using ggplot2/svglite/cowplot

Recommended Posts

Hi,

 

I am generating svgs using the language R and specifically plotting using ggplot2 and outputting using the svglite graphic device

 

Generated a simple ggplot2 scatterplot and opening in Affinity Designer (v1.4.1) is perfect:

 

https://github.com/tinyheero/svglite-affinity-designer/blob/master/figures/ggplot2_test-1.svg

 

But when I combine multiple plots (using cowplot), the resultant svg comes out with two black boxes. The resultant svg can be found here:

 

https://github.com/tinyheero/svglite-affinity-designer/blob/master/figures/cowplot_test-1.svg

 

I've also included the .afdesign file of the cowplot svg file:
 

https://github.com/tinyheero/svglite-affinity-designer/blob/master/afdesign/cowplot_test-1.afdesign

 

 

 

 

Share this post


Link to post
Share on other sites

Hi tinyheero,

It appears as though Affinity is not able to read the embedded stylesheet used in the SVG (where it defines objects to have no fill unless specified). Instead it treats this as having a black fill which is where you are getting the two black rectangles from. I also got the same behaviour with your ggplot2_test-1.svg file.

I'll get it reported and passed on to the developers.

Share this post


Link to post
Share on other sites

Hi tinyheero,

 

It appears as though Affinity is not able to read the embedded stylesheet used in the SVG (where it defines objects to have no fill unless specified). Instead it treats this as having a black fill which is where you are getting the two black rectangles from. I also got the same behaviour with your ggplot2_test-1.svg file.

 

I'll get it reported and passed on to the developers.

 

Ok great. Looking forward to getting this working. Thanks!

Share this post


Link to post
Share on other sites

Hi tinyheero,

 

It appears as though Affinity is not able to read the embedded stylesheet used in the SVG (where it defines objects to have no fill unless specified). Instead it treats this as having a black fill which is where you are getting the two black rectangles from. I also got the same behaviour with your ggplot2_test-1.svg file.

 

I'll get it reported and passed on to the developers.

 

Has there been any updates on this issue? 

 

Thanks,

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.