raldi
raldi

Reputation: 22160

How do I change the background color in gnuplot?

I have a script that renders graphs in gnuplot. The graphs all end up with an ugly white background. How do I change this? (Ideally, with a command that goes into a gnuplot script, as opposed to a command-line option or something in a settings file)

Upvotes: 13

Views: 28293

Answers (4)

Marco Righele
Marco Righele

Reputation: 2852

According to the official documentation, as of version 5.4 the right way to set the background color in a gnuplot script is something like the following:

set term wxt background rgb "gray75"

Note that the color must be quoted. Beside color names you can use hex values with the format "#AARRGGBB" or "0xAARRGGBB

Upvotes: 2

hsxz
hsxz

Reputation: 1069

You can change the background color by command set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"green" behind to set the background color to the the color you specified (here is green).

To get more knowledge about setting the background in gnuplot, you can visit this blog. There are even provided methods to set a gradient color background and background pictures. Good luck!

Upvotes: 23

raldi
raldi

Reputation: 22160

Ooh, found it. It's along the lines of:

set terminal png x222222 xffffff

Upvotes: 10

user9706
user9706

Reputation:

It is a setting for some terminal (windows use background). Check out colorbox including its bdefault.

/Allan

Upvotes: 2

Related Questions