plotting 2 lines and one bar with 2 y-axes
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I'm trying to make a plot with two y-axes but three variables. So, on the first y-axis I want a line and a bar, and for the second y-axis just a line. I can't seem to figure this out with plotyy or plotyyy.
For a bar and line with plotyy I can use this code:
[ax,h1,h2] = plotyy(x1,y1,x2,y2,@bar,@line);
But this does not work with plotyyy:
[ax,hlines] = plotyyy(x1,y1,x2,y2,x3,y3,@bar,@line,@line);
Any suggestions would be greatly appreciated.
Thanks, Dan
0 Commenti
Risposta accettata
Walter Roberson
il 12 Mar 2013
[ax,h1,h2] = plotyy(x1,y1,x3,y3,@bar,@line); %note x3 y3
hold(ax(1), 'on');
plot(ax(1), x2, y2); %on first axis
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Two y-axis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!