24小时热门版块排行榜    

Znn3bq.jpeg
查看: 2281  |  回复: 5
本帖产生 1 个 博学EPI ,点击这里进行查看

tjbbg18

新虫 (小有名气)

[求助] MATLAB 2016a进度条对象获取和设置问题

ha1=get(hrand,'Children');
hac=get(ha1,'Children');
hapa=findall(hac,'Type','patch')
set(hapa,'FaceColor','k')
这个程序在2014a以前都可设置进度条的颜色,我换成MATLAB2016a之后,
hac=get(ha1,'Children');运行显示 0x0 empty GraphicsPlaceholder array.;
而且set也不能设置颜色了,望指教

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖置顶 ( 共有1个 )

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
tjbbg18: 金币+10, 博学EPI+1 2016-08-27 18:15:00
https://stackoverflow.com/questions/36352171/change-width-of-the-bar-figure-at-waitbar-matlab-r2015a
CODE:
% Create a progress bar.
hBar = waitbar ( 0, 'Please Wait....' );
% now use java to get to the progress bar
jFrame = get ( hBar, 'JavaFrame' ); % this will throw a warning
jFigPanel = jFrame.getFigurePanelContainer;
% Now go down through the children of the panel to get the container for the progress bar
jContainer = jFigPanel.getComponent(0);
jPanel = jContainer.getComponent(0);
% Change the location of the panel (ref pixels)
jPanel.setLocation(0,40);
% Change the size of the panel
jPanel.setSize(360,18);
% You then need to repaint and validate for the update to be visible.
jContainer.repaint
jContainer.revalidate

6楼2016-08-27 13:51:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

https://www.mathworks.com/help/m ... r-some-objects.html

Why Is the Children Property Empty for Some Objects?
Starting in R2014b, these objects do not contain handles to underlying objects in their Children properties. To customize the graph, use properties of the actual object. This table lists the affected objects.
2楼2016-08-25 22:38:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tjbbg18

新虫 (小有名气)

引用回帖:
2楼: Originally posted by FMStation at 2016-08-25 22:38:26
https://www.mathworks.com/help/matlab/graphics_transition/why-is-the-children-property-empty-for-some-objects.html

Why Is the Children Property Empty for Some Objects?
Starting in R2014b, these o ...

这个我也查了,我是想知道在2016a中如何设置啊,可否告知
3楼2016-08-26 21:17:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

Use colorbar properties to modify the colorbar.
https://www.mathworks.com/help/matlab/ref/colorbar-properties.html
CODE:
c = colorbar;
w = c.LineWidth;
c.LineWidth = 1.5;

4楼2016-08-26 21:32:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tjbbg18

新虫 (小有名气)

引用回帖:
4楼: Originally posted by FMStation at 2016-08-26 21:32:38
Use colorbar properties to modify the colorbar.
https://www.mathworks.com/help/matlab/ref/colorbar-properties.html


c = colorbar;
w = c.LineWidth;
c.LineWidth = 1.5;

hrand=waitbar(0.3,'颜色')
ha1=get(hrand,'Children');
hac=get(ha1,'Children');
hapa=findall(hac,'Type','patch')
set(hapa,'FaceColor','r')
我还是不懂,就是您能否设置一下进度条的颜色hrand=waitbar(0.3,'颜色'),在2016a中,这个程序在2014a以前都可以把进度条颜色设置为红色,但是2016a中帮助文档说是colorbar但是我还是不会设置进度条啊
5楼2016-08-27 11:11:24
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 tjbbg18 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 今年审到国自然15份,谈谈感受 +19 国自然国社科中 2026-05-17 20/1000 2026-05-20 14:14 by 仲夏夜的星星
[论文投稿] Sci. Bull. 悲剧经验 +4 jyang1999 2026-05-16 5/250 2026-05-20 13:49 by jyang1999
[基金申请] 国自然评分 +3 无名者登山 2026-05-20 4/200 2026-05-20 13:29 by vito刘
[基金申请] 面上本子正文33页,违规吗?会被低分嘛? +9 1234567wang 2026-05-17 11/550 2026-05-20 12:37 by zhuzg0628
[基金申请] 评审有感 +13 popular289 2026-05-18 22/1100 2026-05-20 11:28 by 水和泥不是水泥
[考博] 如果工作了想读博,可以边工作边读全日制嘛? 30+3 铁达火车 2026-05-18 5/250 2026-05-20 09:33 by tfang
[有机交流] 如何实现卤原子转化 +3 BT20230424 2026-05-15 8/400 2026-05-20 09:32 by xtlilibin
[基金申请] 河北省自然科学基金 +3 Peterchao 2026-05-18 3/150 2026-05-20 08:57 by 霸_霸
[文学芳草园] 献血感触 +6 呀呀好傻 2026-05-19 11/550 2026-05-19 22:26 by 而立得乐
[考博] 云南大学材料与能源学院解琳课题组钙钛矿博士招生 +3 光伏爱好者 2026-05-17 5/250 2026-05-19 19:13 by 光伏爱好者
[基金申请] 2026山东省优青 +3 luckinging 2026-05-14 4/200 2026-05-19 16:15 by 52wls
[考博] 找博士生导师 +6 小代想上岸 2026-05-15 7/350 2026-05-19 10:22 by free_fisher
[考博] 26/27申博自荐-锂/钠电池方向 5+3 狗头军师. 2026-05-15 4/200 2026-05-19 09:10 by moonboat
[基金申请] 别被青基扩招骗了!26年科研内卷才刚刚开始 +3 国自然国社科中 2026-05-14 4/200 2026-05-19 08:48 by archvillain
[考博] 博士申请 +5 星…… 2026-05-18 6/300 2026-05-18 23:49 by 糊糊涂涂好
[硕博家园] 我在等一个没有答案的答案 +3 Love_MH 2026-05-17 3/150 2026-05-18 02:22 by 竹林孤影
[考博] 光量子物理方向 博士招生 1人(2026.09) +3 sandyworld 2026-05-15 4/200 2026-05-17 14:38 by sandyworld
[有机交流] 求助2,4-二氯-5-嘧啶甲醛的合成方法 20+3 光吃不拉 2026-05-14 6/300 2026-05-16 19:46 by Equinoxhua
[硕博家园] 申请博士 +3 呃?呃 2026-05-15 3/150 2026-05-16 11:01 by a4742549
[考博] 26应届毕业生考博求助 +3 wo一定上岸 2026-05-13 3/150 2026-05-14 21:47 by 明海天涯
信息提示
请填处理意见