Is it possible to disable axes' edges
Show older comments
Hello,
Im working with handles to create a GUI that will be using several different axes. Can the edges of the axes be removed? I've been searching through the axes properties and I havent seen anything. Can someone please help!
Thanks in advance, Matt
Accepted Answer
More Answers (4)
Walter Roberson
on 17 Jul 2012
1 vote
The only way to remove the edge of the axes is to set the axes visibility to be off. That will also make the tick marks invisible, along with any grid lines.
3 Comments
Matthew
on 18 Jul 2012
Walter Roberson
on 18 Jul 2012
Visible
{on} | off
Visibility of axes. By default, axes are visible. Setting this property to off prevents axis lines, tick marks, and labels from being displayed. The Visible property does not affect children of axes.
Sounds to me exactly what you are looking for.
Matthew
on 19 Jul 2012
Image Analyst
on 18 Jul 2012
0 votes
Matthew, If you have the Image Processing Toolbox, go to File->Preferences->Image Processing->IMSHOW Display and uncheck the "Axes visible" box. That will eliminate any black line around the edge of your images if you use imshow() to display your image.
1 Comment
Deependra Mishra
on 10 Jan 2020
Is there anyway this can be unchecked programmatically?
Christopher Bitikofer
on 11 Aug 2022
This took me too long to figure out. The axes are objects with lots of fun properties including visibility
ax.XAxis.Visible = 'off';
Yuri Janson
on 9 Jun 2023
If you do not want the axes themselves to show, but do want the axis label and/or tick labels to show, then you can do the following:
ax = gca;
% Set color of X and Y axes to background color (white)
set(ax,'XColor',[1 1 1])
set(ax,'YColor',[1 1 1])
% Set color of axis labels back to standard color
set(ax.XLabel,'Color',[0.15 0.15 0.15])
set(ax.YLabel,'Color',[0.15 0.15 0.15])
% Set color of tick labels back to standard color
set(ax.XAxis,'TickLabelColor',[0.15 0.15 0.15])
set(ax.YAxis,'TickLabelColor',[0.15 0.15 0.15])
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!