I used gnuplot to create a graph on linux. The script creates a svg file, but its background has black and white squares. How can I create a white and clear background? The script that I used is below :
set terminal svg enhanced size 1000 1000 fname "Times" fsize 36
set autoscale
set output "plot.svg"
set title "A simple plot of x^2 vs. x"
set xlabel "x"
set ylabel "y"
plot "./data.dat" using 1:2 title ""
Those black and white squares are inserted by your viewer program, and indicate that you actually have no background. To get a white background, use the background
terminal option:
set terminal svg enhanced background rgb 'white'
If your gnuplot version doesn't yet support this option, you can place a full-canvas rectangle behind the plot
set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'white' fillstyle solid noborder
...
plot x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With