9

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!

esperluette
  • 1,792
  • 2
  • 14
  • 21

1 Answers1

11

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.

Christoph
  • 47,569
  • 8
  • 87
  • 187
  • it worked also in epslatex.. but what do you mean set the `dashed` option? can i still have the lines dashed? – esperluette Aug 20 '14 at 14:29
  • The difference between the epslatex and the postscript terminals consists only in the text rendering. All other parts are identical. For the `dashed` terminal option, see e.g. [Gnuplot line types](http://stackoverflow.com/questions/19412382/gnuplot-line-types/19420678#19420678). Rectangle borders are always solid with gnuplot version 4.6.x, but the behavior is fixed for 5.0, see http://sourceforge.net/p/gnuplot/bugs/1460/. – Christoph Aug 20 '14 at 14:39
  • ok, so at the moment I can't have both (colored and dashed) in a rectangle (I did it in the end by modifying the borders in inkscape). Thank you again – esperluette Aug 20 '14 at 15:14