Uhm… not sure what you mean here. If you flip the matrix you would get a different matrix, which could be printed with this as well.
Perhaps you can explain more precisely what is your problem, so someone can help you specifically. We might have a case here where the simplification of your description is not representing what you really want to achieve.
Also, this is an option, to save it to a PDF file (other formats are available, but the pixels
get blurred (there is probably some option to just print a 3x3 pixel image, but I am not
sure if this is what you want, as using it later will not be very practical).
julia> using Images, ImageMagick
julia> function num2col(i)
if i == 0
return Images.colorant"red"
elseif i == 1
return Images.colorant"green"
else
return Images.colorant"blue"
end
end
num2col (generic function with 1 method)
julia> mat = [0 1 2;2 0 1;1 3 1]
3×3 Array{Int64,2}:
0 1 2
2 0 1
1 3 1
julia> c = num2col.(mat)
3×3 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:
RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(0.0,0.502,0.0) RGB{N0f8}(0.0,0.0,1.0)
RGB{N0f8}(0.0,0.0,1.0) RGB{N0f8}(1.0,0.0,0.0) RGB{N0f8}(0.0,0.502,0.0)
RGB{N0f8}(0.0,0.502,0.0) RGB{N0f8}(0.0,0.0,1.0) RGB{N0f8}(0.0,0.502,0.0)
julia> save("test.pdf",c)
Edit: if a gray scale is ok, you can use the more compact:
julia> using Colors, ImageMagick, Images
julia> m = rand(1:10,10,10);
julia> img = Gray.((m.-minimum(m))/maximum(m)) # image appears in notebook here
julia> save("test.pdf",img)
(where the minimum and maximum stuff is because the color scales are mapped from numbers in [0,1])