作者ReiFu21 (ReiFu)
看板MATLAB
标题[问题] 关於bar的存图与visible
时间Fri Oct 19 14:04:23 2012
我想输出bar的图 以下这样没问题
x=[5 9 11];
y=[5 3 2];
tt=bar(x,y')
saveas(tt, ['MyBar','.png'] )
可是加入红色的字後
x=[5 9 11];
y=[5 3 2
;20 30 40];
tt=bar(x,y')
saveas(tt, ['MyBar','.png'] )
会出现以下警告 无法输出图
Operands to the || and && operators must be convertible to logical scalar values
Error in ==> saveas at 64
while ~isempty(h) && ~isfigure(h)
Error in ==> clear_and_clc at 8
saveas(tt, ['MyBar','.png'] )
但是在figure视窗上点'save as' 又可以正常存图
很奇怪 saveas指令不就等於点选save as吗?? 为什麽前者失败後者却可以成功呢?
请问该如何解决呢?
还有 请问该如何隐藏bar的图
我用set( tt , 'visible' ,'off');
set( tt ,'showbaseline','off');
set( gca,'visible' ,'off');
都还是会跳出figure 没办法完全隐藏
以上两个问题 有请高手解答 谢谢!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.120.50.45
※ 编辑: ReiFu21 来自: 140.120.50.45 (10/19 14:07)
1F:推 CBET:是 handle 的问题 10/19 21:23
2F:推 CBET:h = figure; bar(x, y'); set(h, 'visible', 'off'); 10/19 21:30
3F:→ CBET:saveas(h, 'MyBar.png' ); 10/19 21:31
4F:→ ReiFu21:成功了...感谢楼上!! 10/19 21:46