Add text and matrix in a figure

Hi everyone, I run a code and the result is matrix (1x6) and a curve. I want to plot the curve and have as a legend the matrix with a text. How is that possible? Thanks

Respuestas (2)

Thorsten
Thorsten el 16 de En. de 2013

0 votos

x = rand(1, 6); % sample data
plot(x)
legend('my curve')

1 comentario

Natalia
Natalia el 16 de En. de 2013
Ok thanks for the answer. What I want to do is to have as table(3x3) with the curve like this: text1 rand(1,1) rand(1,2); text2 rand(1,3)rand(1,4); text3 rand(1,5) rand(1,6);

Iniciar sesión para comentar.

Shashank Prasanna
Shashank Prasanna el 16 de En. de 2013

0 votos

Here is a work around albeit crude:
plot(rand(5,1)),legend({['1' ' 2' char(10) '3' ' 4' ]})
char(10) adds the new line

2 comentarios

Natalia
Natalia el 16 de En. de 2013
Thanks! It works. I want also to ask you if I don't want to have the lines in legend is that possible?
Natalia
Natalia el 16 de En. de 2013
Also if the '1' '2' ... are cells of a matrix can I have A(1,1) instead of the numbers?

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 16 de En. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by