Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 其它 > 资料存档
资料存档 资料存档
回复
 
主题工具 显示模式
旧 2019-12-10, 16:49   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
帖子 为什么该轴对象在MATLAB中无法正确显示?

我正在用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的某些渲染细节,除了最右边和最底端的像素线外,它遮盖了整个轴,这使该轴看起来“空”了。

哦,这是一个愚蠢的错误。



更多&回答...
poster 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛禁用 表情符号
论坛启用 [IMG] 代码
论坛启用 HTML 代码



所有时间均为北京时间。现在的时间是 22:14


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.