
How can i insert a picture at a specific coordinate in a graph?
16 ビュー (過去 30 日間)
古いコメントを表示
For example if i want a graph of x=1:10, y=1:10, and instead of the dots that symbolize the points i want to have a specific icon that i have on my computer. Thanks!
0 件のコメント
回答 (1 件)
KSSV
2016 年 6 月 6 日
編集済み: KSSV
2016 年 6 月 6 日
clc; clear all
% your data
x=1:10;
y=1:10;
plot(x,y,'.-r');
hold on;
%
dx = 0.5 ; dy = 0.5 ; % size of the image/ icon
xmin = x-dx ; xmax = x+dx ;
ymin = y-dy ; ymax = y+dy ;
% Make background transperent
[img, map, alpha] = imread('MATLAB.png');
img = flipud(img) ;
for i = 1:length(x)
h = image([xmin(i) xmax(i)],[ymin(i) ymax(i)],img); %# P`lot the image
set(h,'AlphaData',0.5);
end

0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Mapping Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!