|
On Jul 14, 6:26 pm, "recep mansiz" <aalmo...@hotmail.com> wrote:
> Hi all!!
>
> I want to put a backround image to my graph so the values can be seen on this image.
>
> I cannot fix the graph and photo correctly. does anybody have any idea how to place the image correctly to tha graph??
>
> below I put three different implementation of the same code.
>
> %%
> x = [16 -21 25 10];
> y = [ 5 -38 16 10];
>
> imshow ('brain2.jpg');
> hold on
>
> for i = 1:length (x)
>
> plot (x(i),y(i),'g.','MarkerSize',16);
> axis([-68 68 -102 70]);
>
> end
>
> figure
>
> % imshow ('brain2.jpg');
> hold on
>
> for i = 1:length (x)
>
> plot (x(i),y(i),'g.','MarkerSize',16);
> axis([-68 68 -102 70]);
> hold on
> end
>
> figure
>
> imshow ('brain2.jpg');
> hold on
>
> for i = 1:length (x)
>
> plot (x(i),y(i),'g.','MarkerSize',16);
> % axis([-68 68 -102 70]);
>
> end
> %%
I do this all the time, but I don't have the Image Processing Toolbox,
and you don't need it for this.
Try this and report back:
c=imread('brain2.jpg');
figure;
image(c);
hold on
plot(x,y,'go',...
'MarkerFaceColor','g')
set(gca,...
'XLim',[-68 68],...
'YLim',[-102 70])
Notes:
1. Try using image instead of imshow
2. You don't need a loop
3. Use filled circles instead of large dots.
4. Use handle graphics
|