Borrar filtros
Borrar filtros

showing correlation on scatter

10 visualizaciones (últimos 30 días)
Hassan
Hassan el 19 de Abr. de 2011
I want to show the R-squared value on the scatterplot. I am using corrcoef function to get the correlation value. I wonder how I can show the correlation or R-squared value on the scatterplot? I appereciate your help.
R=corrcoef(X,Y) R_squared=R(2)^2 scatter(X,Y)

Respuesta aceptada

Arnaud Miege
Arnaud Miege el 19 de Abr. de 2011
Use the text function:
text(x_text, y_text, ['R^2 = ' num2str(R_squared)])
where x_text and y_text are coordinates of where you want to place the text.
HTH,
Arnaud
  1 comentario
Hassan
Hassan el 19 de Abr. de 2011
thanks Arnaud, it's working.

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