Borrar filtros
Borrar filtros

Bar graph in RGB Colors

17 visualizaciones (últimos 30 días)
Ferdinand
Ferdinand el 9 de Oct. de 2012
Hi,
I would like to plot a bar graph in rgb-colors ('Color',[R G B]). I tried to do it the normal way handle=bar(y,x,'Color',[R G B]) and by set(handle,'Color',[R G B]) but it didn't work out.
Could anyone help me on this one? =)
Greetings from Germany!
Ferdinand

Respuestas (2)

Walter Roberson
Walter Roberson el 9 de Oct. de 2012
bar() plots in modern MATLAB create a barseries object. The barseries object has a series of Children, each of which is a patch object, with the color of the patch object being controlled by its CData property. Each patch object represents one original column in y (in the multi-column case).
However, user testing has found that if there are 1000 or more columns that instead of individual patches, a single patch object is created with all of the data.

Image Analyst
Image Analyst el 9 de Oct. de 2012
Try 'FaceColor' instead of 'Color':
x = 30:40;
y = rand(length(x),1);
bar(x,y, 'FaceColor', [.42 .37 .73]); % Values in the 0-1 range for FaceColor
grid on;

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by