Can I make a scatterplot with custom marker symbols?

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?

 Respuesta aceptada

Thomas
Thomas el 21 de Mzo. de 2012
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 comentarios

Chris Taylor
Chris Taylor el 21 de Mzo. de 2012
Thanks! I suspected that was the case. So how would I go about drawing an image at a specified location within the scatterplot?
Oleg Komarov
Oleg Komarov el 21 de Mzo. de 2012
Placing images in a scatter plot it's not a trivial task (at least for me). I gave it a shot but I found problematic to keep the dimension of the image fixed no matter the axis limits.
Thomas
Thomas el 21 de Mzo. de 2012
It is difficult to place custom images.. though fonts or texts might be easier.
this link might help:http://www.mathworks.com/support/solutions/en/data/1-1AS2T/index.html?product=ML&solution=1-1AS2T
Oleg Komarov
Oleg Komarov el 21 de Mzo. de 2012
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 el 21 de Mzo. de 2012
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...

Iniciar sesión para comentar.

Más respuestas (1)

Oleg Komarov
Oleg Komarov el 21 de Mzo. de 2012
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))

Categorías

Más información sobre Discrete Data Plots en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 21 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by