0

当我使用

>> load disney;
>> hcndl = candle(dis('3/31/98::4/30/98'))

hcndl =

  176.0044
  178.0032
  177.0031

如何使用此句柄更改图表的背景颜色。

谢谢

4

2 回答 2

3

我认为您正在寻找 set 功能。Set 函数接受图形的句柄并允许您更改图形的属性。

handle  = candle(dis('3/31/98::4/30/98'));
set(handle,'BackgroundColor','blue');
于 2011-04-04T10:30:18.960 回答
1

您想要修改轴的颜色。candle为您提供线条的句柄,其父级是您要修改的轴。

load disney;
hcndl = candle(dis('3/31/98::4/30/98'));

%# find handle to axes using the first of the three handles
%# note that you could have used any of the three
axH = get(hcndl(1),'Parent');

%# modify axes
set(axH,'Color','k') %# black color
于 2011-04-05T04:10:23.793 回答