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:

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

And I have a rectangle with a dashed line. How to change the color of the line? lc doesn't seem to work after the border. I also tried to set a new line style and border, but I was not successful.

Thanks!

+6
source share
1 answer

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 borders of the rectangle are solid. I tried the terminals wxt , pngcairo , pdfcairo and postscript and set the dashed parameter each time.

+5
source

Source: https://habr.com/ru/post/974102/


All Articles