how to insert image to plot function plot(x,y,...image)

5 views (last 30 days)
x=20 y=60 plot (x,y,'*') instead of * how to insert image

Answers (1)

Walter Roberson
Walter Roberson on 1 Dec 2015
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.

Tags

Community Treasure Hunt

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

Start Hunting!