How to make Matlab print special characters on plots?
4 次查看(过去 30 天)
显示 更早的评论
Hi, all,
I'm currently trying to put a colored line on the side of the title on a subplot, but clueless about how to do it properly. I figured a possible workaround would be to put special characters inside the title, so that they can form a line and be colored.
The problem is, while Matlab will recognize the characters in the Editor, when ploted, it becomes an "?". Any ideas on how to deal with it?
By the way, the characters I tried were: * ▮ * ▀ * ▁ * ▂ * ▃ * ▄ * ▅ * ▆ * ▇ * █ * ▉ * ▊ * ▋ * ▍ * ▎ * ▏ * ▐ * ▮ * ─ * ━ * │ * ┃
2 个评论
Jan
2012-3-6
I'm impressed that you are able to insert these special charatcers in the forum message. How did you do this?
回答(1 个)
Jan
2012-3-6
I suggest to use a line, if you need a line.
Perhaps this works:
titleH = get(SubplotH, 'Title');
set(titleH, 'units', 'data');
Ext = get(titleH, 'Extent');
ExtRight = Ext(1) + Ext(3);
ExtBottom = Ext(2);
ExtHeight = Ext(4);
line([ExtRight, ExtRight], [ExtBottom, ExtBottom + ExtHeight], ...
'LindeWidth', 4.5);
This is just a concept, because I cannot run or test it currently!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!