Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide axes and ticks in matlab without hiding everything else

Tags:

matlab

I draw images to axes in my matlab UI, but I don't want the axes and ticks to be visible how do I prevent that, and also where do I make this call?

I do this

imagesc(myImage,'parent',handles.axesInGuide);
like image 938
DogDog Avatar asked Nov 30 '11 01:11

DogDog


People also ask

How do I hide tick marks in MATLAB?

TickLength = [0 0]; This will allow you to keep the labels but remove the tick marks on only the x-axis.

What does Xticks do in MATLAB?

xticks( ticks ) sets the x-axis tick values, which are the locations along the x-axis where the tick marks appear. Specify ticks as a vector of increasing values; for example, [0 2 4 6] . This command affects the current axes.

How do you clear an AXE in MATLAB GUI?

cla( ax ) deletes graphics objects from the axes, polar axes, or geographic axes specified by ax instead of the current axes. cla reset deletes graphics objects from the current axes regardless of their handle visibility.


2 Answers

axis off;

Is this what you are looking for?

This is definitely somewhere else on this website and in the matlab documentation. Try typing

help plot

Or using the documentation on plotting!

edit: Now that you have shown what you are doing. (You don't need the handles, I just always write them in to clutter my workspace)

myImage = yurbuds0x2Dironman; # don't ask
fH = figure;
iH = imagesc(myImage);
set(gca,'xtick',[],'ytick',[])

Are you able to do it like this?

like image 79
St-Ste-Ste-Stephen Avatar answered Oct 02 '22 18:10

St-Ste-Ste-Stephen


I support the

set(gca,'xtick',[],'ytick',[]);

approach over the

axis off

one. The reason is set(gca, ...) just removes the labels but keeps the axes, unlike axis off. I am generating a group of images with fixed dimensions to combine later into a video. Deleting the axes creates different size frames that can't be recombined.

like image 22
Hazem Avatar answered Oct 02 '22 20:10

Hazem