jonasfoe Posted June 21, 2022 Share Posted June 21, 2022 I am using the popular ggplot2 package for R to make my scientific plots. The transparency doesn't seem to work at all in affinity designer (1.10.5) with a very basic plot. All background appears black. Browsers and Inkscape open it just fine. The R code is really basic: library(ggplot2) theme_update( panel.background = element_rect(fill = "transparent"), # bg of the panel plot.background = element_rect(fill = "transparent", color = NA), legend.background = element_rect(fill = "transparent"), # get rid of legend bg legend.box.background = element_rect(fill = "transparent", colour = NA), # get rid of legend panel bg legend.key = element_rect(fill = "transparent", colour = NA) ) ggplot(cars, aes(speed, dist)) + geom_point() ggsave("test.svg") ggsave("test.png") I am attaching the test.svg file. Your help would be much appreciated. Best, Jonas test.svg Quote Link to comment Share on other sites More sharing options...
Staff Lee_T Posted June 21, 2022 Staff Share Posted June 21, 2022 Hi jonasfoe, welcome to the forums! I can see that there are a few extra (maybe unnecessary?) layers in the output SVG but we'd need to know what it should look like to offer any advice on how to resolve it. removing the solid layers reveals this: Quote Link to comment Share on other sites More sharing options...
jonasfoe Posted June 21, 2022 Author Share Posted June 21, 2022 The plot is meant to look like the png attached here. In any other software that I can open the svg with, I get this result. Only with Affinity Designer do I get the solid layer. Removing the solid layer removes important parts of the figure, as you demonstated (the axes). Thanks for the swift feedback. Quote Link to comment Share on other sites More sharing options...
jonasfoe Posted June 27, 2022 Author Share Posted June 27, 2022 Is anyone still reviewing this? I would be very happy for a solution as my initial impression of Designer was very good and I am hoping to use it more. Quote Link to comment Share on other sites More sharing options...
GarryP Posted June 27, 2022 Share Posted June 27, 2022 There a quite a few things in SVGs that the Affinity applications can’t handle. Out of the (probably many) possible options, one might be to check the ggplot2 export options to see if you can export in the simplest way possible – e.g. no CSS/HTML code, no clip-paths, etc. Other than that you may have to do various manual changes to the SVG before using it which could affect the overall accuracy of your plot and that could cause further problems ‘down the road’. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.