如何在gnuplot中绘制带有彩色边框的矩形 [英] How to draw a rectangle with a colored border in gnuplot
问题描述
我想在绘图中画一个空的矩形.
I would like to draw an empty rectangle in my plot.
到目前为止,我有:
set style rect back fs empty border lt 3
set object 1 rect from 1,1 to 2,2
我有一个带有虚线的矩形.如何更改线条的颜色? lc似乎在边界后不起作用.我也尝试设置新的线型和边框,但没有成功.
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.
谢谢!
推荐答案
在您发布的代码中使用lc
代替lt
可以在4.6.5版中正常使用
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
在任何情况下(同时包含lt 3
和lc ...
),矩形边框都是实心的.我尝试了wxt
,pngcairo
,pdfcairo
和postscript
端子,并每次都设置dashed
选项.
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.
这篇关于如何在gnuplot中绘制带有彩色边框的矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!