remove x labels from a figure with subplots.

36 visualizaciones (últimos 30 días)
Binu
Binu el 12 de Mzo. de 2024
Comentada: Binu el 13 de Mzo. de 2024
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

Respuesta aceptada

Florian Bidaud
Florian Bidaud el 12 de Mzo. de 2024
Editada: Florian Bidaud el 12 de Mzo. de 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

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by