Hi everyone, I want to add the following legend to this layout but don't know how to do it.
Square shape is for Building Triangle shape for HBSs Stars shape for ABSs.
Any help will be really appreciated, thank you so much.

2 件のコメント

dpb
dpb 2014 年 5 月 14 日
Gotta' run, but
doc text
should get you started, I'd think...
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 5 月 14 日
Hi, How can i draw a triangle, square and star using text function ?

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

 採用された回答

Star Strider
Star Strider 2014 年 5 月 14 日

0 投票

Enlarging on dpb’s comment, consider a textbox. See Annotation Textbox Properties for details.

7 件のコメント

Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 5 月 14 日
編集済み: Aftab Ahmed Khan 2014 年 5 月 14 日
Hi, Done with the star and and delta, but what is TeX command for a square ? Can't find it there.
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 5 月 14 日
Hi this is where i am stuck in the legend section. 1. Can't draw the square shape for the building. 2. Also the corresponding colours for each element for the legend as at the moment all of them are black.
Here is my code for the textbox section.......................
annotation('textbox',... [0.75 0.65 0.05 0.1],... 'String',{'Legend \Delta-HBS \ast-ABS -Building'},... 'FontSize',12,... 'FontName','Arial',... 'LineStyle','-',... 'EdgeColor',[0 0 0],... 'LineWidth',2,... 'BackgroundColor',[1 1 1],... 'Color',[0 0 0]);
Star Strider
Star Strider 2014 年 5 月 14 日
編集済み: Star Strider 2014 年 5 月 14 日
Had to look for that, since TeX seems to have overlooked it. Apologise for the delay.
The best option I can think of for the open square is the Webdings character 99 ( 63 hex ). (I believe it displays as the lower-case ‘c’ in ASCII.) In text, you can specify FontName and FontSize, so that might be your best option. (Webdings is a standard Windows-supplied font.)
This illustrates the Webdings version, whimsically:
figure(1)
plot([-0.3:0.1:0.3], 0.3+[-0.3:0.1:0.3].^2)
text(-0.3, 0.7, 'c', 'FontName', 'Webdings', 'Color', 'b')
text(0.3, 0.7, 'c', 'FontName', 'Webdings', 'Color', 'b')
text(0.0, 0.5, '\Delta', 'Color', 'r')
axis([-1 1 0 1])
The only other option I can think of for the open square is the Unicode symbol for it: □. The problem is that I don’t know if it will display correctly in MATLAB. I’ve had problems displaying Unicode characters in MATLAB, which usually displays them as: ??.
EDIT — Added '\Delta' and 'Color'.
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 5 月 14 日
Done, Thank you once again. Cheers bro........
Star Strider
Star Strider 2014 年 5 月 14 日
As always, my pleasure!
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 5 月 14 日
Hi, Just to show you, this is what i made as final version of my layout. Take care.
Star Strider
Star Strider 2014 年 5 月 14 日
Cool!
I’m sure your audience will be appropriately impressed, and appreciative of your efforts!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by