Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove axis in MATLAB

axis off Not working.

function displayResults(filename,hObject, eventdata, handles)
% Open 'filename' file... for reading...
fid = fopen(filename);
for N=6:1:10
    imagename = fgetl(fid);
    if ~ischar(imagename), break, end       % Meaning: End of File...
    [x,map]=imread(imagename);
    rgb=ind2rgb(x,map);
    ax = handles.(sprintf('axes%d', N));
    axis off;
    image(rgb, 'Parent', ax);  
end
guidata(hObject,handles)

Above code results in following output:

image

I've highlighted axis in above figure. All images I've used is bitmap with bit depth of 8. I don't want those axis, how can I remove that?

like image 337
Chethan Avatar asked May 06 '13 13:05

Chethan


People also ask

How do you clear an axis in MATLAB?

Clear Axes and Reset All Axes PropertiesCreate a line plot and set the axis limits. Clear the line plot from the axes and reset all the axes properties to their default values. cla reset resets all properties of the current axes, except for the Position and Units properties.

What does axis off do in MATLAB?

axis visibility , where visibility is off , turns off the display of the axes background. Plots in the axes still display. The default for visibility is on , which displays the axes background. example. lim = axis returns the x-axis and y-axis limits for the current axes.

How do I turn on axis in MATLAB?

Hide the Axis Ticks and Labels From a Plot Using the axis off Command in MATLAB. If you want to hide both the axis ticks and the axis labels, you can use the axis off command, which hides all the axes. For example, let's plot a sine wave and hide its axis ticks and labels using the axis off command.

How do you remove a plot?

In the Plot Style Table Editor, Form View tab, select the plot style that you want to delete from the list of plot styles. Click Delete Style. Click Save & Close.


1 Answers

insert the following at the end of each loop:

set(ax, 'Visible','off')

or you can do this once for all axes in the figure:

set(findobj(gcf, 'type','axes'), 'Visible','off')
like image 133
Amro Avatar answered Sep 30 '22 19:09

Amro