필터 지우기
필터 지우기

How to display special types of symbols e.g. ♪ ?

조회 수: 7 (최근 30일)
Alice
Alice 2014년 10월 24일
답변: matt dash 2014년 10월 24일
Hi,
I need to display a series of symbols that have alt/ascii codes (e.g. ♪) onto a plot. I can already do this with symbols already in matlab, this is my code:
%plot 9 shapes on grid
clear all
clc
x=[2, 2, 2, 3, 3, 3, 4, 4, 4];
y=[2, 5, 8, 2, 5, 8, 2, 5, 8];
figure (1)
plot (x,y, 'k+')
%set axes to show size
axis ([0 15 0 12])
%turn axes off
%draw rectangle around those shapes
figure (1)
myrectangle= rectangle('Position', [1, 1 ,4, 8], 'EdgeColor', [0 0 0])
shg
But how do I replace the '+' signs with a '♪' ?
Thanks

채택된 답변

matt dash
matt dash 2014년 10월 24일
You can display text at a point by using the text() function instead of plot(), but there is no way to display unicode characters like the music note. Two options:
  1. The text() function can display other fonts, so maybe you can find a font that has a music note within the 0-255 ascii range.
  2. You can use the image() function to display a bitmap image, so if you make a little png out of the music note you can display them with image. But this might get more complicated if you have them close enough together that they overlap. (have to deal with transparency).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by