필터 지우기
필터 지우기

Can I make a scatterplot with custom marker symbols?

조회 수: 103 (최근 30일)
Chris Taylor
Chris Taylor 2012년 3월 21일
MATLAB has a range of default symbols to use as point markers on a scatterplot (circle, asterisk, point, etc.). But is there any way of replacing these with a custom symbol? Specifically, I would like to give each point a thumbnail image representing the identity of that point. Is that possible?

채택된 답변

Thomas
Thomas 2012년 3월 21일
Short answer: NO. User defined markers cannot be used in MATLAB.. Though you could draw (image) them in each location..
The markers in MATLAB are..
'+' Plus sign
'o' Circle
'*' Asterisk
'.' Point
'x' Cross
'square' or 's' Square
'diamond' or 'd' Diamond
'^' Upward-pointing triangle
'v' Downward-pointing triangle
'>' Right-pointing triangle
'<' Left-pointing triangle
'pentagram' or 'p' Five-pointed star (pentagram)
'hexagram' or 'h''' Six-pointed star (hexagram)
'none' No marker (default)
  댓글 수: 5
Oleg Komarov
Oleg Komarov 2012년 3월 21일
You can ry this example:
load discrim
h = gscatter(ratings(:,1),ratings(:,2),group,'br','xo');
hold on
troll = imread('http://ragecollection.com/img/ragefaces/trollface.png');
imagesc([680 710],[8800 8100],troll)
Chris Taylor
Chris Taylor 2012년 3월 21일
Thanks to you both for your help. I think by the sound of it, in the end it's going to be easier to export the data to another program and make my graph there...

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Oleg Komarov
Oleg Komarov 2012년 3월 21일
To show a practical example using Thomas' link in the comments:
% Sample scattergroup
load discrim
h = gscatter(ratings(:,1),ratings(:,2),group,'br','xo');
hold on
% Define the font and desired character (smiley)
font = 'Wingdings';
m = 'J';
% Use text to plot the character
x = get(h(2),'Xdata');
y = get(h(2),'Ydata');
text(x,y,m,'fontname',font,'HorizontalAl','center','color','r')
% Delete old markers
delete(h(2))

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by