remove x labels from a figure with subplots.
    52 views (last 30 days)
  
       Show older comments
    
Hi
I have a figure with 5 subplot with the same time timeframe. I want the x axix lable only on the bottom subplot and to keep the grid and ticks in all the subplots. Appreciate your advice.
Thank you
0 Comments
Accepted Answer
  Florian Bidaud
      
 on 12 Mar 2024
        
      Edited: Florian Bidaud
      
 on 12 Mar 2024
  
      figure
for i = 1:5
    s = subplot(5,1,i);
    % plot whatever you want
    plot(0:10,(0:10).^i)
    grid
    grid minor
    if i==5
        xlabel('Time [s]')
    else
        s.XTickLabel={};
    end 
end
More Answers (0)
See Also
Categories
				Find more on Subplots in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

