quiver plot on an image

9 ビュー (過去 30 日間)
Reza Zh
Reza Zh 2024 年 3 月 1 日
コメント済み: Voss 2024 年 3 月 1 日
Hello
I am trying to quiverplot on an image, but quiver plot shows up very small on the upper left corner (attached here)
I have to use 'imshow' instead of 'imagesc' becasue I want the image in black and white and colored quiver vectors. When I assigne colormap for 'imagesc' it messes the quiver vectors.
Is there any way to superimpose quiver plot on imshow function?
thank you

採用された回答

Voss
Voss 2024 年 3 月 1 日
編集済み: Voss 2024 年 3 月 1 日
"Is there any way to superimpose quiver plot on imshow function?"
Yes.
% read an image:
img = imread('peppers.png');
% imshow the image:
imshow(img)
% make a quiver plot:
hold on
[m,n,~] = size(img);
[x,y] = meshgrid(1:n,1:m);
quiver(x,y,randn(m,n),randn(m,n))
% zoom in to see some details:
xlim([101 115])
ylim([101 110])
It looks like the x and y you use in quiver are incorrect is why your quiver plot is so small.
  4 件のコメント
Reza Zh
Reza Zh 2024 年 3 月 1 日
thanks
Voss
Voss 2024 年 3 月 1 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by