using small images over the figure plotted by plot() or scatter() function as a marker
4 views (last 30 days)
Show older comments
Hi all, I need to plot a figure such that in the graph I have my own images in place of the custom markers provided from the Matlab.
so basically I need something like this ...
k = [1 2 3; 1 2 3];
plot(k(1,:),k(2,:));
now matlab plots these three points in the graph with blue circles as the markers. I wish to replace these markers with my own images which I have in my workspace by the name say "mark".
Can anyone help me ???
Regards Abhishek
0 Comments
Answers (1)
Walter Roberson
on 19 Apr 2011
There is no Mathworks provided option to do this for plots. You need to figure out where each of the markers should go, and you need to image() or imagesc() each of the marker images in to place, taking care to adjust the placement coordinates in order to scale the image to the proper size. You will likely also want to read the documentation for the zoom() function and set up an ActionPostCallback to re-size the images when the zoom level changes -- normal plot markers are a constant size, but image() or imagesc()'d markers get zoomed in or out with the zoom, causing them to take over the display...
0 Comments
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!