heliosdrm / GRUtils.jl

Tools for using the GR framework in Julia
Other
31 stars 6 forks source link

Add Option for Accurate Pixel Level Rendering of a Matrix #124

Open RoyiAvital opened 1 year ago

RoyiAvital commented 1 year ago

The use case is similar to the one described in https://discourse.julialang.org/t/101185/3 and https://github.com/heliosdrm/GRUtils.jl/issues/123#issuecomment-1625592409.

Basically, given a Matrix of size MxN generate a 1:1 plot of the image.
Namely the dimensions of the area of with the values from the matrix will be MxN pixels exactly.

The steps should be:

  1. Generate figure with size in pixels which is large enough for the required margins.
  2. Create axes / view with certain rendering size in pixels.
  3. Draw the pixels value (Mapped / Direct) on the axes where each element in the Matrix correspond to a single pixel on screen.

The above is for a Matrix but it would be great to extend to Array{T, 3} where the output will be mapped to RGB color.