Hello there, I am Hossain. As part of my class assignment I have to generate a RGB vertical color bar as shown in the picture.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154613/image.png)
I have tried to make myself. What have I done is given bellow:
y= [100 100 100 100 100 100 100 100; 0 0 0 0 0 0 0 0];b = bar(y,1);b(1).FaceColor = [1 1 1];b(2).FaceColor = [1 1 0];b(3).FaceColor = [0 1 1];b(4).FaceColor = [0 1 0];b(5).FaceColor = [1 0 1];b(6).FaceColor = [1 0 0];b(7).FaceColor = [0 0 1];b(8).FaceColor = [0 0 0];
And the corresponding graph i have generated is :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154614/image.jpeg)
But I want to generate the image as the first image. Would you please help me to generate the image as the first one?. my knowledge on Matlab is not too much deep.
Thanks in advance.
Best Answer