Using Multiple X- and Y-Axes Command Axis Label
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
figure (9)
ax1 = gca; hl1 = line(x1,y1,'Color','r'); set(ax1,'XColor','r','YColor','r')
ax2 = axes('Position',get(ax1,'Position'),... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none',... 'XColor','k','YColor','k'); hl2 = line(x2,y2,'Color','k','Parent',ax2);
ylabel('Drag Force (lbf.)') xlabel('Time (s)')
The above only labels the top axis and the right axis. How do I label the left and the bottom axis?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 1 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 1 Nov. 2012
figure (9)
ax1 = gca;
hl1 = line(x1,y1,'Color','r');
set(ax1,'XColor','r','YColor','r')
ax2 = axes('Position',get(ax1,'Position'),'XAxisLocation','top',...
'YAxisLocation','right','Color','none','XColor','k','YColor','k');
hl2 = line(x2,y2,'Color','k','Parent',ax2);
ylabel(ax1,'Drag Force (lbf.)')% do the same with ax2
xlabel(ax1,'Time (s)')
0 Kommentare
Weitere Antworten (1)
Sean de Wolski
am 1 Nov. 2012
ylabel(ax1,'String','stuff1')
ylabel(ax2,'String','stuff2')
0 Kommentare
Siehe auch
Kategorien
Mehr zu Two y-axis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!