Effacer les filtres
Effacer les filtres

Combine 2 plots into a single figure

1 vue (au cours des 30 derniers jours)
SreeHarish Muppirisetty
SreeHarish Muppirisetty le 12 Déc 2013
Réponse apportée : Suneesh le 12 Déc 2013
Can I combine two plots into a single figure. Assuming that my Xticks for:
Plot1 would be 0 1 2 3 4 5 6 7 8 9 10 and for
Plot2 they would be 10 1000 2000 3000 4000 5000.
I want Plot3 a combined figure of Plot 1 & 2 with Xticks arranged finally as
1 2 3 4 5 6 7 8 9 10 1000 2000 3000 4000 5000.
Thanks for your time

Réponses (1)

Suneesh
Suneesh le 12 Déc 2013
One way to do this is by manipulating the XData and YData properties. Try:
figure; h1 = plot(1:10);
figure; h2 = plot(10:10:50,20:24);
set(h1,'XData',[get(h1,'XData') get(h2,'XData')], 'YData', [get(h1,'YData') get(h2,'YData')])

Community Treasure Hunt

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

Start Hunting!

Translated by