remove y axis in matlab

To remove the y-axis from a MATLAB plot, you can use the set function to set the 'YTick' property of the axes object to [].

Here is an example code block to remove the y-axis from a plot:

main.m
% create a plot
x = 1:10;
y = rand(1,10);
plot(x,y)

% remove the y-axis
set(gca,'YTick',[])
93 chars
8 lines

In this example, gca gets the handle of the current axes, and the set function sets the 'YTick' property to an empty array, effectively removing the y-axis ticks and labels from the plot.

gistlibby LogSnag