Well, this is a problem, because RGB colors are 3D , so their histogram will lead to a 4D chart, which we really do not comprehend.
So, the solution to this is to convert the 4D chart to 3D . This can be done by sorting the colors using something that has some meaning. I will not ponder and describe what I use. I use HSV color space and ignore the value of V. Thus, I lose a lot of information about the color scheme, but this is enough to describe the colors for my purposes. Here's what it looks like:

You can also use more graphics with different V to cover more colors. For more information see:
In any case, you can use any gradient sort or any figure of your plot that is completely on you.
If you want pure RGB , then you can adapt this and use the cube of the RGB surface or display it on a sphere and ignore the length from (0,0,0) (use unit vectors) something like this:

So, if you are R,G,B at <0,1> , you will convert this value to <-1,+1> , then calculate the spherical coordinates (ignoring the radius), and instead of 2 3 you get variables that you can use as a graph (either as a <strong> 2D earth base or 3D sphere ...).
Here's the C ++ code on how to do this (from the HSV histogram):
picture pic0,pic1,pic2,zed; const int na=360,nb=180,nb2=nb>>1;
pic0 input image, pic1 output image (bar graph)pic2 is a copy of pic0 (the rest of the old code)zed is the Zed buffer for the 3D display, eliminating the sorting of Z ...
I use my own image class for images, so some members:
xs,ys image size in pixels
p[y][x].dd - pixel at position (x, y) as a 32-bit integer type
clear(color) - clears the entire image
resize(xs,ys) - resize the image in a new resolution
Since the sphere is a three-dimensional object, you must add a rotation to it so that the entire surface is visible in time (or rotates with the mouse or something else) ...