Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a rectangle with a colored border in gnuplot

I would like to draw an empty rectangle in my plot.

So far I have:

set style rect back fs empty border lt 3 
set object 1 rect from 1,1 to 2,2 

And I have my rectangle with a dashed line. How do I change the color of the line? lc does not seem to work after border. I also tried with setting a new line style, and border but I was not successful.

Thank you!

like image 572
esperluette Avatar asked Aug 20 '14 13:08

esperluette


1 Answers

Using lc instead of lt in the code you posted works fine with version 4.6.5:

reset
set style rect back fs empty border lc rgb '#008800'
set object 1 rect from 1,1 to 2,2 lw 5
set object 2 rect from 1,3 to 2,4 lw 5 fs empty border lc rgb '#880088'
plot x

enter image description here

In any case (both with lt 3 and lc ...) the rectangle borders are solid. I tried the wxt, pngcairo, pdfcairo and postscript terminals and set the dashed option every time.

like image 130
Christoph Avatar answered Nov 14 '22 04:11

Christoph