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

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 Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2014년 5월 14일

댓글:

2014년 5월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by