简体   繁体   English

Gnuplot - 改变背景颜色

[英]Gnuplot - change background color

I used gnuplot to create a graph on linux. 我用gnuplot在linux上创建了一个图形。 The script creates a svg file, but its background has black and white squares. 该脚本创建一个svg文件,但其背景有黑色和白色方块。 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: 要获得白色背景,请使用background终端选项:

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 如果您的gnuplot版本尚不支持此选项,则可以在绘图后面放置一个完整的画布矩形

set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'white' fillstyle solid noborder
...
plot x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM