Thread Subject: get rid of axis values

Subject: get rid of axis values

From: recep mansiz

Date: 6 Oct, 2009 07:47:01

Message: 1 of 6

Hi all!!

c=imread('DEF.jpg');
image(c);
hold on
plot (xfr,yfr,'g.','MarkerSize',10);
xlabel ('A');
ylabel ('B');
title ('front');

The output figure have axis values between 0-500, at the right side and below of the figure.

How can I get rid of these axis values without disturbing axis labels??

Thanks in advance!!

Subject: get rid of axis values

From: Jan Simon

Date: 6 Oct, 2009 09:36:02

Message: 2 of 6

Dear recep mansiz!

> c=imread('DEF.jpg');
> image(c);
> hold on
> plot (xfr,yfr,'g.','MarkerSize',10);
> xlabel ('A');
> ylabel ('B');
> title ('front');
>
> The output figure have axis values between 0-500, at the right side and below of the figure.
>
> How can I get rid of these axis values without disturbing axis labels??

I'm not sure, what "axis values" are. Do you mean the ticks lables (then I'm wondering, why they are on the right side and not on the left) or unneded empty space in the axes?

To remove the tick labels:
  set(gca, 'XTick', [], 'YTick', [])
To crop the image:
  axis('tight');
or:
  axis('image');

BTW: It is always safer to create an AXES manually and use its handle as 'Parent' property to created child objects. Then the results are not disturbt, if the user clicks to any object during creation.

Good luck, Jan

Subject: get rid of axis values

From: recep mansiz

Date: 6 Oct, 2009 11:14:02

Message: 3 of 6


> I'm not sure, what "axis values" are. Do you mean the ticks lables (then I'm wondering, why they are on the right side and not on the left) or unneded empty space in the axes?
>
> To remove the tick labels:
> set(gca, 'XTick', [], 'YTick', [])
> To crop the image:
> axis('tight');
> or:
> axis('image');
>
> BTW: It is always safer to create an AXES manually and use its handle as 'Parent' property to created child objects. Then the results are not disturbt, if the user clicks to any object during creation.
>
> Good luck, Ja

thanks for quick answer Jan. I mean the numbers at the LEFT side and at below of the image; the numbers between the labels and image. when I use 'xlabel' and 'ylabel' commands, numbers appear beside the image.

is there a way to get rid of those numbers??

Subject: get rid of axis values

From: recep mansiz

Date: 7 Oct, 2009 07:57:02

Message: 4 of 6


> thanks for quick answer Jan. I mean the numbers at the LEFT side and at below of the image; the numbers between the labels and image. when I use 'xlabel' and 'ylabel' commands, numbers appear beside the image.
>
> is there a way to get rid of those numbers??

or even editing these numbers and their value interval is acceptable.

Subject: get rid of axis values

From: Jan Simon

Date: 7 Oct, 2009 08:08:01

Message: 5 of 6

Dear recep mansiz!

> > To remove the tick labels:
> > set(gca, 'XTick', [], 'YTick', [])
> > To crop the image:
> > axis('tight');
> > or:
> > axis('image');
> >
> > BTW: It is always safer to create an AXES manually and use its handle as 'Parent' property to created child objects. Then the results are not disturbt, if the user clicks to any object during creation.
>
> thanks for quick answer Jan. I mean the numbers at the LEFT side and at below of the image; the numbers between the labels and image. when I use 'xlabel' and 'ylabel' commands, numbers appear beside the image.
>
> is there a way to get rid of those numbers??

Did you try setting the XTick/YTick properties as suggested???

Kind regards, Jan

Subject: get rid of axis values

From: recep mansiz

Date: 7 Oct, 2009 08:25:02

Message: 6 of 6

yes I tried yesterday, but not as you told and it has given error. after your most recent post I tried again and as you said and it works... thanks very much...

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com