How do I change the axis things get plotted on?
Show older comments
I'm new to matlab and I decided to take on an ambitous project for school. I'm trying to make a reletively simple game but I'm running into a problem where text and graphs will be plotted on images that I plotted before. Below is a small snipet of my code showing the problem. The idea is to shoot a laser from the ufo but instead it graphs it on the ufo. I'd like to know how to fix this and do the same for text. Thanks!!
clc, clear, close all
figure
hold on
axis([0 8 0 8])
Image = imread('Space.jpg');
SpaceBackground = image(xlim,ylim,Image);
axis off
UImage = imread('Ufo.png');
UFO = axes('position',[0.13,0.1115,0.19,0.2]);
imagesc(UImage);
axis off
x = linspace(0,8);
y = 1;
pause(3)
for i = 1:8
p = plot(x(i),y,'ro');
pause(0.1)
delete(p);
end
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!