Plot – Remove axis ticks but keep grid lines
Hi,
I am producing a graph to view open source polysomnography data. I have several arrays in one plot window with an offset between them which is fairly standard. I wish to remove the y tick numbers as they aren’t required and get in the way of some additional lables. I would like to also include some x and y axis gridlines.
I have implemented the following code below, however the ‘set(gca,’ytick’,[])’ command makes the y gridlines not plot. How can I remove the ytick numbers on the y axis but keep the y gridlines?
Thanks in advance,
Christopher!
% Create a new empty figure
figure
% Remove y axis numbering
set(gca,’ytick’,[])
% Set major Grid lines
ax.GridLineStyle = ‘–‘;
ax.GridColor = ‘b’;
ax.GridAlpha = 1;
grid on;
% Set minor Grid lines
ax.MinorGridLineStyle = ‘-‘;
ax.MinorGridColor = ‘b’;
ax.MinorGridAlpha = 0.5;
grid minor;Hi,
I am producing a graph to view open source polysomnography data. I have several arrays in one plot window with an offset between them which is fairly standard. I wish to remove the y tick numbers as they aren’t required and get in the way of some additional lables. I would like to also include some x and y axis gridlines.
I have implemented the following code below, however the ‘set(gca,’ytick’,[])’ command makes the y gridlines not plot. How can I remove the ytick numbers on the y axis but keep the y gridlines?
Thanks in advance,
Christopher!
% Create a new empty figure
figure
% Remove y axis numbering
set(gca,’ytick’,[])
% Set major Grid lines
ax.GridLineStyle = ‘–‘;
ax.GridColor = ‘b’;
ax.GridAlpha = 1;
grid on;
% Set minor Grid lines
ax.MinorGridLineStyle = ‘-‘;
ax.MinorGridColor = ‘b’;
ax.MinorGridAlpha = 0.5;
grid minor; Hi,
I am producing a graph to view open source polysomnography data. I have several arrays in one plot window with an offset between them which is fairly standard. I wish to remove the y tick numbers as they aren’t required and get in the way of some additional lables. I would like to also include some x and y axis gridlines.
I have implemented the following code below, however the ‘set(gca,’ytick’,[])’ command makes the y gridlines not plot. How can I remove the ytick numbers on the y axis but keep the y gridlines?
Thanks in advance,
Christopher!
% Create a new empty figure
figure
% Remove y axis numbering
set(gca,’ytick’,[])
% Set major Grid lines
ax.GridLineStyle = ‘–‘;
ax.GridColor = ‘b’;
ax.GridAlpha = 1;
grid on;
% Set minor Grid lines
ax.MinorGridLineStyle = ‘-‘;
ax.MinorGridColor = ‘b’;
ax.MinorGridAlpha = 0.5;
grid minor; plot, tick, gridline MATLAB Answers — New Questions