A 3-D RGB color cube

    gmtset(MAP_TICK_LENGTH_PRIMARY=0, FONT_ANNOT_PRIMARY="12p,Helvetica-Bold")
    side = 6.35

    plot("@cut-here_11.txt", pen=(:thinnest,"dot"), region=(-51,306,0,1071),
         frame=:none, figsize=(8.9,26.7), x_off=side, y_off=1.2)

    # First, create grids of ascending X and Y and constant 0.
    # These are to be used to represent R, G and B values of the darker 3 faces of the cube.
    x_nc = gmt("grdmath -I1 -R0/255/0/255 X =")
    y_nc = gmt("grdmath -I1 -R Y =")
    c_nc = gmt("grdmath -I1 -R 0 =")

    grdimage!(x_nc, y_nc, c_nc, figsize=(side,-side), proj=:linear, x_off=1.25)
    plot!("@rays_11.txt", pen=(:thinner, :white, :dashed))
    T = text_record([128 128 -45; 102  26 -90; 204  26 -90; 10  140 180],
                    ["12p 60\\217"; "12p 0.4"; "12p 0.8"; "16p G"])
    text!(T, par=(:FONT, :white), attrib=(angle="", font=""))
    arrows!([0 0 0 128], noclip=true, arrow=(len=0.4, stop=true, endpoint=true),
            pen=(2,:white), fill=:white)

    grdimage!(x_nc, c_nc, y_nc, figsize=(side,side), proj=:linear, y_off=side)
    plot!("@rays_11.txt", pen=(:thinner, :white, :dashed))
    T = text_record([128 128 45; 26 102 0; 26 204 0; 140 10 -90; 100 100 -45],
                    ["12p 300\\217"; "12p 0.4"; "12p 0.8"; "16p R"; "16p V"]);
    text!(T, par=(:FONT,:white), attrib=(angle="", font=""))

    arrows!([0 0 128 0], noclip=true, arrow=(len=0.4, stop=true, endpoint=true),
            pen=(2,:white), fill=:white)
    arrows!([0 0 90 90], noclip=true, arrow=(len=0.4, stop=true, endpoint=true),
            pen=(2,:white), fill=:white)

    grdimage!(c_nc, x_nc, y_nc, figsize=(-side,side), proj=:linear, x_off=-side)
    plot!("@rays_11.txt", pen=(:thinner, :white, :dashed))
    T = text_record([128 128 135; 102  26 90; 204  26 90; 10  140  0],
                    ["12p 180\\217"; "12p 0.4"; "12p 0.8"; "16p B"]);
    text!(T, par=(:FONT,:white), attrib=(angle="", font=""))

    arrows!([0 0 0 128], noclip=true, arrow=(len=0.4, stop=true, endpoint=true),
            pen=(2,:white), fill=:white)
    arrows!([0 0 128 0], noclip=true, arrow=(len=0.4, stop=true, endpoint=true),
            pen=(2,:white), fill=:white)

    # Second, create grids of descending X and Y and constant 255.
    # These are to be used to represent R, G and B values of the lighter 3 faces of the cube.

    x_nc = gmt("grdmath -I1 -R 255 X SUB =")
    y_nc = gmt("grdmath -I1 -R 255 Y SUB =")
    c_nc = gmt("grdmath -I1 -R 255       =")

    grdimage!(x_nc, y_nc, c_nc, figsize=(-side,-side), proj=:linear, x_off=side, y_off=side)
    plot!("@rays_11.txt", pen=(:thinner, :black, :dashed))
    T = text_record([128 128 225; 102  26 270; 204  26 270], ["12p 240\\217"; "12p 0.4"; "12p 0.8"])
    text!(T, attrib=(angle="", font=""))

    grdimage!(c_nc, y_nc, x_nc, figsize=(side,-side), proj=:linear, x_off=side)
    plot!("@rays_11.txt", pen=(:thinner, :black, :dashed))
    T = text_record([128 128 -45; 26 102 0; 26 204 0; 100 100  45; 204 66 90], ["12p 0\\217"; "12p 0.4"; "12p 0.8"; "16p S"; "16p H"])
    text!(T, attrib=(angle="", font=""))

    arrows!([0 0 90 90], noclip=true, arrow=(len=0.4, stop=true, endpoint=true), pen=2, fill=:black)
    arrows!([204 204 204 76], noclip=true, arrow=(len=0.4, stop=true, endpoint=true), pen=2, fill=:black)

    grdimage!(x_nc, c_nc, y_nc, figsize=(-side,side), proj=:linear, x_off=-side, y_off=side)
    plot!("@rays_11.txt", pen=(:thinner, :black, :dashed))
    T = text_record([128 128 135; 26  102 180; 26  204 180; 200 200 225], ["12p 120\\217"; "12p 0.4"; "12p 0.8"; "16p GMT"])
    text!(T, attrib=(angle="", font=""), show=1)

See also GMT ex11