how to insert image to plot function plot(x,y,...image)
1 回表示 (過去 30 日間)
古いコメントを表示
x=20 y=60 plot (x,y,'*') instead of * how to insert image
0 件のコメント
回答 (1 件)
Walter Roberson
2015 年 12 月 1 日
You can use image(x,y,ImageArray) . If you do that then the image will be plotted from
x of (x-1/2) : (x+size(ImageArray,2)-1/2) for the pixel centers horizontally
y of (y-1/2) : (y+size(ImageArray,1)-1/2) for the pixel centers vertically
If you want the image to be drawn smaller than (one pixel = 1 data unit) then you need to specify a vector of values for the x and y coordinates.
You can also use patch() and surf() to create images colored according to the color data that is passed in (or the optional CData parameter.)
Sometimes when people ask about this, what they are interested in is a custom marker, a shape. The easiest way to draw a custom marker is to prepare the information for it in terms of parameters that would be suitable for patch(), and then to position it a particular x and y, add that x and y to the appropriate coordinates in a patch() call.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!