![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175447/image.png)
How to add images to data points
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How do I add images to data points just like adding text?
labels = [1:2]
c = cellstr(num2str(labels));
gscatter(X, Y, labels);
text(X+1,Y,c);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157785/image.png)
0 comentarios
Respuesta aceptada
KSSV
el 8 de Nov. de 2016
clc; clear all ;
data = rand(10,2) ;
x = data(:,1) ; y = data(:,2) ;
% Let's try again.
% Plot the original data
plot(x,y);
hold on;
%
dx = 0.08 ; dy = 0.08 ; %# Add to the plot
xmin = x-dx ; xmax = x+dx ;
ymin = y-dy ; ymax = y+dy ;
% Make background transperent
img = imread('14.png');
img = flipud(img) ;
for i = 1:length(data)
h = image([xmin(i) xmax(i)],[ymin(i) ymax(i)],img); %# P`lot the image
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175447/image.png)
YOu need to play around and refine the above lines of code.
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!