Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Plot GNU厚框倍频程图_Plot_Octave_Fltk - Fatal编程技术网

Plot GNU厚框倍频程图

Plot GNU厚框倍频程图,plot,octave,fltk,Plot,Octave,Fltk,我正在尝试制作一个图形,该图形使用一条比网格线更粗的线作为框架/轴。我试着画一个带有粗线条的矩形来模拟图形框架。这几乎可以完美地工作,但右下角的效果并不好。两条线没有很好地吻合(见附件) 下面是一个例子来说明这个问题: plot (rand(1,5),'-o' , 'Linewidth',2); % plot some data grid on % show grid lines (thin) r = axis(); % find the coordinates of the figure fr

我正在尝试制作一个图形,该图形使用一条比网格线更粗的线作为框架/轴。我试着画一个带有粗线条的矩形来模拟图形框架。这几乎可以完美地工作,但右下角的效果并不好。两条线没有很好地吻合(见附件)

下面是一个例子来说明这个问题:

plot (rand(1,5),'-o' , 'Linewidth',2); % plot some data
grid on % show grid lines (thin)
r = axis(); % find the coordinates of the figure frame
rectangle ( 'Position',[r(1) r(3) r(2)-r(1) r(4)-r(3)] , 'Linewidth',5 ) % plot the figure frame using thick lines
print ('test.png') % save to file
有没有办法让这一切顺利进行


获取绘图的当前
对象,并设置其
线宽
属性

set(gca, 'linewidth', 5)
更新

尝试覆盖轴以获得所需的效果,如注释中所示。这种方法是可行的,但遗憾的是,通常需要调整才能使事情变得正确。如果你有一个一致的用例,也许你可以用一个脚本来自动化它

% the "frame" axis
a = axes; 
a_pos = get (a, 'position')
set (a, 'color', 'black', 'xtick', [], 'ytick', []);

% the "white background" axis; sits on top of "a"'s black background
b = axes ()
set (b, 'position', a_pos + [0.01, 0.01, -0.02, -0.02], 'color', 'w', 'xtick', [], 'ytick', []);

% the "actual" axis; transparent so that its background is effectively from "b"
c = axes;
plot (c, rand(1,5),'-o' , 'Linewidth',2); % plot some data
set (c, 'position', a_pos, 'xgrid', 'on', 'ygrid', 'on', 'color', 'none');

这也会增加网格线的线宽,这不是我想要的。此外,这会导致相同的“角落问题”,但这次是在框架的四个角落。关于网格线,您可以始终将一个空轴覆盖在另一个轴上;当
hold
不够时,这是一种非常常见的混合绘图元素的技术。我在这里能想到的唯一其他选择是在你的兴趣轴下放置一个“黑色”轴。稍后我将给出上面的一个例子。覆盖轴的更新实现了我在问题中所描述的。这似乎比它应该的要复杂一点,只是为了避免八度音阶的怪癖,因为在拐角处的线接头很差。将框架的厚度设置为给定的线宽也可能很棘手。但是谢谢!同意。尽管如此,我的印象是糟糕的线条连接是postscript库的上游问题,而不是特定于八度的问题。我认为matlab的行为方式是一样的(但我可能错了)。编辑:啊,没有。也许值得在octave bug tracker中将此报告为bug?看起来您安装的gl2ps没有
setlinecap
设置为2。你们有哪个gl2ps版本?我不知道。我怎么知道?