グラフと写真を合わせる

7 views (last 30 days)
takuyuki hasegawa
takuyuki hasegawa on 20 Sep 2020
Answered: Atsushi Ohashi on 25 Sep 2020
以下のコードで背景に写真を載せ、グラフと重ねようとしているのですが、写真の位置が正しい位置に出ないかつ圧縮されています。
解決策ありましたらお願いします
BackImName='RectifiedPhotos/Photo3/RectifiedPhoto-H2018-02-17-003.png';
file=csvread('modifieddm=1.csv');
figure
for i=2
a=file(:,1);
plot(a,file(:,i));
hold on
end
hold on
I = imread(BackImName);
h = image(xlim,-ylim,I);
uistack(h,'bottom');
xlim([0 2400])
ylim([100 1600])

Answers (1)

Atsushi Ohashi
Atsushi Ohashi on 25 Sep 2020
Line関数で画像上にプロットを描く手段はいかがでしょうか。
BackImName='RectifiedPhotos/Photo3/RectifiedPhoto-H2018-02-17-003.png';
file=csvread('modifieddm=1.csv');
figure;
img = imread(BackImName);
imshow(img);
ax = gca;
h = line(ax, file(:, 1), file(:, 2));
% ラインが目立つよう色を変更しております
h.Color = [1, 0, 1];

Community Treasure Hunt

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

Start Hunting!