graphing colors
    14 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
this is the code i have:
plot(all_conflims_mult, 'linestyle', '--', 'color', [0.00 0.00 1.00], 'linewidth', thick)
instead of having 'color', [0.00 0.00 1.00]
i would like to just 'g' or 'r' (For green and red) instead of the 3 numbers, how would i do that? THanks
0 comentarios
Respuesta aceptada
  Micah
      
 el 11 de Oct. de 2011
        You can use the few matlab built in colors ('red','green,'blue,'black','white','cyan','magenta','yellow'),
plot(...,'color','green',...)
but you could also just declare a variable that is that vector, i.e.
g = [0 0 1]
plot(...,'color',g,...)
0 comentarios
Más respuestas (2)
  Sean de Wolski
      
      
 el 11 de Oct. de 2011
        or:
plot(x,y,'g');
and
doc linespec
for a full list of predefined colors.
0 comentarios
  Laura Proctor
    
 el 11 de Oct. de 2011
        plot(1:10,'--b')
Also note that LineWidth must be a number:
plot(1:10,'LineStyle','--','Color','b','LineWidth',4)
0 comentarios
Ver también
Categorías
				Más información sobre Line Plots en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



