Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我正在用MATLAB编写两个小型的心理声学测试应用程序。第一个没有问题,但第二个却没有,我只是想不通为什么。
这是问题所在:axes对象已创建,但是为空。 failed_axis http://dl.getdropbox.com/u/98854/help.png 这是创建此图形和坐标轴的代码: hFig = figure('dockcontrols','off','menubar','none', ... 'name','choose the better sounding file', ... 'numbertitle','off','position',[0,0,700,500], ... 'resize','off','toolbar','none','units','normalized', ... 'color',[.8,.8,.8]); progress_idc = axes('position',[.1,.8,.8,.05],'box','on','parent',hFig,... 'xlim',[-.03,1.03],'xtickmode','manual','xtick',[], ... 'xticklabelmode','manual','xticklabel',[], ... 'ylim',[-1,1],'ytickmode','manual','ytick',[], ... 'yticklabelmode','manual','yticklabel',[], ... 'nextplot','add'); 这是在此轴上绘制的代码(该功能由计时器定期调用): function replot(varargin) % this is a nested function cla; % plot start_indicator plot([x_start,x_start],[-.7,.7],'k','linewidth',2); fill([x_start,x_start-.02,x_start-.02],[0,-.7,.7],[0,0,0]); % plot stop_indicator plot([x_stop,x_stop],[-.7,.7],'k','linewidth',2); fill([x_stop,x_stop+.02,x_stop+.02],[0,-.7,.7],[0,0,0]); % plot play_position plot([x_play,x_play],[-1,1],'r'); drawnow; end 如果可行,这是它的样子: 正确轴http://dl.getdropbox.com/u/98854/help2.png 您知道这里出了什么问题吗? 回答: 我终于找到了(愚蠢的)答案。标题偶然与绘图轴的位置相同。由于Matlab的某些渲染细节,除了最右边和最底端的像素线外,它遮盖了整个轴,这使该轴看起来“空”了。 哦,这是一个愚蠢的错误。 更多&回答... |
![]() |
![]() |