Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: axis off -> xaxis off

Subject: axis off -> xaxis off

From: Suguleasa

Date: 2 Jul, 2008 16:18:02

Message: 1 of 3


I want to turn off only the x axis, but not the y axis. Is
there a way to do it?

Thanks!
Suguleasa

Subject: axis off -> xaxis off

From: Yuri Geshelin

Date: 2 Jul, 2008 19:28:02

Message: 2 of 3

"Suguleasa " <suguleasa@gmail.com> wrote in message
<g4g9nq$d8j$1@fred.mathworks.com>...
>
> I want to turn off only the x axis, but not the y axis. Is
> there a way to do it?
>
> Thanks!
> Suguleasa

Hi,

Here is a trick:

set(gca, 'xcolor ',XCOL, 'xtick ',[])

where XCOL is a color that makes the X-axis invisible (most
commonly, white). Of course, the axis is still there:
something to keep in mind when you set up other axes or
make use of these gca properties:

Layer, LineWidth etc.

In addition, if you print your image in a file, use this
command:

set(gcf, 'color ',XCOL)

This is an awkward solution. There may be others, but I do
not know of them.

Yuri



Subject: axis off -> xaxis off

From: Suguleasa

Date: 2 Jul, 2008 20:15:11

Message: 3 of 3

Yes, that's what I ended up doing. The idea was to free the
pixels taken by the width of the axes.
I also tried to set LineWidth to zero, but it returned an
error message that the width has to be greater than zero. I
believe Matlab should be more flexible with regard to this.

Thank you for the reply!
Suguleasa


"Yuri Geshelin" <geshelin@hotmail.com> wrote in message
<g4gks2$9fi$1@fred.mathworks.com>...
> "Suguleasa " <suguleasa@gmail.com> wrote in message
> <g4g9nq$d8j$1@fred.mathworks.com>...
> >
> > I want to turn off only the x axis, but not the y axis. Is
> > there a way to do it?
> >
> > Thanks!
> > Suguleasa
>
> Hi,
>
> Here is a trick:
>
> set(gca, 'xcolor ',XCOL, 'xtick ',[])
>
> where XCOL is a color that makes the X-axis invisible (most
> commonly, white). Of course, the axis is still there:
> something to keep in mind when you set up other axes or
> make use of these gca properties:
>
> Layer, LineWidth etc.
>
> In addition, if you print your image in a file, use this
> command:
>
> set(gcf, 'color ',XCOL)
>
> This is an awkward solution. There may be others, but I do
> not know of them.
>
> Yuri
>
>
>

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
xaxis axis off turn off only x axis Suguleasa 2 Jul, 2008 12:20:04
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics