Is it possible to disable axes' edges
40 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Sean de Wolski
2012 年 7 月 17 日
So something like:
figure;
axes('box','off','xtick',[],'ytick',[],'ztick',[],'xcolor',[1 1 1],'ycolor',[1 1 1]);
line([0 1],[0 1])
2 件のコメント
Jan
2012 年 7 月 17 日
Exactly: You set the color of the axes lines to either the background color of the axes or of the figure:
figH = figure;
bg = get(figH, 'Color');
axes('xcolor', bg, 'ycolor', bg);
To remove the ticks also, see Sean's code.
その他の回答 (4 件)
Walter Roberson
2012 年 7 月 17 日
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 件のコメント
Walter Roberson
2012 年 7 月 18 日
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.
Image Analyst
2012 年 7 月 18 日
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 件のコメント
Christopher Bitikofer
2022 年 8 月 11 日
This took me too long to figure out. The axes are objects with lots of fun properties including visibility
ax.XAxis.Visible = 'off';
0 件のコメント
Yuri Janson
2023 年 6 月 9 日
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])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!