フィルターのクリア

How to make Matlab print special characters on plots?

5 ビュー (過去 30 日間)
Igor de Britto
Igor de Britto 2012 年 3 月 6 日
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
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?
Igor de Britto
Igor de Britto 2012 年 3 月 6 日
Actually, I'm pretty impressed too. It didn't argue with any of the special characters at all!

サインインしてコメントする。

回答 (1 件)

Jan
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!
  1 件のコメント
Igor de Britto
Igor de Britto 2012 年 3 月 6 日
I prefer to use a line too, mainly because it would be possible to control the width and look like an actual legend.
I tried to code, but the problem is the line is created within the Imagesc plot. I would have it better just over the imagesc, beside the title, so that the matrices display isn't altered.
I'm thinking, however, of making a really big subplot (like using 100 lines, instead of 4) and creating a line on one of them. I just wish there was a more elegant and simple solution, but your idea already points me a possible, but harsh way. Thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by