Plotyy with bars stacked

4 visualizaciones (últimos 30 días)
Giorgos Papakonstantinou
Giorgos Papakonstantinou el 4 de Jun. de 2013
I am trying to do a matlab plot with two y axes. I want both to plots to be of type 'bars'. I can't work out how to make them stacked an how to hace axes going from 1:3 with out overlapping each other.
Here's what I do.
y = {rand(x, 1) * 100; (-0:(0.8)/(x-1):0.8)'};
fn1=@(x,y) bar(x , y, 0.3, 'FaceColor','r');
fn2=@(x,y) bar(x , y, 0.3, 'FaceColor','b');
[ax, hbar1, hbar2]=plotyy(1:2:6, y{1},2:2:6,y{2} ,fn1,fn2);

Respuestas (0)

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by