2011-04-04 73 views
0

当我使用MATLAB K线图处理

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

hcndl = 

    176.0044 
    178.0032 
    177.0031 

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

谢谢

回答

3

我想你正在寻找设置功能。 Set函数接受图形的句柄,并允许你改变图形的属性。

handle = candle(dis('3/31/98::4/30/98')); 
set(handle,'BackgroundColor','blue'); 
+0

我得到这样的结果????错误使用==>设置 没有“BACKGROUNDCOLOR”中的“检测LineSeries阶级属性。 – BAR 2011-04-04 22:38:12

+0

那我很抱歉。你可能要问父句柄作为乔纳斯建议。我没有意识到它返回线路系列的句柄。 – Biggles 2011-04-05 06:17:24

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