Thread Subject: plot problem

Subject: plot problem

From: recep mansiz

Date: 18 Sep, 2009 09:26:04

Message: 1 of 5

Hi all!!

x = [5];
y = [5];

c=imread('FRONT.jpg');
image(c);
hold on
plot (x,y,'g.','MarkerSize',1);

when I want to plot, no point is apparent on screen. when I choose (x,y) = (6,6)
a point is apparent on screen.

shouldn't a graph start from (0,0) or (1,1) instead??

Thanks in advance!!

(image FRONT.jpg is a 770x770 picture)

Subject: plot problem

From: Wayne King

Date: 18 Sep, 2009 11:08:03

Message: 2 of 5

"recep mansiz" <aalmoraa@hotmail.com> wrote in message <h8vjnc$7cm$1@fred.mathworks.com>...
> Hi all!!
>
> x = [5];
> y = [5];
>
> c=imread('FRONT.jpg');
> image(c);
> hold on
> plot (x,y,'g.','MarkerSize',1);
>
> when I want to plot, no point is apparent on screen. when I choose (x,y) = (6,6)
> a point is apparent on screen.
>
> shouldn't a graph start from (0,0) or (1,1) instead??
>
> Thanks in advance!!
>
> (image FRONT.jpg is a 770x770 picture)

Hi Recep,
I'm not totally sure I understand your question, but does the command

axis xy

help you?

so

image(randn(256,256));
hold on;
axis xy;
plot(5,5,'r^','markersize',10)

Your markersize of 1 (in your code) is really small and (5,5) on axes of length 770 is going to put the marker very much in the absolute corner of the image, so again I'm not sure this is what you're asking.

Wayne

Subject: plot problem

From: recep mansiz

Date: 18 Sep, 2009 12:28:02

Message: 3 of 5

Thanks for your reply Wayne, and yes now I see my question isn't clear enough.

I have an image that I should mark some specific points on it. I have some input data such as (x,y) = (-30,30).

My x,y data is between (-68,68) and (-41,47) in turn. When I use
axis([xmin xmax ymin ymax])
the graph is centered at (0,0) point but the image slides away, with its left top corner is placed near but not exactly (0,0) point, with its bounds ascending through +x and -y direction.

So I don't use 'axis' command for my input bound. instead I try to normalize the input data with the image.

I mean I use c=imread('FRONT.jpg');
                       image(c);
                       hold on
                       plot (x+385 , -y+385 ,'g.','MarkerSize',1);

to make my (x,y) = (0,0) point corresponds to the center of the image (image is 770x770). But it does not!!!

I discovered that when I choose (x,y) = (0,0) to (5,5) the points are not shown in the graph. after (x,y) = (6,6), the points begin to appear in the graph. this is the problem!!! because I cannot assign input points to their exact points in the graph.

I know that it seems a little complicated, but the problem is basic.

thanks for your interests again.








 

Subject: plot problem

From: Steven Lord

Date: 18 Sep, 2009 13:21:52

Message: 4 of 5


"recep mansiz" <aalmoraa@hotmail.com> wrote in message
news:h8vuci$d4e$1@fred.mathworks.com...
> Thanks for your reply Wayne, and yes now I see my question isn't clear
> enough.
>
> I have an image that I should mark some specific points on it. I have some
> input data such as (x,y) = (-30,30).
>
> My x,y data is between (-68,68) and (-41,47) in turn. When I use
> axis([xmin xmax ymin ymax])
> the graph is centered at (0,0) point but the image slides away, with its
> left top corner is placed near but not exactly (0,0) point, with its
> bounds ascending through +x and -y direction.
>
> So I don't use 'axis' command for my input bound. instead I try to
> normalize the input data with the image.
>
> I mean I use c=imread('FRONT.jpg');
> image(c);
> hold on
> plot (x+385 , -y+385 ,'g.','MarkerSize',1);
>
> to make my (x,y) = (0,0) point corresponds to the center of the image
> (image is 770x770). But it does not!!!

More than likely it does. The problem is likely that the marker is just so
small that you can't see it. Try:

hLine = plot(x+385, 385-y, 'g.', 'MarkerSize', 50);

If you still don't, try moving the line to the top of the stacking order
with UISTACK. This will move it "on top" of the image.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: plot problem

From: recep mansiz

Date: 18 Sep, 2009 13:54:03

Message: 5 of 5

> More than likely it does. The problem is likely that the marker is just so
> small that you can't see it. Try:
>
> hLine = plot(x+385, 385-y, 'g.', 'MarkerSize', 50);
>
> If you still don't, try moving the line to the top of the stacking order
> with UISTACK. This will move it "on top" of the image.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>
the reason that I can't see the marker cannot be its size because when I use different point I can see it (I use markersize=1 on purpose). but I'll try to move the line as you said. thanks for reply Steve.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
plot recep mansiz 18 Sep, 2009 05:29:03
image recep mansiz 18 Sep, 2009 05:29:03
rssFeed for this Thread

Contact us at files@mathworks.com