2nd x-axis on plotyy
Mostrar comentarios más antiguos
Hey guys, I've got a bit of a pain of a problem I've been fighting with. I have a plotyy using 2 lots of data with the same logorithmic x-axis. I need to add a 2nd x-axis on top, but this will just be a different form of the original x-axis, i.e. if the lower x-axis was 0-10, the upper axis will be 0-100, where 1 in the lower axis = 10 in the upper.
Here's the code I have used for the plotyy:
MATLAB code
figure
[AX,H1,H2] = plotyy(x,y1,x,y2);
set(AX,'XScale','log');
set(get(AX(1),'Ylabel'),'String','Y1');
set(get(AX(2),'Ylabel'),'String','Y2');
set(H1,'LineStyle','-','Marker','x','Color','b');
set(H2,'LineStyle','--','Marker','+','Color','g');
grid on
thanks a lot Jay
Respuestas (2)
Azzi Abdelmalek
el 19 de Mzo. de 2013
Editada: Azzi Abdelmalek
el 19 de Mzo. de 2013
set(AX(2),'XaxisLocation','top','xlim',[0 100])
Jay Keeley
el 19 de Mzo. de 2013
Editada: Jay Keeley
el 19 de Mzo. de 2013
0 votos
2 comentarios
Azzi Abdelmalek
el 19 de Mzo. de 2013
can you post your code, I do not know how did you get that.
Jay Keeley
el 20 de Mzo. de 2013
Categorías
Más información sobre Two y-axis en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!