Skip to content

Commit

Permalink
fix incorrect orientation of grayscale
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Feb 20, 2023
1 parent d3a21ee commit d4ac30e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/matrices/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ recurrent points contained in it. The levels of gray are coded as numbers of the
same type as the black and white codes.
It is advised to use `width, height` arguments for large matrices otherwise
plots using functions like e.g. `imshow` could be misleading.
plots using functions like e.g. `heatmap` could be misleading.
"""
function grayscale(R, bwcode::Tuple{TT,T}=(0.0,1.0);
exactsize=false, kwargs...) where {TT<:Real, T<:Real}
Expand Down Expand Up @@ -193,4 +193,6 @@ function grayscale(R, bwcode::Tuple{TT,T}=(0.0,1.0);
# Change to color scale
p .= bwcode[1].*p .+ bwcode[2].*(1 .- p)
pt = (T<:Integer) ? round.(T, p) : T.(p)
# need to flip `y` so that diagonal is in the correct way...
return reverse(pt; dims = 2)
end

0 comments on commit d4ac30e

Please sign in to comment.