How to add a title to a subplot

7 visualizaciones (últimos 30 días)
Becca
Becca el 16 de Feb. de 2015
Respondida: Geoff Hayes el 16 de Feb. de 2015
I have four bar graphs grouped together in a subplot. Each individual graph has a title, but is there a way to give the group one single title as well?
current_events=xlsread('CURRENT EVENTS.xlsx')
figure
subplot(2,2,1)
bar(current_events(:,1),current_events(:,2))
xlabel('Attention Paid')
ylabel('Percentage of Participants')
title('US Airstrikes in Iraq')
axis([0,6,0,40])
subplot(2,2,2)
bar(current_events(:,1),current_events(:,3))
xlabel('Attention Paid')
ylabel('Percentage of Participants')
title('Death of Robin Williams')
axis([0,6,0,40])
subplot(2,2,3)
bar(current_events(:,1),current_events(:,4))
xlabel('Attention Paid')
ylabel('Percentage of Participants')
title('Shooting In Ferguson, MO')
axis([0,6,0,40])
subplot(2,2,4)
bar(current_events(:,1),current_events(:,5))
xlabel('Attention Paid')
ylabel('Percentage of Participants')
title('Ebola Outbreak')
axis([0,6,0,40])
end

Respuestas (1)

Geoff Hayes
Geoff Hayes el 16 de Feb. de 2015
Becca - you may want to look at Ben Barrows' suplabel submission to the File Exchange.

Categorías

Más información sobre Title en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by