superimposing plots.
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
[EDIT: Wed May 25 22:22:46 UTC 2011 - Reformat - MKF]
Hello, I have the two following plots which I am trying to superimpose. I want figure two to be super imposed on figure 1 but figure 1 has a log scale on its x axis. Can someone please help.
semilogx(f,x) %figure 1
stem(y,z) %figure 2
0 comentarios
Respuesta aceptada
Matt Fig
el 25 de Mayo de 2011
Why not use SUBPLOT?
subplot(1,2,1)
stem(y,z)
supbplot(1,2,2)
semilogx(f,x)
By the way, a figure is the window that holds the axes object. If you want them on the same axes, do
semilogx(f,x)
hold on
stem(y,z)
2 comentarios
Matt Fig
el 25 de Mayo de 2011
If that is your concern, do this:
x = 1:10:10000;
semilogx(x,.3*x.^3);
axx = gca;
ax = axes;
plot(x,x.^5,'r')
set(ax,'visible','off','ylim',get(axx,'ylim'))
The last line scales the ylimits of the second axes to match the first axes. If you don't want to do this, just take the part out where ylim is set.
Más respuestas (1)
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!