- https://en.wikipedia.org/wiki/Zapf_Dingbats
- https://help.adobe.com/en_US/framemaker/2015/using/using-framemaker-2015/Appendix/frm_character_sets_cs/frm_character_sets_cs-5.htm
How can I create elliptical-shaped markers?
11 次查看(过去 30 天)
显示 更早的评论
I have two columns of data [X Y] that I would like to plot with elliptical-shaped markers.
1 个评论
Karthick SK
2021-8-25
编辑:Karthick SK
2021-8-25
In 'Windows' machine it does not work. Select symbols from Matlab default fonts like 'ZapfDingbats' to achieve the goal.
Important thing to note is that you need to give the 'char' command in hexadecimal.
For example,
text(0.5,0.5,char(11055),'fontname','ZapfDingbats','fontsize',20); % char in decimal code
prints the corresponding ZapfDingbats character, whereas
text(0.4,0.5,char(0x2B2C),'fontname','ZapfDingbats','fontsize',20); % char in hexadecimal code
prints the corresponding ZapfDingbats graphic text.
⬬Black Horizontal Ellipse 11052; 0x2B2C;
⬭White Horizontal Ellipse 11053; 0x2B2D;
⬮Black Vertical Ellipse 11054; 0x2B2E;
⬯White Vertical Ellipse 11055; 0x2B2F;
The relevant decimal and hexadecimal values can be found in the following links:
Use the table given in the Unicode blocks for ‘Zapf Dingbats’ .
A detailed code is given below
% sample code to plot letters from a font as markers
clc; clearvars; close all;
% Make some arbitrary data - linear scale
x = linspace(1,10,10);
y = x;
% Use TEXT to plot the character along the data
subplot(121); % linear scale
l = plot(nan, nan); % creating an empty line before
text(x,y,char(11052),'fontname','ZapfDingbats','fontsize',10); % add the actual data
% Manually set axis limits, since TEXT does not do this for you
xlim([min(x)-1 max(x)+1])
ylim([min(y)-1 max(y)+1])
% legend change
l.XData = []; % remove its points from the axes
l.YData = [];
l.Color = [0 0 0]; l.LineStyle = 'none'; l.Marker = 'none';
leg = legend(l,strcat(char(11052),' Data'),'location','northwest');
set(leg,'fontname','ZapfDingbats','fontsize',10);
% finish
axis square; grid on; box on;
(Credits: Kannan Munusamy. My friends found this way as efficient and the credits go to him)
采纳的回答
Image Analyst
2017-6-10
See if there is a character that is an ellipse, like in the webdings or wingdings font. Then use text() to place it on your graph.
1 个评论
Walter Roberson
2017-6-10
Unfortunately I do not see anything suitable; https://www.thespreadsheetguru.com/blog/wingdings-webdings-font-icon-cheat-sheet-printable
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!