Leged for multiple subplots
Afficher commentaires plus anciens
I have a figure that includes three subplot. I'd like to add an overall legent to the figure at the location of the fourth subplot (which is empty). I have already read this post, but I think it does not answer my question. Would you please help me to figure out how I can do it?

My code is as follows (you don't have some of its data):
subplot(2,2,1);
plot(2615, 50, 's', 'MarkerEdgeColor', [0 0.4470 0.7410], 'MarkerFaceColor', [0 0.4470 0.7410], 'MarkerSize', 7)
hold on
plot(fg1(1,:), fg1(2,:), 'o', 'MarkerEdgeColor', [0.8500 0.3250 0.0980], 'MarkerFaceColor', [0.8500 0.3250 0.0980], 'MarkerSize', 7)
plot([pop(fg).obj1], [pop(fg).obj2], '*', 'MarkerEdgeColor', [0.9290 0.6940 0.1250], 'MarkerSize', 7)
grid on
title('Obj. 1 vs Obj. 2')
ylabel('Obj. 2: DSM')
xlabel('Obj. 1: TCS')
subplot(2,2,2);
plot(2615, 12, 's', 'MarkerEdgeColor', [0 0.4470 0.7410], 'MarkerFaceColor', [0 0.4470 0.7410], 'MarkerSize', 7)
hold on
plot(fg1(1,:), fg1(3,:), 'o', 'MarkerEdgeColor', [0.8500 0.3250 0.0980], 'MarkerFaceColor', [0.8500 0.3250 0.0980], 'MarkerSize', 7)
plot([pop(fg).obj1], [pop(fg).obj3], '*', 'MarkerEdgeColor', [0.9290 0.6940 0.1250], 'MarkerSize', 7)
grid on
title('Obj. 1 vs Obj. 3')
ylabel('Obj. 3: DCH')
xlabel('Obj. 1: TCS')
subplot(2,2,3);
plot(50, 12, 's', 'MarkerEdgeColor', [0 0.4470 0.7410], 'MarkerFaceColor', [0 0.4470 0.7410], 'MarkerSize', 7)
hold on
plot(fg1(2,:), fg1(3,:), 'o', 'MarkerEdgeColor', [0.8500 0.3250 0.0980], 'MarkerFaceColor', [0.8500 0.3250 0.0980], 'MarkerSize', 7)
plot([pop(fg).obj2], [pop(fg).obj3], '*', 'MarkerEdgeColor', [0.9290 0.6940 0.1250], 'MarkerSize', 7)
grid on
title('Obj. 2 vs Obj. 3')
ylabel('Obj. 3: DCH')
xlabel('Obj. 2: DSM')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Subplots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!