Plot doubt: how to fill the squares.

Hello, I am using plot function to plot some data at the same time:
plot(AATnew,QG,'s',AATnew,Y,'-')
The problem I have is that the squares I have in the plot are empty and I can not fill them with any colour. How could I solve the problem?
Thank you,
Andoni

 Respuesta aceptada

Evan
Evan el 19 de Ag. de 2014
Editada: Evan el 19 de Ag. de 2014
Try using the MarkerFaceColor property.
Example:
x = 0:pi/32:2*pi;
y = sin(x);
z = cos(x);
plot(x,y,'s',x,z,'-','MarkerFaceColor',[0 0 0])
That seems to work fine, since your second set of data is plotted with a line marker, but you could always also split them up into separate plot commands if you for some reason wanted to control the marker face color of each.

3 comentarios

Andoni Mendialdua
Andoni Mendialdua el 19 de Ag. de 2014
Thank you for your answer Evan. I tried to use it, but I do not know how to do it. I would be glad if you could tell me.
Evan
Evan el 19 de Ag. de 2014
Does the example I added help, or are you still having problems?
Andoni Mendialdua
Andoni Mendialdua el 20 de Ag. de 2014
Thank you very much Evan. I solved the problem:)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 19 de Ag. de 2014

Comentada:

el 20 de Ag. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by