在Octave中设置fplot的线宽

时间:2018-06-10 09:30:30

标签: matlab octave

此代码

fplot(@sin, [0 4], 'LineWidth', 2)

在MATLAB中工作,但使用Octave提供错误消息。如何在Octave中设置fplot的曲线线宽?

2 个答案:

答案 0 :(得分:2)

Octave在不经常使用的区域充满了虫子。那可能就是其中之一。

改为使用普通plot功能。

%get data
[x,y]=fplot(@sin, [0 4]);
%or
x=0:0.1:4; y=sin(x); 

%plot data
plot(x,y, 'LineWidth', 10)
%or
l=plot(x,y);
set(l,'LineWidth', 10)

答案 1 :(得分:2)

Dimitry’s answer可能是更好的,但你也可以找到行句柄并修改它:

fplot(@sin, [0 4])
h = findobj(gca, 'type', 'line');
set(h, 'LineWidth', 2)