How to Make a Transparent Background in Graphics with Julia
Code 1
If the browser is in dark mode, you can clearly see that the background has been rendered transparent.
You just need to insert the :transparent
symbol into the background_color
option. It saves well as *.png
, but it is said that it doesn’t save well as *.pdf
.
using Plots
plot(rand(10), background_color = :transparent)
png("example")
As you can guess from the option name, if you put in a color symbol, it will be output in that color. For example, a picture drawn with :yellow
looks like this.
Environment
- OS: Windows
- julia: v1.6.2