Borrar filtros
Borrar filtros

Bar plot problem with legend

1 visualización (últimos 30 días)
Francesco
Francesco el 31 de En. de 2014
Comentada: Azzi Abdelmalek el 31 de En. de 2014
If I have
A1 =
1.0e-013 *
Columns 1 through 8
0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574
Column 9
0.1465
And
A2 =
1.0e-013 *
Columns 1 through 8
0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523
Column 9
0.1465
How can I plot either variables, on the same bar plot?
bar([A1 A2])
legend('A1,'A2')
If MATLAB said:
Warning: Ignoring extra legend entries.
> In legend at 278
What's the mistake?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 31 de En. de 2014
Editada: Azzi Abdelmalek el 31 de En. de 2014
A1 =1.0e-013 *[ 0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574]
A2= 1.0e-013 *[0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523]
bar([A1' A2'])
legend('A1','A2')
  6 comentarios
Francesco
Francesco el 31 de En. de 2014
But If I have A1 and A2 variables, for example, A1=A2=1*n how I can do the bar plot?
Azzi Abdelmalek
Azzi Abdelmalek el 31 de En. de 2014
The same as the above answer
bar([A1' A2'])
legend('A1','A2')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by