Razer
Razer

Reputation: 8211

Boxed label with background color

Howto plot a boxed label with a specific background color? (Like the legend box)

Upvotes: 3

Views: 5031

Answers (1)

mgilson
mgilson

Reputation: 309891

Do you mean something like:

LABEL="label in a box"
set obj 10 rect at 0,0 size char strlen(LABEL), char 1 fc rgb "cyan"
set label 10 LABEL at 0,0 front center
plot sin(x)

Here's a link to gnuplot's demo where I got the idea.

Of course, you can make the size of the box slightly bigger -- I find that it makes things look a little nicer:

set obj 10 rect at 0,0 size char strlen(LABEL)+1, char 1.5 fc rgb "cyan"

But that's up to you.

Upvotes: 3

Related Questions